temporal effect on depth result in ghosty image
Hi, I'm trying to do temporarl removal on depth image, and I'm getting a ghosty image as shown in the video below https://www.youtube.com/watch?v=5HBlp...
and here is the code:
while (key != 'q') {
if (zed.grab(runtime_parameters) == ERROR_CODE::SUCCESS) {
zed.retrieveImage(depth_image_zed_display, VIEW::DEPTH, MEM::CPU, new_image_size);
zed.retrieveMeasure(depth_image_zed, MEASURE::DEPTH, MEM::CPU, new_image_size);
cv::Mat dst;
//cv::boxFilter(depth_image_ocv_display, dst, -1, cv::Size(1, 1));
cv::Mat result;
double factor = 0.5;
cv::addWeighted(depth_image_ocv, 1.0 - factor, last_image, factor, 0.0, result);
last_image = result;
cv::imshow("dep", depth_image_ocv_display);
cv::Mat ucharMat, ucharMatScaled;
result.convertTo(result, CV_8UC1);
// scale values from 0..1 to 0..255
result.convertTo(ucharMatScaled, CV_8UC1, 255, 0);
cv::imshow("filtered_ dep", ucharMatScaled);
// Handle key event
key = cv::waitKey(10);
}
}
please rather add a single image here, than a link to a video elsewhere, thank you.
@break I added a single image
can you take a look at it again, and clarify, where all those Mat's come from, and where they go ?
does your camera move ?
what does it mean ? removal of what ? explain, please.
@break, I wanna do temporal filtering on that image, I see a lot of spots that appear in the screen. Yes the camera moves, and i see accumlated ghosty image that fades the filtered image into black when I move
i've no idea about the range of your depth images, but this:
might simply binarize it if it was in [0..1] before
hard to say anything with that incommplete code, please update
what you're producing there is some kind of "echo buffer". if that's not what you wanted, you'll have to explain better what you wanted instead
@break I removed that line you mentioned, I'm getting an echo buffer still, like the picture is accumlated to black every frame, that's the complete code actually above. My main complaint is to remove temporarl effect, like popping up spots on the depth image, how would I remove that ?
@break the depth image is C1_32F
no, it's not complete, we don't know, what depth_image_ocv or depth_image_ocv_display are
i can't see any of it in your image above (so again, please show a "problematic" one !), and it's also unclear, if this is a temporal effect even, or "speckles" from the disparity generation. i also have no idea, how the zed folks generate the depth image
as long as the camera moves, your idea above won't work, simply said.
@breal I uploaded a video, which shows two things 1. Speckles 2. Ghosting after filtering the depth. https://www.youtube.com/watch?v=5HBlp... Please take a look at it. The above video is done using the above code.
@break ok, lets focus on something, how would I do temporal remove on a depth image ?