KR100467620B1 - Method and apparatus for compressing and/or decompressing binary images - Google Patents

Method and apparatus for compressing and/or decompressing binary images Download PDF

Info

Publication number
KR100467620B1
KR100467620B1 KR10-2002-0082381A KR20020082381A KR100467620B1 KR 100467620 B1 KR100467620 B1 KR 100467620B1 KR 20020082381 A KR20020082381 A KR 20020082381A KR 100467620 B1 KR100467620 B1 KR 100467620B1
Authority
KR
South Korea
Prior art keywords
record
image
dictionary
binary image
black
Prior art date
Application number
KR10-2002-0082381A
Other languages
Korean (ko)
Other versions
KR20040056405A (en
Inventor
신상윤
Original Assignee
삼성전자주식회사
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 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to KR10-2002-0082381A priority Critical patent/KR100467620B1/en
Publication of KR20040056405A publication Critical patent/KR20040056405A/en
Application granted granted Critical
Publication of KR100467620B1 publication Critical patent/KR100467620B1/en

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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction

Abstract

본 발명은 이진영상 압축 방식에 관한 것으로 본 발명은 프린터에서 이진영상의 저장이나 데이터 전송시 메모리,전송시간절약을 위해 영상을 압축 및/또는 복원하는 방법과 그를 수행하는 장치에 관한 것이다. 본 발명은 이를 위하여 0과 1의 반복횟수를 구하여 레코드를 생성함에 있어서, 0에 대한 반복횟수 n비트와 1에 대한 반복횟수 n비트를 결합한 2n비트를 이용하여 레코드를 생성하는 이진영상압축방법을 제공한다. 이로써 본 발명은 종래기술에서 입력스트림으로부터 4바이트 혹은 8바이트를 받아 레코드로 사용하였던 방법을 개선하여 이진영상의 0과 1의 반복횟수를 구한 뒤 두 개의 반복횟수를 묶은 한 쌍으로 레코드를 구성하여 비트당 더 많은 정보를 실을 수 있게 하고, 레코드의 크기를 4바이트 보다 작게 하여 반복되는 패턴을 사전 목록에서 찾을 수 있는 확률을 높게 함으로써, 그림 글자 혼재영상이나 에러확산방법으로 얻어진 이진 영상에서 압축률을 개선할 수 있다.The present invention relates to a binary image compression method, and the present invention relates to a method for compressing and / or restoring an image for saving a transmission time and a memory for storing a binary image or transmitting data in a printer, and an apparatus for performing the same. The present invention provides a binary image compression method for generating a record using 2n bits in which a repetition number of 0 and 1 is generated to generate a record. to provide. Accordingly, the present invention improves the method of receiving 4 or 8 bytes from the input stream in the prior art and used it as a record to obtain the repetition number of 0 and 1 of a binary image, and then configure the record in a pair of two repetition numbers to form a bit. By increasing the probability of finding repeating patterns in the dictionary list by allowing more information to be loaded and by reducing the size of the records to less than 4 bytes, the compression rate can be reduced in binary images obtained by mixed glyphs or error diffusion methods. It can be improved.

Description

이진 영상 압축 및/또는 복원 방법 및 장치{Method and apparatus for compressing and/or decompressing binary images}Binary image compression and / or decompression method and apparatus {Method and apparatus for compressing and / or decompressing binary images}

본 발명은 이진 영상 압축 및/또는 복원 방식에 관한 것으로, 보다 상세하게는 프린터에서 이진 영상의 저장이나 데이터 전송시 메모리, 전송 시간 절약을 위해 영상을 압축 및/또는 복원하는 방법 및 그를 수행하는 장치에 관한 것이다.The present invention relates to a method for compressing and / or restoring a binary image, and more particularly, to a memory for storing or transferring a binary image in a printer, a method of compressing and / or restoring an image for saving transmission time, and an apparatus for performing the same. It is about.

기존의 렘펠지브(Lempel-Ziv) 기반의 슬라이딩 사전을 이용한 데이터 압축/복원 기술은 다음과 같이 구성되어 있다.The data compression / restore technology using the conventional Lempel-Ziv-based sliding dictionary is composed as follows.

그 영상 압축 부분에는 모든 레코드와 사전, 윈도우를 초기화 하는 부분, 입력스트림을 미러 회전(mirror rotation)시키는 부분, 입력스트림을 4바이트 혹은 8바이트 단위로 입력받아 레코드에 채워놓는 부분, 입력받은 레코드와 일치하는 레코드를 먼저 윈도우내에서 찾는 부분, 윈도우내에서 현재 레코드와 일치하는 레코드를 찾았을 경우 그 레코드에 해당하는 인덱스를 출력하는 부분, 윈도우에서 찾지 못할 경우 사전에서 찾는 부분, 사전에서 현재 레코드와 일치하는 레코드를 찾았을 경우 그 레코드에 해당하는 인덱스를 출력하는 부분, 사전에서도 현재 레코드와 일치하는 레코드를 찾지 못하면 사전 목록에 새롭게 등록하고 마커(marker 0xFE)를 붙여서 압축데이터로 출력하는 부분, 사전 목록의 개수가 254가 되면 사전내의 현재 위치를 0으로 바꾸는 부분, 및 종료 마커(marker 0xFF)를 출력하는 부분을 구비하고 있다.The video compression part includes all records, dictionaries, window initialization part, mirror rotation of the input stream, input stream of 4 byte or 8 byte unit, and fill in the record. Finds the matching record in the window first, finds the index that matches the current record in the window, prints the index corresponding to the record, finds the dictionary in the window, finds the record in the dictionary, If a matching record is found, the part that outputs the index corresponding to the record, and if the dictionary does not find a record that matches the current record, the part is newly registered in the dictionary list and the marker (xer 0xFE) is added and output as compressed data. When the number of lists reaches 254, the part that replaces the current position in the dictionary with 0 And a part for outputting an end marker (0xFF).

또한, 그 영상 복원 부분에는 모든 레코드와 사전, 윈도우를 초기화 하는 부분, 입력 압축파일에서 한 바이트를 입력받아 종료 마커인지 체크하여 종료 마커이면 종료시키는 부분, 종료 마커가 아닌 경우 0xFE이면 0xFE 이후에 4바이트 혹은 8바이트를 복원 데이터로 출력해주는 부분, 및 마커(Marker 0xFE)가 아닌 경우 사전내의 목록번호이므로 사전내에서 목록번호에 해당하는 레코드를 찾아 출력해주는 부분을 구비한다.Also, the image restoration part includes all records, dictionaries, window initialization part, one byte input from the input compressed file and checks whether it is an end marker, and ends it if it is an end marker. And a part for outputting bytes or 8 bytes as the restoration data, and a part for finding and outputting a record corresponding to the list number in the dictionary since it is a list number in the dictionary if it is not a marker (Marker 0xFE).

이러한 기존의 데이터압축/복원 기술은 렘펠지브(Lempel-Ziv) 압축방법을 개선한 방법으로서, 렘펠지브 압축 방법들에서 사용한 방법들이 공통적으로 많이 사용되었다. 렘펠지브 압축 방법은 입력 스트림과 비슷한 데이터가 반복되는 형태를가질 때 압축이 일어난다. 이러한 기존의 압축기술에서는 종래의 렘펠지브방법을 확장하여 레코드의 크기를 4바이트 또는 8바이트로 정하고 사전의 크기도 고정시켜 압축, 복원 시간을 단축시키고 있다. 즉, 기존의 압축 방법에서는 현재 입력받은 4바이트 혹은 8바이트의 입력 스트림을 사전내에서 반복되는 레코드를 찾아 내어 일치하는 레코드를 찾았을 경우 목록번호만 출력하고 일치하는 레코드가 존재하지 않을 경우에는 사전에 새롭게 추가한뒤 압축데이터로 출력한다. 또한, 기존의 복원 방법에서는 압축데이터로부터 목록번호만 출력된 압축데이터는 목록번호에 해당하는 레코드를 사전에서 찾아서 복원하고 그렇지 않은 경우에는 마커뒤에 이어진 4바이트 혹은 8바이트의 압축데이터 스트림을 그대로 출력하여 복원시킨다.The existing data compression / restore technique is an improvement method of the Lempel-Ziv compression method, and the methods used in the Lempel-Jib compression methods are commonly used. In the Rempeljib compression method, compression occurs when data similar to the input stream is repeated. In the existing compression technology, the conventional Rempel Jib method is extended to set the size of the record to 4 bytes or 8 bytes and to fix the size of the dictionary to shorten the compression and restoration time. In other words, the existing compression method finds a record that is repeated in the dictionary with 4 or 8 byte input streams, and outputs only the list number when a matching record is found. Newly added to and output as compressed data. In addition, in the conventional restoration method, compressed data, which outputs only the list number from the compressed data, searches for and restores the record corresponding to the list number in advance. Otherwise, the compressed data stream following the marker is output as it is. Restore

상술한 바와 같이, 기존의 데이터 압축/복원 방법은 레코드를 입력 스트림에서 4바이트 혹은 8바이트를 단위로 직접 입력받게 되어 있다. 이러한 방법을 사용하여 레코드를 구성하게 되면 최대 4대1 혹은 8대1 이상 압축률을 얻기가 어렵다. 디더링(dithering)방식의 하프토닝을 거친 영상 압축의 경우에는 데이터 스트림간에 상관관계가 높음에도 불구하고 최대 압축률의 제한으로 압축률에서 이득을 보기가 어려우며, 상관관계가 비교적 낮은 에러확산(error diffusion) 방법으로 얻은 이진영상의 압축에서는 4바이트 혹은 8바이트 단위의 입력 레코드와 일치하는 레코드를 사전내에서 찾기가 대단히 어려워져서 압축률이 떨어지게된다. 또한 필요이상으로 많은 비트가 할당된 마커의 크기로 인해 불필요한 압축손실이 일어난다.As described above, in the conventional data compression / restore method, a record is directly input in units of 4 bytes or 8 bytes in an input stream. Using this method to organize records makes it difficult to achieve compression ratios of up to four to one or eight to one. In the case of dithering half-toning image compression, although the correlation between data streams is high, it is difficult to see the gain in the compression ratio due to the limitation of the maximum compression ratio, and the error diffusion method has a relatively low correlation. In the compression of binary images obtained by, it is very difficult to find a record in the dictionary that matches the input record in units of 4 or 8 bytes. Also, unnecessary compression loss occurs due to the size of the marker with more bits allocated than necessary.

따라서, 본 발명의 목적은 상술한 종래의 단점을 해결하기 위하여, 종래기술에서 입력스트림으로부터 4바이트 혹은 8바이트를 받아 레코드로 사용하였던 방법을 개선하여 이진영상의 0과 1의 반복횟수를 구한 뒤 두 개의 반복횟수를 묶은 한 쌍으로 레코드를 구성하여 비트당 더 많은 정보를 실을 수 있게 하고, 레코드의 크기를 4바이트 보다 작게 하여 반복되는 패턴을 사전 목록에서 찾을 수 있는 확률을 높게 함으로써, 그림 글자 혼재영상이나 에러확산방법으로 얻어진 이진 영상에서 압축률을 개선할 수 있는 이진 영상 압축 방법 및 장치를 제공하는데 있다.Accordingly, an object of the present invention is to solve the above-mentioned disadvantages, to improve the method used as a record by receiving 4 bytes or 8 bytes from the input stream in the prior art to obtain the number of repetitions of 0 and 1 of the binary image By organizing a record into a pair of number of repetitions, it can carry more information per bit, and by reducing the size of the record to less than 4 bytes, it increases the probability of finding a repeating pattern in the dictionary list. The present invention provides a binary image compression method and apparatus for improving a compression ratio in a binary image obtained by a mixed image or an error diffusion method.

본 발명의 다른 목적은 상관관계가 높은 글자 영상에서의 압축률이 최대압축률의 제한으로 압축률에서 이득을 못보았던 점을 개선하기 위해 사전 목록에서 찾아진 목록번호에 대한 런렝쓰(run length)를 구함으로써, 입력 스트림간 높은 상관관계가 있는 영상에서도 압축률을 개선할 수 있는 이진 영상 압축 방법 및 장치를 제공하는데 있다.Another object of the present invention is to obtain a run length for the list number found in the dictionary list to improve the point that the compression rate in the highly correlated character image has not benefited from the compression rate by limiting the maximum compression rate. In addition, the present invention provides a method and apparatus for compressing a binary image capable of improving a compression ratio even in a video having high correlation between input streams.

본 발명의 다른 목적은 마커에 불필요하게 할당된 비트 수를 1비트로 줄임으로써 압축률을 높일 수 있는 이진 영상 압축 방법 및 장치를 제공하는데 있다.Another object of the present invention is to provide a method and apparatus for compressing a binary image which can increase the compression rate by reducing the number of bits unnecessarily allocated to the marker to 1 bit.

본 발명의 또다른 목적은 상기 이진 영상 압축 방법 및 장치에 의해 압축된 이진 영상의 복원 방법 및 장치를 제공하는데 있다.Another object of the present invention is to provide a method and apparatus for restoring a binary image compressed by the binary image compression method and apparatus.

도 1은 본 발명의 영상 압축을 설명하기 위한 흐름도이다.1 is a flowchart illustrating image compression according to the present invention.

도 2는 에러확산 방법으로 얻어진 이진영상을 압축하기위한 전처리 방법을 도시한 예시도이다.2 is an exemplary diagram showing a preprocessing method for compressing a binary image obtained by an error diffusion method.

도 3은 본 발명의 레코드 생성방법을 설명하기 위한 도면이다.3 is a view for explaining the record generation method of the present invention.

도 4는 본 발명의 영상 복원을 설명하기 위한 흐름도이다.4 is a flowchart illustrating image restoration of the present invention.

도 5는 디더링 방법으로 얻어진 이진영상의 압축률 비교도이다.5 is a comparison of compression ratios of binary images obtained by a dithering method.

도 6은 에러확산 방법으로 얻어진 이진영상의 압축률 비교도이다.6 is a comparison of compression ratios of binary images obtained by an error diffusion method.

전술한 목적을 달성하기 위한 본 발명의 일 형태는, 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 압축하는 이진영상압축방법에 있어서, 0과 1의 반복횟수를 구하여 레코드를 생성함에 있어서, 0에 대한 반복횟수 n비트와 1에 대한 반복횟수 n비트를 결합한 2n비트를 이용하여 레코드를 생성하는단계를 포함하는 이진영상압축방법을 제공한다.One aspect of the present invention for achieving the above object is a binary image compression method for compressing a binary image by searching for a record matching a current record using a dictionary, and generating a record by obtaining a repetition number of 0 and 1 In addition, the present invention provides a binary image compression method comprising generating a record using 2n bits in which a repetition number n bits for 0 and a repetition number n bits for 1 are combined.

바람직하기로는 압축하고자 하는 영상이 디더링 영상인지 에러확산 영상인지 체크하는 단계, 및 에러확산 영상인 경우 전처리 하는 단계를 포함한다.Preferably, the method includes checking whether the image to be compressed is a dithering image or an error diffusion image, and preprocessing the error diffusion image.

더욱 바람직하기로는 상기 전처리단계는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '1'로 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '0'으로 표현하여 새로운 입력 데이터를 얻거나, 또는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '0'으로, 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '1'로 표현하여 새로운 입력 데이터를 얻는 단계임을 특징으로 한다.More preferably, in the preprocessing step, the portion that changes from white to black and black to white is continuously expressed as '1' or expressed as '0' in a section in which black is maintained to obtain new input data or white In this case, the black and white to black portions are expressed as '0', and in a section where white is maintained or black is '1', new input data is obtained.

바람직하기로는 사전에서 레코드를 검색하는 단계, 일치하는 레코드를 찾지 못했을 때 현재의 레코드를 출력하고 사전에 추가하는 단계, 일치하는 레코드를 찾았을 때 일치하는 레코드의 반복횟수를 계산하여, 반복횟수가 2이상인지 체크하는 단계, 반복홧수가 2이상인 경우 사전의 레퍼런스 값과 횟수를 출력하는 단계, 및 반복횟수가 2미만일 때 사전의 레퍼런스 값을 출력하는 단계를 더 포함하는 것을 특징으로 한다.Preferably, retrieving records from the dictionary, outputting the current record and adding it to the dictionary when no matching record is found, and counting the number of repetitions of the matching record when the matching record is found, Checking whether the number of repetitions is greater than or equal to two, outputting a reference value and a number of dictionaries when the number of repetitions is two or more, and outputting a reference value of the dictionary when the number of repetitions is less than two.

본 발명의 다른 형태에 의하면, 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 압축하는 이진영상압축장치에 있어서, 0과 1의 반복횟수를 구하여 레코드를 생성함에 있어서, 0에 대한 반복횟수 n비트와 1에 대한 반복횟수 n비트를 결합한 2n비트를 이용하여 레코드를 생성하는 압축부를 포함하는 이진영상압축장치를 제공한다.According to another aspect of the present invention, in a binary image compression apparatus for retrieving a binary image and compressing a binary image by using a dictionary, generating a record by obtaining a repetition number of 0 and 1, The present invention provides a binary image compression apparatus including a compression unit that generates a record using 2n bits in which a repetition number n bits and a repetition number n bits for 1 are combined.

바람직하기로는 상기 압축부는 압축하고자 하는 영상이 디더링 영상인지 에러확산 영상인지 체크하는 단계, 및 에러확산 영상인 경우 전처리 하는 것을 특징으로 한다.Preferably, the compression unit checks whether an image to be compressed is a dithering image or an error diffusion image, and preprocesses the error diffusion image.

더욱 바람직하기로는 상기 압축부는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '1'로 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '0'으로 표현하여 새로운 입력 데이터를 얻거나, 또는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '0'으로, 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '1'로 표현하여 새로운 입력 데이터를 얻는 단계를 수행함을 특징으로 한다.More preferably, the compression unit expresses new input data by expressing a portion that changes from white to black and black to white to '1' continuously in white or '0' in a section maintaining black, or in white The method for obtaining new input data may be performed by expressing black, a portion changed from black to white as '0', and maintaining the white or '1' in a section maintaining black.

바람직하기로는 상기 압축부는 사전에서 레코드를 검색하고, 일치하는 레코드를 찾지 못했을 때 현재의 레코드를 출력하고 사전에 추가하고, 일치하는 레코드를 찾았을 때 일치하는 레코드의 반복횟수를 계산하여, 반복횟수가 2이상인지 체크하고, 반복홧수가 2이상인 경우 사전의 레퍼런스 값과 횟수를 출력하고, 및 반복횟수가 2미만일 때 사전의 레퍼런스 값을 출력함을 특징으로 한다.Preferably, the compression unit searches for a record in a dictionary, outputs the current record when the record is not found, adds it to the dictionary, calculates the number of repetitions of the matching record when the matching record is found, and the number of repetitions. Is 2 or more, and if the number of repetitions is 2 or more, the reference value and the number of times of the dictionary are output, and if the number of repetitions is less than 2, the dictionary reference value is output.

또한 본 발명의 다른 형태에 의하면, 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 복원하는 이진영상복원방법에 있어서, 수신된 이진영상의 1비트를 읽어 들여서 마커가 1인지 확인하는 단계; 마커가 0인 경우 2바이트의 레코드를 읽어들여 사전에 추가하고 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 출력하는 단계; 1인 경우 1바이트를 더 읽어들여 0xFF인지 확인하는 단계; 0xFF가 아닌 경우 사전의 레퍼런스 값에 해당하는 레코드값을 찾아내어 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 반복하여 출력하는 단계;0xFF인 경우 2바이트를 더 읽어들여서 첫번째 값을 사전의 레퍼런스 값으로 사용하여 두 번째 값을 반복횟수로 사용하여, 0xFF가 아닌 경우와 같은 방법으로 출력하는 단계; 디더링영상인지 에러확산영상인지를 확인하는 단계; 에러확산영상인 경우 흑백 변환점을 검출하는 단계; 디더링영상인 경우 압축해제된 데이터를 출력하는 단계; 및 화일의 길이가 높이*폭이 될 때까지 상술한 단계 401-412를 반복하는 단계를 구비하는 이진영상복원방법을 제공한다.According to another aspect of the present invention, in a binary image restoration method of restoring a binary image by searching for a record matching a current record using a dictionary, reading the 1 bit of the received binary image and confirming whether the marker is 1; ; Reading the two-byte record to add it to the dictionary when the marker is zero, and splitting the record into four bits to output '0' and '1' by each value; If 1, reads one more byte and checks whether it is 0xFF; If it is not 0xFF, find the record value corresponding to the reference value of the dictionary, divide the record into 4 bits, and output '0' and '1' repeatedly by each value; if 0xFF, read 2 more bytes first Using the value as the reference value of the dictionary and using the second value as the number of iterations, outputting the same method as in the case of not being 0xFF; Checking whether the image is a dithering image or an error diffusion image; Detecting a black and white conversion point in the case of an error diffusion image; Outputting decompressed data in the case of a dither image; And repeating the above steps 401-412 until the file length becomes height * width.

본 발명의 다른 형태에 의하면, 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 복원하는 이진영상복원장치에 있어서, 수신된 이진영상의 1비트를 읽어 들여서 마커가 1인지 확인하는 단계; 마커가 0인 경우 2바이트의 레코드를 읽어들여 사전에 추가하고 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 출력하는 단계; 1인 경우 1바이트를 더 읽어들여 0xFF인지 확인하는 단계; 0xFF가 아닌 경우 사전의 레퍼런스 값에 해당하는 레코드값을 찾아내어 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 반복하여 출력하는 단계; 0xFF인 경우 2바이트를 더 읽어들여서 첫번째 값을 사전의 레퍼런스 값으로 사용하여 두 번째 값을 반복횟수로 사용하여, 0xFF가 아닌 경우와 같은 방법으로 출력하는 단계; 디더링영상인지 에러확산영상인지를 확인하는 단계; 에러확산영상인 경우 흑백 변환점을 검출하는 단계; 디더영상인 경우 압축해제된 데이터를 출력하는 단계; 및 화일의 길이가 높이*폭이 될 때까지 상술한 단계 401-412를 반복하는 단계를 통하여 수신된 이진영상을 복원하는 복원부를 포함하는 이진영상복원장치를 제공한다.According to another aspect of the present invention, a binary image restoring apparatus for restoring a binary image by searching for a record matching a current record using a dictionary, the method comprising: checking whether a marker is 1 by reading 1 bit of a received binary image; Reading the two-byte record to add it to the dictionary when the marker is zero, and splitting the record into four bits to output '0' and '1' by each value; If 1, reads one more byte and checks whether it is 0xFF; If it is not 0xFF, finding a record value corresponding to a reference value of a dictionary, dividing the record into 4 bits and repeatedly outputting '0' and '1' by each value; In the case of 0xFF, reading two more bytes, using the first value as a reference value of the dictionary, and using the second value as the number of repetitions, and outputting the same method as in the case of not 0xFF; Checking whether the image is a dithering image or an error diffusion image; Detecting a black and white conversion point in the case of an error diffusion image; Outputting decompressed data in the case of a dither image; And a restoration unit for restoring the received binary image by repeating the above steps 401-412 until the file length becomes height * width.

이하 첨부된 도면들을 참조하여 본 발명의 일 형태에 의한 이진 영상 압축 및 복원 방법 및 장치의 구성 및 동작을 구현한 실시예를 상세히 설명하기로 한다.DETAILED DESCRIPTION Hereinafter, embodiments of the structure and operation of the method and apparatus for compressing and restoring a binary image according to one embodiment of the present invention will be described in detail with reference to the accompanying drawings.

본 발명의 이진 영상 압축 방법은 도 1에 도시한 바와 같이, 기존의 렘펠지브 기반의 데이터 압축 방법과 달리, 사전을 초기화 하는 단계(101), 입력 데이터가 비었는지 체크하여 끝내는 단계(102), 디더링 영상인지 에러확산 영상인지 체크하는 단계(103), 에러확산 영상인 경우 전처리 하는 단계(104), 0과 1의 반복횟수를 구하여 레코드를 생성하는 단계(105), 사전에서 검색하는 단계(106), 일치하는 레코드를 찾지 못했을 때(107) 현재의 레코드를 출력하고(112) 사전에 추가하는 단계(113), 일치하는 레코드를 찾았을 때(107) 일치하는 레코드의 반복횟수를 계산하는 단계(108), 반복횟수가 2이상인지 체크하는 단계(109), 반복홧수가 2이상인 경우 사전의 레퍼런스 값과 횟수를 출력하는 단계(110), 및 반복횟수가 2미만일 때 사전의 레퍼런스 값을 출력하는 단계(111)를 구비한다.In the binary image compression method of the present invention, as shown in FIG. 1, unlike the conventional RempelJib-based data compression method, a step of initializing a dictionary (101), checking whether the input data is empty (102), A step 103 of checking whether it is a dithering image or an error diffusion image, a step of preprocessing 104 in the case of an error diffusion image, a step of generating a record by obtaining a repetition number of 0 and 1, and a step of retrieving from a dictionary 106 Outputting the current record (112) and adding it to the dictionary (113) when a matching record is not found (107), and calculating the number of iterations of the matching record when the matching record is found (107) (108), checking if the repetition number is 2 or more (109), if the repetition number is 2 or more, outputting the reference value and the number of times of the dictionary 110, and outputting the reference value of the dictionary when the repetition number is less than 2; Find Step 111 The.

본 발명의 이진 영상 복원 방법은 도 4에 도시한 바와 같이, 사전을 초기화 하는 단계(400), 1비트를 읽어 들여서(401) 마커가 1인지 확인하는 단계(402), 마커가 0인 경우 2바이트의 레코드를 읽어들여 사전에 추가하고 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 출력하는 단계(404), 1인경우 1바이트를 더 읽어들여(403) 0xFF인지 확인하는 단계(405), 0xFF가 아닌 경우 사전의 레퍼런스 값에 해당하는 레코드값을 찾아내어 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 반복하여 출력하는 단계(407), 0xFF인 경우 2바이트를 더 읽어들여서(406) 첫번째 값을 사전의 레퍼런스 값으로 사용하여 두 번째 값을 반복횟수로 사용하여,0xFF가 아닌 경우와 같은 방법으로 출력하는 단계(408), 그 다음 디더영상인지 에러확산영상인지를 확인하는 단계(409), 에러확산영상인 경우 흑백 변환점을 검출하는 단계(410), 디더영상인 경우 압축해제된 데이터를 출력하는 단계(411), 및 화일의 길이가 높이*폭이 될 때까지 상술한 단계 401-412를 반복하는 단계(412)를 구비한다.In the binary image reconstruction method of the present invention, as shown in FIG. 4, a step of initializing a dictionary (400), reading a single bit (401), and checking whether the marker is 1 (402), or the marker is 0 is 2. Read a byte record and add it to the dictionary, split the record into 4 bits, and output '0' and '1' by each value (404) .If 1, read one more byte (403) and check whether it is 0xFF. In step 405, if it is not 0xFF, finding the record value corresponding to the reference value of the dictionary, dividing the record by 4 bits and repeatedly outputting '0' and '1' by each value (407), and 0xFF. In the case of reading two more bytes (406), using the first value as a reference value of the dictionary and the second value as the number of iterations, and outputting in the same manner as in the case of not 0xFF (408), then the dither image Determining whether the image is an error diffusion image (409), Detecting black and white conversion points (410), outputting decompressed data (411) in the case of a dither image, and repeating steps 401-412 described above until the length of the file becomes height * width ( 412.

이하 상술한 도 1 및 도 4의 이진 영상 압축 및 복원 방법의 구성 및 동작을 보다 상세히 설명하기로 한다.Hereinafter, the configuration and operation of the above-described binary image compression and decompression method of FIGS. 1 and 4 will be described in detail.

본 발명에서는 렘펠지브(Lempel-Ziv) 방법을 기반으로 하여 입력 데이터 스트림이 비슷한 데이터가 반복되는 형태를 가질 때 압축이 일어나도록 하였다.In the present invention, compression occurs when the input data stream has a form in which similar data is repeated based on the Lempel-Ziv method.

도 1은 압축흐름도를 나타낸다. 먼저, 사전을 초기화한다(101). 본 발명에서는 사전 목록 번호를 8비트로 표현하도록 하기 위해 2부터 254까지 253개의 사전 목록 번호를 갖도록 하였다. 0, 1, 255 는 마커로 사용하기 위해 사전 목록 번호에는 포함시키지 않는다. 마커로 0과 1을 사용함으로써 비트 손실을 최소화 하였다. 단계 102에서는 현재 입력 스트림이 더 이상 존재하는지 체크하여 더 이상의 입력데이터가 존재하지 않는 경우 종료시킨다. 본 발명에서는 에러 확산 방법에 의하여 얻어진 이진 영상에 대하여 압축률을 높이기 위해 전처리를 수행한다. 단계 103에서는 현재 압축하고자 하는 이진 영상이 디더링 영상인지 에러확산 영상인지 체크하여 에러 확산 이진 영상인 경우 전처리를 한다(104). 전처리 과정방법에 대해 도 2에 도시하였다. 전처리 과정은 입력 스트림이 '0'에서 '1'로 '1'에서 '0'으로 바뀌는 지점에서는 '1'을 내보내고 이전 값과 계속 같은 값을 내보내는 경우에는 '0'을 내보내게 된다. 이러한 전처리가 필요한 이유는 에러확산 이진 영상의 경우 '010101....'과 같은 패턴이 자주 나오는데, 도 2에 나타낸 방법을 사용하여 전처리를 할 경우 모두 '11111...'로 변하게 되어 상관관계가 높은 새로운 데이터를 만들어 낼 수 있다. 단계 105에서는 '0'과 '1'의 반복횟수를 구하여 레코드를 생성한다. 글자와 그림이 혼재된 영상에서는 '0'또는 '1'이 연속적으로 길게 반복되지 않으므로 '0'과 '1'의 반복횟수에 많은 비트를 할당하면 비트 낭비가 생겨 압축률이 떨어지게 된다. 본 발명에서는 '0'과 '1'의 반복횟수를 최대 15번으로 제한하여 비트 손실을 최소화하였다. 본 발명에서는 '0'의 반복횟수 4비트와 '1'의 반복횟수 4비트를 합하여 8비트를 만드는데. 이러한 8비트 데이터 2개가 모여 1개의 레코드를 생성한다. 레코드의 크기는 2바이트로 제한하였는데, 이 또한 글자 그림 혼재 영상에서 레코드의 크기가 커지게 되면 같은 패턴을 가지는 레코드를 사전에서 찾기가 어려워지므로 2바이트로 제한하였다. 도 3에 레코드 생성 방법을 도시하였다. 106단계에서는 얻어진 레코드와 일치하는 레코드를 사전에서 찾는다. 일치하는 레코드를 찾지 못하였을 경우 단계 112에서는 마커 '0'과 2바이트의 레코드를 압축 데이터로 내보내고, 사전목록에 추가시킨다(113). 사전 목록 번호가 254에 도달하면 다시 목록 번호 2번부터 추가시킨다. 단계 107에서 일치하는 레코드를 사전에서 찾은 경우에는 단계 108에서 사전목록번호 값을 세어 사전 목록 번호에 대한 런렝쓰를 구하게 된다. 같은 사전 목록번호가 2회 이상 반복 되었는지 체크하여(109), 2회 이상인 경우 마커 '1'과 '0xFF' 그리고 반복된 사전 목록 번호와 반복횟수를 압축 데이터로 출력한다(110). 2회 이상이 아닌 경우에는 마커 '1'과 사전목록 번호만 압축 데이터로 내보내게 된다. 본 발명에서 단계 110은 앞단에서 '0'과 '1'의 반복회수와 레코드의 크기를 제한함으로써 나타날 수 있는 문제점을 보완한다. 즉, 이진 영상 데이터간 상관관계가 큰 글자 영상의 압축의 경우에는 '0'과 '1'의 반복횟수가 커질수록 압축률은 커지게 되는데 단계 110에서 그런 부분을 담당한다. 본 발명에서는 상관관계가 높은 이진 영상의 경우 최대 250 : 1의 압축률을 제공한다. 따라서 본 발명에서는 종래의 기술보다 글자영상에서도 압축률을 향상시켰고, 글자 그림 혼재 영상에서도 압축률을 향상시킬 수가 있다.1 shows a compression flow chart. First, the dictionary is initialized (101). In the present invention, in order to represent the dictionary list number in 8 bits, it has 253 dictionary list numbers from 2 to 254. 0, 1, and 255 are not included in the dictionary list number for use as markers. By using 0 and 1 as markers, bit loss is minimized. In step 102, it is checked whether the current input stream no longer exists, and terminates when no further input data exists. In the present invention, preprocessing is performed to increase the compression ratio on the binary image obtained by the error diffusion method. In step 103, if the binary image to be compressed is a dithering image or an error diffusion image, it is preprocessed if it is an error diffusion binary image (104). The pretreatment process method is illustrated in FIG. 2. The preprocessing will export '1' at the point where the input stream changes from '0' to '1' and from '1' to '0', or '0' if it keeps exporting the same value as the previous value. The reason for such preprocessing is that in case of error diffusion binary image, a pattern such as '010101 ....' is frequently appeared. When preprocessing using the method shown in FIG. Can generate new high data. In step 105, a record is generated by obtaining the number of repetitions of '0' and '1'. In a mixed image of letters and pictures, '0' or '1' does not repeat continuously long, so if a lot of bits are assigned to the number of repetitions of '0' and '1', the compression rate decreases because of bit waste. In the present invention, bit loss is minimized by limiting the number of repetitions of '0' and '1' to a maximum of 15 times. In the present invention, 8 bits are made by adding 4 bits of '0' and 4 bits of '1'. These two 8-bit data come together to create one record. The size of the record was limited to 2 bytes. In addition, when the size of the record increases in the mixed character picture image, the record having the same pattern becomes difficult to find in the dictionary, so it is limited to 2 bytes. 3 shows a record generation method. In step 106, the record matching the obtained record is found in the dictionary. If no matching record is found, in step 112, the marker '0' and the two-byte record are exported as compressed data and added to the dictionary list (113). When the dictionary list number reaches 254, add the list number 2 again. If a matching record is found in the dictionary in step 107, the value of the dictionary list number is counted in step 108 to obtain a run length for the dictionary list number. If the same dictionary list number is repeated two or more times (109), in the case of two or more times, the marker '1' and '0xFF' and the repeated dictionary list number and the number of repetitions are output as compressed data (110). If it is not more than two times, only the marker '1' and the dictionary list number are exported as compressed data. In the present invention, step 110 compensates for the problems that may occur by limiting the number of repetitions and the size of the records of '0' and '1' at the front. That is, in the case of compressing a character image having a large correlation between binary image data, as the number of repetitions of '0' and '1' increases, the compression ratio becomes large. The present invention provides a maximum compression ratio of 250: 1 for binary images with high correlation. Therefore, in the present invention, the compression ratio is improved in the text image, and the compression ratio is also improved in the mixed text image.

도 4는 영상 복원 흐름도이다. 먼저, 사전을 초기화하고(400), 1비트의 마커를 읽어 들인다(401). 마커가 1인지 0인지 체크하여(402), 0인 경우에는 사전에서 일치하는 레코드를 찾지 못한 경우이므로, 압축 데이터로부터 레코드를 읽어 들여 4비트씩 쪼갠다. 레코드의 크기는 2바이트이므로 각각의 4비트 값만큼 '0'과 '1'을 반복하여 복원데이터로 내보낸다. 그리고 나서 레코드를 사전에 추가시킨다(404). 단계 402에서 마커가 1인 경우에는 1바이트를 읽어 들여(403) 마커 0xFF인지 확인한다(405). 0xFF가 아닌 경우에는 사전 목록번호가 2회 미만 반복한 경우이므로 현재 1바이트 값에 해당하는 사전 목록 번호로부터 2바이트의 레코드를 얻는다. 그리고 나서 404단계와 마찬가지로 4바이트 단위로 쪼개어 '0'과 '1'을 반복하여 내보내어 복원데이터를 얻는다(407). 단계 405에서 0xFF인 경우에는 사전목록 번호가 2회이상 반복된 경우이므로 2바이트를 더 읽어 들여(406), 반복된 사전목록 값과 반복횟수를 얻는다. 반복횟수는 최대 255회 이므로 상관관계가 높은 이진 영상의 경우 최대 압축률을 향상시킨다. 408단계에서는 반복횟수만큼 목록값을 407단계와 같은 방법으로 반복하여 복원데이터를 생성하면 된다. 단계 409에서는 디더링(dithering)영상인지 에러확산 이진영상인지 체크하여 에러확산 영상인 경우 단계 410으로 진행하여 도 2에서 도시한 방법과 역으로 하여 최종 복원데이터를 출력하고, 디더영상인 경우에는 단계 411로 진행하여 도 2에서 도시한 방법과 역으로 하여 최종 복원데이터를 출력하게 된다. 그리고 단계 412에서는 복원데이터의 크기가 최종 복원데이터의 크기와 같은지 체크하여 같은 경우 영상 복원을 종료하게 된다.4 is a flowchart of image restoration. First, a dictionary is initialized (400), and a marker of 1 bit is read (401). If the marker is 1 or 0, it is checked (402). If it is 0, no matching record is found in the dictionary, and the record is read from the compressed data and divided into 4 bits. Since the size of the record is 2 bytes, '0' and '1' are repeatedly exported as reconstruction data for each 4-bit value. The record is then added to the dictionary (404). If the marker is 1 in step 402, one byte is read (403) to see if the marker is 0xFF (405). If it is not 0xFF, the dictionary list number is repeated less than two times, so a 2-byte record is obtained from the dictionary list number corresponding to the current 1-byte value. Then, as in step 404, the data is divided into 4 byte units, and the data are repeatedly exported to obtain '0' and '1' (407). In the case of 0xFF in step 405, since the dictionary list number is repeated two or more times, two more bytes are read (406) to obtain the repeated dictionary list value and the number of repetitions. The maximum number of repetitions is 255, which improves the maximum compression ratio for highly correlated binary images. In step 408, the list value may be repeated as many times as in step 407 to generate the restored data. In step 409, it is checked whether the image is a dithering image or an error diffusion binary image. In the case of the error diffusion image, the process proceeds to step 410 and the final reconstruction data is output in the reverse manner to the method shown in FIG. Proceeds to the reverse of the method shown in Figure 2 to output the final reconstruction data. In step 412, the restoration is terminated by checking whether the size of the restoration data is the same as the size of the final restoration data.

상술한 바와 같은 본 발명에서는 종래의 기술보다 글자 영상과 같은 영상 데이터간 상관관계가 높은 영상 뿐만 아니라 에러확산 방법으로 얻어진 글자와 그림이 혼재하는 복잡한 영상에서도 압축률을 개선시켰다. 본 발명에서의 압축 방법에서 앞 단에서는 글자와 그림이 혼재하는 복잡한 영상의 경우에 적용하기 위해 비트 손실을 줄이고, 레코드의 크기를 줄임으로써 일치하는 패턴의 레코드를 찾기가 쉽도록 하였다, 뒷 단에서는 영상데이터간에 상관관계가 높은 영상의 경우를 위해 사전목록 번호에 대한 런렝쓰를 구함으로써 압축률을 향상시켰다. 또한 에러확산 영상의 경우에 압축 효율을 증가시키기 위해 전처리를 함으로써 상관관계가 높아져 압축률이 향상된다. 도 5에서는 디더링 방법으로 얻어진 이진 영상에 대한 압축률 비교하였고, 도 6에서는 에로확산 방법으로 얻어진 이진 영상에 대한 압축률을 비교하여 도시하였다. 본 발명에서 제안한 압축 복원 방법은 압축 시간보다 복원 시간이 몇배 더 빠르므로 프린터내에 도안이나 폰트와 같은 영상을 저장하였다가 복원할 때 사용할 수 있으며, GDI 방식의 프린터에서도 이진영상 데이터 전송용으로도 사용가능하다.In the present invention as described above, the compression ratio is improved not only for the image having a higher correlation between image data such as a character image, but also for a complex image in which characters and pictures obtained by an error diffusion method are mixed. In the compression method of the present invention, it is easy to find a record with a matching pattern by reducing the bit loss and reducing the size of the record to apply to a complex image having a mixture of letters and pictures. The compression rate is improved by obtaining the run length for the dictionary list number for the case of the image with high correlation between the image data. In addition, in the case of error diffusion images, the correlation is increased by preprocessing to increase the compression efficiency, thereby improving the compression ratio. In FIG. 5, the compression ratios of the binary images obtained by the dithering method are compared. In FIG. 6, the compression ratios of the binary images obtained by the erotic diffusion method are compared. The decompression method proposed in the present invention can be used to store and restore images such as patterns and fonts in a printer because the restoration time is several times faster than the compression time, and can also be used for binary image data transmission in a GDI type printer. It is possible.

지금까지 본 발명의 실시예에 대하여 설명하였으나 본 발명은 이에 한정되는 것이 아니며, 명세서에 기재되고 청구된 원리의 진정한 정신 및 범위 안에서 수정 및 변경할 수 있는 여러 가지 실시 형태도 본 발명의 권리 보호범위에 속하는 것임을 이해하여야 할 것이다.Although the embodiments of the present invention have been described so far, the present invention is not limited thereto, and various embodiments which can be modified and changed within the true spirit and scope of the principles described and claimed are also included in the scope of protection of the present invention. It should be understood that it belongs.

Claims (10)

사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 압축하는 이진영상압축방법에 있어서,In the binary image compression method for compressing a binary image by searching for a record matching a current record using a dictionary, 0과 1의 반복횟수를 구하여 레코드를 생성함에 있어서, 0에 대한 반복횟수 n비트와 1에 대한 반복횟수 n비트를 결합한 2n비트를 이용하여 레코드를 생성하는 단계를 포함하는 이진영상압축방법.And generating a record by obtaining a repetition number of 0 and 1, and generating a record using 2n bits that combine n bits of 0 and n bits of 1 for repetition. 제1항에 있어서, 압축하고자 하는 영상이 디더링 영상인지 에러확산 영상인지 체크하는 단계, 및 에러확산 영상인 경우 전처리 하는 단계를 포함하는 이진영상압축방법.The binary image compression method of claim 1, further comprising: checking whether the image to be compressed is a dithering image or an error diffusion image, and preprocessing the error diffusion image. 제2항에 있어서, 상기 전처리단계는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '1'로 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '0'으로 표현하여 새로운 입력 데이터를 얻거나, 또는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '0'으로, 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '1'로 표현하여 새로운 입력 데이터를 얻는 단계임을 특징으로 하는 이진영상압축방법.3. The method of claim 2, wherein the preprocessing step is to obtain new input data by expressing a portion that changes from white to black and black to white as '1' or '0' in a section maintaining black. Or a step of obtaining new input data by expressing a portion that changes from white to black and black to white as '0' and '1' in a section where white is continuously maintained or black is maintained. 제1항 내지 제3항 중의 어느 한 항에 있어서, 사전에서 레코드를 검색하는 단계, 일치하는 레코드를 찾지 못했을 때 현재의 레코드를 출력하고 사전에 추가하는 단계, 일치하는 레코드를 찾았을 때 일치하는 레코드의 반복횟수를 계산하여, 반복횟수가 2이상인지 체크하는 단계, 반복홧수가 2이상인 경우 사전의 레퍼런스 값과 횟수를 출력하는 단계, 및 반복횟수가 2미만일 때 사전의 레퍼런스 값을 출력하는 단계를 더 포함하는 것을 특징으로 하는 이진영상압축방법.4. The method of any one of claims 1 to 3, further comprising: retrieving a record from a dictionary, outputting the current record and adding it to the dictionary when no matching record is found, and matching when a matching record is found. Calculating the number of repetitions of the record, checking if the number of repetitions is 2 or more, outputting a reference value and the number of dictionaries if the number of repetitions is 2 or more, and outputting a reference value of the dictionary if the number of repetitions is less than 2 Binary image compression method characterized in that it further comprises. 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 압축하는 이진영상압축장치에 있어서,In the binary image compression device for compressing a binary image by searching for a record matching the current record using a dictionary, 0과 1의 반복횟수를 구하여 레코드를 생성함에 있어서, 0에 대한 반복횟수 n비트와 1에 대한 반복횟수 n비트를 결합한 2n비트를 이용하여 레코드를 생성하는 압축부를 포함하는 이진영상압축장치.A binary image compression device comprising a compression unit for generating a record by obtaining a repetition number of 0 and 1 and generating a record by combining 2 n bits of repetition number n bits for 0 and n bits of repetition number for 1. 제5항에 있어서, 상기 압축부는 압축하고자 하는 영상이 디더링 영상인지 에러확산 영상인지 체크하는 단계, 및 에러확산 영상인 경우 전처리 하는 것을 특징으로 하는 이진영상압축장치.6. The binary image compression apparatus as claimed in claim 5, wherein the compression unit checks whether the image to be compressed is a dithering image or an error diffusion image, and preprocesses the error diffusion image. 제6항에 있어서, 상기 압축부는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '1'로 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '0'으로 표현하여 새로운 입력 데이터를 얻거나, 또는 화이트에서 블랙, 블랙에서 화이트로 바뀌어지는 부분을 '0'으로, 계속 화이트를 유지하거나 블랙을 유지하는 구간에서는 '1'로 표현하여 새로운 입력 데이터를 얻는 단계를 수행함을 특징으로 하는 이진영상압축장치.The method of claim 6, wherein the compression unit expresses a new portion of white to black, a portion changed from black to white to '1' to maintain white or to '0' in a period of maintaining black, or Binary image compression device, characterized in that the step of obtaining new input data by expressing the portion that changes from white to black and black to white as '0' and '1' in the period of maintaining white or black is maintained. . 제5항 내지 제7항 중의 어느 한 항에 있어서, 상기 압축부는 사전에서 레코드를 검색하고, 일치하는 레코드를 찾지 못했을 때 현재의 레코드를 출력하고 사전에 추가하고, 일치하는 레코드를 찾았을 때 일치하는 레코드의 반복횟수를 계산하여, 반복횟수가 2이상인지 체크하고, 반복홧수가 2이상인 경우 사전의 레퍼런스 값과 횟수를 출력하고, 및 반복횟수가 2미만일 때 사전의 레퍼런스 값을 출력함을 특징으로 하는 이진영상압축장치.8. The method according to any one of claims 5 to 7, wherein the compression unit searches for a record in the dictionary, outputs the current record and adds it to the dictionary when no matching record is found, and matches when a matching record is found. It calculates the number of repetitions of the records to check, checks if the number of repetitions is 2 or more, outputs the reference value and the number of the dictionary when the repetition number is 2 or more, and outputs the reference value when the repetition number is less than 2 Binary image compression device. 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 복원하는 이진영상복원방법에 있어서,In the binary image restoration method of restoring a binary image by searching for a record matching the current record using a dictionary, 수신된 이진영상의 1비트를 읽어 들여서 마커가 1인지 확인하는 단계;Checking whether the marker is 1 by reading 1 bit of the received binary image; 마커가 0인 경우 2바이트의 레코드를 읽어들여 사전에 추가하고 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 출력하는 단계;Reading the two-byte record to add it to the dictionary when the marker is zero, and splitting the record into four bits to output '0' and '1' by each value; 1인 경우 1바이트를 더 읽어들여 0xFF인지 확인하는 단계;If 1, reads one more byte and checks whether it is 0xFF; 0xFF가 아닌 경우 사전의 레퍼런스 값에 해당하는 레코드값을 찾아내어 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 반복하여 출력하는 단계;If it is not 0xFF, finding a record value corresponding to a reference value of a dictionary, dividing the record into 4 bits and repeatedly outputting '0' and '1' by each value; 0xFF인 경우 2바이트를 더 읽어들여서 첫번째 값을 사전의 레퍼런스 값으로 사용하여 두 번째 값을 반복횟수로 사용하여, 0xFF가 아닌 경우와 같은 방법으로 출력하는 단계;In the case of 0xFF, reading two more bytes, using the first value as a reference value of the dictionary, and using the second value as the number of repetitions, and outputting the same method as in the case of not 0xFF; 디더링영상인지 에러확산영상인지를 확인하는 단계;Checking whether the image is a dithering image or an error diffusion image; 에러확산영상인 경우 흑백 변환점을 검출하는 단계;Detecting a black and white conversion point in the case of an error diffusion image; 디더영상인 경우 압축해제된 데이터를 출력하는 단계; 및Outputting decompressed data in the case of a dither image; And 화일의 길이가 높이*폭이 될 때까지 상술한 단계 401-412를 반복하는 단계를 구비하는 이진영상복원방법.And repeating the above steps 401-412 until the file length becomes height * width. 사전을 이용하여 현재 레코드와 일치하는 레코드를 검색하여 이진 영상을 복원하는 이진영상복원장치에 있어서,In the binary image restoration apparatus for restoring a binary image by searching for a record matching the current record using a dictionary, 수신된 이진영상의 1비트를 읽어 들여서 마커가 1인지 확인하는 단계;Checking whether the marker is 1 by reading 1 bit of the received binary image; 마커가 0인 경우 2바이트의 레코드를 읽어들여 사전에 추가하고 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 출력하는 단계;Reading the two-byte record to add it to the dictionary when the marker is zero, and splitting the record into four bits to output '0' and '1' by each value; 1인 경우 1바이트를 더 읽어들여 0xFF인지 확인하는 단계;If 1, reads one more byte and checks whether it is 0xFF; 0xFF가 아닌 경우 사전의 레퍼런스 값에 해당하는 레코드값을 찾아내어 레코드를 4비트씩 쪼개어 각각의 값만큼 '0'과 '1'을 반복하여 출력하는 단계;If it is not 0xFF, finding a record value corresponding to a reference value of a dictionary, dividing the record into 4 bits and repeatedly outputting '0' and '1' by each value; 0xFF인 경우 2바이트를 더 읽어들여서 첫번째 값을 사전의 레퍼런스 값으로 사용하여 두 번째 값을 반복횟수로 사용하여, 0xFF가 아닌 경우와 같은 방법으로 출력하는 단계;In the case of 0xFF, reading two more bytes, using the first value as a reference value of the dictionary, and using the second value as the number of repetitions, and outputting the same method as in the case of not 0xFF; 디더링영상인지 에러확산영상인지를 확인하는 단계;Checking whether the image is a dithering image or an error diffusion image; 에러확산영상인 경우 흑백 변환점을 검출하는 단계;Detecting a black and white conversion point in the case of an error diffusion image; 디더영상인 경우 압축해제된 데이터를 출력하는 단계; 및Outputting decompressed data in the case of a dither image; And 화일의 길이가 높이*폭이 될 때까지 상술한 단계 401-412를 반복하는 단계를 통하여 수신된 이진영상을 복원하는 복원부를 포함하는 이진영상복원장치.And a restoring unit for restoring the received binary image by repeating the above steps 401-412 until the file length becomes height * width.
KR10-2002-0082381A 2002-12-23 2002-12-23 Method and apparatus for compressing and/or decompressing binary images KR100467620B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0082381A KR100467620B1 (en) 2002-12-23 2002-12-23 Method and apparatus for compressing and/or decompressing binary images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0082381A KR100467620B1 (en) 2002-12-23 2002-12-23 Method and apparatus for compressing and/or decompressing binary images

Publications (2)

Publication Number Publication Date
KR20040056405A KR20040056405A (en) 2004-07-01
KR100467620B1 true KR100467620B1 (en) 2005-01-24

Family

ID=37349095

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0082381A KR100467620B1 (en) 2002-12-23 2002-12-23 Method and apparatus for compressing and/or decompressing binary images

Country Status (1)

Country Link
KR (1) KR100467620B1 (en)

Also Published As

Publication number Publication date
KR20040056405A (en) 2004-07-01

Similar Documents

Publication Publication Date Title
US4814746A (en) Data compression method
US7079051B2 (en) In-place differential compression
US7539685B2 (en) Index key normalization
US7616138B2 (en) Data compression using a stream selector with edit-in-place capability for compressed data
US5229768A (en) Adaptive data compression system
US5374916A (en) Automatic electronic data type identification process
US5995118A (en) Data coding system and decoding circuit of compressed code
US7233266B2 (en) Data compression/decompression device and data compression/decompression method
US6664903B2 (en) Method, apparatus, computer program and storage medium for data compression
JP2003179501A (en) Data compression method
JPH11168390A (en) Data compression device, data restoration device, data compression method, data restoration method, preparation device for dictionary for data compression/ restoration and computer readable medium recording data compression program or data restoration program
Deorowicz Universal lossless data compression algorithms
EP0127815B1 (en) Data compression method
US7647291B2 (en) B-tree compression using normalized index keys
US20030184809A1 (en) Grayscale and binary image data compression
US6798914B1 (en) Neural-network-based method of image compression
US4972497A (en) Image coding system
US6112208A (en) Data compressing method and apparatus to generate bit maps in accordance with extracted data symbols
KR100467620B1 (en) Method and apparatus for compressing and/or decompressing binary images
US6104323A (en) Data compression apparatus for compensating a deviation of a compression rate
JP3265268B2 (en) String compression method
KR100462603B1 (en) Method and apparatus for compressing and decompressing image data
JP2003318739A (en) System and method for compressing data sequence, and computer readable medium
JP3283150B2 (en) Data compression / decompression method
FI115937B (en) Lossless data compression and decompression

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee