How to fill OpenCV image with one solid color?

前端 未结 8 1450
陌清茗
陌清茗 2020-12-01 11:32

How to fill OpenCV image with one solid color?

8条回答
  •  情歌与酒
    2020-12-01 12:00

    Create a new 640x480 image and fill it with purple (red+blue):

    cv::Mat mat(480, 640, CV_8UC3, cv::Scalar(255,0,255));
    

    Note:

    • height before width
    • type CV_8UC3 means 8-bit unsigned int, 3 channels
    • colour format is BGR

提交回复
热议问题