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

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

So given a rectangle or other polygon, extract the pixel values inside it?
Maria
Maria 2012년 8월 29일
편집: Maria 2012년 8월 29일
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);

댓글을 달려면 로그인하십시오.

답변 (1개)

Chaowei Chen
Chaowei Chen 2011년 8월 27일

0 개 추천

You are almost there.
ROI=roipoly(img);
pixValue=img(ROI);

카테고리

도움말 센터File Exchange에서 Image Data Workflows에 대해 자세히 알아보기

질문:

2011년 8월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by