Low preview performance for 4K camera

Dear Mathworks support team,
I'm currently using Image Acquisition Toolbox 5.3 (R2017b) to acquire images from a Point Grey BlackFlyS camera (BFS-U3-89S6C-C, 4096x2160 resolution).
When I use preview function, the live video has very low performance (the actual frame rate is just 3-4 fps). Can you clarify the problem and give me a solution for this issue?
Thank you

6 Comments

Could you confirm that you have the device connected directly to a USB-3 compatible port on your host, and that nothing else is connected to the same USB-3 controller ? I would recommend looking through the system hardware inventory to confirm this, as it is not uncommon for USB controllers to be shared with unexpected devices. (I still have no idea where the infrared sensor is on my machine, but it is connected to one of the USB controllers that is connected to some of my slots...)
I connect the camera directly to the USB-3 port. When I check the camera with the manufacturer program (SpinView), it works fine. However, the live video is slow when I use preview function in Matlab. I don't think there is a problem with the connection, maybe Matlab data transferring problem instead (8.9Mb/frame * 30 fps --> huge data).
USB-3: theoretical 640 megabytes per second. The benchmarks I find suggest that in real transfer situations it will probably be between 115 to 167 megabytes per second.
If we suppose real-world rates of 150 megabytes per second (near the top end of the tests), then that would be about 17 frames per second at 8.9 megabytes per frame.
8.9 megabytes per frame would be 4096*2160/1000/1000 which would be for uncompressed 8 bits per pixel grayscale. But the BFS-U3-89S6C-C, is a color device capable of 10 bits and 12 bits resolution; the 42 fps mode is for 8 bits images, which in turn implies either MONO8 or BayerRG8 which https://www.ptgrey.com/Content/Images/Uploaded/Downloads/TRM/2016/BFS-html/html/Model/public/ImageFormatControl.html appears to be "8-bit bayer red green packed format", and if I read the documentation carefully it is only sending 2 bits per pixel for two of the colors with the other four bits being a double-sample of the third color. Ummm, possible, but not high quality color.
I have to wonder precisely what format you are requesting from the camera, because the above might be fast but not good color, and the alternatives with better color would be at most half the maximum frame rate.
At the moment, when I look at the technical documentation, it is plausible that the preview frame rate you are seeing is realistic -- that is, that rate would be what would be expected for higher quality images at that image resolution.
Duc Do
Duc Do on 15 Apr 2018
Edited: Duc Do on 15 Apr 2018
Thank you very much for your help.
I'm using 8-bit image format (BayerRG8) for the camera, and I can get 42fps when using SpinView. However, I can get only 3fps when using Matlab preview.
Actually, if I change the setting to using obsolete preview, imaqmex('feature', '-useObsoletePreview', true), I can get a good preview. However, I cannot plot on the obsolete window as I can do on the normal preview figure (I need to plot some shapes on the live video). Do you have any suggestion or any workaround for that?
I successfully do the same thing using lower resolution cameras. The problem only occurs when using the new 4K camera.
Thank you very much. I will try to find the solution.

Sign in to comment.

Answers (0)

Asked:

on 14 Apr 2018

Edited:

on 25 Jul 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!