Ask Your Question

Noo7's profile - activity

2021-01-08 05:31:31 -0600 received badge  Popular Question (source)
2019-02-20 01:50:55 -0600 received badge  Famous Question (source)
2018-04-04 02:17:56 -0600 received badge  Notable Question (source)
2017-11-13 08:14:50 -0600 received badge  Popular Question (source)
2016-11-30 16:39:09 -0600 commented question OpenCV Error: Assertion failed (src.type() == CV_8UC1) in cv::findNonZero?

converting xrayImg to 1 channel image using

cv::cvtColor(xrayImg,xray1Channel,CV_BGR2GRAY);

solved the roblem.

2016-11-30 15:46:56 -0600 received badge  Editor (source)
2016-11-30 15:33:31 -0600 asked a question OpenCV Error: Assertion failed (src.type() == CV_8UC1) in cv::findNonZero?

I have the following code snippet which fails at the line where I call cv::findNonZero(... I dont know why, I did manual conversion on cmprResult and the type is still unchanged, which is type 16 according to the cout<<

    cv::Mat cmprResult = cv::Mat::zeros(xrayImg.size(),CV_8U);
    std::vector<cv::Point> pointsZeroXray;
    cv::compare(xrayImg, 0, cmprResult, cv::CMP_EQ);

    std::cout << "ompare Result " << cmprResult << std::endl;
    std::cout << "type " << cmprResult.type() <<std::endl;
    cmprResult.convertTo(cmprResult, CV_8UC1);

    cv::findNonZero(cmprResult, pointsZeroXray);
    std::cout << "nonzero after" << pointsZeroXray << std::endl;
    std::cout << "finished comparing xray" << std::endl;
2016-11-18 05:43:58 -0600 received badge  Supporter (source)
2016-11-18 05:43:57 -0600 received badge  Scholar (source)
2016-11-17 14:13:24 -0600 commented question Error: Sizes of input arguments do not match, why?

yes, first i want to sum them though

2016-11-17 13:56:29 -0600 asked a question Error: Sizes of input arguments do not match, why?

I have the following code and it produces the error "Sizes of input arguments do not match" at the line where I try to add two cv::Mat objs together. Why?

std::vector<cv::Mat> depths;
for (int i = 0; i<102; ++i)
    depths.push_back(cv::imread(img_path + std::to_string(i) + img_suffix));

cv::Mat mean_depth = cv::Mat::zeros(depths.at(0).size(), CV_64F);

for (std::vector<int>::size_type i = 0; i != depths.size(); i++) {
    mean_depth = mean_depth + depths[i];
}