Banana Pi M64 (Allwinner A64): Getting the OV5640 camera to work under armbian with kernel 5.8


Recommended Posts

1 hour ago, Levent Erenler said:

i thought csi camera uses GPU to grab image.

No GPU/VPU involved.

 

1 hour ago, Levent Erenler said:

Cpu usage around %70 with opencv V4l2 capture fmt:UYVY8_2X8/640x480@30FPS and %60 with JPEG_1X8/640x480@30FPS

I think there is a conversion from YUV to rgb in opencv and possible a decompression from jpeg to rgb, i am not an opencv expert, maybe someone can give more details about what's going on inside opencv. There is still room to optimize the JPEG_1x8.

 

1 hour ago, Levent Erenler said:

Usb ov5640 cpu usage around %25

That's pretty good. There must be no conversion in the image format to achieve this. It is interesting to find out more about it. Can you share more about your application and your setup and usb camera?

Link to post
Share on other sites
Donate and support the project!

5 minutes ago, @lex said:

There must be no conversion in the image format to achieve this. It is interesting to find out more about it. Can you share more about your application and your setup and usb camera?

yes,  u are right that means there is no conversion. The app is very simple;  open camera with opencv videocapturer and grap image with opencv(v3.4.10) and calculate fps (no display). Setup Pine64+ 1GB A64 Kernel 5.9.3 with HBV1318 ov5640 usb camera

 

cpu usage is %6-8 at each core and total cpu usage %25 -31 ( 640*480*30FPS) 

 

device listed as 

doccamera: doccamera (usb-1c1a000.usb-1):
        /dev/video4
        /dev/video5
 

Link to post
Share on other sites

Ok. 

In the JPEG_1X8/640x480@30FPS case you should expect a bit more cpu usage than the USB camera, say ~5% more cpu usage and not the ~35% increase you see. The reason is you get 640x480x3 pixels from the sensor instead of only the compressed image.

I would build opencv with debugging info and try to find the bottleneck. And why there is an image conversion in the DVP case.

Push the limits to 720P/30fps or even 1080P and see what you get.

 

 

Link to post
Share on other sites
On 11/16/2020 at 4:50 PM, @lex said:

I would build opencv with debugging info and try to find the bottleneck. And why there is an image conversion in the DVP case.

Push the limits to 720P/30fps or even 1080P and see what you get.

Thanks for your support, I prefer 640*480 cause opencv face or tag recognition consume lots of cpu power,  640*480@30 is acceptable. I try a few more resolution and its getting worst :)

 

[fmt:JPEG_1X8/1280x720]   %100 cpu usage limited 15 FPS, could not reach more fps,  cpu usage at single core that means not multithreaded
[fmt:UYVY8_2X8/1280x720]  // %190 cpu usage @30 fps ,multi threaded
[fmt:UYVY8_2X8/1980x1080] // could not handle 30fps ,%200 cpu usage at 15FPS 
 

 

UPDATE: my best scenario is fmt:UYVY8_2X8 and opencv CV_CAP_PROP_FOURCC property is CV_FOURCC('Y', 'U', '1', '2') Cpu usage ~%52

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...