- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to figure out where the source code (C++) is for the alignment function in RealSense SDK2.0 and wonder if someone can give me an advice.
Specifically, I wrote codes for aligning a depth frame to the corresponding color frame as follows:
rs2::frameset frames = pipe.wait_for_frames();
rs2::align align(rs2_stream::RS2_STREAM_COLOR);
rs2::frameset aligned_frames = align.process(frames);
rs2::frame color_frame = frames.get_color_frame();
rs2::frame depth_frame = aligned_frames.get_depth_frame();
I'd like to see source codes for checking how the alignment is accomplished. I found the following codes in "rs_processing.hpp" but I do not see any code for actual calculations for the alignment.
class align
{
public:
.....
}
Also, I've found that "align.cpp" has the "void align_images()" function but I am not sure if this is the same as the alignment function above.
Where can I find the source code for the alignment function?
Regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is also a file in the source code called align.h in the src/proc folder.
https://github.com/IntelRealSense/librealsense/blob/093186bfaaf89a3bd140fc943daf46cd5a6eadc3/src/proc/align.h librealsense/align.h at 093186bfaaf89a3bd140fc943daf46cd5a6eadc3 · IntelRealSense/librealsense · GitHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MartyG,
Thanks for letting me know align.h
It seems to me that the critical part of alignment is the following code in align.cpp:
frameset process(frameset frame)
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
return frameset(f);
}
Nonetheless, from here, I cannot figure out how to get to the source code for actual calculations for the alignment. Is the source code available or hidden?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SDK 2.0 is fully open source, so it is unlikely there are hidden parts. They may just be very difficult to find. I went through the source code carefully and all roads of the investigation seemed to lead back to rs_processing.hpp, the file you'd already found.
This documentation page has an outline explanation of how Align is processed, and may give you some new leads to follow.
https://unanancyowen.github.io/librealsense2_apireference/classrs2_1_1align.html Intel® RealSense™ Cross Platform API: rs2::align Class Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks MartyG. I sent an email to the guy who created the website about the alignment function.
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you mean UnaNancyOwen, their documentation site draws its contents directly from the official documentation and arranges it in a more user-friendly interface. Having said that, UnaNancyOwen is a very skilled developer, having created a set of sample programs for using SDK 2.0 camera functions such as depth and align with OpenCV. So maybe they can give you some useful insight.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MartyG,
Yes, I meant UnaNancyOwen. He was quick in replying to my email. He said the alignment function is written in align.cpp. I will take a closer look.
In any case, thanks always for giving me helpful advices.
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are very welcome. It's great that UnaNancyOwen replied so fast. Have a great day!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page