AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Video orientation change

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Video orientation change

Postby nmasry » Mon Feb 27, 2017 10:04 pm

I'm using VideoCaptureDevice for showing live stream video with resolution 1280 × 720 landscape , i need to change camera to portrait orientation to be vertical without losing quality ?

How can i do this ?

here is my code

private void StartCapture()
{
try
{
FinalFrame = new VideoCaptureDevice(CaptureDevice[SharedData.SelectedCamera].MonikerString);// specified web cam and its filter moniker string
int ind = 0;
int lastVal = 0;
for (int i = 0; i < FinalFrame.VideoCapabilities.Length; i++)
{

Size frame = FinalFrame.VideoCapabilities[i].FrameSize;
if (frame.Width > lastVal)
{
ind = i;
lastVal = frame.Width;
}
}
FinalFrame.VideoResolution = FinalFrame.VideoCapabilities[ind];
FinalFrame.NewFrame += new NewFrameEventHandler(FinalFrame_NewFrame);// click button event is fired,
FinalFrame.Start();
}
catch { }
}
nmasry
 
Posts: 3
Joined: Mon Feb 27, 2017 9:53 pm

Re: Video orientation change

Postby andrew.kirillov » Tue Feb 28, 2017 8:04 am

In the NewFrame event handler you can rotate/mirror/etc. images the way you like.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Video orientation change

Postby nmasry » Tue Feb 28, 2017 9:43 pm

andrew.kirillov wrote:In the NewFrame event handler you can rotate/mirror/etc. images the way you like.


yeah but rotating rotate the camera but without the rotating the image itself so the image upside down.
nmasry
 
Posts: 3
Joined: Mon Feb 27, 2017 9:53 pm




Return to AForge.NET Framework

cron