用matlab在图像上画矩形框,并保存坐标到文本中
来源:互联网 发布:算法的乐趣 epub 编辑:程序博客网 时间:2024/06/07 00:08
I = imread('/home/wgb/Desktop/matlab_code/0009_color.jpg');imshow(I)% axis([0 1000 0 1000]);hold onfid = fopen('wgb_2.txt','wt');[x1,y1]=ginput(1);plot(x1,y1,'+');[x2,y2]=ginput(1);plot(x2,y2,'+');[x3,y3]=ginput(1);plot(x3,y3,'+');[x4,y4]=ginput(1);plot(x4,y4,'+');% plot([x1 x2],[y1 y2]);wgb = [[x1,y1];[x2,y2];[x3,y3];[x4,y4]];[row, col] = size(wgb);for i = 1:row for j = 1:col fprintf(fid, '%g\t', wgb(i,j)); end fprintf(fid, '\n');endfclose(fid);vertColor = 'r';horizColor ='g';rectPts = wgb;hold on;h(1) = line([rectPts(1,1) rectPts(2,1)], [rectPts(1,2) rectPts(2,2)],'Color',vertColor);h(2) = line([rectPts(2,1) rectPts(3,1)],[rectPts(2,2) rectPts(3,2)],'Color',horizColor);h(3) = line([rectPts(3,1) rectPts(4,1)],[rectPts(3,2) rectPts(4,2)],'Color',vertColor);h(4) = line([rectPts(4,1) rectPts(1,1)],[rectPts(4,2) rectPts(1,2)],'Color',horizColor);hold off% plot([x1 x2],[y1 y2]);% plot([x2 x3],[y2 y3]);% plot([x3 x4],[y3 y4]);% plot([x4 x1],[y4 y1]);% button=1% while(button==1)% [x1,y1]=ginput(1);% plot(x1,y1,'+');% % [x2,y2,button]=ginput(1);% % plot(x2,y2,'+');% % plot([x1 x2],[y1 y2]);% end
阅读全文
0 0
- 用matlab在图像上画矩形框,并保存坐标到文本中
- [图像]用Matlab在图像上画矩形框
- [图像]用Matlab在图像上画矩形框
- 【matlab】从图片中截取矩形区域(手工选取/标记在原图上/截取矩形区域并保存)
- 在图像中画矩形框(matlab)
- 用鼠标截矩形图像并保存
- matlab 在照片中画矩形框
- 毕业设计——人脸检测——MATLAB 在图片上画矩形框(已知矩形左上角坐标、长、宽)
- OpenCV实现从图像中选择矩形区域并保存
- matlab读取txt文本内容修改并保存到txt
- 用鼠标截取矩形图像并保存(1)
- 在图像上画矩形 opencv
- 在RFT中如何截取屏幕图像并保存到文件中?
- 使用MATLAB在图像中选择矩形框区域的操作函数即过程
- 使用MATLAB在图像中选择矩形框区域的操作函数即过程
- matlab中在图像上划线 画圈的方法
- 在图像中选择矩形区域并高亮显示
- 【Matlab图像处理】截取图像中的矩形区域(可不平行于坐标轴)并保存为图片
- C++基础之字符串与指针
- 1025. PAT Ranking (25)
- 【二分+RMQ】玲珑oj 1149
- SVN常用命令
- 筛法快速求解素数
- 用matlab在图像上画矩形框,并保存坐标到文本中
- Codeforces Round 833A-The Meaningless Game
- ios-饼图和柱状图的绘制
- 多线程之初理解
- Linux和Windonws下静态库与动态库(动态库篇)
- HDU3264 Open-air shopping malls【几何】
- Recycleview的各种炫酷应用
- 【转】【Oracle】oracle登录验证的三种方式(详解)
- [Leetcode P10]Regular Expression Matching 正则匹配