在Matlab中有效地获取像素坐标 [英] Getting pixel coordinates efficiently in Matlab

查看:1327
本文介绍了在Matlab中有效地获取像素坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Matlab中创建一个函数,给定一个图像,允许用户通过在图像中单击它来选择像素并返回像素的坐标。理想情况下,人们可以连续点击图像中的几个像素,并且该函数将所有相应的坐标存储在矩阵中。有没有办法在Matlab中做到这一点?

I would like to create a function in Matlab that, given an image, will allow one to select a pixel by clicking on it in the image and return the coordinates of the pixel. Ideally, one would be able to click on several pixels in the image in succession, and the function would store all the respective coordinates in a matrix. Is there a way to do this in Matlab?

推荐答案

ginput


鼠标或光标的图形输入
语法

Graphical input from mouse or cursor Syntax



    [x,y] = ginput(n) 
    [x,y] = ginput 
    [x,y,button] = ginput(...)




描述



[x,y ] = ginput(n)使您能够
从当前
轴识别n个点并返回x和y列中的x和
y坐标
向量。按返回键,
在输入n
点之前终止输入。

Description

[x,y] = ginput(n) enables you to identify n points from the current axes and returns their x- and y-coordinates in the x and y column vectors. Press the Return key to terminate the input before entering n points.

这篇关于在Matlab中有效地获取像素坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆