Reputation: 5342
I was trying to convert every channel of a RGB image, stored in Mat channel, into 3 2D matrices, each for R,G and B. This question maybe rudimentary, but could you please tell me how I can achieve this? Am using opencv2.4.3 in Linux, Cmake compiler.
I used split, but it stores the values again in a Mat. I want a simple 2D array, that can be accessed easily, instead of Mat. Could you please help me here?
Upvotes: 2
Views: 1966
Reputation: 35269
You can use split
, from the opencv docs:
The functions split splits a multi-channel array into separate single-channel arrays
Upvotes: 1