librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Texture alignment seems worse when align is used

Open AItah opened this issue 7 years ago • 9 comments

Windows 10 C++ D435

Dear Friends,

We continue to try and align texture and points cloud. When using align it seems that texture is less aligned relative to without using it, also it seems that with align image texture is less smeared.

the relevant code (with align): auto frames = pipe.wait_for_frames(); auto processed = align.process(frames); rs2::depth_frame depth = processed.get_depth_frame(); rs2::video_frame color = processed.get_color_frame(); pc.map_to(color);

error_withalign

BTW the red object is approximately 0.5 meters away from the camera.

without align: auto frames = pipe.wait_for_frames(); rs2::depth_frame depth = frames.get_depth_frame(); rs2::video_frame color = frames.get_color_frame(); pc.map_to(color);

noalign

Can you please help how to improve results so alignment will be correct and no smeared area will apear? What is the main cause for these issues?

Best Regards, Amir I.

AItah avatar Jan 20 '19 20:01 AItah

Aligning a 3D point cloud is a bit more complicated than a 2D image align, as you have to take the extrinsics of the camera into account to get correct results. Here is an example discussion of the subject:

https://github.com/IntelRealSense/librealsense/issues/2455

MartyG-RealSense avatar Jan 20 '19 21:01 MartyG-RealSense

Hi,

we followed the align example - is it not sufficiant? what r u recommanding to do?

best regards, A.I.

On Sun, Jan 20, 2019, 23:28 MartyG-RealSense [email protected] wrote:

Aligning a 3D point cloud is a bit more complicated than a 2D image align, as you have to take the extrinsics of the camera into account to get correct results. Here is an example discussion of the subject:

#2455 https://github.com/IntelRealSense/librealsense/issues/2455

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/3106#issuecomment-455904044, or mute the thread https://github.com/notifications/unsubscribe-auth/ArqfMYlZaYLG3RsPtFTrdlRRjlkfDR0jks5vFN92gaJpZM4aJ1uJ .

AItah avatar Jan 20 '19 21:01 AItah

I believe the alignment in the Align sample program is an alignment of 2D data and not a point cloud.

It is possible to align color and depth in the RealSense Viewer software instead of using scripting. In its default 2D mode, set both the depth stream and RGB stream running. Then click on the '3D' button in the top corner to enter 3D point cloud mode.

Using the lower of two drop down menus at the top of the Viewer screen in 3D mode, you can choose the color stream instead of the default depth stream setting, and the RGB then aligns to the point cloud.

https://forums.intel.com/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=0680P000005i6sZ&operationContext=CHATTER&contentId=05T0P00000FsSqX

Ignore the temporal filter highlighted in the white box in the picture - I linked to that one to show the top-screen menus, as I am on a tablet right now and could not make a new image. :)

MartyG-RealSense avatar Jan 20 '19 21:01 MartyG-RealSense

Dear Marty,

10x 4 trying to help. We think that what we did has similar results to the realsense viewer.

Align indeed bring the scene to be aligned however not perfectly. As can be seen in the sample we uploaded in the original post. We guess that smeared area is due to area which is not available between the two scene. this is why in the none align case the smeared area is dramatically seen relative to the align case. We also guess that wrong texture alignment results form two main reason: 1) Depth error which results with the texture to be seen in wrong depth location. 2) images is taken from different location therefore projection can be wrong.

Can you please confirm if indeed above explains the two problems or maybe it is something else?

Regards, Amir I.

AItah avatar Jan 21 '19 08:01 AItah

Another input which is relevant: When mapping to IR data the results are much better (see attached). with RGB we get smearing at edges and also wrong alignment while the IR texture results with expected outcome for this kind of camera.

Can you please guide us how to calibrate alignment between RGB camera and point cloud so the results will be with same quality as with the IR texture.

Best, Amir I. infra1 map2color infra2

AItah avatar Jan 21 '19 09:01 AItah

Hello @spaltiel,

image The depth FOV is larger, so on the boundaries the pointcloud for D435 will lack texture data, as it clearly seen in the first pair of images in this thread. Hence when you're aligning depth to color, the texture (u,v) coordinates that are outside the texture boundaries will be drawn according to OpenGl rendering configuration, such as clamp/stretch or wrap around.

  • The alignment issue (in yellow) the above snapshot, is most certainly an occlusion artifact (#2445)

ev-mp avatar Jan 21 '19 14:01 ev-mp

10x!

we tried to add occlusion filter and the results are improved however yet the occlusions are still there.

Did you tried to rotate the RGB image based on the camera calibration and projecting the texture while taking into account the camera error?

anyway it can be nice solution.

Thanks and best regards, Amir I.

AItah avatar Jan 21 '19 15:01 AItah

ev-mp,

thanks for your support! it indeed helped us.

Amir I.

AItah avatar Jan 21 '19 17:01 AItah

Duplicate of #2237, #2355

ev-mp avatar Aug 04 '19 06:08 ev-mp