Open jashshah999 opened 1 year ago
There is an example on how to render the depth buffer: https://github.com/cansik/realsense-processing/blob/master/examples/UseDepthBuffer/UseDepthBuffer.pde
I think the performance issues are due to the GetDistance()
method which is slow for so many calls. It's better to work on the depth buffer directly.
Also it makes sense to scale down the depth buffer with the DecimationFilter.
And you could use an opencv method for thresholding, which is implemented fast enough, or even better, implement a processing shader.
Sorry but I do not understand how this will help. How do I modify my binary thresholding function to incorporate this? Could you provide a sample where there is a function that takes as an input a PI image and then does the binary thresholding using the example you just mentioned - thank you
No, I'm not going to write code for you. I have provided examples which should be enough to help. What you have to do is to replace your GetDistance
method with reading the depth buffer before the for-loops and then look it up during the for-loops.
If you have a more specific question about one of the hints, feel free to ask.
Thanks - I was not asking for the code but I just wanted to know how to use it because if I simply copy paste the code you provided - I do not get any output - the window is crashing so not sure what the issue is.
That is why I had asked for an example program. This should work out of the box right (?)
Please let me know if there is something I am missing
Hi, I want to implement binary thresholding based on distance. If the depth value of a pixel is between x and y, it should make it white, else make it black. Right now I am using a very crappy method (pixel-wise) but I was wondering if this repo has something that can make it fast because it is extremely slow right now. This is the current code,
Please help if there is a pre-existing function or if there is a faster way to do this.