interpolate_scattered_data_image — 图像的插值。
interpolate_scattered_data_image(Image, RegionInterpolate : ImageInterpolated : Method, GenParamName, GenParamValue : )
interpolate_scattered_data_image interpolates the Image
at the region RegionInterpolate and returns the result in
ImageInterpolated. The difference of the domain of the
Image and the region RegionInterpolate specifies the valid
data points that can be used for the interpolation whereas
RegionInterpolate specifies the points, where the
gray values of the Image should be determined.
With the parameter Method the interpolation algorithm
is specified. So far, only the
'thin_plate_splines' are supported. This method interpolates on
a global scale, which means that all points are regarded for the
interpolation, no matter how far away they are. The influence of far points
is correlated to where r defines
the distance of two points. If the same Image is interpolated at
different points in subsequent steps, the operator
create_scattered_data_interpolator may be more efficient.
The following parameters can be adjusted with GenParamName and
GenParamValue:
The parameter 'alpha' is a smoothing factor.
For 'alpha' = 0, all points in the image Image
are interpolated exactly. With 'alpha' getting larger, the
interpolation smoothes the image points in way that all interpolated
points of the result image ImageInterpolated lie on a common
plane.
Default: is 0
Restriction: 'alpha' >= 0
interpolate_scattered_data_image is best used with very few data
points, e.g, less than 1000. In order to reconstruct
destroyed image data in the region RegionInterpolate, the data
points should be reduced to an appropriate number, e.g., by only using the
border pixels of the hole regions. An example program is shown below.
Image (输入对象) singlechannelimage → object (byte / uint2 / real)
Image to interpolate
RegionInterpolate (输入对象) region → object
Region to interpolate
ImageInterpolated (输出对象) singlechannelimage → object (real)
Interpolated image
Method (输入控制) string → (string)
Method for the interpolation
默认值: 'thin_plate_splines'
建议值: 'thin_plate_splines'
GenParamName (输入控制) attribute.name-array → (string)
Names of the generic parameters that can be adjusted
默认值: []
建议值: 'alpha'
GenParamValue (输入控制) attribute.value-array → (string / integer / real)
Values of the generic parameters that can be adjusted
默认值: []
建议值: 0, 1.0, 10.0, 100.0
* This example program shows how to use the scattered data interpolator
* to fill holes in an image
gen_image_surface_second_order (ImageData, 'real', 1, 1, 0, 0, 0, 1, \
24, 24, 48, 48)
gen_circle (Circle, 12, 12, 6)
difference (ImageData, Circle, Region)
reduce_domain (ImageData, Region, ImageReduced)
dev_clear_window ()
dev_display (ImageReduced)
stop()
*
* Select only border pixels for the interpolation
dilation_circle (Circle, CircleDilation, 1.5)
intersection (CircleDilation, Region, RegionBorderData)
dev_clear_window ()
dev_display (ImageReduced)
dev_display (RegionBorderData)
stop()
*
* Interpolate pixels
reduce_domain (ImageData, RegionBorderData, ImageReducedBorder)
interpolate_scattered_data_image (ImageReducedBorder, Circle, \
ImageInterpolated, \
'thin_plate_splines', [], [])
paint_gray (ImageInterpolated, ImageData, ImageFilled)
dev_clear_window ()
dev_display (ImageFilled)
如果参数有效,算子
interpolate_scattered_data_image 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
interpolate_scattered_data_points_to_image
基础