ClassesClassesClassesClasses | | | | Operators

interpolate_scattered_data_imageT_interpolate_scattered_data_imageInterpolateScatteredDataImageinterpolate_scattered_data_imageInterpolateScatteredDataImageInterpolateScatteredDataImage (Operator)

Name

interpolate_scattered_data_imageT_interpolate_scattered_data_imageInterpolateScatteredDataImageinterpolate_scattered_data_imageInterpolateScatteredDataImageInterpolateScatteredDataImage — Interpolation of an image.

Signature

interpolate_scattered_data_image(Image, RegionInterpolate : ImageInterpolated : Method, GenParamNames, GenParamValues : )

Herror T_interpolate_scattered_data_image(const Hobject Image, const Hobject RegionInterpolate, Hobject* ImageInterpolated, const Htuple Method, const Htuple GenParamNames, const Htuple GenParamValues)

Herror interpolate_scattered_data_image(Hobject Image, Hobject RegionInterpolate, Hobject* ImageInterpolated, const HTuple& Method, const HTuple& GenParamNames, const HTuple& GenParamValues)

void InterpolateScatteredDataImage(const HObject& Image, const HObject& RegionInterpolate, HObject* ImageInterpolated, const HTuple& Method, const HTuple& GenParamNames, const HTuple& GenParamValues)

void HOperatorSetX.InterpolateScatteredDataImage(
[in] IHUntypedObjectX* Image, [in] IHUntypedObjectX* RegionInterpolate, [out] IHUntypedObjectX*ImageInterpolated, [in] VARIANT Method, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues)

static void HOperatorSet.InterpolateScatteredDataImage(HObject image, HObject regionInterpolate, out HObject imageInterpolated, HTuple method, HTuple genParamNames, HTuple genParamValues)

Description

interpolate_scattered_data_imageinterpolate_scattered_data_imageInterpolateScatteredDataImageinterpolate_scattered_data_imageInterpolateScatteredDataImageInterpolateScatteredDataImage interpolates the ImageImageImageImageImageimage at the region RegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateregionInterpolate and returns the result in ImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedimageInterpolated. The difference of the domain of the ImageImageImageImageImageimage and the region RegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateregionInterpolate specifies the valid data points that can be used for the interpolation whereas RegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateregionInterpolate specifies the points, where the gray values of the ImageImageImageImageImageimage should be determined. With the parameter MethodMethodMethodMethodMethodmethod the interpolation algorithm is specified. So far, only the 'thin_plate_splines'"thin_plate_splines""thin_plate_splines""thin_plate_splines""thin_plate_splines""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 ImageImageImageImageImageimage is interpolated at different points in subsequent steps, the operator create_scattered_data_interpolatorcreate_scattered_data_interpolatorCreateScatteredDataInterpolatorcreate_scattered_data_interpolatorCreateScatteredDataInterpolatorCreateScatteredDataInterpolator may be more efficient.

The following parameters can be adjusted with GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames and GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues:

'alpha'"alpha""alpha""alpha""alpha""alpha":

The parameter 'alpha'"alpha""alpha""alpha""alpha""alpha" is a smoothing factor. For 'alpha'"alpha""alpha""alpha""alpha""alpha" = 0, all points in the image ImageImageImageImageImageimage are interpolated exactly. With 'alpha'"alpha""alpha""alpha""alpha""alpha" getting larger, the interpolation smoothes the image points in way that all interpolated points of the result image ImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedimageInterpolated lie on a common plane. Default value is 0. Restrictions: 'alpha'"alpha""alpha""alpha""alpha""alpha" >= 0

interpolate_scattered_data_imageinterpolate_scattered_data_imageInterpolateScatteredDataImageinterpolate_scattered_data_imageInterpolateScatteredDataImageInterpolateScatteredDataImage is best used with very few data points, e.g, less than 1000. In order to reconstruct destroyed image data in the region RegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateregionInterpolate, 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.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2 / real)

Image to interpolate

RegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateRegionInterpolateregionInterpolate (input_object)  region objectHRegionHRegionHRegionHRegionXHobject

Region to interpolate

ImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedImageInterpolatedimageInterpolated (output_object)  singlechannelimage objectHImageHImageHImageHImageXHobject * (real)

Interpolated image

MethodMethodMethodMethodMethodmethod (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Method for the interpolation

Default value: 'thin_plate_splines' "thin_plate_splines" "thin_plate_splines" "thin_plate_splines" "thin_plate_splines" "thin_plate_splines"

Suggested values: 'thin_plate_splines'"thin_plate_splines""thin_plate_splines""thin_plate_splines""thin_plate_splines""thin_plate_splines"

GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames (input_control)  attribute.name-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the generic parameters that can be adjusted

Default value: []

Suggested values: 'alpha'"alpha""alpha""alpha""alpha""alpha"

GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues (input_control)  attribute.value-array HTupleHTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Values of the generic parameters that can be adjusted

Default value: []

Suggested values: 0, 1.0, 10.0, 100.0

Example (HDevelop)

* 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)

Result

If the parameters are valid, the operator interpolate_scattered_data_imageinterpolate_scattered_data_imageInterpolateScatteredDataImageinterpolate_scattered_data_imageInterpolateScatteredDataImageInterpolateScatteredDataImage returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Alternatives

interpolate_scattered_data_points_to_imageinterpolate_scattered_data_points_to_imageInterpolateScatteredDataPointsToImageinterpolate_scattered_data_points_to_imageInterpolateScatteredDataPointsToImageInterpolateScatteredDataPointsToImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators