MRE is required. for both languages. we don’t know what you did.
the numpy shape (h,w,3)
indicates 3-channel data. your claim that in C++ image.channels()
returns 1
would suggest you have 1-channel data there.
so your codes must not be equivalent.