Converting the Image Color Format
This section describes how to convert the color format of an image. The native OpenCV does not provide the option of converting RGB/BGR to NV12/NV21.
API Calling
HiLensEC hilens::CvtColor(const cv::Mat & src, cv::Mat & dst, CvtCode code)
Parameter Description
Parameter |
Description |
---|---|
src |
Source image (BGR888 or RGB888). |
dst |
Target image |
code |
Color conversion code, which specifies the conversion type. The options are RGB2YUV_NV12, RGB2YUV_NV21, BGR2YUV_NV12, and BGR2YUV_NV21. enum hilens::CvtCode For details about the enumerated values, see Table 2. |
Return Value
If the return value is 0, the operation is successful. Otherwise, the operation fails. Refer to Error Codes for details about the failure response parameters.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot