-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Acquiring multiple frames from D435 #9800
Comments
Hi @asb2111991 The RealSense SDK's Keep() function might meet your requirements. It enables frames to be stored in memory and then processed in a batch in a single action when closing the pipeline - for example, applying post-processing and alignment to all of the stored frames and then saving them to file. Information about using Keep() with Python can be found at #6146 |
Thank you so much @MartyG-RealSense, using the keep method, is it possible to retrieve all the 5 frames or I can only get processed output? |
You do not have to apply post-processing, align or file-save to the memory-stored frames after the pipeline is closed if you do not need to. You should be able to access all of the stored frames. Reading your case again though, I wonder if the artifacts that you are experiencing are due to the fact that the auto-exposure takes the first several frames to settle down after the pipeline has started. You could therefore put a few lines into your script to skip the first several frames and then capture a single frame after that to fulfill your one-shot needs. #7932 has an example of a Python script under the Loading Code heading that demonstrates skipping the first 5 frames.
Alternatively, you could disable the depth auto-exposure function like in #3558 (comment) as it is not necessary to skip the first several frames when using manual exposure.
|
Thank you @MartyG-RealSense for the answer. But, I would really like to use the keep() method. For my application, the external lighting (which I know has a minimal impact over the depth map) is highly variable while the accuracy requirement is very high. So, after so much experimentation, I have found the median filtering approach more effective. I have figured out how to use set_option and rs.option.frames_queue_size. Now I would really like my code to be able to pull multiple frames in one go and use that object to align and also apply post-processing filters.
Thank you |
There are few references about using Keep() to perform actions on the data after the frames are stored. #3164 (comment) provides a simple Python example of using a Decimation post-processing filter with Keep(). An example that uses frames.keep() is also at #3121 (comment) |
I have looked at both references you have cited a while ago, but, they do not seem to be working on individual frames that I collect using the keep(). I am starting to wonder if it is even a possibility to extract specific number of frames using keep() Also, I was looking at frame_queue_example.py and in there I have come across the usage of
How is this different from what I (and many others) am using?
Please advise. |
In addition to Marty's suggestion, here are other examples for postprocessing filters in C/C++ and python. Please see if examples below contain any information that can be applied to your use case. Python box-measurement example also shows an example of applying spatial and temporal filters to the depth. |
Thank you @RealSenseSupport for jumping in to help. I have few outputs under different settings. The code is as follows:
The outputs are: These images have been taken under controlled conditions. While the last output (using accumulation) is the desirable outcome, it takes significantly longer duration for acquiring multiple frames in a loop. Is there any way I can avoid loops and acquire 'n' (= 5 in my case) frames with one command? Thank you. |
Hi @asb2111991 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Issue Description
I am extracting RGB and Depth frames on a single shot basis and process them for object identification application. I observed that sometimes, it is likely that the depth map has some artifacts and hence throws the algorithm off. I found that acquiring multiple frames using loops can help me run a median filter and make the depth map more reliable. Is there any way to acquire 5 frames as a single burst rather than using a loop which is time-consuming?
I am a beginner and would really appreciate it if anyone can point me to an example program. I looked into the concept of 'frameset' and it was confusing. Any help is appreciated.
The text was updated successfully, but these errors were encountered: