-
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
Android - Problem with GLSurfaceView after saving aligned colorized depth image #10007
Comments
After some trial and error, I managed to solve the problem by just not using Colorizer on the frameset that is being uploaded to the GLSurfaceView. So there is no more stacking of images on the screen and the saved images are aligned as expected. |
That's excellent to hear, @Xantiks - thanks very much for the update :) |
@Xantiks Hi, could you share where is the function void snapshot(String profile, String folderPath) called? I am having trouble saving the color image and depth image locally, could you help me? Thanks. |
Hi @oddityyyy, I just call the function when a button is pressed. Maybe you can check out the recording example and see if it helps you out. |
The recording example sets two buttons, mStartRecordFab and mStopRecordFab. We only need one button, that is, press the button once to take a picture. So I just need to replace the toggleRecording() method triggered by the button with the snapshot() method you wrote. And not change other parts. Did I understand it correctly? Could you help me see it? thanks! o( ̄▽ ̄)ブ `mStartRecordFab.setOnClickListener(new View.OnClickListener() {
|
Yes, that should do it. |
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/android/examples/capture/src/main/java/com/intel/realsense/capture |
I'm also a beginner at this, but I skimmed through your code and at the start I see that you are missing the |
Sorry, I tried the suggestions you gave, but the application still crashes. I think there is a problem with the code I wrote. Could I learn from the rest of the code you wrote? |
I simply copied the code and attempted to run it, but it displayed the "Connect A RealSense Camera" message when I connected my Intel RealSense camera. And I am using D415 realsense. |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
Hi,
I'm trying to use the
Align
class to align the depth frame to color frame and then save the image as .jpg. The issue I'm facing is that when I useapplyFilter
to the Frameset I get the correct image, but the GLSurfaceView somehow gets updated with the aligned image.This is the code for uploading frameset to the GLSurfaceView, which is unchanged:
This function is used for saving RGB and colorized depth image as .jpg files and saving raw depth data in .npy file. It is called in an AsyncTask if that is of any relevance.
This is how my screen looks like when this code is used:
Once I add the Align filter like this in the 3rd line of the snapshot function:
FrameSet frames = mPipeline.waitForFrames().releaseWith(fr).applyFilter(mAlign).releaseWith(fr)
,a single image is added to the GLSurfaceView every time, which results in this:
In case I would take lets say 20 pictures, I would have 20 images stacked on top of each other. I really have no idea what I'm missing and how can this happen by just adding a
.applyFilter(Align)
, so if you could help me out I would really appreciate it.Thank you in advance.
The text was updated successfully, but these errors were encountered: