CImCombine:SetRelRect
The SetRelRect method defines a fractional dimension rectangle for sampling the image to compute the image normalization statistic.
CImCombine:SetRelRect( CRect ) |
CRect is the rectangle object containing percent values coordinates.
The normalization region may be specified in absolute pixel coordinates (i.e., in terms of column number and row number) or in relative coordinates as a percentage of the image dimensions. The present method defines the rectangle in the percentage way. The advantage of this method is that the rectangle will always lie in the same relative position on any image. If you need to specify exact column and row positions, use the SetRect method instead.
The percentage rectangle is expressed in terms of width and position of the rectangle, ranging between 0 and 100% of the image size. These are encoded in the rectangle as CRect( width, x, height, y ). To specify a rectangle width of 10% of the image width, set width=10. To position the rectangle at the center of the image (i.e., at 50% of the width), set position=50. To set a rectangle of 20% of the width and 30% of the height, centered at 25% of the width and 75% of the height, use CRect( 20, 25, 30, 75 ).
Suppose a CImageSet named S exists. The following script uses a CRect object to define the normalization region and then combines the images using the Mean method:
|
-- create a CImCombine object |
|
-- central 10% of image |
|
-- specify CImage and CRect to measure |
|
-- use the median as the statistic |
|
-- scale to normalize the image set |
|
-- combine image set and return new image |
|
-- show the new image |
|
-- when done with S, remove it from memory |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.