[mmGetpixels] [Up] [mmCoord2vec] Programming support

mmPutpixels
Set ROI using 1-D indexing from another input image

Synopsis

Image mmPutpixels ( const Image& f , const Image& fi , const Image& fv );

Input

f Image [ Gray-scale (uint8 or uint16) or binary image ]

Input image.

fi Image [ Gray-scale (uint8 or uint16) or binary image ]

1-D indexing values: raster coordinates of the pixels to be modified.

fv Image [ Gray-scale (uint8 or uint16) or binary image ]

Values to be asserted for each index (1-D image, same dimension as fi).

Output

g Image [ Gray-scale (uint8 or uint16) or binary image ]

Modified image

Description

Set the Region Of Interest (ROI) of the input/output image using 1-D indexing given by vector fi to the values of image fv. This function mimmics the MATLAB functionality of ROI setting.

Examples

Image  a = mmReadgray("astablet.tif");
Image aa = mmReadgray("pcb_gray.tif");
Image bb = aa.slice(0, a.width(), 0, a.height(), 0, 1);
//
Image dd = mmOpen(a, mmSedisk(20));
Image ff = mmRegmax(dd, mmSebox());
//
Image gg = mmFind(ff);
Image cc = mmGetpixels(bb, gg);
Image hh = mmPutpixels(a, gg, cc);
mmShow(a);
mmShow(bb);
mmShow(hh);

a bb
hh

See also

mmGetpixels Select pixels of image fv at 1D offset indexes given by image fi.
mmFind Find 1-D indexes of pixels different from zero
[mmGetpixels] [Up] [mmCoord2vec]