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 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
More Answers (1)
Image Analyst
on 20 Nov 2012
Edited: Image Analyst
on 20 Nov 2012
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!