ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 90/270 degrees rotation of webcam video (DirectX

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Oribi Posted - Jan 21 2014 : 01:39:38
Is it possible to rotate a camera feed (using DirectX) 90 or 270 degrees?

I'm currently using a 5 megapixel camera to capture images which I rotate using the TIEBitmap.Rotate() method after capturing them.
As you can imagine this slows down the capture rate considerable.

Is it possible to have the DirectX layer to perform the rotating instead?

--
Peter
1   L A T E S T    R E P L I E S    (Newest First)
Oribi Posted - Jan 29 2014 : 06:21:29
The "Video Processing Project" (http://sourceforge.net/projects/videoprocessing/) contains a Rotate Filter which can be used to rotate images.

When I test this filter using GraphEdt everything works great, however when I add to the filter to the graph created by ImageEn the image appears to be corrupted (it is rotated though).

I currently use the following code to test this:

ImageEn.IO.DShowParams.SetVideoInput(0, 0, w, h, f);
ImageEn.IO.DShowParams.EnableSampleGrabber := true;
ImageEn.IO.DShowParams.Connect;
ImageEn.IO.DShowParams.SaveGraph('y:\graph1.grf');

// Get the Source Output Pin and the input Pin it is connected to
SourceFilter := ImageEn.IO.DShowParams.CurVideoInput;
SrcPinOut := GetPin(SourceFilter, IEPINDIR_OUTPUT);
SrcPinOut.ConnectedTo(DstPinIn);

// Break the existing link
SrcPinOut.Disconnect;
DstPinIn.Disconnect;

// Add the rotate filter
RotateFilter := CreateComObject(CLSID_RotateFilter) as IIEBaseFilter;
ImageEn.IO.DShowParams.Graph.AddFilter(RotateFilter, 'RotateFilter');

// Get the in- and outputpin of the rotate filter
RotateFilterIn := GetPin(RotateFilter, IEPINDIR_INPUT);
RotateFilterOut := GetPin(RotateFilter, IEPINDIR_OUTPUT);

// Place the Rotate Filter between the source
// and the original linked filter
ImageEn.IO.DShowParams.Graph.Connect(SrcPinOut, RotateFilterIn);
ImageEn.IO.DShowParams.Graph.Connect(RotateFilterOut, DstPinIn);

// Rotate 180 degrees
if RotateFilter.QueryInterface(ISettingsInterface, FilterSettings) = S_OK then
FilterSettings.SetParameter('rotationmode', '2');

// Save the new graph (for inspection using GraphEdt)
ImageEn.IO.DShowParams.SaveGraph('y:\graph2.grf');
ImageEn.IO.DShowParams.Run;

Does anyone know what I'm doing wrong?