that’s a difference in the last bit of fp32 mantissa. I wonder what code path caused this and how. perhaps someone somewhere used some constants that aren’t quite “exact”… it’s floating point math. don’t expect exactness. IIRC, the coefficients for BGR2GRAY can’t be expressed exactly as binary floating point numbers.
I can’t reproduce this from python (windows), which I find odd.
a = np.full((8, 1, 3), 1.0, dtype=np.float32)
a[0,0,:] = 0.75
b = cv.cvtColor(a, cv.COLOR_BGR2GRAY)
assert b[0,0] == 0.75
run this and inspect the results:
a = np.eye(3, dtype=np.float32).reshape((3,1,3))
b = cv.cvtColor(a, cv.COLOR_BGR2GRAY)
print(b) # should give you the B,G,R factors for conversion
assert b.sum() == 1