detect color space with openCV

前端 未结 5 474
予麋鹿
予麋鹿 2020-12-08 02:00

how can I see the color space of my image with openCV ?

I would like to be sure it is RGB, before to convert to another one using cvCvtColor() function

thank

5条回答
  •  心在旅途
    2020-12-08 02:35

    txandi makes an interesting point. OpenCV has a BGR colorspace which is used by default. This is similar to the RGB colorspace except that the B and R channels are physically switched in the image. If the physical channel ordering is important to you, you will need to convert your image with this function: cvCvtColor(defaultBGR, imageRGB, CV_BGR2RGB).

提交回复
热议问题