c++ and opencv get and set pixel color to Mat

前端 未结 3 533
遇见更好的自我
遇见更好的自我 2020-12-08 02:18

I\'m trying to set a new color value to some pixel into a cv::Mat image my code is below:

    Mat image = img;
    for(int y=0;y

        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 02:47

    just use a reference:

    Vec3b & color = image.at(y,x);
    color[2] = 13;
    

提交回复
热议问题