create_dl_transform_random_geometricT_create_dl_transform_random_geometricCreateDlTransformRandomGeometricCreateDlTransformRandomGeometriccreate_dl_transform_random_geometric (Operator)
Name
create_dl_transform_random_geometricT_create_dl_transform_random_geometricCreateDlTransformRandomGeometricCreateDlTransformRandomGeometriccreate_dl_transform_random_geometric — Create a random geometric transform.
Signature
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 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)
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)
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)
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)
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(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_geometriccreate_dl_transform_random_geometricCreateDlTransformRandomGeometricCreateDlTransformRandomGeometriccreate_dl_transform_random_geometric creates a random
geometric transform and returns the transform handle in RandomGeometricRandomGeometricRandomGeometricrandomGeometricrandom_geometric.
The transform performs a random scaling, translation, rotation, as well as small
shearing or perspective transformations of the centered input image.
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 ProbabilityProbabilityProbabilityprobabilityprobability specifies the probability with which the
transform is executed in the pipeline. The probability must be between
0.0 and 1.0. A value of 0.0 disables execution,
while a value of 1.0 guarantees that the operation is executed.
The parameters RangeScaleRangeScaleRangeScalerangeScalerange_scale, RangeTransRangeTransRangeTransrangeTransrange_trans,
RangeRotRangeRotRangeRotrangeRotrange_rot, RangeShearRangeShearRangeShearrangeShearrange_shear and RangePerspectiveRangePerspectiveRangePerspectiverangePerspectiverange_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], where 'range_min'"range_min""range_min""range_min""range_min" and
'range_max'"range_max""range_max""range_max""range_max" must be
between 0.5 and 1.5 relative to the input size
for RangeScaleRangeScaleRangeScalerangeScalerange_scale,
between -1.0 and 1.0 relative to the output size
for RangeTransRangeTransRangeTransrangeTransrange_trans,
between -180.0 and 180.0 in degrees for RangeRotRangeRotRangeRotrangeRotrange_rot,
between -10.0 and 10.0 in degrees for RangeShearRangeShearRangeShearrangeShearrange_shear,
and a strength between -0.001 and 0.001 for
RangePerspectiveRangePerspectiveRangePerspectiverangePerspectiverange_perspective. Set RangeScaleRangeScaleRangeScalerangeScalerange_scale to [1.0, 1.0]
to disable scaling, or set RangeTransRangeTransRangeTransrangeTransrange_trans, RangeRotRangeRotRangeRotrangeRotrange_rot,
RangeShearRangeShearRangeShearrangeShearrange_shear and RangePerspectiveRangePerspectiveRangePerspectiverangePerspectiverange_perspective to [0.0, 0.0]
to disable translation, rotation, shearing and perspective transformation,
respectively.
The parameter ClipSizeClipSizeClipSizeclipSizeclip_size contains the
output image dimensions 'width' and 'height' as a tuple.
Passing -1 keeps the
corresponding dimension of the input image unchanged. RangeTransRangeTransRangeTransrangeTransrange_trans
shifts the image center by a random fraction of ClipSizeClipSizeClipSizeclipSizeclip_size.
The following generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the
corresponding values GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:
- 'interpolation'"interpolation""interpolation""interpolation""interpolation":
-
Specifies the interpolation mode.
Currently the modes 'bilinear'"bilinear""bilinear""bilinear""bilinear" and
'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" are supported.
Default:
'bilinear'"bilinear""bilinear""bilinear""bilinear".
Padding is applied if required, the 'fill_value'"fill_value""fill_value""fill_value""fill_value"
can be specified using set_dl_transform_pipeline_paramset_dl_transform_pipeline_paramSetDlTransformPipelineParamSetDlTransformPipelineParamset_dl_transform_pipeline_param.
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""random_geometric""random_geometric""random_geometric". 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
|
|
'range_scale'"range_scale""range_scale""range_scale""range_scale" |
x |
x
|
|
'range_trans'"range_trans""range_trans""range_trans""range_trans" |
x |
x
|
|
'range_rot'"range_rot""range_rot""range_rot""range_rot" |
x |
x
|
|
'range_shear'"range_shear""range_shear""range_shear""range_shear" |
x |
x
|
|
'range_perspective'"range_perspective""range_perspective""range_perspective""range_perspective" |
x |
x
|
|
'clip_size'"clip_size""clip_size""clip_size""clip_size" |
x |
x
|
|
'interpolation'"interpolation""interpolation""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
TransformNameTransformNameTransformNametransformNametransform_name (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of the output transform.
Default:
'random_geometric'
"random_geometric"
"random_geometric"
"random_geometric"
"random_geometric"
ProbabilityProbabilityProbabilityprobabilityprobability (input_control) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Probability to execute the transform.
Default:
1.0
RangeScaleRangeScaleRangeScalerangeScalerange_scale (input_control) real-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Tuple with random scale range.
Default:
[0.5,1.5]
RangeTransRangeTransRangeTransrangeTransrange_trans (input_control) real-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Tuple with random translation range.
Default:
[-0.1,0.1]
RangeRotRangeRotRangeRotrangeRotrange_rot (input_control) real-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Tuple with random rotation range.
Default:
[0.0,0.0]
RangeShearRangeShearRangeShearrangeShearrange_shear (input_control) real-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Tuple with random shear range.
Default:
[0.0,0.0]
RangePerspectiveRangePerspectiveRangePerspectiverangePerspectiverange_perspective (input_control) real-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Tuple with random perspective range.
Default:
[0.0,0.0]
ClipSizeClipSizeClipSizeclipSizeclip_size (input_control) integer-array → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Tuple containing output image size.
Default:
[-1,-1]
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Generic input parameter names.
Default:
[]
List of values:
'interpolation'"interpolation""interpolation""interpolation""interpolation"
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Generic input parameter values.
Default:
[]
Suggested values:
RandomGeometricRandomGeometricRandomGeometricrandomGeometricrandom_geometric (output_control) dl_transform → HDlTransform, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Random geometric 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
Module
Foundation