Hello every body! First post in this community!
I am developing a pure C application that uses librealsense (with D415 or D435 cameras) to get a depth frame and perform some calculation (which calculation is irrelevant by now...)
Before taking the depth frame to the functions tate make all the computation, I need to transform it to a single channel 8bpp image. To do this I defined a chain of post-processing filters as described here:
and ended the chain with a colorizer filter that returns a gray level image.
Unfortunately, the application crashes (with segmentation fault) after a while. Looking at the process memory with tools like top or htop it seems that there is some memory leak in the code, and valgrind confirms that too. But all the lost memory is within librealsense, which sound strange actually. I am thinking that maybe I am missing some passage, but the documentation is not very detailed.
The code is wide... not sure if I can post it here. However, I suspect that the issue is in cleaning up of the pointers I get from librealsense. Each post-processing filters return a filtered image that is the input to the next filter in the chain. After all the processing has been done, and the 8bpp image has been copied to the rest of the applicaition, I release them all with rs2_release_frame().
Does anybody here have some insights about how memory is managed in librealsense? Should I release the memory or not? Am I missing something in using the filters? Any complete example available?
Thanks in advance!
Please sign in to leave a comment.