New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_infrared_frame python wrapper #1297
Comments
Hi @TheMikeyR , for frame in pipe.wait_for_frames():
print frame.profile EDIT: for frame in pipe.wait_for_frames():
print frame.profile.stream_type(), frame.profile.stream_index() |
@zivsha thanks, i've just realised when recording data from realsense-viewer that it only record one infrared stream even though both is activated. Not sure if that is intended or bug? I've tried to enable both infrared and no depth, record, load bag file and post index like above and it only shows index 2. If I enable both streams from camera and use the above, I get both index 1 and 2. I might add get_infrared_stream if I can figure out how, I'm not the strongest in cpp yet. |
Can you please elaborate on this? The viewer should (and as far as I can see, does) record both infrared streams. This works for me with or without depth stream. Can you please make sure that if you open the file with the viewer, all streams are available? Regarding infrared index - The index might also be 0 sometimes, depending on which streams are active. If you run Regarding adding the function to python, .def("get_infrared_frame", &rs2::frameset::get_infrared_frame, "index"_a = 0) next to: librealsense/wrappers/python/python.cpp Line 419 in 5121ab0
|
@zivsha oh yeah my bad, they are both being recorded (when I open it in the viewer all streams are available). That seems extremely easy! I will try it out, thanks 👍 |
It worked wonders, thanks @zivsha I made a PR to get it added. For others who are coming across this, here is an example on how to get each IR stream.
|
Awesome, glad to hear it all works. |
Hi all, I just came up into this issue.
the problem here is on the "cv2.imshow('IR Example', image)" line, because the dtype of image is an array of pyrealsense2.pyrealsense2.video_frame. Do you know how to solve this? |
I just solved my issue by substituting |
@Woodstock94 you mean:
|
yes, sure. I messed it up!^^ |
I believe this may be the solution I am looking for. I am a newbie to Python. How do I use the above code to extract the raw images? |
Update: I have installed the necessary packages and managed to get the program running. This was able to stream the IR and also view the dots. However I was unable to capture an image. It would be great if someone could show me how to do that. |
Hi @neocubist, |
Issue Description
Any plan on adding
get_infrared_frame
to the python wrapper or there any workaround to get both infrared streams? Currently I'm able to get one of the infrared stream using theframeset.first(rs.stream.infrared)
call.I suspected that it should be available in the python wrapper but can't seem to find it anywhere https://github.com/IntelRealSense/librealsense/blob/development/wrappers/python/python.cpp#L419
Currently you are able to call
get_infrared_frame(index)
in cpp according to #1140 (comment)I can see the function is defined here
librealsense/include/librealsense2/hpp/rs_frame.hpp
Line 691 in 9437bc2
It would be nice with the same functionality to python.
The text was updated successfully, but these errors were encountered: