This is what I noticed when I used my own .jpg image sets. In the sample script available in the Opencv doc , notice that it has the undistort and crop the image lines, as shown below:
# undistort dst = cv2.undistort(img, mtx, dist, None, newcameramtx)
So, when we run the code for the first time, it executes the line cv2.imwrite('calibresult.jpg',dst) , saving the image calibresult.jpg in the current directory. So, the next time I ran the code, along with my sets of sample images that I used to calibrate the camera in jpg format, the code also tried to examine this newly added image calibresult.jpg , which caused an error to calibresult.jpg up
error: C:\builds\master_PackSlaveAddon-win64-vc12-static\opencv\modules\imgproc\src\color.cpp:7456: error: (-215) scn == 3 || scn == 4 in function cv::ipp_cvtColor
What I did: I simply deleted this newly created image after each run or alternatively changed the image type to say png or tiff . This solved the problem. Make sure you enter and record calibresult the same type. If so, just change the type.
Bhanu Chander Mar 12 '17 at 12:45 2017-03-12 12:45
source share