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

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 ?

A

isequal B. (why do you think, it's not ?)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 .

don't use jpg (for such comparisons)

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