create_dl_transform_resizeT_create_dl_transform_resizeCreateDlTransformResizeCreateDlTransformResizecreate_dl_transform_resize (Operator)

Name

create_dl_transform_resizeT_create_dl_transform_resizeCreateDlTransformResizeCreateDlTransformResizecreate_dl_transform_resize — Create a resize transform using absolute dimensions.

Signature

create_dl_transform_resize( : : TransformName, ImageDimensions, GenParamName, GenParamValue : Resize)

Herror T_create_dl_transform_resize(const Htuple TransformName, const Htuple ImageDimensions, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Resize)

void CreateDlTransformResize(const HTuple& TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Resize)

void HDlTransform::HDlTransform(const HString& TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDlTransform::HDlTransform(const char* TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDlTransform::HDlTransform(const wchar_t* TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

void HDlTransform::CreateDlTransformResize(const HString& TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDlTransform::CreateDlTransformResize(const char* TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDlTransform::CreateDlTransformResize(const wchar_t* TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

static void HOperatorSet.CreateDlTransformResize(HTuple transformName, HTuple imageDimensions, HTuple genParamName, HTuple genParamValue, out HTuple resize)

public HDlTransform(string transformName, HTuple imageDimensions, HTuple genParamName, HTuple genParamValue)

void HDlTransform.CreateDlTransformResize(string transformName, HTuple imageDimensions, HTuple genParamName, HTuple genParamValue)

def create_dl_transform_resize(transform_name: str, image_dimensions: Sequence[int], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, float, int]]) -> HHandle

Description

The operator create_dl_transform_resizecreate_dl_transform_resizeCreateDlTransformResizeCreateDlTransformResizecreate_dl_transform_resize creates a resize transform with absolute output dimensions and returns the transform handle in ResizeResizeResizeresizeresize. The transform resizes the input image to the specified dimensions if required.

The parameter TransformNameTransformNameTransformNametransformNametransform_name specifies a unique, non-empty name for the transform. Note that when creating a transform pipeline using create_dl_transform_pipelinecreate_dl_transform_pipelineCreateDlTransformPipelineCreateDlTransformPipelinecreate_dl_transform_pipeline, each transform within the pipeline must have a unique name.

The parameter ImageDimensionsImageDimensionsImageDimensionsimageDimensionsimage_dimensions defines the absolute output dimensions of the resize transform ResizeResizeResizeresizeresize. It contains the output image dimensions 'width', 'height', and 'num_channels' as a tuple. Passing -1 keeps the corresponding dimension of the input image unchanged. It is not permitted to set all image dimensions to -1 simultaneously. The number of input channels is checked to be equal to the wanted number of channels. The number of channels can only be adapted to 3 (for input containing 1 channel) or 1 (for input containing 3 channels). In all other cases, an error is raised.

The following generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and their corresponding values GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:

'alignment'"alignment""alignment""alignment""alignment":

Specifies the alignment mode when 'zoom_type'"zoom_type""zoom_type""zoom_type""zoom_type"='fit'"fit""fit""fit""fit" is used. Currently the alignments 'center'"center""center""center""center" and 'top_left'"top_left""top_left""top_left""top_left" are supported.

Default: 'center'"center""center""center""center".

'interpolation'"interpolation""interpolation""interpolation""interpolation":

Specifies the interpolation mode. Currently the modes 'constant'"constant""constant""constant""constant" and 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" are supported.

Default: 'constant'"constant""constant""constant""constant".

'zoom_type'"zoom_type""zoom_type""zoom_type""zoom_type":

Specifies the zooming mode applied during resizing. Possible values are:

Default: 'fill'"fill""fill""fill""fill".

The following parameters are specific to the transforms of type 'resize'"resize""resize""resize""resize". They can respectively be get or set using the operators get_dl_transform_pipeline_paramget_dl_transform_pipeline_paramGetDlTransformPipelineParamGetDlTransformPipelineParamget_dl_transform_pipeline_param and set_dl_transform_pipeline_paramset_dl_transform_pipeline_paramSetDlTransformPipelineParamSetDlTransformPipelineParamset_dl_transform_pipeline_param:

ParamName set get
'alignment'"alignment""alignment""alignment""alignment" x x
'image_dimensions'"image_dimensions""image_dimensions""image_dimensions""image_dimensions" x x
'interpolation'"interpolation""interpolation""interpolation""interpolation" x x
'zoom_type'"zoom_type""zoom_type""zoom_type""zoom_type" x x

Execution Information

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

TransformNameTransformNameTransformNametransformNametransform_name (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the output transform.

Default: 'resize' "resize" "resize" "resize" "resize"

ImageDimensionsImageDimensionsImageDimensionsimageDimensionsimage_dimensions (input_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Image dimensions width, height and number of channels.

Default: [512,512,3]

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Generic input parameter names.

Default: []

List of values: 'alignment'"alignment""alignment""alignment""alignment", 'interpolation'"interpolation""interpolation""interpolation""interpolation", 'zoom_type'"zoom_type""zoom_type""zoom_type""zoom_type"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)

Generic input parameter values.

Default: []

Suggested values: 'fill'"fill""fill""fill""fill", 'fit'"fit""fit""fit""fit", 1.0

ResizeResizeResizeresizeresize (output_control)  dl_transform HDlTransform, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Resize transform.

Possible Successors

create_dl_transform_pipelinecreate_dl_transform_pipelineCreateDlTransformPipelineCreateDlTransformPipelinecreate_dl_transform_pipeline

See also

create_dl_transform_random_hsvcreate_dl_transform_random_hsvCreateDlTransformRandomHsvCreateDlTransformRandomHsvcreate_dl_transform_random_hsv, transform_dl_sample_batchtransform_dl_sample_batchTransformDlSampleBatchTransformDlSampleBatchtransform_dl_sample_batch

Module

Foundation