How can I get the RGB values separately for an image taken using a webcam?

조회 수: 4 (최근 30일)
caner kaya
caner kaya 2017년 10월 11일
댓글: Walter Roberson 2017년 10월 12일
For example, taken color is the WHITE, and I need the MATLAB code gives me these values:
R=255, G=255, B=255
Please help me!

답변 (2개)

OCDER
OCDER 2017년 10월 11일
R = 255, G = 255, B = 255 is the RGB color for white when the data is in uint8 format( 0 - 255 ) values. The website below shows you the RGB values and colors:

Image Analyst
Image Analyst 2017년 10월 11일
If you know the row and column, you can get a 3 element array with the RGB values from your RGB image like this
rgbValue = rgbImage(row, column, :);
  댓글 수: 2
caner kaya
caner kaya 2017년 10월 12일
what does it means, row and column. I take the color picture (for example red apple) using the pc webcam.
Walter Roberson
Walter Roberson 2017년 10월 12일
Images are stored in memory in rectangular arrays, by pixels (small rectangular areas of color.) MATLAB arrays are indexed by specifying the row number first and then the column number. The row number corresponds to vertical position, and the column number corresponds to horizontal position. In terms of (X,Y) coordinates, MATLAB indexing is by Y first and then X -- img(Y,X)
In MATLAB, the first entry in an array img, img(1,1), can correspond to the top left corner, and increasing the row number to img(2,1) can correspond to going down the left side of the image. However, it is also very common for img(1,1) to correspond to the bottom left corner, and increasing the row number to img(2,1) would correspond to going up the left side of the image. This indexing method is closer the traditional meaning of increasing Y coordinate as meaning moving upwards.

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

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by