September 7th, 1999, 07:23 AM
Hi,
I'm trying to find help to implement a real time video processing component in
Microsoft Visual C++ 6.0.
My ultimate aim is to extract the RGB value of a selected rectangle from a video capture
window.
I have broken down the problem into a number of steps.
Problem 1. Trying to draw the rectangle onto a video caputure window
--------------------------------------------------------------------
Currently:- I have implemented a simple rubber band method using window message to draw
rubber bands onto a CDialog window.
Problem:- I can't seem draw the rubber band onto the video capture window.
Background:-I have created a CCamera class that implements the digital video stream
capturing. I am using vfw32.lib( video for windows ) methods to implement the video
capturing from my attached USB camera. The method 'capCreateCaptureWindow' recieves a
parent HWND to implement the creation of a capture window. I pass the HWND of the CCamera's
CDialog as a parent.
As I attempt to use the already existing rubber band code it won't let me draw onto the
outputting video window contained within the CDialog because it isn't a CDialog. I tried
only capturing a single frame then drawing but it still won't let me draw the rubber band.
Problem 3. Dump an uncompressed frame from the digital stream from frame buffer into my own
-----------------------------------------------------------------------------------------
Currenlty:- played with capGrabFrameNoStop to grab a single compressed frame and playing with
capCaptureGetSetup/capCaptureSetSetup to adjust the CAPTUREPARMS structure which assigns
video buffers.
Problem:- Don't know how to access to video buffers set by the CAPTUREPARMS structure. The
capGrabFrameNoStop grabs a single frame when eventually I want to process many frames from
the digital video stream.
Background:- I want to eventually extract the RGB values of every pixel in a single frame
of digital video. The video buffers I don't know whether I need to manually assign them
myself or whether I could use the CAPTUREPARMS structure that controls the various
attributes of a video capture window. These buffers are temporary stores before I process
a frame for its pixel RGB values. Also I will be doing real time video processing so this
process will have to occur with timers.
Problem 2. Extracting the rectangle from the buffer
---------------------------------------------------
Currently:- Read documentation about how images are dumped as bitmaps.....and that's as
far as I got.
Problem:- how to I implement extracting every nth pixel in the apparently( only a novice
programmer here!) 2-dimensional array?
Background:- I have no idea how to go about doing this. Is there some MFC class or some
SDK methods that automates extraction of a rectangle in video capture window? Or do I have
to go low level and do this manually by going through the array and finding the x and y values
within the range of the rectangle?
Problem 3. Extracting the RGB value of the rectangle from the buffer
--------------------------------------------------------------------
Currently:- no luck.
Problem:- NO IDEA HOW!!
Background:- After drawing a rectangle rubber band, dumping into the frame buffer uncompressed
I want to extract the RGB value of every nth pixel of that rectangle. Any library methods
that do this? Or do I have to go low level programming?
Did you get all that???
I hope someone has some ideas about this as this is for a final year Computer Science
Project.
Well if any suggestions, thoughts please don't hold back!
Even flaming for such long stupid emails!
I'm trying to find help to implement a real time video processing component in
Microsoft Visual C++ 6.0.
My ultimate aim is to extract the RGB value of a selected rectangle from a video capture
window.
I have broken down the problem into a number of steps.
Problem 1. Trying to draw the rectangle onto a video caputure window
--------------------------------------------------------------------
Currently:- I have implemented a simple rubber band method using window message to draw
rubber bands onto a CDialog window.
Problem:- I can't seem draw the rubber band onto the video capture window.
Background:-I have created a CCamera class that implements the digital video stream
capturing. I am using vfw32.lib( video for windows ) methods to implement the video
capturing from my attached USB camera. The method 'capCreateCaptureWindow' recieves a
parent HWND to implement the creation of a capture window. I pass the HWND of the CCamera's
CDialog as a parent.
As I attempt to use the already existing rubber band code it won't let me draw onto the
outputting video window contained within the CDialog because it isn't a CDialog. I tried
only capturing a single frame then drawing but it still won't let me draw the rubber band.
Problem 3. Dump an uncompressed frame from the digital stream from frame buffer into my own
-----------------------------------------------------------------------------------------
Currenlty:- played with capGrabFrameNoStop to grab a single compressed frame and playing with
capCaptureGetSetup/capCaptureSetSetup to adjust the CAPTUREPARMS structure which assigns
video buffers.
Problem:- Don't know how to access to video buffers set by the CAPTUREPARMS structure. The
capGrabFrameNoStop grabs a single frame when eventually I want to process many frames from
the digital video stream.
Background:- I want to eventually extract the RGB values of every pixel in a single frame
of digital video. The video buffers I don't know whether I need to manually assign them
myself or whether I could use the CAPTUREPARMS structure that controls the various
attributes of a video capture window. These buffers are temporary stores before I process
a frame for its pixel RGB values. Also I will be doing real time video processing so this
process will have to occur with timers.
Problem 2. Extracting the rectangle from the buffer
---------------------------------------------------
Currently:- Read documentation about how images are dumped as bitmaps.....and that's as
far as I got.
Problem:- how to I implement extracting every nth pixel in the apparently( only a novice
programmer here!) 2-dimensional array?
Background:- I have no idea how to go about doing this. Is there some MFC class or some
SDK methods that automates extraction of a rectangle in video capture window? Or do I have
to go low level and do this manually by going through the array and finding the x and y values
within the range of the rectangle?
Problem 3. Extracting the RGB value of the rectangle from the buffer
--------------------------------------------------------------------
Currently:- no luck.
Problem:- NO IDEA HOW!!
Background:- After drawing a rectangle rubber band, dumping into the frame buffer uncompressed
I want to extract the RGB value of every nth pixel of that rectangle. Any library methods
that do this? Or do I have to go low level programming?
Did you get all that???
I hope someone has some ideas about this as this is for a final year Computer Science
Project.
Well if any suggestions, thoughts please don't hold back!
Even flaming for such long stupid emails!