-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About Infrared camera of RealSense D435 and OpenCV #11113
Comments
Hi @Vermilion016 I note that in the other case at the link below that you posted the question at, you wished to adjust the rs-dnn OpenCV example program to use infrared instead of RGB color. https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/dnn Whilst it is sometimes possible to change a program to use the infrared stream instead of RGB (especially for RealSense camera module boards that do not have an RGB sensor), it may not be practical to do so for a DNN detection program. The stream type could be changed from RGB to infrared, but a DNN program relies on identification of specific types of visual elements on an RGB image using a dataset that has been trained to recognize them. rs-dnn would also not be a suitable example program for face detection, since its dataset is not trained for face recognition. The example program rs-dlib-face which uses the 'Dlib' face recognition library is more in line with what you have in mind. https://github.com/IntelRealSense/librealsense/tree/master/wrappers/dlib/face There is also a RealSense face recognition example program for the OpenVINO Toolkit. https://github.com/IntelRealSense/librealsense/tree/master/wrappers/openvino/face If you would like to test making changes to rs-dnn to see whether it works with the infrared image, I would recommend the following changes to the script:
https://github.com/IntelRealSense/librealsense/blob/master/wrappers/opencv/dnn/rs-dnn.cpp#L33
rs2::align align_to(RS2_STREAM_INFRARED); Although depth and infrared are already aligned as they both originate from the left infrared sensor, we will change this line since the rs-dnn program calls for alignment to be performed. https://github.com/IntelRealSense/librealsense/blob/master/wrappers/opencv/dnn/rs-dnn.cpp#L35
https://github.com/IntelRealSense/librealsense/blob/master/wrappers/opencv/dnn/rs-dnn.cpp#L63 Ideally, we would use auto infrared_frame = data.get_infrared_frame(); but since the rs-dnn script relies on the 'color_frame' name in multiple lines, it is easier for test purposes to just change the second half of the line so that it accesses the infrared frame. |
There is an OpenCV example for the infrared stream at the link below. |
Thank you very much. |
Has the problem in this case been solved by the resolution mentioned at #11116 (comment) please or do you still require assistance? Thanks! |
Does performance improve if you change the FPS value from 30 to 15? |
I see. I tried lowering the fps and image quality. |
You are very welcome. I'm pleased that I could help. Thanks very much for the update! |
Excuse me. |
If you are still using the Haar Cascade in the script above at #11113 (comment) then a cascade will tend to run slowly. Googling for the term opencv slow haar cascade provides information about this. |
I'see. I will try. |
I am learning Intel RealSense D435 & Visual Studio 2017.
Like the image, I would like to reproduce it with an infrared camera instead of a color camera in a program that recognizes faces with a RealSense camera and OpenCV. Is there a way?
If possible, I would appreciate it if you could also describe the program.
The text was updated successfully, but these errors were encountered: