PixelValue

PixelValue[image,ppos]
gives the pixel value of image at position pos.

PixelValue[image,ppos,"type"]
gives the pixel value converted to the specified type.

更多信息和选项更多信息和选项

  • Pixel positions ppos can be in one of the following forms:
  • {x,y}or {x,y,z}single position in 2D or 3D
    {xmin;;xmax,}span of positions
    {ppos1,ppos2,}a list of position specifications
    markerimagea marker image
  • In PixelValue[image,{xp,yp}], the pixel position with assumed to be in the standard image coordinate system, where the values of x range from to width and y from to height.
  • In PixelValue, integer coordinates correspond to the centers of the pixels. In 2D, pixel position represents the center of the bottom-left pixel. In 3D, pixel position corresponds to the center of the bottom-left front pixel.
  • PixelValue gives the value of the pixel nearest to , except that when the position lies on a boundary between pixels, the average of the pixels surrounding is returned.
  • Use ImageValue to extract interpolated values at in the standard image coordinate system.
  • With PixelValue[image,marker], nonzero pixels of the image marker are used as the list of positions.
  • PixelValue[image,ppos] by default returns values between 0 and 1. Using PixelValue[image,ppos,"type"], pixel value is returned in the range specified by . See the reference page for Image for a list of all possible data types.
  • PixelValue[image,ppos,Automatic] is equivalent to PixelValue[image,ppos,ImageType[image]].
  • PixelValue 可以采用 Padding 选项,该选项当一个指定的坐标位于图像之外时使用.
2010年引入
(8.0)
| 2014年更新
(10.0)