- 60
- 0
- 约1.18万字
- 约 18页
- 2016-11-28 发布于河南
- 举报
matlab像素提取方法
matlab像素提取方法
im = imread(***.jpg);
[imcroped rect] = imcrop(im);
%拖动鼠标选取你要处理的范围,双击完成
%范围图像存放在imcroped中,坐标存放在rect中
imtmp = improcess(imcroped); % 你的处理
%把处理后效果的覆盖原图
im(rect(2):rect(2)+rect(4),rect(1):rect(1)+rect(3)) = imtmp;
[x,y]=ginput(2);鼠标点击那两个交点,然后[x,y]
[x,y] = ginput; disp({横坐标是:,num2str(x),纵坐标是:,num2str(y)});
用ginput函数获得鼠标点击后的坐标
ginput
Graphical input from mouse or cursor
Descriptionginput enables you to select points from the figure using the mouse for cursor positioning. The figure must have focus before ginput receives input.
[x,y] = ginput(n) enables you to select n points from the current axes and returns the x- and y-coordinates in the column vectors x and y, respectively. Press the Return key to terminate the input before entering n points.
[x,y] = ginput gathers an unlimited number of points until you press the Return key.
Note Clicking an axes makes that axes the current axes. Although you may set the current axes before calling ginput, whichever axes the user clicks becomes the current axes and ginput returns points relative to that axes. For example, if a user selects points from multiple axes, the results returned are relative to the different axes coordinate systems.
[x,y,button] = ginput(...) returns the x-coordinates, the y-coordinates, and the button or key designation. button is a vector of integers indicating which mouse buttons you pressed (1 for left, 2 for middle, 3 for right), or ASCII numbers indicating which keys on the keyboard you pressed.
----------------------------------------------------------------------引自MATLAB help
网络工具很有用,先找后试,再问!
--------------------------------------转自sina博客-------------------------------------------------------------
第一种途径:ginput()函数
ginput提供了一个十字光标使我们能更精确的选择我们所需要的位置,并返回坐标值。函数调用形式为:
[x,y] = ginput(n)
[x,y] = ginput
[x,y,button] = ginput(...)
对于[x,y] = ginput(n),能使你从当前的坐标系中读取n个点,并返回这n个点的x,y坐标,均为nX1的向量。可以按回车提前结束读数。
[x,y] = ginput 可以无限的读取坐标直到按下回车键。
[x,y,
您可能关注的文档
最近下载
- 生物校本教材—生活中的生物科学.docx VIP
- 2025年高中英语1000个高频重点词汇掌握住考试得高分.doc VIP
- 个人征信报告模板征信报告模板(2021简版带水印).docx VIP
- 论文设计_环境工程_碳捕集利用与封存(CCUS)技术的能耗优化研究_202512.docx
- 2025--2026学年七年级上册历史期末复习试题(含答案).pdf VIP
- 2025年最新团史知识竞赛题目及答案.doc VIP
- 江苏省无锡市锡山区2023-2024学年三年级上册期末考试语文试卷.pdf VIP
- 歌曲十二生肖教学课件.ppt VIP
- 茶叶发酵微生物功能探究-洞察与解读.docx VIP
- 全册单词默写(专项训练)-2025-2026学年沪教牛津版英语七年级下册最新版 可打印.docx VIP
原创力文档

文档评论(0)