CN106941610B - Binary ROI mask coding method based on improved block coding - Google Patents

Binary ROI mask coding method based on improved block coding Download PDF

Info

Publication number
CN106941610B
CN106941610B CN201710277604.4A CN201710277604A CN106941610B CN 106941610 B CN106941610 B CN 106941610B CN 201710277604 A CN201710277604 A CN 201710277604A CN 106941610 B CN106941610 B CN 106941610B
Authority
CN
China
Prior art keywords
symbol
run
sequence
symbol sequence
length
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.)
Active
Application number
CN201710277604.4A
Other languages
Chinese (zh)
Other versions
CN106941610A (en
Inventor
张静
赵威
戴薇
吴仁坚
李珊珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Electronic Science and Technology
Original Assignee
Xian University of Electronic Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xian University of Electronic Science and Technology filed Critical Xian University of Electronic Science and Technology
Priority to CN201710277604.4A priority Critical patent/CN106941610B/en
Publication of CN106941610A publication Critical patent/CN106941610A/en
Application granted granted Critical
Publication of CN106941610B publication Critical patent/CN106941610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/93Run-length coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a binary ROI mask coding method based on improved block coding, which mainly solves the problem of low coding efficiency of the conventional ROI mask. The implementation scheme is as follows: 1) partitioning the ROI mask, representing by using a symbol, and scanning all the partitions to obtain a one-dimensional symbol sequence; 2) calculating a run-length array of the symbol '0' in the symbol sequence, and replacing the continuous symbol '0' in the original symbol sequence with a symbol '0' to obtain a corrected symbol sequence; 3) and respectively carrying out Huffman coding on the run-length array and the corrected symbol sequence, and merging the code streams of the run-length array and the corrected symbol sequence to obtain a final code stream. The method has the characteristics of simple coding process, high symbol sequence coding efficiency and large code stream saving, and can be used for the compression process of the remote sensing image ROI mask.

Description

Binary ROI mask coding method based on improved block coding
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a binary ROI mask coding method which can be used for realizing efficient coding of a remote sensing cloud picture ROI mask.
Background
The block coding is used for coding binary images, such as fax images, and is popularized to the coding of gray level images due to the simplicity and effectiveness of the method. The block coding is divided into two processes: block scanning and huffman coding: firstly, selecting blocks with set size to divide an image, then taking the arrangement information of gray values in the blocks as information for representing the blocks, representing the information by using corresponding symbols, then scanning the whole image, forming one-dimensional symbol sequences by using symbols corresponding to all the blocks, and finally carrying out Huffman coding on the symbol sequences.
The traditional block coding effectively utilizes the spatial correlation of binary images, but in the coding of symbol sequences, because the characteristics of the corresponding symbol sequences of different binary images are not considered, the traditional Huffman coding method is uniformly used, and therefore the coding efficiency of the symbol sequences is reduced.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention provides a method for encoding a binary ROI mask based on improved block coding, which improves the coding efficiency of the ROI mask.
The technical idea of the invention is as follows: aiming at the characteristics that the regionality of an ROI mask and symbol sequences corresponding to the regions have a large amount of statistical redundancy, the ROI mask is subjected to block processing by utilizing the spatial correlation among pixels of the ROI mask, a one-dimensional symbol sequence is obtained by carrying out symbol packaging on each block, the code of the ROI mask is the code of the symbol sequence, the run-length array of the symbol sequence is calculated by independently processing the symbol '0' with the largest occurrence frequency and the strongest continuity in the symbol sequence, and the code of the run-length array and the corrected symbol sequence is implemented. The specific implementation scheme comprises the following steps:
(1) 3-3 partitioning the ROI mask image from top to bottom and from left to right, reading pixel values in the partitions into a nine-bit binary 0 and 1 sequence, and converting the binary sequence into decimal values serving as symbols for representing the partitions; scanning all the 3 x 3 blocks according to the sequence from top to bottom and from left to right, and reading all the symbols into a one-dimensional symbol sequence;
(2) traversing the one-dimensional symbol sequence, calculating a run-length array of '0' symbols in the symbol sequence, and replacing continuous '0' symbols in the symbol sequence with a corresponding symbol to obtain a corrected symbol sequence;
(3) and respectively carrying out Huffman coding on the run-length array and the corrected symbol sequence, and merging the code streams of the run-length array and the corrected symbol sequence to obtain a final code stream.
Compared with the prior art, the invention has the following advantages:
first, the present invention takes advantage of the spatial correlation of ROI masks to reduce the statistical redundancy of ROI masks
Secondly, the invention can complete the coding of the ROI mask by using shorter code stream, thereby improving the coding efficiency of the ROI mask.
Drawings
FIG. 1 is a flow chart of an implementation of the present invention;
fig. 2 is a schematic diagram of block scanning in the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Step 1, dividing the ROI mask into blocks to obtain a symbol sequence.
(1a) Creating a two-dimensional array A, reading an ROI mask extracted from the ROI into the two-dimensional array A, performing 3-by-3 blocking operation, and reading pixel values in blocks according to the method shown in FIG. 2 to obtain a binary sequence;
(1b) creating a variable T, storing the symbols corresponding to the blocks, initializing the variable T to 0, traversing the binary sequence from the high order to the low order, adding a decimal value corresponding to each digit in the binary sequence to the variable T, and obtaining the symbols corresponding to the blocks after the traversal is finished;
(1c) and traversing the symbols corresponding to all the blocks to obtain a symbol sequence.
And step 2, traversing the symbol sequence to obtain a run-length array of the symbol '0' and the corrected symbol sequence.
(2a) Creating a one-dimensional array B for storing the run length of the symbol '0' and initializing the one-dimensional array B to be empty;
(2b) starting from the first symbol of the symbol sequence, determining whether the symbol is '0':
if the symbol is not '0', skipping the symbol, performing (2 c);
if the symbol is '0', calculating the number n of consecutive '0's after the symbol, adding n to the array B, and skipping n symbols '0', performing (2 c);
(2c) judging whether the end of the symbol sequence is reached:
if the end is not reached, returning to (2b) to continue traversing;
if the end is reached, the traversal is finished to obtain a run-length array of the symbol '0';
(2d) from the first symbol of the symbol sequence, go through again, determine if the symbol is '0':
if the symbol is not '0', skipping the symbol, performing (2 e);
if the symbol is '0', deleting all the symbols which are '0' consecutively after the symbol, and skipping the symbol, performing (2 e);
(2e) judging whether the end of the symbol sequence is reached:
if the end is not reached, performing step (2 d);
and if the end is reached, the traversal is finished, and the corrected symbol sequence is obtained.
And 3, performing Huffman coding on the result obtained in the step 2, and combining code streams.
(3a) Calculating the probability of each value in the run-length array of the symbol '0', and allocating the code length according to the probability corresponding to each value: the larger the probability of the value is, the shorter the allocated code length is, the smaller the probability is, the longer the allocated code length is, and finally, all the values of the run-length array are encoded according to the allocated code words to obtain the encoded code stream of the run-length array of the symbol '0';
(3b) calculating the probability of each symbol in the corrected symbol sequence, and distributing the code length according to the probability corresponding to the symbol: the larger the probability of the symbol is, the shorter the allocated code length is, the smaller the probability is, the longer the allocated code length is, and finally, all symbols in the corrected symbol sequence are coded according to the allocated code words to obtain a coded code stream of the corrected symbol sequence;
(3c) and (3) adding the length of the code stream of the run-length array of the symbol '0' obtained in the step (3a) to the front of the code stream of the run-length array, splicing the code stream of the corrected symbol sequence obtained in the step (3b) to the code stream of the run-length array, and then completing the merging of the code streams to obtain the final code stream.
Taking the symbol sequence {2,0,0, 511,5,0,0,0} as an example, the specific implementation of this step is described as follows:
firstly, executing steps (2a) to (2c) to obtain a run-length array of a symbol '0' as [43], and executing steps (2d) to (2e) to obtain a corrected symbol sequence as {2,0,511,5, 0 };
and (3a) coding the run-length array, wherein the probabilities of 4 and 3 values in the run-length array are the same, so that the two values are allocated with code lengths of the same length, namely 0 and 1 respectively, and the run-length array is coded according to the allocated code lengths to obtain a coded code stream '01'.
Then, step (3b) is performed to calculate the probabilities of the symbols '2', '0', '511' and '5' in the modified symbol sequence, respectivelyAndallocating code lengths with the length of 1 to the symbols '0' and '511' with the maximum probability, wherein the code lengths are 0 and 1 respectively; allocating code lengths of 2, which are respectively 01 and 10, to the symbols '2' and '511' with smaller probability; coding the corrected symbol sequence according to the allocated code length to obtain a coded code stream '01011100';
finally, executing the step (3c), calculating the length of the coded code stream of the run-length array to be 2, representing the length by using a byte 00000010, and adding the byte to the front of the coded code stream '01' of the run-length array to obtain a code stream '0100000010'; and adding the code stream '0100000010' into the code stream '01011100' of the corrected symbol sequence to finally obtain a code stream of '010000001001011100', and completing the coding of the ROI mask.
The foregoing description is only an example of the present invention and is not intended to limit the invention, so that it will be apparent to those skilled in the art that various changes and modifications in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims (4)

1. A binary ROI mask coding method based on improved block coding comprises the following steps:
(1) 3-3 partitioning the ROI mask image from top to bottom and from left to right, reading pixel values in the partitions into a nine-bit binary 0 and 1 sequence, and converting the binary sequence into decimal values serving as symbols for representing the partitions; scanning all the 3 x 3 blocks according to the sequence from top to bottom and from left to right, and reading all the symbols into a one-dimensional symbol sequence;
(2) traversing the one-dimensional symbol sequence, calculating a run-length array of '0' symbols in the symbol sequence, and replacing continuous '0' symbols in the symbol sequence with a corresponding symbol to obtain a corrected symbol sequence;
(3) and respectively carrying out Huffman coding on the run-length array and the corrected symbol sequence, and merging the code streams of the run-length array and the corrected symbol sequence to obtain a final code stream.
2. The method of claim 1, wherein the run-length array of '0' symbols in the sequence of symbols is calculated in step (2) by:
(2a) creating an array A for storing the run and initializing the array A to be empty;
(2b) starting from the first symbol of the symbol sequence, determining whether the symbol is '0':
if the symbol is not '0', skipping the symbol, performing (2 c);
if the symbol is '0', calculating the number n of consecutive '0's after the symbol, adding n to the array A, and skipping n symbols '0', performing (2 c);
(2c) judging whether the end of the symbol sequence is reached, if the end is not reached, returning to the step (2b) to continue traversing; if the end is reached, the traversal ends.
3. The method of claim 1, wherein the step (2) replaces successive '0' symbols in the symbol sequence with a corresponding one of the symbols by:
(2d) starting from the first symbol of the symbol sequence, determining whether the symbol is '0':
if the symbol is not '0', skipping the symbol, performing (2 e);
if the symbol is '0', deleting all the symbols which are '0' consecutively after the symbol, and skipping the symbol, performing (2 e);
(2e) judging whether the end of the symbol sequence is reached, if the end is not reached, returning to the step (2d) to continue traversing; if the end is reached, the traversal ends.
4. The method of claim 1, wherein step (3) is performed by:
(3a) calculating the probability of each value in the run-length array of the symbol '0', and distributing the code length according to the probability corresponding to the value: the larger the probability of the value is, the shorter the distributed code length is, the smaller the probability is, the longer the distributed code length is, and finally, all values of the run-length array are coded according to the distributed code words to obtain a coded code stream of the run-length array of the symbol '0';
(3b) calculating the probability of each symbol in the corrected symbol sequence, and distributing the code length according to the probability corresponding to the symbol: the larger the probability of the symbol is, the shorter the allocated code length is, the smaller the probability is, the longer the allocated code length is, and finally, all symbols in the corrected symbol sequence are coded according to the allocated code words to obtain a coded code stream of the corrected symbol sequence;
(3c) and (3) adding the length of the code stream of the run-length array of the symbol '0' obtained in the step (3a) to the front of the code stream of the run-length array, splicing the code stream of the corrected symbol sequence obtained in the step (3b) to the code stream of the run-length array, and then completing the merging of the code streams to obtain the final code stream.
CN201710277604.4A 2017-04-25 2017-04-25 Binary ROI mask coding method based on improved block coding Active CN106941610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710277604.4A CN106941610B (en) 2017-04-25 2017-04-25 Binary ROI mask coding method based on improved block coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710277604.4A CN106941610B (en) 2017-04-25 2017-04-25 Binary ROI mask coding method based on improved block coding

Publications (2)

Publication Number Publication Date
CN106941610A CN106941610A (en) 2017-07-11
CN106941610B true CN106941610B (en) 2019-12-24

Family

ID=59464833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710277604.4A Active CN106941610B (en) 2017-04-25 2017-04-25 Binary ROI mask coding method based on improved block coding

Country Status (1)

Country Link
CN (1) CN106941610B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114697655B (en) * 2020-12-30 2023-04-11 中国科学院计算技术研究所 Neural network quantization compression method and system for equalizing compression speed between streams
CN116418997A (en) * 2021-12-28 2023-07-11 中国电信股份有限公司 Characteristic data compression method, device and system, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1586042A (en) * 2001-11-22 2005-02-23 松下电器产业株式会社 Variable length coding method and variable length decoding method
CN101572587A (en) * 2008-04-30 2009-11-04 中兴通讯股份有限公司 Method and device for coding sequences and overload indication information set method
CN101964912A (en) * 2010-10-15 2011-02-02 北京中科大洋科技发展股份有限公司 Method for fast calculating run length by run length coding in MPEG2
CN102129875A (en) * 2011-02-22 2011-07-20 武汉纺织大学 Block encoding and decoding device for two-dimensional runlength limited constraint and using method thereof
CN102129698A (en) * 2011-03-08 2011-07-20 华中科技大学 Image coding method based on region of interest
WO2011128268A1 (en) * 2010-04-13 2011-10-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Probability interval partioning encoder and decoder
CN104081772A (en) * 2011-10-06 2014-10-01 弗兰霍菲尔运输应用研究公司 Entropy coding buffer arrangement
CN104298775A (en) * 2014-10-31 2015-01-21 北京工商大学 Multi-feature content-based image retrieval method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1586042A (en) * 2001-11-22 2005-02-23 松下电器产业株式会社 Variable length coding method and variable length decoding method
CN101572587A (en) * 2008-04-30 2009-11-04 中兴通讯股份有限公司 Method and device for coding sequences and overload indication information set method
WO2011128268A1 (en) * 2010-04-13 2011-10-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Probability interval partioning encoder and decoder
CN101964912A (en) * 2010-10-15 2011-02-02 北京中科大洋科技发展股份有限公司 Method for fast calculating run length by run length coding in MPEG2
CN102129875A (en) * 2011-02-22 2011-07-20 武汉纺织大学 Block encoding and decoding device for two-dimensional runlength limited constraint and using method thereof
CN102129698A (en) * 2011-03-08 2011-07-20 华中科技大学 Image coding method based on region of interest
CN104081772A (en) * 2011-10-06 2014-10-01 弗兰霍菲尔运输应用研究公司 Entropy coding buffer arrangement
CN104298775A (en) * 2014-10-31 2015-01-21 北京工商大学 Multi-feature content-based image retrieval method and system

Also Published As

Publication number Publication date
CN106941610A (en) 2017-07-11

Similar Documents

Publication Publication Date Title
KR101461209B1 (en) Method and apparatus for image compression storing encoding parameters in 2d matrices
US20200389660A1 (en) Method and apparatus for decoding a received set of encoded data
CN112383781B (en) Method and device for block matching coding and decoding in reconstruction stage by determining position of reference block
CN1681330B (en) Adaptive 2n-ary tree generating method, and method and apparatus for encoding and decoding 3d volume data using it
KR101605173B1 (en) Method for processing an image
US7561744B2 (en) Image encoding apparatus, image decoding apparatus, and their control method, and computer program and computer-readable storage medium
EP3343446A1 (en) Method and apparatus for encoding and decoding lists of pixels
CN106941610B (en) Binary ROI mask coding method based on improved block coding
Mohideen et al. A systematic evaluation of coding strategies for sparse binary images
CN115474044B (en) Bayer domain image lossy compression method
CN116843774A (en) Point cloud data compression method, device, equipment and storage medium
CN110710219B (en) Method and apparatus for context derivation for coefficient coding
EP2810371B1 (en) Binary arithmetic coding scheme
EP3319318B1 (en) Intra compression of screen content based on soft context formation
CN113099269A (en) String matching prediction method, encoding and decoding method, related equipment and device
CN117097905B (en) Lossless image block compression method, lossless image block compression equipment and storage medium
JP4743884B2 (en) Image coding apparatus and control method thereof
Wang et al. A lossless compression of remote sensing images based on ANS entropy coding algorithm
KR100387559B1 (en) Fractal image compression method
JP4743883B2 (en) Image coding apparatus and control method thereof
CN116095333A (en) Image compression method, device, equipment and storage medium
CN1115878C (en) Method for processing picture signal with target using epitaxial interpolation technology and apparatus thereof
JP2012109880A (en) Image encoding method, image encoding device, image decoding method, and image decoding device
CN117333559A (en) Image compression method, device, electronic equipment and storage medium
Wai et al. Lossless Compression for Raster Maps Based On Mobile

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant