How can i get RGB value if i have position(x,y)
조회 수: 1 (최근 30일)
이전 댓글 표시
if i have position of image(pixel) . How can i get RGB value of this position?
댓글 수: 0
채택된 답변
Image Analyst
2012년 1월 22일
Note that row = y and is the first index, not the second index.
redValue = rgbImage(y, x, 1);
greenValue = rgbImage(y, x, 2);
blueValue = rgbImage(y, x, 3);
댓글 수: 0
추가 답변 (2개)
Andrew Fowler
2012년 1월 21일
Since RGB images are really 3D matrices, you can use the squeeze command :
pixelRGB = squeeze(yourImage(x,y,:));
댓글 수: 0
Sukuchha
2012년 1월 22일
use function impixel if you have image processing toolbox
P = impixel(RGB,c,r)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!