Replies: 12 comments 10 replies
-
Hi @MCR100 #10363 should be a useful reference for aligning between a thermal camera and a RealSense camera, using the RealSense SDK's software-device interface. |
Beta Was this translation helpful? Give feedback.
-
When aligning, are you using the RealSense SDK's align_to instruction like rs-align does? If you are using align_to, are you using the intrinsics of the stream that you are aligning to? If you are aligning depth to the thermal image then you should use the thermal intrinsics. If you are aligning depth to thermal and you use the depth intrinsics then it may result in an inaccurate aligned image. |
Beta Was this translation helpful? Give feedback.
-
Hi @MCR100 It's great to hear that you made significant progress! rs-align is a C++ language example, though the Python example align_depth2color.py uses the same alignment mechanism (align_to) as rs-align. I would think that in order to use your thermal-RGB merged image as the color frame, you would have to define a color_frame that uses that merged image instead of the original thermal-less RGB image. |
Beta Was this translation helpful? Give feedback.
-
There was a case at #5093 (comment) where instead of aligning two streams into one and then aligning that with another, alignment was defined for the three frame types separately and then they were all combined together by an aligned_frames = align.process(frames) instruction. |
Beta Was this translation helpful? Give feedback.
-
Other RealSense users have previously attempted to convert a numpy array to rs2::frame but have not succeeded. cv::mat to rs2::frame is feasible, as advised by a RealSense team member at #2634 (though the scripting is C++). |
Beta Was this translation helpful? Give feedback.
-
The software-device interface would be the best way to import custom data instead of using an SDK stream, but it is best suited to C++ rather than Python. Would it be be possible to perform a normal depth to color alignment (so that the depth stream field of view size changes to match the color field of view size) and then align the thermal image to the color image afterwards after the depth-color alignment has been performed? |
Beta Was this translation helpful? Give feedback.
-
I note that in your 4th line you are using bundle.push_back(f), whilst the original script at #5847 (comment) uses an append instruction: bundle.append(f) |
Beta Was this translation helpful? Give feedback.
-
I could not locate any further references for custom processing block in Python either, unfortunately. I am not sure if this will be relevant to your particular situation, but a RealSense user at #6358 attempted to read depth and color composite frames into a list with frame appending and then performed alignment on them. |
Beta Was this translation helpful? Give feedback.
-
The C++ example for software_device that uses syncer can handle two stream types simultaneously. Logically the same should apply for Python, though my knowledge of syncer is admittedly limited. |
Beta Was this translation helpful? Give feedback.
-
I have highlighted to my Intel RealSense colleagues your Python bundler.invoke problem and the previous one at #9900 (comment) to seek their advice. |
Beta Was this translation helpful? Give feedback.
-
Hi @MCR100 One of my colleagues has provided a response to your issue. If I understand correctly, the customer already aligned the thermal with Intel RGB, so it can be simplified by aligning depth to Intel RGB as well. The depth frame is aligned to RGB with the same resolution and viewpoint as the Intel RGB, pixel to pixel matched. aligned_depth_frame = aligned_frames.get_depth_frame() and the Intel RGB image is unchanged during the alignment in this case: color_frame = aligned_frames.get_color_frame() So at this point, if the thermal is aligned with the Intel RGB, with the same resolution and same viewpoint as Intel RGB, then |
Beta Was this translation helpful? Give feedback.
-
You are very welcome. It's great news that you achieved a solution. Thanks so much for the update and for sharing your solution with the RealSense community. As you suggested, I will close the issue. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Hi everyone.
For one of my project, I want to align/register a thermal image (From FLIR camera) of an object onto a depth image of the same object acquired using D415. I want to do it using the extrinsic camera parameters without using the scene features (independent of scene structure). Is it possible to utilize rs.align or is there another ways?
Beta Was this translation helpful? Give feedback.
All reactions