I want to get values of nonZero elements of a 2-dim cv::Mat and put the result on a cv::Mat. How I can do this ? I used following code to get the index of nonZero elements :
cv::vector<cv::vec2i> nonzero ;
cv::findNonZero(mask,nonzero);
1 | initial version |
I want to get values of nonZero elements of a 2-dim cv::Mat and put the result on a cv::Mat. How I can do this ? I used following code to get the index of nonZero elements :
cv::vector<cv::vec2i> nonzero ;
cv::findNonZero(mask,nonzero);