How to use spatial image coordinates to get image pixel values??

7 Ansichten (letzte 30 Tage)
BHARATH
BHARATH am 25 Aug. 2011
Dear all I am working in hyperspectral image classification. I need to collect the training samples using the displayed image. I have gone through impoly, imrect.. It gives the coordinates. It doesnt help me much...
does any one has any idea?? how to do it??
  2 Kommentare
Sean de Wolski
Sean de Wolski am 25 Aug. 2011
So given a rectangle or other polygon, extract the pixel values inside it?
Maria
Maria am 29 Aug. 2012
Bearbeitet: Maria am 29 Aug. 2012
Could you please help with this. Yes I want the pixel values inside a polygon of an image(colored) only.how should I do that?
This is how the polygon has been made
rgbImage = imread('100_3816.jpg');
imshow(rgbImage);
BW = roipoly;
% Mask the image.
maskedRgbImage = bsxfun(@times, rgbImage, cast(BW,class(rgbImage)));
% Display it.
imshow(maskedRgbImage);

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chaowei Chen
Chaowei Chen am 27 Aug. 2011
You are almost there.
ROI=roipoly(img);
pixValue=img(ROI);

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by