MATLAB中做点标注ginput
来源:互联网 发布:优盘数据恢复软件 编辑:程序博客网 时间:2024/05/16 19:36
图像的点标注,手动完成图像中目标的坐标标注并保存到mat中。plot执行一次完成一次标注,为了补充漏掉的可能标注点,采取四次标注的方式,完成整个过程。
%对图片上某些点进行标注clear allclose allclcset(gcf,'color','white')src='';%图片集名称提前按数字排好序for i=1:300 //num代表是第几张图片 num = i str = '.jpg' ; Mstr='.mat'; filestr='F:/m_and_c_aboutCounting/airport_tianjin/'; refilestr='F:/m_and_c_aboutCounting/airport_tianjin_R/'; %我的图片集名称是 air ( ).jpg 的格式,air后面有个空格 left_par='air ('; Mark='mark'; right_par=')'; %原图片的位置 STR = sprintf('%s%s%d%s%s', filestr,left_par,num ,right_par, str) ; %压缩后图片的存储位置 RSTR=sprintf('%s%s%d%s%s', refilestr,left_par,num ,right_par, str) ; %标注.mat存储位置 MSTR=sprintf('%s%s%d%s%s', refilestr,left_par,num ,right_par, Mstr) ; %带标注点的图片 MarkSTR=sprintf('%s%s%d%s%s', refilestr,Mark,num , str) ; %读取图片 pic_source=imread(STR); %改变图片大小为原来的五分之一 pic=imresize(pic_source,0.2); imwrite(pic,RSTR); //显示图片 showpic=imshow(pic); %set(B, 'X', [0 1000], 'Y', [0 1000]) //第1次使用ginput取图片中的点 [x1,y1] = ginput; B=[x1,y1]; hold on plot(x1,y1,'r+'); //第2次使用ginput取图片中的点 [x2,y2] = ginput; C=[x2,y2]; hold on plot(x2,y2 ,'r+'); //第3次使用ginput取图片中的点 [x3,y3] = ginput; D=[x3,y3]; hold on plot(x3,y3,'r+'); //第4次使用ginput取图片中的点 [x4,y4] = ginput; E=[x4,y4]; hold on plot(x4,y4,'r+'); imwrite(pic,MarkSTR); //将四次取的点保存下来 gt_point=[B;C;D;E]; save(MSTR,'gt_point'); end
阅读全文
0 0
- MATLAB中做点标注ginput
- matlab ginput详解
- matlab ginput详解
- matlab ginput详解
- matlab ginput详解
- Matlab基本函数-ginput函数
- ginput
- matlab 标注连通域
- MATLAB中标注图例
- Matlab 绘图特殊标注
- MATLAB批量标注legend
- matlab 标注连通域
- MATLAB图形标注
- MATLAB画图符号标注
- matlab文字标注
- matlab中标注连接分量
- matlab figure edit 加标注
- matlab中坐标轴标注和特殊字体
- CCF 201703-2 学生排队
- 139. Subarray Sum Closest
- 1020. 月饼 (25)
- delete大量数据时正确姿势(待测试)
- 当遇到jQuery操作checkbox无效
- MATLAB中做点标注ginput
- 编程必备的最基本5种算法思想
- 机器学习工程师必知的十大算法
- 定义字符指针数组分别指向5个字符串常量,从小到大输出字符串内容
- C语言结构体(预习)
- 快递地址测试
- 笔记
- Windows无法访问Ubuntu Samba 解决方案
- Python自学之路第三步——列表的增删改查