how to trance to gray in cv2.imread(img,0) ?

asked 2016-01-11 21:42:46 -0600

gelgel gravatar image

I using the opencv3.
I tried
A = cv2.imread(str,0).
img = cv2.imread(str,1).
B = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY).
now A is not equal B. I think, there are difference method.

I found B 's method in http://docs.opencv.org/master/de/d25/...
but can't found A 's method. how to trance to gray in A ? where the fomula ?

edit retag flag offensive close merge delete

Comments

A is equal B. (why do you think, it's not ?)

berak gravatar imageberak ( 2016-01-11 21:46:08 -0600 )edit

i tried
>>>A == B
array([[ True, True, True, ..., True, True, True],
[ True, True, True, ..., True, True, True],
[ True, True, True, ..., True, True, True],
...,
[ True, True, True, ..., True, True, False],
[ True, True, True, ..., True, False, True],
[ True, True, True, ..., False, True, True]], dtype=bool)
It is a slight , but there was a difference .

gelgel gravatar imagegelgel ( 2016-01-11 21:52:44 -0600 )edit

don't use jpg (for such comparisons)

berak gravatar imageberak ( 2016-01-11 21:54:23 -0600 )edit

when I use "bmp", all the elements has become true. I understand that these methods are the same. thank you.

gelgel gravatar imagegelgel ( 2016-01-11 22:21:27 -0600 )edit