Can not grab full resolution video over CoaXPress using GenTL - MATLAB is not configuring grabber properly
8 次查看(过去 30 天)
显示 更早的评论
Hi everybody,
We are trying to use JAI SP-5000M-CXP2 camera with ActiveSilicon FireBird CoaxPress grabber with matlab image acquisition toolbox. It does not work as expected and we can not get full resolution images from the camera.
Investigating the problem futher the following has been found:
1. Image acquisition in matlab works fine if only we set ROI for grabbing as [0,0,640,480]. Bigger region leads to segfault crash, smaller gives a black rectangle in preview window.
2. The application which comes with the grabber (ASDemo) works fine for any frame size we have tried. It allows us to edit properties of the grabber and the camera attached to it. Camera is presented as 'SP-5000M-CXP2' node with width, height and pixel format properties among the others. Grabber properties are presented under 'FireBird Baseboard (2xCXP) #1 \ Channel #1' node as width, height, pixel format, incoming width, incoming height and incoming pixel format among the others. When camera property like width is changed in the application one can observe that corresponding properties of grabber are adjusted automatically i.e. frame sizes set in camera and grabber properties are always same.
3. When we run ASDemo application after matlab crash we can see that camera properties are set to ROI parameters requested in crashed matlab session, while grabber parameters are set to 640x480. We can suspect that matlab only sets camera properties when changing ROI leaving grabber properties untouched and/or initialized to default values. Such behavior can lead to segfault in case if bigger camera frame is copied by grabber driver to smaller matlab buffer.
To check that we traced all calls made by applications to GenTL provider supplied with camera (TLActiveSilicon.cti) which is actually just a dll exporting functions described in GenTL specification. When asdemo application is ran we can see the foolowing trace:
... some initialization ...
IFOpenDevice() -> outputs interface handle (hIFace) according to gentl spec
...
DevGetPort(hIface) -> outputs camera port handle (hCamPort)
...
... camera property is changed in application ...
GCWritePort(hCamPort, port1, data)
GCWritePort(hIFace, port2, data)
GCWritePort(hIFace, port3, data)
where port1 is address for changed property as specified in camera XML, port2 and port 3 are addresses for changed property as specified in grabber XML
But when matlab is ran we only see writes to camera registers and no writes to grabber registers at all during the whole initialization and ROI changing process.
So matlab does not configure grabber properties in our configuration and that seems to be the reason of the crashes.
The question is how we can configure grabber properties from matlab? Does matlab provide interface for gentl register writing so we could configure grabber along with ROI setting? Can we force matlab doing this for us by some specific settings?
回答(1 个)
Mandar
2016-4-11
Yes. As you used dll from JAI for the Camera. It is also necessary to use dll for Frame Grabber. Can you share your code? I am a student working on the same model at my university project. It would be very helpful for me to refer.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 National Instruments Frame Grabbers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!