Reputation: 1120
what is the proper way of using cvSplit
function? I saw different version of it.
should it be
cvSplit(oriImg, r,g,b, NULL);
or
cvSplit(oriImg, b,g,r, NULL);
Upvotes: 2
Views: 320
Reputation: 19
It is exactly the same thing I was puzzled by when I started using OpenCV. OpenCV uses BGR instead of RGB so you should use
cvSplit(img,b,g,r,NULL);
Upvotes: 0
Reputation: 3334
Both of them are ok, it depends on the channel ordering. By default OpenCV uses BGR, so in this case it would be cvSplit(oriImg, b,g,r, NULL);
, but you can convert it to RGB and then use the other one.
Upvotes: 3