In OpenCV, what's the difference between CV_8U and CV_8UC1?

后端 未结 2 751
庸人自扰
庸人自扰 2021-02-06 23:59

In OpenCV, is there a difference between CV_8U and CV_8UC1? Do they both refer to an 8-bit unsigned type with one channel? If so, why are there two names? If not, what\'s the di

2条回答
  •  不知归路
    2021-02-07 00:32

    You can see from this answer, they evaluate to identical types.

    As for why there are two names, if you look at how the #defines are structured (again, see linked answer), a type in OpenCV has 2 parts, the depth, and the number of channels. The system is flexible enough to let you define new types with up to 512 channels. It just so happens that when you specify 1 channel, the channel component of type is set to 0 which makes the result equivalent to simply using the depth CV_8U.

提交回复
热议问题