I can use updateHistoryImage with a stereo image?
I am working with a 8UC3 stereo image, but the function updateHistoryImage works only with 8UC1 and 32UF1...
The error: OpenCV(4.0.1-dev) Error: Assertion failed (_silhouette.type() == CV_8UC1 && _mhi.type() == CV_32FC1) in cv::motempl::updateMotionHistory, file C:\opencv4\opencv_contrib-master\modules\optflow\src\motempl.cpp, line 76
I tried to convert the stereo image to 1 level but nothing... How can I make it work?
frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera
frame depth = data.get_depth_frame().apply_filter(color_map);
const int w = depth.as<video_frame>().get_width();
const int h = depth.as<video_frame>().get_height();
Mat image(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);
Mat image2(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);
absdiff(image, image2, differenceImage);
threshold(differenceImage, silhouette, 127, 255, THRESH_BINARY);
mhi = Mat::zeros(image.size(), CV_32FC1);
updateMotionHistory(silhouette, mhi, timestamp, MHI_DURATION);
imho, you need to explain, what is in your stereo images, and how that relates to motion
It's referred to hand gestures..
i still have no idea, what you're trying to achieve here, but please take another look at the sample -- creating a new
mhi
Mat each time is for sure wrong, you have to do that only once (and keep it around for updatingalso, while that example has an absdiff, too, those frames are consecutive in time, there, not "spatially different", but at the same time.
idk., if your setup makes any sense, here.