Short description
create_dl_transform_random_geometricCreateDlTransformRandomGeometricCreateDlTransformRandomGeometriccreate_dl_transform_random_geometricT_create_dl_transform_random_geometric — Create a random geometric transform.
Signature
create_dl_transform_random_geometric( string TransformName, real Probability, real RangeScale, real RangeTrans, real RangeRot, real RangeShear, real RangePerspective, integer ClipSize, attribute.name GenParamName, attribute.value GenParamValue, out dl_transform RandomGeometric )void CreateDlTransformRandomGeometric( const HTuple& TransformName, const HTuple& Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* RandomGeometric )static void HOperatorSet.CreateDlTransformRandomGeometric( HTuple transformName, HTuple probability, HTuple rangeScale, HTuple rangeTrans, HTuple rangeRot, HTuple rangeShear, HTuple rangePerspective, HTuple clipSize, HTuple genParamName, HTuple genParamValue, out HTuple randomGeometric )def create_dl_transform_random_geometric( transform_name: str, probability: float, range_scale: Sequence[float], range_trans: Sequence[float], range_rot: Sequence[float], range_shear: Sequence[float], range_perspective: Sequence[float], clip_size: Sequence[int], gen_param_name: Sequence[str], gen_param_value: Sequence[str] ) -> HHandle
Herror T_create_dl_transform_random_geometric( const Htuple TransformName, const Htuple Probability, const Htuple RangeScale, const Htuple RangeTrans, const Htuple RangeRot, const Htuple RangeShear, const Htuple RangePerspective, const Htuple ClipSize, const Htuple GenParamName, const Htuple GenParamValue, Htuple* RandomGeometric )
void HDlTransform::HDlTransform( const HString& TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue )
void HDlTransform::HDlTransform( const char* TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue )
void HDlTransform::HDlTransform( const wchar_t* TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue ) (Windows only)
public HDlTransform( string transformName, double probability, HTuple rangeScale, HTuple rangeTrans, HTuple rangeRot, HTuple rangeShear, HTuple rangePerspective, HTuple clipSize, HTuple genParamName, HTuple genParamValue )
void HDlTransform::CreateDlTransformRandomGeometric( const HString& TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue )
void HDlTransform::CreateDlTransformRandomGeometric( const char* TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue )
void HDlTransform::CreateDlTransformRandomGeometric( const wchar_t* TransformName, double Probability, const HTuple& RangeScale, const HTuple& RangeTrans, const HTuple& RangeRot, const HTuple& RangeShear, const HTuple& RangePerspective, const HTuple& ClipSize, const HTuple& GenParamName, const HTuple& GenParamValue ) (Windows only)
void HDlTransform.CreateDlTransformRandomGeometric( string transformName, double probability, HTuple rangeScale, HTuple rangeTrans, HTuple rangeRot, HTuple rangeShear, HTuple rangePerspective, HTuple clipSize, HTuple genParamName, HTuple genParamValue )
Description
The operator create_dl_transform_random_geometricCreateDlTransformRandomGeometric creates a random
geometric transform and returns the transform handle in RandomGeometricrandomGeometricrandom_geometric.
The transform performs a random scaling, translation, rotation, as well as small
shearing or perspective transformations of the centered input image.
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 Probabilityprobabilityprobability specifies the probability with which the
transform is executed in the pipeline. The probability must be between
0.00.0 and 1.01.0. A value of 0.00.0 disables execution,
while a value of 1.01.0 guarantees that the operation is executed.
The parameters RangeScalerangeScalerange_scale, RangeTransrangeTransrange_trans,
RangeRotrangeRotrange_rot, RangeShearrangeShearrange_shear and RangePerspectiverangePerspectiverange_perspective
define the ranges for the random geometric transformations scaling,
translation, rotation, shearing and perspective of the input image,
respectively. The ranges are tuples of the form
[range_min, range_max][range_min, range_max], where 'range_min'"range_min" and
'range_max'"range_max" must be
between 0.50.5 and 1.51.5 relative to the input size
for RangeScalerangeScalerange_scale,
between -1.0-1.0 and 1.01.0 relative to the output size
for RangeTransrangeTransrange_trans,
between -180.0-180.0 and 180.0180.0 in degrees for RangeRotrangeRotrange_rot,
between -10.0-10.0 and 10.010.0 in degrees for RangeShearrangeShearrange_shear,
and a strength between -0.001-0.001 and 0.0010.001 for
RangePerspectiverangePerspectiverange_perspective. Set RangeScalerangeScalerange_scale to [1.0, 1.0][1.0, 1.0]
to disable scaling, or set RangeTransrangeTransrange_trans, RangeRotrangeRotrange_rot,
RangeShearrangeShearrange_shear and RangePerspectiverangePerspectiverange_perspective to [0.0, 0.0][0.0, 0.0]
to disable translation, rotation, shearing and perspective transformation,
respectively.
The parameter ClipSizeclipSizeclip_size contains the
output image dimensions 'width' and 'height' as a tuple.
Passing -1-1 keeps the
corresponding dimension of the input image unchanged. RangeTransrangeTransrange_trans
shifts the image center by a random fraction of ClipSizeclipSizeclip_size.
The following generic parameters GenParamNamegenParamNamegen_param_name and the
corresponding values GenParamValuegenParamValuegen_param_value are supported:
Padding is applied if required, the 'fill_value'"fill_value"
can be specified using set_dl_transform_pipeline_paramSetDlTransformPipelineParam.
Note that for axis-aligned object detection, rotation, shearing and
perspective transformation may cause bounding
boxes to fit less tightly around objects than before the transformation.
The following parameters are specific to the transforms of type
'random_geometric'"random_geometric". They can respectively be get or set using the
operators get_dl_transform_pipeline_paramGetDlTransformPipelineParam and
set_dl_transform_pipeline_paramSetDlTransformPipelineParam:
| ParamName |
set |
get |
| 'range_scale'"range_scale" |
x |
x |
| 'range_trans'"range_trans" |
x |
x |
| 'range_rot'"range_rot" |
x |
x |
| 'range_shear'"range_shear" |
x |
x |
| 'range_perspective'"range_perspective" |
x |
x |
| 'clip_size'"clip_size" |
x |
x |
| 'interpolation'"interpolation" |
x |
x |
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: 'random_geometric'"random_geometric"
Probabilityprobabilityprobability (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)
Probability to execute the transform.
Default: 1.01.0
RangeScalerangeScalerange_scale (input_control) real-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Tuple with random scale range.
Default: [0.5, 1.5][0.5, 1.5]
RangeTransrangeTransrange_trans (input_control) real-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Tuple with random translation range.
Default: [-0.1, 0.1][-0.1, 0.1]
RangeRotrangeRotrange_rot (input_control) real-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Tuple with random rotation range.
Default: [0.0, 0.0][0.0, 0.0]
RangeShearrangeShearrange_shear (input_control) real-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Tuple with random shear range.
Default: [0.0, 0.0][0.0, 0.0]
RangePerspectiverangePerspectiverange_perspective (input_control) real-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Tuple with random perspective range.
Default: [0.0, 0.0][0.0, 0.0]
ClipSizeclipSizeclip_size (input_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
Tuple containing output image size.
Default: [-1, -1][-1, -1]
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: 'interpolation'"interpolation"
GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)
Generic input parameter values.
Default: [][]
RandomGeometricrandomGeometricrandom_geometric (output_control) dl_transform → (handle)HTuple (HHandle)HDlTransform, HTuple (IntPtr)HHandleHtuple (handle)
Random geometric transform.
Combinations with other operators
Combinations
Possible successors
create_dl_transform_pipelineCreateDlTransformPipeline
See also
create_dl_transform_random_hsvCreateDlTransformRandomHsv
Module
Foundation