MATLAB图像处理提取坐标,MATLAB中如何提取二维坐标

本文介绍了一个MATLAB函数`ginput_ax_mod2`,用于从图像中高效地提取二维坐标。该函数考虑了不同鼠标按钮操作,并在用户接近图像边界时改变光标样式。通过设置容忍度阈值,它能够在满足特定距离条件下终止坐标提取过程。通过这个函数,用户可以方便地在MATLAB中进行图像处理和坐标选取。
摘要由CSDN通过智能技术生成

CODE:

function varargout = ginput_ax_mod2(ha,n)

if nargin<2

n=1;

end

k = 0;

button = 0;

%%// Tolerance so that in the inifnity case, this could act as

%%// the thresholding distance below which the

%%// input extracting operation must be terminated

TOL = 0.01;

%%// Placeholders for X-Y and button type could be stored

button1 = [];

xy = [];

hf = get(ha,'parent');

figure(hf);

set(hf,'WindowButtonMotionFcn',@changepointer)

set(ha,'ButtonDownFcn',@getpoints)

hp = get(ha,'children');

ht = get(hp,'hittest');

set(hp,'hittest','off')

axlim = get(ha,'Position');

fglim = get(hf,'Position');

x1 = axlim(1)*fglim(3) + fglim(

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值