Items with no label
3335 Discussions

How do I change color data?

ARafi4
Beginner
1,694 Views

auto color = frames.get_color_frame();

auto colorFrame = color.get_data();

Is there any way to modify the color data? The color.get_data() returns a "const void *" and I am trying to highlight certain portions of the image before displaying it.

0 Kudos
3 Replies
MartyG
Honored Contributor III
387 Views

The RealSense SDK 2.0 allows you to define Regions Of Interest (ROI) and alter the exposure values inside that ROI. You can define a Setpoint value that the camera tries to keep the exposure at within that box.

Section 'E' on page 2 of the document linked to below describes ROI and Setpoints, and how you can set them up in the RealSense Viewer application.

https://realsense.intel.com/wp-content/uploads/sites/63/BKMs-For-Tuning-RealSense_D4xx_Cameras_WP_1.7.pdf https://realsense.intel.com/wp-content/uploads/sites/63/BKMs-For-Tuning-RealSense_D4xx_Cameras_WP_1.7.pdf

ARafi4
Beginner
387 Views

This is interesting, but it won't work in this case because the ROI has to be predefined. For example, we want to be able to put a red ball in front of the camera and have it so the color frame is tinted red in the area where the ball is on the camera feed. Is there any way to do this, or should we try to create our own frame?

0 Kudos
MartyG
Honored Contributor III
387 Views

It sounds like this falls into the area of Object Detection. An OpenCV object detection sample was recently contributed that puts a green highlighting box round a detected object. Perhaps the sample could be modified to color-fill the inside of the box.

https://github.com/twMr7/rscvdnn GitHub - twMr7/rscvdnn: Test program for OpenCV DNN object detection with RealSense camera

0 Kudos
Reply