Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

here's the culprit:

cvtColor(B, B, COLOR_BGR2GRAY);

you probably expected it to haqppen "in-place", but -- since the number of input/output pixels differ, the internal memory of B is reallocated, and it's data pointer is no more the same as A or C

in other words, all expected behaviour. (A and C still point to the very same memory)

here's the culprit:

cvtColor(B, B, COLOR_BGR2GRAY);

you probably expected it to haqppen happen "in-place", but -- since the number of input/output pixels differ, the internal memory of B is reallocated, and it's data pointer is no more the same as A or C

in other words, all expected behaviour. (A and C still point to the very same memory)