ML Kit의 디지털 잉크 인식 API를 사용하면 필기 텍스트를 인식하고 디지털 표면에서 수백 개의 언어로 동작을 분류하며 스케치를 분류할 수 있습니다. 디지털 잉크 인식 API는 Gboard, Google 번역, Quick, Draw! 게임에서 필기 인식을 지원하는 것과 동일한 기술을 사용합니다.
디지털 잉크 인식을 통해 할 수 있는 작업은 다음과 같습니다.
가상 키보드에서 입력하는 대신 화면에 씁니다. 이렇게 하면 사용자가 키보드에서 사용할 수 없는 문자(예: 라틴어 알파벳 키보드의 경우 Agree, 森)를 그릴 수 있습니다.
동작을 사용하여 기본 텍스트 작업 (탐색, 수정, 선택 등)을 실행합니다.
손으로 그린 도형과 이모티콘을 인식합니다.
디지털 잉크 인식은 사용자가 화면에 그리는 획과 함께 작동합니다. 카메라로 촬영한 이미지에서 텍스트를 읽어야 하는 경우 Text Recognition API를 사용합니다.
인식기는 Ink 객체를 입력으로 사용합니다. Ink는 사용자가 화면에 작성한 내용을 벡터로 표현한 것으로, 일련의 획은 터치 포인트라고 하는 시간 정보가 포함된 좌표 목록입니다. 획은
사용자가 스타일러스나 손가락을 내려놓을 때 시작되고 위로 올리면 끝납니다. Ink는 인식기에 전달되어 하나 이상의 가능한 인식 결과를 신뢰 수준과 함께 반환합니다.
예
영어 필기
아래 왼쪽 이미지는 사용자가 화면에 그린 것을 보여줍니다. 오른쪽 이미지는 상응하는 Ink 객체입니다. 여기에는 각 획 내의 터치 포인트를 나타내는 빨간색 점이 있는 획이 포함되어 있습니다.
스트로크 4개가 있습니다. Ink 객체의 처음 두 획은 다음과 같습니다.
잉크
스트로크 1
x
392, 391, 389, 287, ...
y
52, 60, 76, 97, ...
t
0, 37, 56, 75, ...
스트로크 2
x
497, 494, 493, 490, ...
y
167, 165, 165, 165, ...
t
694, 742, 751, 770 등
...
이 Ink를 영어 인식기에 전송하면 5~6자가 포함된 가능한 스크립트 여러 개가 반환됩니다. 신뢰도가 낮은 순으로 정렬됩니다.
RecognitionResult
인식 후보 #1
Handw
인식 후보 #2
Handrw
인식 후보 #3
Hardw
인식 후보 #4
Handu
인식 후보 #5
Handwe
동작
동작 분류기는 잉크 획을 아래에 나열된 9가지 동작 클래스 중 하나로 분류합니다.
동작
예
arch:above arch:below
caret:above caret:below
circle
corner:downleft
scribble
strike
verticalbar
writing
그림 이모티콘 스케치
아래 왼쪽 이미지는 사용자가 화면에 그린 것을 보여줍니다. 오른쪽 이미지는 상응하는 Ink 객체입니다. 여기에는 각 획 내의 터치 포인트를 나타내는 빨간색 점이 있는 획이 포함되어 있습니다.
Ink 객체에는 획 6개가 포함되어 있습니다.
잉크
스트로크 1
x
269, 266, 262, 255, ...
y
40, 40, 40, 41, ...
t
0, 36, 56, 75, ...
스트로크 2
x
179, 182, 183, 185, ...
y
157, 158, 159, 160, ...
t
2475, 2522, 2531, 2541, ...
...
이 Ink를 그림 이모티콘 인식기에 전송하면 여러 가능한 텍스트 변환이 신뢰도가 낮은 순으로 정렬됩니다.
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eML Kit's Digital Ink Recognition API recognizes handwritten text and gestures, converting them into digital format, comparable to the technology used in Gboard and Google Translate.\u003c/p\u003e\n"],["\u003cp\u003eThis API enables on-screen writing in various languages, using gestures for text editing, and recognizing hand-drawn shapes and emojis, all without an internet connection.\u003c/p\u003e\n"],["\u003cp\u003eIt supports over 300 languages and 25+ writing systems, along with gesture classification and emoji recognition, functioning by processing stroke data of user input.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can integrate this feature to allow users to write with styluses or fingers, replacing or supplementing traditional keyboard input for a more natural and versatile user experience.\u003c/p\u003e\n"]]],["ML Kit's digital ink recognition API converts handwritten text, gestures, and sketches into digital formats. It operates offline on Android and iOS, supporting 300+ languages and 25+ writing systems. The API processes user-drawn strokes (Ink objects) to recognize text, emojis, and basic shapes, returning ranked recognition results. Gestures are classified into nine categories, aiding in text operations and user interface actions. Language packs are dynamically downloaded for space efficiency.\n"],null,["# Digital ink recognition\n\nWith ML Kit's digital ink recognition API, you can recognize handwritten text\nand classify gestures on a digital surface in hundreds of languages, as well as\nclassify sketches. The digital ink recognition API uses the same technology that\npowers handwriting recognition in Gboard, Google Translate, and the\n[Quick, Draw!](https://quickdraw.withgoogle.com/) game.\n\nDigital ink recognition allows you to:\n\n- Write on the screen instead of typing on a virtual keyboard. This lets users draw characters that are not available on their keyboard, such as ệ, अ or 森 for latin alphabet keyboards.\n- Perform basic text operations (navigation, editing, selection, and so on) using gestures.\n- Recognize hand‑drawn shapes and emojis.\n\nDigital ink recognition works with the strokes the user draws on the screen. If\nyou need to read text from images taken with the camera, use the\n[Text Recognition API](/ml-kit/vision/text-recognition).\n\nDigital ink recognition works fully offline and is supported on Android and iOS.\n\n[iOS](/ml-kit/vision/digital-ink-recognition/ios)\n[Android](/ml-kit/vision/digital-ink-recognition/android)\n\nKey Capabilities\n----------------\n\n- Converts handwritten text to sequences of unicode characters\n- Runs on the device in near real time\n- The user's handwriting stays on the device, recognition is performed without any network connection\n- Supports 300+ languages and 25+ writing systems, see the [complete list of supported languages](/ml-kit/vision/digital-ink-recognition/base-models#text)\n - Supports gesture classification for these languages via [`-x-gesture` extensions](/ml-kit/vision/digital-ink-recognition/base-models#text)\n- Recognizes emojis and basic shapes\n- Keeps on-device storage low by dynamically downloading language packs as needed\n\nThe recognizer takes an `Ink` object as input. `Ink` is a vector representation\nof what the user has written on the screen: a sequence of *strokes* , each being\na list of coordinates with time information called *touch points* . A stroke\nstarts when the user puts their stylus or finger down and ends when they lift it\nup. The `Ink` is passed to a recognizer, which returns one or more possible\nrecognition results, with levels of confidence.\n\nExamples\n--------\n\n### English handwriting\n\nThe image on the left below shows what the user drew on the screen. The image on\nthe right is the corresponding `Ink` object. It contains the strokes with red\ndots representing the touch points within each stroke.\n\n\nThere are four strokes. The first two strokes in the `Ink` object look like\nthis:\n\n| **Ink** |||\n|----------|-----|-------------------------|\n| Stroke 1 | `x` | 392, 391, 389, 287, ... |\n| Stroke 1 | `y` | 52, 60, 76, 97, ... |\n| Stroke 1 | `t` | 0, 37, 56, 75, ... |\n| Stroke 2 | `x` | 497, 494, 493, 490, ... |\n| Stroke 2 | `y` | 167, 165, 165, 165, ... |\n| Stroke 2 | `t` | 694, 742, 751, 770, ... |\n| ... | | |\n\nWhen you send this `Ink` to a recognizer for the English language, it returns\nseveral possible transcriptions, containing five or six characters. They are\nordered by decreasing confidence:\n\n| **RecognitionResult** ||\n|-------------------------|--------|\n| RecognitionCandidate #1 | handw |\n| RecognitionCandidate #2 | handrw |\n| RecognitionCandidate #3 | hardw |\n| RecognitionCandidate #4 | handu |\n| RecognitionCandidate #5 | handwe |\n\n### Gestures\n\nGesture classifiers classify an ink stroke into one of nine gesture classes\nlisted below.\n\n| Gesture | Example |\n|-----------------------------|---------|\n| `arch:above` `arch:below` | |\n| `caret:above` `caret:below` | |\n| `circle` | |\n| corner:downleft | |\n| `scribble` | |\n| `strike` | |\n| `verticalbar` | |\n| `writing` | |\n\n| **Note:** It is not always possible to reliably distinguish some gestures from writing. For example, the `verticalbar` gesture may look exactly like the digit `1` or letter `l` when they are written as a vertical lines. To allow the user to use both gestures and writing, your application may need to consider the position of the writing or gesture: for the writing over existing text, prefer the gesture interpretation; for the writing over empty space, prefer the text interpretation.\n\n### Emoji sketches\n\nThe image on the left below shows what the user drew on the screen. The image on\nthe right is the corresponding `Ink` object. It contains the strokes with red\ndots representing the touch points within each stroke.\n\n\nThe `Ink` object contains six strokes.\n\n\n| **Ink** |||\n|----------|-----|-----------------------------|\n| Stroke 1 | `x` | 269, 266, 262, 255, ... |\n| Stroke 1 | `y` | 40, 40, 40, 41, ... |\n| Stroke 1 | `t` | 0, 36, 56, 75, ... |\n| Stroke 2 | `x` | 179, 182, 183, 185, ... |\n| Stroke 2 | `y` | 157, 158, 159, 160, ... |\n| Stroke 2 | `t` | 2475, 2522, 2531, 2541, ... |\n| ... | | |\n\nWhen you send this `Ink` to the emoji recognizer, you get several possible\ntranscriptions, ordered by decreasing confidence:\n\n| **RecognitionResult** ||\n|-------------------------|--------------|\n| RecognitionCandidate #1 | 😂 (U+1f62d) |\n| RecognitionCandidate #2 | 😅 (U+1f605) |\n| RecognitionCandidate #3 | 😹 (U+1f639) |\n| RecognitionCandidate #4 | 😄 (U+1f604) |\n| RecognitionCandidate #5 | 😆 (U+1f606) |"]]