I try to make object tracking using CamShift. But I cant surpass calcBackProject and I have take error(assertion failure).
02-05 03:35:23.282: E/cv::error()(11447): OpenCV Error: Assertion failed (rsz == dims*2 || (rsz == 2 && _1d) || (rsz == 0 && images.depth(0) == CV_8U)) in void cv::calcBackProject(cv::InputArrayOfArrays, const std::vector<int>&, cv::InputArray, cv::OutputArray, const std::vector<float>&, double), file /home/reports/ci/slave_desktop/50-SDK/opencv/modules/imgproc/src/histogram.cpp, line 1956
Here is my code. Can anybody help me?(sory my poor eng)
Imgproc.cvtColor(mrgba,mHsv, Imgproc.COLOR_BGR2HSV); List<mat> lHSV= Arrays.asList(mHsv); Mat backproj = new Mat(); Imgproc.calcBackProject(lHSV, new MatOfInt(0, 1),roiHist, backproj,new MatOfFloat(0, 179, 0, 255), 1); RotatedRect rect=Video.CamShift(backproj,roi, new TermCriteria(TermCriteria.EPS,10,1));