How to fill OpenCV image with one solid color?

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

How to fill OpenCV image with one solid color?

8条回答
  •  眼角桃花
    2020-12-01 12:23

    If you are using Java for OpenCV, then you can use the following code.

    Mat img = src.clone(); //Clone from the original image
    img.setTo(new Scalar(255,255,255)); //This sets the whole image to white, it is R,G,B value
    

提交回复
热议问题