imx8: Facedetection not working with NXP MINISASTOCSI Camera

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8: Facedetection not working with NXP MINISASTOCSI Camera

2,615 Views
vsuneja63
Contributor III

I am testing facedetection sample code. Detection is not proper & continuous on face while testing on imx8mq evk target with MIPISASTOCSI camera but the same binary working effectively with less resolution USB web Cam.

Does MINISASTOCSI camera suitable for such usecase?

If the camera is suitable for such usecase what parameter can cause this issue?

Its blockage for me, Would like to hear from you asap.

Thanks & Regards,

Vipul Kumar

0 Kudos
Reply
6 Replies

2,430 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

It´s better to look into your code. You prepared g2d buffers and open g2d handle in main thread.

But g2d_blit(live video) are in your created thread inc_x1_thread, They should be in the same thread. This is why you got invalid thread context error.

Regards

0 Kudos
Reply

2,430 Views
manizillion
Contributor IV

Hi Bio, 

Can you please confirm again if g2d is applicable for imx8mqevk ? pls . this link says no from nxp

https://community.nxp.com/message/1254512

OK ! if not g2d then can you please share g3d sample code for face detection which will work faster on GPU for IMX8MQEVK ?

We have imx-gpu-viv integrated to run on imx8mqevk, need object detection source examples to run on GPU.

Regards

Mani

0 Kudos
Reply

2,430 Views
manizillion
Contributor IV

Hi ,

Can these settings be applicable for Vivante also, Or these are specific to Etnaviv or Mesa settings. ?

0 Kudos
Reply

2,430 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Vipul,

Find the new code attached. 

 

To build the application in your side, just run the environment_setup script (if you ware using yocto toolchain) and then "make" the application. There are some improvements that I still need to do (remove 2 memcpy operations). 

 

In the code attached you it performs the facedetection using OpenCV (detect.multiScale, haarcascades), but now using a improved capture system, g2d for resizing, opencl for colorspace conversion. When a face is not detected, the average performance is:

 

FPS=16.9492                                                                    

FPS=15.1515                                                                    

FPS=16.3934                                                                    

FPS=15.1515  

 

when a face is detected, the average performance is:

 

FPS=20.8333                                                                    

FPS=21.2766                                                                    

FPS=20.4082                                                                    

FPS=21.7391     

 

and if you change the capture size (800x600 - lines 73 and 98) to 640x480, face detection is still being performed at 720x640, you will get around ~30FPS.

Attention that the code still needs improvement, please, see it only as a base for understanding the approach I mentioned before.

Regards

0 Kudos
Reply

2,430 Views
vsuneja63
Contributor III

Hi,

Any suggestion on the "g2d device opening failed" error. Looking forward to hear from you asap.

Thanks & Regards,

Vipul Kumar

0 Kudos
Reply

2,430 Views
vsuneja63
Contributor III

Hi,

Thanks for the reference code!

I could compile the shared source code but facing runtime error. Its showing g2d device opening failed, here are the logs:

[ 140.592281] mx6s-csi 30a90000.csi1_bridge: CSI dev coherent is 1
Camera /dev/video0 opened successfully
[ 141.328500] ov5640_mipi 1-003c: s_stream: 1
depth: 8
width: 640
height: 480
channels: 2
Image Size: 614400
V4L2 pixelformat: 1448695129
g2d_open: fail with status -7
Fail to open g2d device!

Loading color_conversions.cl: OK
g2d_blitEx: Invalid handle !

Error on g2d_blit operation
g2d_finish: Invalid handle !

imx-gpu-g2d is already install in my & could verify .h & .so library in place. I think openg2d API is part of libfslcg.so, so difficult to debug for me. Can you please guide me for the issue?

Thanks & Regards,

Vipul Kumar

0 Kudos
Reply