c++ opencv创建空图片

 

#include <opencv2/opencv.hpp>

int main() {
    // 创建一个空的图片,宽度为500像素,高度为500像素,通道数为3(RGB),数据类型为8位无符号整数
    cv::Mat image = cv::Mat::zeros(500, 500, CV_8UC3);

    // 将图片的所有像素值填充为255
    image.fill(255);

    return 0;
}

 

 

 

=======

posted @ 2024-01-25 21:23  西北逍遥  阅读(99)  评论(0编辑  收藏  举报