I was trying to use impixel function described in help option of matlab. it instructed to press Return. But I can't find Return.

1 次查看(过去 30 天)
the following code allowed me to choose the point of my interest to identify pixel value
I=imread('3.BMP'); vals=impixel(I);
but i can't find Return, the way it is instructed in matlab help option which is shown below:
When you are finished selecting points, press Return. impixel returns the pixel values in an n-by-3 array, where n is the number of points you selected.

采纳的回答

Ilham Hardy
Ilham Hardy 2012-11-20
Press "Enter" button..

更多回答(1 个)

Image Analyst
Image Analyst 2012-11-20
编辑:Image Analyst 2012-11-20
That's the enter key on the keyboard. Alternatively you can use ginput(1) to return a column, row and then get the value from the image itself. ginput(1) does not require the user to type the enter key, if you know in advance how many points to ask your user for (this is the input argument to ginput).
[x, y] = ginput(1) % Ask for 1 point
row = int32(y)
column = int32(x)
grayLevel = grayImage(row, column)
If you don't pass anything into ginput, then it keeps letting the user specify points until he presses the enter key.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by