You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce async TextDetector create and availability methods (#110)
This change introduces two new static methods to the TextDetector interface:
* TextDetector.availability(options): Allows developers to quickly check if a given set of languages are supported for text detection.
* TextDetector.create(options): A promise-based factory method that handles asynchronous resource setup and returns a TextDetector instance.
Fixes#109.
---------
Co-authored-by: Alvin Ji <alvinji@chromium.org>
Co-authored-by: Reilly Grant <reillyeon@users.noreply.github.com>
@@ -42,7 +42,10 @@ Please see the <a href="https://github.com/WICG/shape-detection-api/blob/gh-page
42
42
43
43
# Text Detection API # {#api}
44
44
45
-
Individual browsers MAY provide Detectors indicating the availability of hardware providing accelerated operation.
45
+
Individual browsers MAY provide a {{TextDetector}} to perform text detection in images,
46
+
potentially leveraging hardware acceleration or additional dependent libraries.
47
+
The {{TextDetector/availability()}} method allows developers to check for the availability
48
+
of these capabilities and specific language support.
46
49
47
50
## Image sources for detection ## {#image-sources-for-detection}
48
51
@@ -52,16 +55,25 @@ Please refer to [[SHAPE-DETECTION-API#image-sources-for-detection]]
52
55
53
56
{{TextDetector}} represents an underlying accelerated platform's component for detection in images of Latin-1 text as defined in [[iso8859-1]]. It provides a single {{TextDetector/detect()}} operation on an {{ImageBitmapSource}} of which the result is a Promise. This method must reject this Promise in the cases detailed in [[#image-sources-for-detection]]; otherwise it may queue a task using the OS/Platform resources to resolve the Promise with a sequence of {{DetectedText}}s, each one essentially consisting on a {{DetectedText/rawValue}} and delimited by a {{DetectedText/boundingBox}} and a series of {{Point2D}}s.
54
57
55
-
<div class="example">
56
-
Example implementations of Text code detection are e.g. <a href="https://developers.google.com/android/reference/com/google/android/gms/vision/text/package-summary">Google Play Services</a>, <a href="https://developer.apple.com/reference/coreimage/cidetectortypetext">Apple's CIDetector</a> (bounding box only, no OCR) or <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.ocr.aspx">Windows 10 <abbr title="Optical Character Recognition">OCR</abbr> API</a>.
0 commit comments