Error using calculLut and/or getMinMaxHistogram
int main(int argc, char** argv){
if(argc!=1){
usage();
}
for ( indice=1 ;indice<=14; indice++ ){
src = imread(cv::format("NouveauPermis/%d.jpg",indice).c_str(), indice);
//imshow("original",src);
// Pretraitement
vector<Point> points = getMinMaxHistogram(src);
calculLut(points[0],points[1], src);
//imshow("l'image transformée",src);
// Detection des contours
contour = method_canny(src);
//imshow("les contour",contour);
imwrite(cv::format("NouveauPermisT/frame%d.jpg",indice).c_str(), src);
waitKey(0);
destroyAllWindows();
}
return 0;
}
but i get this error when I run it:
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
terminate called after throwing an instance of 'cv::Exception' what(): c:/opencv/sources/modules/imgproc/src/color.cpp:8000: error: (-215) scn == 3 || scn == 4 in function cvtColor
You need to reduce this to the smallest possible code that throws the exception. What does reading 14 images have to do with anything? Where does "method_canny" come from?
the method I created it myself, what I want to do is read one image at a time(from a local forlder which contains 14 images)and then do a series of treats, I waste time reading the images one by one
check, if your images really were loaded (i bet, not so. it's the typical noob problem)