Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Different results between imread as grayscale and cvtColor

$
0
0
Did anyone notice that if you load a color image directly as gray scale, the resulting image is slightly different than loading it to a color image and then cvtColor to grayscale? Anyone know why? img1=cv2.imread("imge.jpg", 0) img2=cv2.imread("imge.jpg", 1) img2=cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) print np.max(img1!=img2) # True print np.max(img1.astype('float32')-img2.astype('float32')) # 2.0 BTW, this happens under both Linux and Windows (either c++ or python).

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>