Function File: impixel ()
Function File: impixel (img, x, y)
Function File: impixel (ind, map, x, y)
Function File: impixel (xdata, ydata, img, x, y)
Function File: impixel (xdata, ydata, ind, map, x, y)
Function File: [x, y, p] = impixel (…)

Get pixel values.

For any image img, or indexed image ind with colormap map, returns the pixel values at the image coordinates x and y.

The 2 element vectors xdata and ydata can be used to set an alternative coordinate system.

If more than one output argument is requested, also returns the x and y coordinates for the image.

  • The pixel values are always returned in RGB style triples, even when img is a grayscale image.
  • The value for pixel coordinates outside the image limits is NaN.
  • Because a floating-point is required to represent a NaN, the pixel values will be of class double if input is double, and single otherwise.

Package: image