How to align infrared resolution the same as RGB resolution ?
Hello Everyone, I use these codes to align the depth and IR to the RGB resolution. However, I can achieved only the depth data that is the same with RGB. I want to know how to configure or align the IR to RGB. Thank you.
align_to = rs.stream.color
align = rs.align(align_to)
frames = pipeline.wait_for_frames()
aligned_frames = align.process(frames)
aligned_depth_frame = aligned_frames.get_depth_frame()
aligned_infra_frame = aligned_frames.get_infrared_frame()
color_frame = aligned_frames.get_color_frame()
depth_image = np.asanyarray(aligned_depth_frame.get_data())
infra_image = np.asanyarray(aligned_infra_frame.get_data())
color_image = np.asanyarray(color_frame.get_data())
-
Official comment
Hello Lyhour,
Alignment can be done only between a depth stream and another stream, either RGB or IR. You cannot align IR to RGB. Why do you need to align the IR image to RGB?
Sincerely,
Jesus G.
Intel Customer SupportComment actions -
Thank you very much for you kindly response. the reason that I want to align the IR image because I want to use this information for my object detection. Typically, the object detection conducted base on CNN mean that using RGB information (3 channel) for convolutional process. However, I want to add the depth information and IR information for object detection. Hence, I have 5 channels (RGB-D-IR) information for input in the neural network. To do this, we have to acquiring the new dataset that all information of these 5 channels must have the same resolution (W×H). Thank you very much.
Best Regards,
CHHAY LYHOUR
-
Hello Lyhour,
If your use-case allows, you can align color to depth by changing these lines:
align_to = rs.stream.depth
align = rs.align(align_to)Since the IR stream is generated by the depth sensor of the L515, the IR and depth streams have the same resolution, intrinsics, and extrinsics in relation to the RGB stream. When you align the color to depth, the resolution of the aligned color frame will match that of the depth/IR frame. Then you will have the three streams aligned to each other.
Sincerely,
Jesus G.
Intel Customer Support
Please sign in to leave a comment.
Comments
3 comments