The invention is related to an image processing method, and more particularly, to methods generating pixel data for a missing block in an image frame.
For images with non-vertical or non-horizontal patterns, the conventional method cannot efficiently regenerate missing block data with satisfaction.
A method of generating pixel data of a missing block in an image frame is disclosed. Edge points are detected from neighboring image sides adjacent to the missing block. A direction is calculated for each edge point. Edge lines are formed from edge points based on the direction thereof to partition the missing block into a plurality of missing regions. Data for missing pixels in each missing region are then calculated using reference pixels from neighboring image sides that adjacent to the missing region.
The accompanying drawings incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the features, advantages, and principles of the invention.
Patterns in images are distinguished by color change. Edges are formed between colors, and outline the patterns. By detecting edges from neighboring images of a missing block and extending edges into the missing block, patterns of an image can be rebuilt.
Wherein Xi is pixel data and QP is a quantization parameter associated with the image frame.
In general, multiple edge points are detected around a true edge except sharp step edges, such as edge points 3102, 3103 and 3104 detected for just one real edge. In order to determine a true single edge point, edge thinning is performed such that one edge point with maximum edge magnitude is chosen. Illustration 310B shows edge point 3103 chosen to represent a real edge point.
and an edge magnitude can be calculated as √{square root over ((GR(n))2+(GC(n))2)}{square root over ((GR(n))2+(GC(n))2)}. An edge angle is increased by π when the edge angle is lower than zero, making the edge angle positive. An average edge angle and magnitude of k*k pixel matrix are then calculated as the direction of the edge point. A set of edge angle and magnitude is discarded from calculating the average edge angle and magnitude when the edge magnitude is less than 2*MAD. Adaptive size of pixel matrix can provide more accurate edge direction property for the context adaptive edge points.
An image with complicated information contains many small color patterns. Edge points may be found for small patterns on the sides of the missing block. Connecting edge points of small patterns with compatible direction of edges but different colors may crumble the missing block image. An edge point with statistic lower than a statistic threshold, which is 30% in this embodiment, then can be discarded. The statistic is calculated by: quantizing the (k−2)*(k−2) edge angles and the average angle of k*k pixel matrix with a quantizing parameter π/32, accumulating edge magnitudes with corresponding quantized edge angle equals to the quantized average edge angle, and dividing the accumulated edge magnitudes by sum of all edge magnitudes. An edge magnitude lower than MAD will be discarded from statistic calculation. Low statistic of an edge point means the neighboring image has low edge angel consistency and should not be connected to other side of the missing block.
A method of forming edge lines from edge points based on the direction thereof to partition the missing block into a plurality of missing regions according to step S3 of
A pair of edge points with compatible directions is chosen based on edge angles and magnitudes. All directions of edge points are normalized by dividing edge angles by Π and dividing edge magnitudes by a maximum storable value, such as 256 for an 8-bit image data system. Selecting edge point pairs with a normalized edge magnitude difference lower than 4*QP/N2 and normalized edge angle difference lower than Π/8 forms a linked edge line. Thresholds like 4*QP/N2 or Π/8 can be defined as other values to adapt to different image process requirements.
A linked node of edge points with minimum of √{square root over ((Pi-Pj)2+
Data of a missing pixel is then calculated as the sum of the contributions of each reference pixel, wherein the contribution of each reference pixel being the pixel data times a weight coefficient. Missing pixel data {circumflex over (x)}j can be calculated as:
Wherein ai is a weight coefficient equaling a normalized distance between the missing pixel and reference pixels.
The invention discloses methods of generating pixel data for a missing block in an image frame, providing smoothness and consistency applicable in macro-block lost error concealment in video communication or image manipulation. An unwanted block in an image can be deleted, and then regenerated using data from the neighborhood image by methods according to the invention.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. Those skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents.
Number | Name | Date | Kind |
---|---|---|---|
5396625 | Parkes | Mar 1995 | A |
5751361 | Kim | May 1998 | A |
5841477 | Kim | Nov 1998 | A |
5875040 | Matraszek et al. | Feb 1999 | A |
6532467 | Brocklebank et al. | Mar 2003 | B1 |
6892343 | Sayood et al. | May 2005 | B2 |
6993075 | Kim et al. | Jan 2006 | B2 |
7042948 | Kim et al. | May 2006 | B2 |
7136541 | Zhang et al. | Nov 2006 | B2 |
7313285 | Aliaga et al. | Dec 2007 | B2 |
20040076343 | Zhang et al. | Apr 2004 | A1 |
20040193632 | McCool et al. | Sep 2004 | A1 |
20070189615 | Liu et al. | Aug 2007 | A1 |
20080069452 | Matsumoto | Mar 2008 | A1 |
Number | Date | Country |
---|---|---|
1159122 | Sep 1997 | CN |
1106767 | Apr 2003 | CN |
Number | Date | Country | |
---|---|---|---|
20070014482 A1 | Jan 2007 | US |