이제 회색으로 변환하는 함수를 작성했습니다.
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/buildd/opencv-2.3.1/modules/imgproc/src/color.cpp, line 2834
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/imgproc/src/color.cpp:2834: error: (-215) scn == 3 || scn == 4 in function cvtColor
어떤 문제가 될 수 :
cv::cvtColor(image, image, CV_RGB2GRAY);
는 그리고이 오류가 다가와서?
이
내가 (회원의 이력서가있는 imagehandler 클래스 :: 매트 m_image을 통해) 이미지를 읽는 방법입니다imagehandler::imagehandler(const std::string& fileName)
: m_image(imread(fileName, CV_LOAD_IMAGE_COLOR))
{
if(!m_image.data)
{
cout << "Failed loading " << fileName << endl;
}
}
'이미지'를 컬러 이미지로 읽으시겠습니까? – Sassa
어떻게하면됩니까? – TheNotMe
[imread] (http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread)를 확인하십시오. 코드에서 어떻게 읽습니까? – Sassa