# US 2016/0260235 A1 · Method for Generating Masking Image Using General Polygonal Mask

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

- Number: US 2016/0260235 A1
- Document ID: US20160260235A1
- Status: Published application
- Kind: A1
- Application number: 14/639,124
- Filed: 2015-03-05
- Published: 2016-09-08
- Earliest claimed: 2015-03-05
- Assignees: Novatek Microelectronics Corp.
- Applicants: NOVATEK Microelectronics Corp.
- Inventors: Jau-Hong Kao; Shiang-Fei Wang; Yi-Jen Wu; Chih-Huang Lin; Min-Hui Chu; Hong-Chu Chen; Chi-Fan Liou
- Web page: https://patentgrep.com/patent/US20160260235A1

## CPC

- G06T 11/40: Filling planar surfaces by adding surface attributes, e.g. adding colours or textures
- G06T 11/00: Two-dimensional [2D] image generation
- G06T 15/405: {using Z-buffer}
- G08B 13/19606: {Discriminating between target movement or movement in an area of interest and other non-signicative movements, e.g. target movements induced by camera shake or movements of pets, falling leaves, rotating fan}
- G06T 2200/12: involving antialiasing
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G08B: SIGNALLING SYSTEMS, e.g. PERSONAL CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS

## Abstract

A method for generating masking image using general polygonal mask includes receiving a pixel of a raw image and a polygon vertices array corresponding to a polygonal mask, determining whether the pixel is inside the polygonal mask, labeling the pixel to be a masked pixel if the pixel is inside the polygonal mask, or labeling the pixel to be a visible pixel if the pixel is outside the polygonal mask, and outputting the masked pixel or the visible pixel to generate the masking image.

## Claims

### Claim 1

A method for generating masking image using general polygonal mask, comprising:
receiving a pixel of a raw image and a polygon vertices array corresponding to a polygonal mask;
determining whether the pixel is inside the polygonal mask;
labeling the pixel to be a masked pixel if the pixel is inside the polygonal mask, or labeling the pixel to be a visible pixel if the pixel is outside the polygonal mask; and
outputting the masked pixel or the visible pixel to generate the masking image.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining whether the pixel is inside the polygonal mask comprises:
determining whether the pixel is inside the polygonal mask according to a count of a function of:
F

(
L
,
Q
)
=
{
1

:
pixel


Q


intersects


edge


L


at


its


right


side
0

:
other
,
wherein Q is the pixel, and L is the edge formed by two consecutive vertices of the polygon vertices array.

### Claim 3 (depends on 2)

The method of claim 2, wherein the pixel is inside the polygonal mask if the count is odd, and the count is a function of:
C
=
∑
i
=
0
N


F

(
P
i

P
i
+
1
_
,
Q
)
wherein C is the count, N is a number of edges of the polygonal mask, i is an indication, and PiPi+1 is an edge formed by the two consecutive vertices of the polygon vertices array.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining whether the pixel is inside the polygonal mask comprises:
setting two consecutive vertices of the polygon vertices array to be a start point and a terminal point according to an indication, wherein the indication is one of numbers from zero to a number of edges of the polygonal mask;
checking if the pixel is bounded by the start and terminal points in a first dimension;
determining if the pixel is at a left side of the first vector according to a cross product and a direction of the first vector if the pixel is bounded by the start and terminal points in the first dimension;
increasing the count by one if the pixel is at the left side of the first vector;
checking whether relative locations between the pixel and all the edges of the polygonal mask are determined; and
checking if the count is odd to determine whether the pixel is inside the polygonal mask if the relative locations between the pixel and all the edges of the polygonal mask are checked.

### Claim 5 (depends on 4)

The method of claim 4, checking whether the relative locations between the pixel and all the edges of the polygonal mask are determined comprises:
checking if the terminal point is a last vertex of the polygon vertices array if the pixel is not bounded by the first vector, if the cross product is smaller than zero, and after the count is increased by one; and
increasing the indication by one if the terminal point is not the last vertex of the polygon vertices array to reset the start and terminal points according to the indication.

### Claim 6 (depends on 4)

The method of claim 4, wherein the pixel is inside the polygonal mask if the count is odd, and pixel is outside the polygonal mask if the count is even.

### Claim 7 (depends on 4)

The method of claim 4, further comprising:
setting the count to be zero when receiving the pixel of the raw image and the polygon vertices array corresponding to the polygonal mask.

### Claim 8 (depends on 4)

The method of claim 4, wherein determining if the pixel is at the left side of the first vector according to the cross product and the direction of the first vector comprises:
determining a direction of the first vector by comparing coordinates of the start and terminal points in the first dimension;
computing the cross product according to a function of:
RC=(XT−X)*(YT−YS)−(XT−XS)*(YT−Y) if the first vector directs a first direction, wherein RC is the cross product, X, XS and XT are coordinates of the pixel, the start and terminal points in a second dimension, and Y, YS and YT are coordinates of the pixel, the start and terminal points in the first dimension;
computing the cross product according to a negative of the function if the first vector directs a second direction; and
checking if the cross product is greater than zero to determine if the pixel is at the left side of the first vector,
wherein the pixel is at the left side of the first vector if the cross product is greater than zero, and the pixel is at a right side of the first vector if the cross product is smaller than zero.

### Claim 9 (depends on 4)

The method of claim 4, wherein determining if the pixel is at the left side of the first vector according to the cross product and the direction of the first vector comprises:
determining a direction of the first vector by comparing coordinates of the start and terminal points in the first dimension;
checking if a former item (XT−X)*(YT−YS) is greater than a later item (XT−XS)*(YT−Y) if the first vector directs a first direction, wherein the pixel is at the left side of the first vector if the former item is greater than the later item; and
checking if the former item (XT−X)*(YT−YS) is smaller than a later item (XT−XS)*(YT−Y) if the first vector directs a second direction, wherein the pixel is at the left side of the first vector if the former item is smaller than the later item,
wherein X, XS and XT are coordinates of the pixel, the start and terminal points in a second dimension, and Y, YS and YT are coordinates of the pixel, the start and terminal points in the first dimension.
