VisionDetectRectanglesRequest class
iOS 11.0+, macOS 10.13+
An image analysis request that finds projected rectangular regions in an image.
A rectangle detection request locates regions of an image with rectangular shape, like credit cards, business cards, documents, and signs. The request returns its observations in the form of VisionRectangleObservation objects, which contain normalized coordinates of bounding boxes containing the rectangle.
Use this type of request to find the bounding boxes of rectangles in an image. Vision returns observations for rectangles found in all orientations and sizes, along with a confidence level to indicate how likely it’s that the observation contains an actual rectangle.
To further configure or restrict the types of rectangles found, set properties on the request specifying a range of aspect ratios, sizes, and quadrature to5lerance.
- Inheritance
-
- Object
- VisionRequest
- VisionDetectRectanglesRequest
Constructors
- VisionDetectRectanglesRequest.new({double? minAspectRatio, double? maxAspectRatio, double? quadratureTolerance, double? minSize, double? minConfidence, int? maxObservations, Rect? regionOfInterest, required VisionRequestCallback onResults})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxAspectRatio → double?
-
A double specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
The value should range from 0.0 to 1.0, inclusive. The default value is 0.5.
final
- maxObservations → int?
-
An integer specifying the maximum number of rectangles Vision returns.
The default value is 1.
Setting this property to 0 allows Vision algorithms to return an unlimited number of observations.
final
- minAspectRatio → double?
-
A double specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
The value should range from 0.0 to 1.0, inclusive. The default value is 0.5.
final
- minConfidence → double?
-
A value specifying the minimum acceptable confidence level.
Vision won’t return rectangles with a confidence score lower than the specified minimum.
The confidence score ranges from 0.0 to 1.0, inclusive, where 0.0 represents no confidence, and 1.0 represents full confidence.
final
- minSize → double?
-
The minimum size of a rectangle to detect, as a proportion of the smallest dimension.
The value should range from 0.0 to 1.0 inclusive. The default minimum size is 0.2.
Any smaller rectangles that Vision may have detected aren’t returned.
final
- onError → VisionRequestErrorCallback?
-
finalinherited
- onResults → VisionRequestCallback
-
finalinherited
- quadratureTolerance → double?
-
A double specifying the number of degrees a rectangle corner angle can deviate from 90°.
The tolerance value should range from 0 to 45, inclusive. The default tolerance is 30.
final
- regionOfInterest → Rect?
-
The region of the image in which Vision will perform the request.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → VisionRequestType
-
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - In the child class override, super.toMap() must be concatenated.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited