ofr
November 24, 2006, 15:49:47
I have a few question about the Imaging Control SDK.
I'm using VS2005/C++ + Win2000, IC 3 + VS2005 patch:
I want to grab frames from a device as fast as possible and
pass the frames to my own processing functions which run in an
extra thread. If the device produces color frames, I want them in
a 3x8 bit format, and if it is mono then in a 1x8 bit format.
This is what I do now:
- create grabber
- setOverlayBitmapPathPosition( ePP_NONE )
- openDevByDisplayName(selected device)
- setVideoFormat(selected format)
- create FrameHandlerSink(DShowLib::eRGB8,0) (also tried other formats)
- setSnapMode(false)
- setSinkType(the sink)
- setDeviceFrameFilters(my frame interceptor instance)
- startLive(false)
The filter's transform() function copies the frame data to an
internal double buffer and signals the processing thread.
This works, but with high CPU load the frames come with a delay.
The manual recommands under "Conecepts and Components" a few
things to achieve higher performance, but I'm not sure that I have
understand them.
"prevent automatic colorspace conversion."
Since devices do not produce color formats which are always either
RGB24 or Y8, one must at least once convert them to the desired
format, right? If so, how do I do it most efficiently?
"do not use the ring buffer".
OK, but how? Maybe I'm doing it right but at the moment, when
processing of the frames produces a high CPU load, the frames
come in delayed, sometimes 1-2 seconds (but they are never lost).
This must mean, there is a ring of mem buffers involved, right?
How do I turn it off?
Since low latency is more important than procesing of all frames,
I would prefer to drop frames that to have a delay.
Is there a color format, that encodes the channels as separated planes?
How can the program detect, that a camera has color or not to set
a matching sink color type?
Should I intercept frames with a FrameFilter or a GrabberListener?
I'm not sure that I have understand the difference between the two
concepts.
Another problem: The debugger shows that some threads exit with code 2,
some with -2147024637 (0x80070103) and there are also memory leaks.
Oliver
I'm using VS2005/C++ + Win2000, IC 3 + VS2005 patch:
I want to grab frames from a device as fast as possible and
pass the frames to my own processing functions which run in an
extra thread. If the device produces color frames, I want them in
a 3x8 bit format, and if it is mono then in a 1x8 bit format.
This is what I do now:
- create grabber
- setOverlayBitmapPathPosition( ePP_NONE )
- openDevByDisplayName(selected device)
- setVideoFormat(selected format)
- create FrameHandlerSink(DShowLib::eRGB8,0) (also tried other formats)
- setSnapMode(false)
- setSinkType(the sink)
- setDeviceFrameFilters(my frame interceptor instance)
- startLive(false)
The filter's transform() function copies the frame data to an
internal double buffer and signals the processing thread.
This works, but with high CPU load the frames come with a delay.
The manual recommands under "Conecepts and Components" a few
things to achieve higher performance, but I'm not sure that I have
understand them.
"prevent automatic colorspace conversion."
Since devices do not produce color formats which are always either
RGB24 or Y8, one must at least once convert them to the desired
format, right? If so, how do I do it most efficiently?
"do not use the ring buffer".
OK, but how? Maybe I'm doing it right but at the moment, when
processing of the frames produces a high CPU load, the frames
come in delayed, sometimes 1-2 seconds (but they are never lost).
This must mean, there is a ring of mem buffers involved, right?
How do I turn it off?
Since low latency is more important than procesing of all frames,
I would prefer to drop frames that to have a delay.
Is there a color format, that encodes the channels as separated planes?
How can the program detect, that a camera has color or not to set
a matching sink color type?
Should I intercept frames with a FrameFilter or a GrabberListener?
I'm not sure that I have understand the difference between the two
concepts.
Another problem: The debugger shows that some threads exit with code 2,
some with -2147024637 (0x80070103) and there are also memory leaks.
Oliver