Skip to content

create_dl_transform_resizeCreateDlTransformResizeCreateDlTransformResizecreate_dl_transform_resizeT_create_dl_transform_resize🔗

Short description🔗

create_dl_transform_resizeCreateDlTransformResizeCreateDlTransformResizecreate_dl_transform_resizeT_create_dl_transform_resize — Create a resize transform using absolute dimensions.

Signature🔗

create_dl_transform_resize( string TransformName, integer ImageDimensions, attribute.name GenParamName, attribute.value GenParamValue, out dl_transform Resize )void CreateDlTransformResize( const HTuple& TransformName, const HTuple& ImageDimensions, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Resize )static void HOperatorSet.CreateDlTransformResize( HTuple transformName, HTuple imageDimensions, HTuple genParamName, HTuple genParamValue, out HTuple resize )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

Herror T_create_dl_transform_resize( 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)

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

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)

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

Description🔗

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

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

The parameter ImageDimensionsimageDimensionsimage_dimensions defines the absolute output dimensions of the resize transform Resizeresizeresize. It contains the output image dimensions 'width', 'height', and 'num_channels' as a tuple. Passing -1-1 keeps the corresponding dimension of the input image unchanged. It is not permitted to set all image dimensions to -1-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 33 (for input containing 11 channel) or 11 (for input containing 33 channels). In all other cases, an error is raised.

The following generic parameters GenParamNamegenParamNamegen_param_name and their corresponding values GenParamValuegenParamValuegen_param_value are supported:

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

    Default: 'center'"center".

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

    Default: 'constant'"constant".

  • 'zoom_type'"zoom_type": Specifies the zooming mode applied during resizing. Possible values are:

    • 'fill'"fill": Resizes the image to the specified width and height. The aspect ratio may change. Padding is not applied.

    • 'fit'"fit": Resizes the image to fit into the specified width or height. The aspect ratio is preserved. Padding is applied if required, the 'fill_value'"fill_value" can be specified using set_dl_transform_pipeline_paramSetDlTransformPipelineParam.

    Default: 'fill'"fill".

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

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

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🔗

TransformNametransformNametransform_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the output transform.

Default: 'resize'"resize"

ImageDimensionsimageDimensionsimage_dimensions (input_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Image dimensions width, height and number of channels.

Default: [512, 512, 3][512, 512, 3]

GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Generic input parameter names.

Default: [][]
List of values: 'alignment', 'interpolation', 'zoom_type'"alignment", "interpolation", "zoom_type"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (string / real / integer)HTuple (HString / double / Hlong)HTuple (string / double / int / long)Sequence[Union[str, float, int]]Htuple (char* / double / Hlong)

Generic input parameter values.

Default: [][]
Suggested values: 'fill', 'fit', 1.0"fill", "fit", 1.0

Resizeresizeresize (output_control) dl_transform → (handle)HTuple (HHandle)HDlTransform, HTuple (IntPtr)HHandleHtuple (handle)

Resize transform.

Combinations with other operators🔗

Combinations

Possible successors

create_dl_transform_pipelineCreateDlTransformPipeline

See also

create_dl_transform_random_hsvCreateDlTransformRandomHsv, transform_dl_sample_batchTransformDlSampleBatch

Module🔗

Foundation