Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::minMaxLoc argument problem

I'm trying to use cv::minMaxLoc to find minium and maximum values and points in a one-dimensional array but I can't compile the source.

void main(void)
{
    cv::Mat array1D = cv::Mat(1, 800, CV_32FC1, cv::Scalar(0));
    double minVal;
    double maxVal;
    int minIdx;
    int maxIdx;
    // ....
    // putting an image projection to array1D and I can draw and view it's histogram
    // ....
    cv::minMaxLoc(array1D, &minVal, &maxVal, &minIdx, &maxIdx);
}

But I'm getting, error C2665: 'cv::minMaxLoc' : none of the 2 overloads could convert all the argument type when I change the cv::minMaxLoc line to cv::minMaxLoc(array1D, &minVal, &maxVal);, there is no error.

cv::minMaxLoc argument problem

I'm trying to use cv::minMaxLoc to find minium and maximum values and points in a one-dimensional array but I can't compile the source.

void main(void)
{
    cv::Mat array1D = cv::Mat(1, 800, CV_32FC1, cv::Scalar(0));
    double minVal;
    double maxVal;
    int minIdx;
    int maxIdx;
    // ....
    // putting an image projection to array1D and I can draw and view it's histogram
    // ....
    cv::minMaxLoc(array1D, &minVal, &maxVal, &minIdx, &maxIdx);
}

But I'm getting, error C2665: 'cv::minMaxLoc' : none of the 2 overloads could convert all the argument type when I change the cv::minMaxLoc line to cv::minMaxLoc(array1D, &minVal, &maxVal);, there is no error.error. I also tried casting the idx addresses with (int *) and also tried too cv::minMaxLoc(array1d, &minVal, &maxVal, &minIdx, &maxIdx, cv::Mat()) and result is same.