Main Content

getScreenPixelRGBValue

Get screen value of specified pixel in image model

Description

pixval = getScreenPixelRGBValue(imgmodel,r,c) returns the screen value of one or more pixels with (row, column) coordinate (r, c) in image imgmodel.

Input Arguments

collapse all

Image model, specified as a scalar imagemodel object.

Row coordinate of pixel, specified as a positive integer or vector of positive integers.

Column coordinate of pixel, specified as a positive integer or vector of positive integers.

Output Arguments

collapse all

Pixel value, returned as one of the following.

Input TypeReturn Format
p grayscale pixelsp-by-3 numeric array. Each row specifies a pixel. The columns specify the red, green, and blue components of the pixel value.
p RGB pixelsNumeric row vector of length p*3. The first p elements are the red value for each pixel. The next p elements are the green value for each pixel. The last p elements are the blue value for each pixel.
p binary pixelsp-by-3 numeric array. Each row specifies a pixel. The columns specify the red, green, and blue components of the pixel value.
p indexed pixelsp-by-3 numeric array. Each row specifies a pixel. The columns specify the red, green, and blue components of the pixel value.

Data Types: double

Version History

Introduced before R2006a