Converting the Image Color Format
This API is used to convert the image color format. The native OpenCV does not provide the option of converting RGB/BGR to NV12/NV21.
- API calling
hilens.cvt_color(src, code)
- Parameter description
Table 1 Parameters Parameter
Mandatory
Type
Description
src
Yes
<class'numpy.ndarray'> object
Source image (BGR888 or RGB888)
code
Yes
Enumeration type. Options: {RGB2YUV_NV12, RGB2YUV_NV21, BGR2YUV_NV12, BGR2YUV_NV21}.
Conversion type
- Return value
<class'numpy.ndarray'> object, converted image (NV12 or NV21). If the conversion fails, an empty numpy.ndarray object is returned.
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