You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

To use these functions, the ImageJCV Feature is required.

ReinterpretCV(ImageJCV i, Number newWidth, Number newhHeight, Number newDepth, Number newNumChannels, Number newPixelFormat)

Reinterprets the content of an image (argument 0) as another image with different width, height, depth, number of channels or pixel format. Any parameter which is set to 1 will be replaced by the corresponding value of the original image. Buffer sizes of original and reinterpreted image must match!

Example: Convert a 16-bit grayscale image to a 32-bit RGBA image with half of the width:

Example
output = MAP({expressions=[['reinterpret(image, getWidth(image)/2, -1, 8, 4, 28)', 'image']]}, input)

Parameter explanation:

  • image: Original image
  • getWidth(image)/2: Half width
  • -1: Original height
  • 8: 8 bit per pixel channel
  • 4: 4 channels per pixel
  • 28: 32 Bit RGBA pixel format (see JavaCV doc: AV_PIX_FMT_RGBA)

Inv(Image i)

Inverts the pixel values of the given image

Example
SELECT inv(image) FROM Stream

Get(Image i, Number x, Number y)

Return the value of the pixel at the given location

Example
SELECT get(image, 100, 100) FROM Stream

Set(Image i, Number x, Number y, Number c)

Set the pixel at the given location to the given value

Example
SELECT set(image, 100, 100, 0.5) FROM Stream

Rotate(Image i, Number angle)

Rotates the image at the given angle in degree.

Example
SELECT rotate(image, 90.0) FROM Stream

Resize(Image i, Number width, Number height)

Resize the image to the given width and height

Example
SELECT resize(image, 500, 500) FROM Stream

Sub(Image i, Number x, Number y, Number width, Number height)

Returns a sub image at the given location and the given width and height.

Example
SELECT sub(image, 5, 5, 200, 200) FROM Stream

ToImage(<Number width, Number height>|<Matrix matrix>)

Creates a new image with the given width and height

Example
SELECT toImage(500, 500) FROM Stream

ToMatrix(Image i)

Return the pixel values of the given image as a matrix

 

 

  • No labels