CN102647541B - Picture encoding method based on lossy compression chain code - Google Patents
Picture encoding method based on lossy compression chain code Download PDFInfo
- Publication number
- CN102647541B CN102647541B CN201210132776.XA CN201210132776A CN102647541B CN 102647541 B CN102647541 B CN 102647541B CN 201210132776 A CN201210132776 A CN 201210132776A CN 102647541 B CN102647541 B CN 102647541B
- Authority
- CN
- China
- Prior art keywords
- pixel
- code
- chain code
- relative
- neighbour
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a picture encoding method based on a lossy compression chain code. The method includes moving along a picture contour in a mode of one pixel apart from the picture contour and changing in a relative 15 direction. The first code value is encoded by adopting an absolute 16 direction code value of a 16-site neighborhood pixel which is one pixel apart from a starting encoded point pixel, and each of the other code values is encoded by adopting the 16-site neighborhood pixel of the present pixel in a decoding direction of the relative 15 direction of the present pixel. According to the picture encoding method based on the lossy compression chain code, one-pixel forwarding at one time in the existing angle difference in Freeman chain code is changed into two-pixel forwarding at one time in the relative 15 direction chain code, the occupying lossy storage space of information is minimized, fast and real-time transmission of the pictures is improved, and damage of burr of the picture contour is avoided. Simultaneously, the Huffman decoding is adopted; therefore the compressibility of the chain code is greatly improved.
Description
Technical field
The present invention relates to a kind of method for encoding images based on lossy compression method chain code.
Background technology
Chain code is the effective means of the binary picture that consists of profile of a kind of description, and it is widely applied to the fields such as the compression of pattern recognition, shape analysis, profile and binary picture based on shape and reconstruction.The basic thought of chain code be on identification and storage profile each pixel to the direction code of its neighbour's pixel, according in the process describing to the loss of shape information whether, chain code can be divided into lossy compression method chain code and Lossless Compression chain code.
Conventional Lossless Compression chain code has: Freeman chain code, summit chain code, differential seat angle Freeman chain code, the compression summit chain code based on summit chain code and Huffman coding thinking etc.Lossless Compression chain code can not lose the profile information of image, but the memory space simultaneously taking is relatively large.But in some applications, do not need to adopt Lossless Compression chain code, but wish by the appropriate loss of image information being exchanged for to memory space and improving compression ratio, thereby proposed lossy compression method chain code.
Current a kind of lossy compression method chain code is many grids chain code (Multi-Grid Chain Code, MGCC), it is elementary cell that this kind of chain code adopts a hexagonal mesh consisting of 3 * 3 pixels of arranging, as shown in FIG. 1A and 1B, coding moving direction in grid carries out along the border of pixel, and it is basic exercise unit that the movement of each step all be take by this grid cell.As shown in the figure, the pixel boundary position that enters this grid cell is defined as 0, through this grid cell have 7 possible outlet pixel boundary positions 1 ..., 7}.The different courses in grid cell are described in each outlet.Consider the factor of compression efficiency, grid cell has two types, and a kind of is clockwise coding as shown in Figure 1A, and a kind of is counterclockwise coding as shown in Figure 1B.During many grids chain code coding, also consider the probability that each code value occurs, adopt Huffman coding, but the realization of the coding method of many grids chain code is relatively complicated.
Current another kind of lossy compression method chain code is the improved differential seat angle Freeman chain code (MDF9) that nine symbols represent.This kind of chain code comprise nine code values 0,1,2,3,4, A, B, C, D}, wherein, the implication of code value 0,1,2,3,4 is identical with the implication of front 5 code values of differential seat angle Freeman chain code, represents respectively 0 ° of angle difference, 45 ° ,-45 °, 90 ° ,-90 °; Code value A, B, C, D obtain in the following way: A represents k continuous code value 0, and B represents the combination of code value " 12 ", and C represents the combination of code value " 21 ", and D represents the combination of m continuous code value " 12 ", k wherein, m ∈ [2,50].
Two kinds of above-mentioned lossy compression method chain codes are all defined as the image outline of description simple profile border, the zone boundary interconnecting, having two pixels at least is 8 neighbours, and having a neighbour is interior zone pixel, the pixel that forms profile is neighbour's interior zone both, neighbour perimeter again, like this, the image outline of description is not comprise burr part.In addition, in to the cataloged procedure of the simple profile of this definition, many grids chain code produces the error that is no more than a pixel unit sometimes, the improved differential seat angle Freeman chain code that nine symbols represent can not produce error, but the compression ratio of the improved differential seat angle Freeman chain code that nine symbols represent is lower than many grids chain code.
Summary of the invention
The problems referred to above that exist for the lossy compression method chain code of current image, the present invention proposes a kind of method for encoding images based on lossy compression method chain code, proposed a kind of relative 15 direction chain codes, this coding method is the coding method based on these relative 15 direction chain codes simultaneously.The technological means that the present invention adopts is as follows:
A method for encoding images based on lossy compression method chain code, comprises the following steps:
Step 1: scan the profile boundary pixel of image to be encoded, the point using profile top left corner pixel as start code, preserves the coordinate of this start code point.
Step 2: take this start code point is current pixel, searches first the 16 neighbour pixel with this 1 pixel in current pixel interval by predetermined direction, based on absolute 16 direction encoding modes, this 16 neighbour pixel is encoded, and preserves 16 direction code values after coding.
Step 3: the 16 neighbour's pixels that find of take are current pixel, searches first the 16 neighbour pixel with this 1 pixel in current pixel interval by predetermined direction, based on relative 15 direction encoding modes, this pixel is encoded.
Step 4: judge that whether current pixel is 8 neighbour's pixels of start code point, is to perform step five, otherwise returns to step 3.
Step 5: end-of-encode, statistics based on relative 15 direction encoding modes, obtain the probability of occurrence of code value, and carry out Huffman coding, obtain Huffman code value.
Step 6: using the coordinate of start code point, 16 direction code values and Huffman code value jointly as the relative 15 direction chain codes of image outline.
Method for encoding images based on lossy compression method chain code of the present invention is that current differential seat angle Freeman chain code 1 pixel of once advancing is changed into 2 pixels of once advancing of relative 15 direction chain codes, thereby, the minimise storage space that damages that has realized information takies, quick, the real-time Transmission performance of image are improved, and relative 15 direction encoding modes of the present invention can be encoded with the round profile of-180 ° to 180 °, avoid the loss of image outline burr.Simultaneously, this chain code is easy to realize, and adopt Huffman coding, thus greatly improved the compression ratio of chain code, avoided that the required bank bit of current Lossless Compression chain code is more and lossy compression method chain code efficiency is lower, from affecting the drawback of quick, the real-time transmission performance of image.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the present invention is further elaborated:
Figure 1A is clockwise many grids chain code code value schematic diagram.
Figure 1B is anticlockwise many grids chain code code value schematic diagram.
Fig. 2 is the inventive method flow chart.
Fig. 3 is chain code code value schematic diagram under absolute 16 direction encoding modes.
Fig. 4 is chain code code value schematic diagram under relative 15 direction encoding modes.
Embodiment
As shown in Figure 2, method of the present invention comprises the following steps:
Step 1: from left to right, scan successively from top to bottom the profile boundary pixel of image to be encoded, the point using profile top left corner pixel as start code, preserves the coordinate of this start code point.
Step 2: take this start code point is current pixel, by predetermined direction (as clockwise direction or counterclockwise), search first the 16 neighbour pixel with this 1 pixel in current pixel interval, based on absolute 16 direction encoding modes, this 16 neighbour pixel is encoded, preserve 16 direction code values after coding.As shown in Figure 3, along image outline boundary pixel, the mode with 16 adjacency of the pixel of being separated by with it moves chain code under these absolute 16 direction encoding modes, each moving direction, through 2 pixels or 3 pixels, when through 3 pixels, can produce the error of 1 pixel.By set of digits i|i=0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F} encodes, and represents the 22.5 ° * i angle with X-axis forward.
Step 3: the 16 neighbour's pixels that find of take are current pixel, searches first the 16 neighbour pixel with this 1 pixel in current pixel interval by predetermined direction, based on relative 15 direction encoding modes, this pixel is encoded.As shown in Figure 4, under relative 15 direction encoding modes, when encoding by counterclockwise advancing along image outline, definition chain code code value 0,1,2,3,4,5,6,7,8, A, B, C, D, E, F represents respectively the changing value of the direction of the relative current pixel of 16 neighbour's pixel that finds, represents respectively 0 °, 22.5 ° ,-22.5 °, 45 ° ,-45 °, 67.5 ° ,-67.5 °, 90 ° ,-90 °, 112.5 ° ,-112.5 °, 135 ° ,-135 °, 157.5 °, 180 °; When encoding by counterclockwise advancing along image outline, chain code code value 0,1,2,3,4,5,6,7,8, A, B, C, D, E, F represents respectively 0 ° ,-22.5 °, 22.5 ° ,-45 °, 45 ° ,-67.5 °, 67.5 ° ,-90 °, 90 ° ,-112.5 °, 112.5 ° ,-135 °, 135 ° ,-157.5 °, 180 °.
Step 4: judge whether current pixel is 8 neighbour's pixels of start code point, illustrate complete to whole pixel coders of image outline and got back to start code point, execution step five, otherwise return to step 3, continue next pixel to carry out relative 15 direction encodings.
Step 5: end-of-encode, statistics based on relative 15 direction encoding modes, obtain the probability of occurrence of code value, and carry out Huffman coding, obtain Huffman code value.
Step 6: using the coordinate of start code point, 16 direction code values and Huffman code value jointly as the relative 15 direction chain codes of image outline.
Claims (2)
1. the method for encoding images based on lossy compression method chain code, is characterized in that comprising the following steps:
Step 1: scan the profile boundary pixel of image to be encoded, the point using profile top left corner pixel as start code, preserves the coordinate of this start code point;
Step 2: take this start code point is current pixel, searches first the 16 neighbour pixel with this 1 pixel in current pixel interval by predetermined direction, based on absolute 16 direction encoding modes, this 16 neighbour pixel is encoded, and preserves 16 direction code values after coding;
Step 3: the 16 neighbour's pixels that find of take are current pixel, searches first the 16 neighbour pixel with this 1 pixel in current pixel interval by predetermined direction, based on relative 15 direction encoding modes, this pixel is encoded;
Step 4: judge that whether current pixel is 8 neighbour's pixels of start code point, is to perform step five, otherwise returns to step 3;
Step 5: end-of-encode, statistics based on relative 15 direction encoding modes, obtain the probability of occurrence of code value, and carry out Huffman coding, obtain Huffman code value;
Step 6: using the coordinate of start code point, 16 direction code values and Huffman code value jointly as the relative 15 direction chain codes of image outline;
Wherein, predetermined direction is clockwise direction or counter clockwise direction.
2. coding method according to claim 1, it is characterized in that under relative 15 direction encoding modes, when encoding by counterclockwise advancing along image outline, definition chain code code value 0,1,2,3,4,5,6,7,8, A, B, C, D, E, F represents respectively the changing value of the direction of the relative current pixel of 16 neighbour's pixel that finds, represents respectively 0 °, 22.5 ° ,-22.5 °, 45 ° ,-45 °, 67.5 ° ,-67.5 °, 90 ° ,-90 °, 112.5 ° ,-112.5 °, 135 ° ,-135 °, 157.5 °, 180 °; When advancing in the direction of the clock coding along image outline, chain code code value 0,1,2,3,4,5,6,7,8, A, B, C, D, E, F represents respectively 0 ° ,-22.5 °, 22.5 ° ,-45 °, 45 ° ,-67.5 °, 67.5 ° ,-90 °, 90 ° ,-112.5 °, 112.5 ° ,-135 °, 135 ° ,-157.5 °, 180 °.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210132776.XA CN102647541B (en) | 2012-04-28 | 2012-04-28 | Picture encoding method based on lossy compression chain code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210132776.XA CN102647541B (en) | 2012-04-28 | 2012-04-28 | Picture encoding method based on lossy compression chain code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102647541A CN102647541A (en) | 2012-08-22 |
CN102647541B true CN102647541B (en) | 2014-08-20 |
Family
ID=46660104
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210132776.XA Expired - Fee Related CN102647541B (en) | 2012-04-28 | 2012-04-28 | Picture encoding method based on lossy compression chain code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102647541B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10687062B1 (en) | 2019-02-22 | 2020-06-16 | Google Llc | Compression across multiple images |
CN113408543B (en) * | 2021-05-28 | 2022-08-16 | 南京林业大学 | Two-dimensional part outline rasterization feature representation method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101212680A (en) * | 2006-12-30 | 2008-07-02 | 扬智科技股份有限公司 | Image data storage access method and system |
CN102158706A (en) * | 2011-05-19 | 2011-08-17 | 大连民族学院 | Image compressing storage method on the basis of compressing vertex chain code |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4909779B2 (en) * | 2006-04-17 | 2012-04-04 | パナソニック株式会社 | Image data transfer method, image processing apparatus, and imaging system |
-
2012
- 2012-04-28 CN CN201210132776.XA patent/CN102647541B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101212680A (en) * | 2006-12-30 | 2008-07-02 | 扬智科技股份有限公司 | Image data storage access method and system |
CN102158706A (en) * | 2011-05-19 | 2011-08-17 | 大连民族学院 | Image compressing storage method on the basis of compressing vertex chain code |
Also Published As
Publication number | Publication date |
---|---|
CN102647541A (en) | 2012-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112383780B (en) | Encoding and decoding method and device for point matching reference set and index back and forth scanning string matching | |
US10021418B2 (en) | Method and apparatus of candidate generation for single sample mode in video coding | |
TWI536811B (en) | Method and system for image processing, decoding method, encoder and decoder | |
KR101461209B1 (en) | Method and apparatus for image compression storing encoding parameters in 2d matrices | |
CN107925759A (en) | Method and apparatus for coding and decoding infra-frame prediction | |
CN111800641A (en) | Image coding and decoding method and device adopting different types of reconstructed pixels in same mode | |
CN102647594B (en) | Integer pixel precision motion estimation method and system for same | |
CN102547290B (en) | Video image coding/decoding method based on geometric partitioning | |
CN102648631A (en) | Method and apparatus for encoding/decoding high resolution images | |
CN102685477A (en) | Method and device for obtaining image blocks for merging mode | |
EP3343446A1 (en) | Method and apparatus for encoding and decoding lists of pixels | |
CN102647541B (en) | Picture encoding method based on lossy compression chain code | |
CN102611881A (en) | Method and module for obtaining reference motion vector, encoding and decoding device | |
CN104202605A (en) | Method for predicting division way of high-definition image coding unit CU by reducing resolution and implementation device thereof | |
CN104427346A (en) | Method and apparatus for predicting depth quadtree in three-dimensional video | |
CN107682699B (en) | A kind of nearly Lossless Image Compression method | |
CN109035351A (en) | A kind of image object boundary expression based on side chain code | |
CN103647969B (en) | A kind of object-based Fast Fractal video compress and decompression method | |
CN106941610B (en) | Binary ROI mask coding method based on improved block coding | |
CN102665028B (en) | Lossy-compressed chain code-based image coding method | |
CN102769751A (en) | Image encoding method based on directional block compressed sensing | |
CN103139557B (en) | Method for estimating in a kind of Video coding and system | |
CN112565753A (en) | Method and apparatus for determining motion vector difference, storage medium, and electronic apparatus | |
CN105208396A (en) | Video frame coding method, video frame decoding method, video frame coding device, and video frame decoding device | |
CN105637865B (en) | Image prediction processing method and relevant device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140820 Termination date: 20170428 |