Usenet.com

www.Usenet.com

Group Index

Sci Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Hardware



Hi Hamish,

<<...my problem comes in using the software to get the image into a
frame which I can then easily read pixel values. >>

The easies way for MS-Windows is, how I already suggested, the
VideoCapture interface:

1) create a capture window
hWndC = capCreateCaptureWindow ( "", WS_CHILD | WS_VISIBLE , 0, 0,
160, 120, hwndParent, nID);

2) connect the camera and set the pointer to a callback function
capDriverConnect (hWndC, 0);
capSetCallbackOnFrame(hWndC,FrameCallbackProc);

3) grab one frame
capGrabFrame(hWndC);

4) When the frame is acquired, Windows will call the
"FrameCallbackProc" with the videoheader (LPVIDEOHDR *vhdr) as
argument. This one includes a pointer to the pixel values
"vhdr->lpData".

All this is explained in the help file "mmedia.hlp" from Microsoft.
You can also get an example by downloading the code of my image
analysis system (module videocap).

<<I wish I understood Linux, I am aware that everything non consumer
based runs like a dream on that platform. But maybe next time.>>

Not everything, and also a lot of consumer based stuff, but video
capturing is really easy to accomplish.


Best regards,
Tilman JOCHEMS
http://mfj.chez.tiscali.fr/html/index_en.html

PS: The functions for video capturing, described above, are defined in
the dynamic libraries avicap32.dll and avifil32.dll. You have to link
the respective import libraries to your project.



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.