# US 2021/0342625 A1 · Text detection, caret tracking, and active element detection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342625 A1
- Document ID: US20210342625A1
- Status: Published application
- Kind: A1
- Application number: 17/326,263
- Filed: 2021-05-20
- Published: 2021-11-04
- Earliest claimed: 2020-05-01
- Assignees: UiPath, Inc.
- Applicants: UiPath, Inc.
- Inventors: Vaclav SKARDA
- Web page: https://patentgrep.com/patent/US20210342625A1

## CPC

- G06F 3/0481: based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F 3/0233: {Character input methods}
- G06V 10/25: Determination of region of interest [ROI] or a volume of interest [VOI]
- G06V 10/40: Extraction of image or video features
- G06V 10/44: Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
- G06V 10/74: Image or video pattern matching; Proximity measures in feature spaces
- G06V 20/41: {Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items (segmenting video sequences G06V20/49)}
- G06V 20/46: {Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames}
- G06V 30/19013: {Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching (specially adapted for image segmentation G06T7/10; specially adapted for the analysis of motion G06T7/20; specially adapted for image alignment G06T7/30; specially adapted for the calculation of depth from stereo images G06T7/50; specially adapted for position determination G06T7/70)}
- G06V 30/41: Analysis of document content (recognition of printed characters based on code marks G06V30/224)
- G06F 11/3438: {monitoring of user actions (tracking the activity of the user H04L67/535)}
- G06V 30/10: Character recognition
- G06V 2201/02: Recognising information on displays, dials, clocks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Detection of typed and/or pasted text, caret tracking, and active element detection for a computing system are disclosed. The location on the screen associated with a computing system where the user has been typing or pasting text, potentially including hot keys or other keys that do not cause visible characters to appear, can be identified and the physical position on the screen where typing or pasting occurred can be provided based on the current resolution of where one or more characters appeared, where the cursor was blinking, or both. This can be done by identifying locations on the screen where changes occurred and performing text recognition and/or caret detection on these locations. The physical position of the typing or pasting activity allows determination of an active or focused element in an application displayed on the screen.

## Claims

### Claim 1

A computer program comprising pasted text detection logic embodied on a non-transitory computer-readable medium, wherein when content has been added to a clipboard of an operating system within a time window, the computer program configured to cause at least one processor to:
determine one or more regions where a first image differs from a second image,
extract one or more connected members in the one or more determined regions and perform optical character recognition (OCR) on the extracted one or more connected members, producing one or more recognized characters, one or more recognized character sequences, or both, and respective positions,
compare the one or more recognized characters, the one or more recognized character sequences, or both, to clipboard content, and
when a character or character sequence matches a character or character sequence of the clipboard content, obtain coordinates of the pasted text and set a graphical element including the coordinates of the pasted text as an active element.

### Claim 2 (depends on 1)

The computer program of claim 1, wherein the computer program is further configured to cause the at least one processor to:
flush the clipboard and repeat the process for a third image.

### Claim 3 (depends on 1)

The computer program of claim 1, wherein the computer program is further configured to cause the at least one processor to:
determine one or more user gestures pertaining to user interactions with a computing system;
based on the one or more determined user gestures, determine whether a paste has occurred; and
when the paste has occurred, perform the pasted text detection logic.

### Claim 4 (depends on 3)

The computer program of claim 3, wherein the one or more user gestures comprise mouse clicks, pressing control and V, right clicking plus selecting paste from a menu of an application, and/or clicking a home button and pasting in the application.

### Claim 5 (depends on 1)

The computer program of claim 1, wherein when content has not been added to the clipboard within the time window, the computer program is further configured to cause the at least one processor to:
perform typed text detection, caret tracking, or both; and
identify an active element in the first image that includes the typed text, the caret, or both.

### Claim 6 (depends on 1)

The computer program of claim 1, wherein
the first image and the second image are compressed in a lossy format, and
the determining of the one or more regions where the first image differs from the second image comprises applying one or more tolerances to corresponding regions of the first image and the second image.

### Claim 7 (depends on 1)

The computer program of claim 1, wherein the computer program is further configured to cause the at least one processor to:
apply an autocorrect algorithm to a sequence of characters detected by the OCR; and
perform the comparison to the clipboard content using the autocorrected character sequence.

### Claim 8 (depends on 1)

The computer program of claim 1, wherein when determining the one or more regions where the first image differs from the second image, the computer program is further configured to cause the at least one processor to:
apply fuzzy image matching to a region from the first image and a corresponding region from the second image to determine whether a change occurred in the region.

### Claim 9 (depends on 1)

The computer program of claim 1, wherein the computer program is a robotic process automation (RPA) robot.

### Claim 10 (depends on 1)

The computer program of claim 1, wherein when more than a predetermined percentage of the pixels of the first image differ from the second image, the first image is ignored and the pasted text detection logic proceeds to a third image.

### Claim 11 (depends on 1)

The computer program of claim 1, wherein the determination of the one or more regions where the first image differs from the second image comprises:
dividing the first image and the second image into horizontal rows with a predetermined height;
comparing each corresponding row from the first image and the second image to determine whether the rows are the same;
when a row is not the same between the first image and the second image, extracting the row and dividing the row into equal size blocks;
determining whether a difference exists between respective blocks in the first image and the second image; and
extracting blocks where a difference exists.

### Claim 12 (depends on 11)

The computer program of claim 11, wherein when a number of blocks in a region exceeds a threshold, the first image is ignored the typed text detection logic proceeds to a third image.

### Claim 13 (depends on 11)

The computer program of claim 11, wherein when a number of blocks in a region does not exceed a threshold, the computer program is further configured to cause the at least one processor to:
join proximate blocks;
determine a bounding rectangle for a region for each set of proximate blocks; and
calculate pixel changes for each region and projecting the pixel changes to a binary matrix.

### Claim 14 (depends on 13)

The computer program of claim 13, wherein the computer program is further configured to cause the at least one processor to:
determine a connected member binary matrix for the one or more connected members in each binary matrix; and
crop each connected member binary matrix;
retrieve pixel data for each changed pixel between the first image and the second image for each connected member binary matrix; and
perform the OCR using the retrieved pixel data.

### Claim 15

A non-transitory computer-readable medium storing a computer program comprising pasted text detection logic, wherein when clipboard content has been added during a time window, the computer program configured to cause the at least one processor to:
determine one or more regions where a first image differs from a second image,
extract one or more connected members in the one or more determined regions and perform optical character recognition (OCR) on the extracted one or more connected members, producing one or more recognized characters, one or more recognized character sequences, or both, and respective positions,
compare the clipboard content to the one or more recognized characters, the one or more recognized character sequences, or both, and
when the clipboard content matches the one or more recognized characters, the one or more recognized character sequences, or both, set a graphical element in the first image with a position including the one or more recognized characters, the one or more recognized character sequences, or both, as an active element.

### Claim 16 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the computer program is further configured to cause the at least one processor to:
determine one or more user gestures pertaining to user interactions with a computing system;
based on the one or more determined user gestures, determine whether a paste has occurred; and
when the paste has occurred, perform the pasted text detection logic.

### Claim 17 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein when content has not been added to the clipboard within the time window, the computer program is further configured to cause the at least one processor to:
perform typed text detection, caret tracking, or both; and
identify an active element in the first image that includes the typed text, the caret, or both.

### Claim 18 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the program is a robotic process automation (RPA) robot.

### Claim 19 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the determination of the one or more regions where the first image differs from the second image comprises:
dividing the first image and the second image into horizontal rows with a predetermined height;
comparing each corresponding row from the first image and the second image to determine whether the rows are the same;
when a row is not the same between the first image and the second image, extracting the row and dividing the row into equal size blocks;
determining whether a difference exists between respective blocks in the first image and the second image; and
extracting blocks where a difference exists.

### Claim 20 (depends on 19)

The non-transitory computer-readable medium of claim 19, wherein
when a number of blocks in a region exceeds a predetermined number, the first image is ignored the typed text detection logic proceeds to a third image, and
when the number of blocks in a region does not exceed a predetermined number, the computer program is further configured to cause the at least one processor to:
join proximate blocks,
determine a bounding rectangle for a region for each set of proximate blocks,
calculate pixel changes for each region and projecting the pixel changes to a binary matrix,
determine a connected member binary matrix for the one or more connected members in each binary matrix,
crop each connected member binary matrix,
retrieve pixel data for each changed pixel between the current screenshot frame and the previous screenshot frame for each connected member binary matrix, and
perform the OCR using the retrieved pixel data.

### Claim 21

A computer-implemented method for pasted text detection for robotic process automation (RPA) when clipboard content exists and was added during a time window, comprising:
determining, by an RPA robot, one or more regions where a first image differs from a second image;
extracting one or more connected members in the one or more determined regions and performing optical character recognition (OCR) on the extracted one or more connected members, by the RPA robot, producing one or more recognized characters, one or more recognized character sequences, or both, and respective positions;
comparing the clipboard content to the one or more recognized characters, the one or more recognized character sequences, or both, by the RPA robot; and
when the clipboard content matches the one or more recognized characters, the one or more recognized character sequences, or both, setting a graphical element in the first image with a position including the one or more recognized characters, the one or more recognized character sequences, or both, as an active element, by the RPA robot.
