opencv 图片读写,截取,复制,标记
2019-04-15 14:02发布
生成海报
参考
图片读写
Mat pic=imread("a.png");
imshow("title",pic);
Mat a=xxx
imwrite("filename.png",a)
图片截取
Mat a=xxx
Mat b(a,Range(10,10,100,100))
imshow("picture b",b)
imwrite("b.png",b)
图片复制
Mat a=xxx;
Mat b=a.clone();
Mat c;
a.copyTo(c);
Mat d=a;
图片标记
Point p;
p.x=10;
p.y=100;
Point p2=Point(10,200);
Rect rect
rect.x=10
rect.y=10
rect.width=50
rect.height=50
Rect rect2=Rect(10,10,100,100)
Size size;
size.width=10;
size.height=20;
Scalar color(255,0,0);
ellipse()
circle()
line()
rectangle()
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮