Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It rearranges the channels, so if before it was BGR (the default format), then after it would be GRB, which is weird. The statement has the identical im in all three channels, so why rearrange it?

Try just replacing it with im = [im, im, im] and see if that works.

If this is just a simplified version and you do need an OpenCV replacement, use mixChannels. I'm not sure what the python bindings are, but that's the function. The documentation there has a small C++ example.

Slightly slower, but with a python example is splitting and then merging, which is in the tutorial HERE.