KR100279594B1 - How to enlarge and reduce binary image - Google Patents

How to enlarge and reduce binary image Download PDF

Info

Publication number
KR100279594B1
KR100279594B1 KR1019970038988A KR19970038988A KR100279594B1 KR 100279594 B1 KR100279594 B1 KR 100279594B1 KR 1019970038988 A KR1019970038988 A KR 1019970038988A KR 19970038988 A KR19970038988 A KR 19970038988A KR 100279594 B1 KR100279594 B1 KR 100279594B1
Authority
KR
South Korea
Prior art keywords
mask
value
data
outputting
image
Prior art date
Application number
KR1019970038988A
Other languages
Korean (ko)
Other versions
KR19990016437A (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 KR1019970038988A priority Critical patent/KR100279594B1/en
Publication of KR19990016437A publication Critical patent/KR19990016437A/en
Application granted granted Critical
Publication of KR100279594B1 publication Critical patent/KR100279594B1/en

Links

Images

Abstract

본 발명은 팩시밀리, 프린터와 같은 영상처리기에서 하프톤(halftone) 과정을 거친후 0과 1로 표현되는 바이너리 영상을 확대하거나 축소하는 기술에 관한 것으로, 영상처리속도를 개선하고 원가를 절감하기 위하여, 스케일 테이블 S(x)=[X*(Lout/Lin)], 테이블 값 T(x)=S(x+1)-S(x)로 각기 구하고, 그 T(x)에 따라 해당 픽셀 데이터 라인을 삭제하거나, 그대로 출력하거나, 두 번 출력하는 테이블 계산과정과; 비트열이 서로 대칭적으로 고정된 마스크값(MASK1), (MASK2)을 이용하여 마스크 출력 mask_out = (MASK1&pre_data)|(MASK2&data)을 결정하는 마스크 사용과정을 포함하여 이루어지도록 하였다.The present invention relates to a technology for enlarging or reducing binary images represented by 0s and 1s after a halftone process in an image processor such as a facsimile or printer, in order to improve image processing speed and reduce costs. Find the scale table S (x) = [X * (L out / L in )] and the table values T (x) = S (x + 1) -S (x), respectively. A table calculation process of deleting data lines, outputting them as they are, or outputting them twice; The mask sequence includes determining a mask output mask_out = (MASK1 & pre_data) | (MASK2 & data) using the mask values MASK1 and MASK2 in which the bit strings are symmetrically fixed to each other.

Description

바이너리 영상의 확대, 축소 방법How to enlarge and reduce binary image

본 발명은 팩시밀리, 프린터와 같은 영상처리기에서 하프톤(halftone) 과정을 거친후 0과 1로 표현되는 바이너리 영상을 확대하거나 축소하는 기술에 관한 것으로, 특히 하드웨어의 구현이 용이하고 처리속도를 향상시키기 위하여 축소/확대할 위치에 대한 테이블값을 계산할 때 확대/축소에 대한 계산을 병행하도록한 바이너리 영상의 확대, 축소 방법에 관한 것이다.The present invention relates to a technique for enlarging or reducing binary images represented by 0s and 1s after a halftone process in an image processor such as a facsimile or a printer. In particular, it is easy to implement hardware and improve processing speed. The present invention relates to a method for enlarging and reducing a binary image in which a calculation for zooming in / out is performed in parallel when calculating a table value for a zoom-out position.

통상적으로, 영상처리기에서 영상 데이터를 출력하기 위해 회색조(gray level)로 표현된 영상을 0과 1의 디지탈 값을 가진 영상(binary image)으로 변환하게 된다. 이렇게 바이너리 데이터로 표현된 영상을 출력할 때 프린트 용지의 크기나 프린트의 해상도 등 출력 환경에 알맞게 축소해야하는 경우가 발생된다.In general, an image processor converts an image expressed in gray levels into a binary image having digital values of 0 and 1, in order to output image data. When outputting an image represented by binary data, it may be necessary to reduce the size of the print paper to suit the output environment such as the size of the print paper or the print resolution.

이를 위해 바이너리 영상의 정보를 최대한 유지하면서 확대하거나 축소하는 종래기술에 의한 런렝스 스켈링(Run-Length Scaling) 방법을 설명하면 다음과 같다.To this end, the Run-Length Scaling method according to the prior art that enlarges or reduces while maintaining the information of the binary image to the maximum is as follows.

패턴 대응법이나 오차 확산법은 비트맵(BITMAP)으로 복화화된 데이터를 이용하여 출력 화상의 크기를 변환하기 때문에 MH, MR, MMR로 처리하는 팩시밀리에서는 효율적이지 못하다. 따라서, 복호와 과정에서 필연적으로 발생하는 런렝스 데이터를 이용하여 수평 해상도변환(Scaling)을 수행한 후, 수직 해상도변환을 수행하여 처리 속도가 향상되도록 하였다.The pattern correspondence method and the error diffusion method are not efficient in facsimile processing with MH, MR, and MMR because the size of the output image is converted by using the data decoded by bitmap (BITMAP). Therefore, after performing horizontal resolution conversion using run length data inevitably generated during decoding and processing, vertical resolution conversion is performed to improve processing speed.

먼저, 상기 수평 해당도변환 과정을 설명한다.First, the horizontal correspondence conversion process will be described.

MH, MR, MMR로 부호화된 데이터로 부터 런렝스 데이터를 얻고 이를 비트맵으로 변환하기 전에 스켈링을 한다. 이때, 미리 만들어 놓은 스케일 테이블을 이용하여 빠른 속도를 얻을 수 있으며, 그 스케일 테이블은 하기의 (수학식 1)을 이용하여 작성된다.Run-length data is obtained from the data encoded by MH, MR, and MMR, and then scaled before conversion to bitmap. At this time, a fast speed can be obtained using a previously created scale table, and the scale table is created by using Equation 1 below.

[수학식 1 ]Equation 1

Figure kpo00001
Figure kpo00001

여기서, x=1,2,...........,Lin Where x = 1,2, ..........., L in

상기에서 Lin은 입력라인의 화소(pixel)수, Lout은 출력라인의 화소수이고, [x]는 x를 넘지않는 최대 정수를 의미한다. 입력 런렝스시퀀스를 {Pn}, 출력 런렝스 시퀀스를 {Rn} 이라고 하면, Pn과 Rn사이에는 다음의 (수학식 2)와 같은 관계가 성립한다.Lin is the number of pixels in the input line, Lout is the number of pixels in the output line, and [x] is the maximum integer not exceeding x. If the input run length sequence is {P n } and the output run length sequence is {R n }, the following relationship is established between P n and R n .

[수학식 2][Equation 2]

Figure kpo00002
Figure kpo00002

여기서, n=1,2,...........,Nin Where n = 1,2, ..........., N in

여기서, Nin은 입력 런렝스 시퀀스의 크기이다. 이러한 스켈링은 일정 비율로 점을 제거하거나 복사하는 것과 동일한 작용을 한다.Where N in is the size of the input run length sequence. This scaling works the same as removing or copying points at a certain rate.

예를들어, Lin=5, Lout=7인 경우를 생각해 보자. S(0)에서 S(5)까지는 차례로 0,1,2,4,5,7의 값을 갖는다. 여기서, S(3)와 S(2), S(5)와 S(4)의 차이가 2인데, 이는 입력 라인의 셋째 화소와 다섯째 화소가 복사되는 것을 의미한다.For example, consider the case of Lin = 5 and Lout = 7. S (0) to S (5) in turn have values of 0,1,2,4,5,7. Here, the difference between S (3) and S (2), S (5) and S (4) is 2, which means that the third and fifth pixels of the input line are copied.

Lin=7, Lout=5인 경우에는 S(0)에서 S(7)까지 0,0,1,2,2,3,4,5의 값을 갖는다. 여기서, S(1)과 S(0), S(4)와 S(3)의 차이가 0인데, 이는 입력 라인의 첫째 화소와 넷째 화소가 삭제되는 것을 의미한다. 그러나, 이렇게 일정한 위치의 화소를 복사하거나 삭제하게 되면 특히 중간조로 처리된 영상에 대하여 눈에 거슬리는 세로줄이 나타날 수 있다. 이 현상은 변화비율이 100%에 근접할수록 심하게 나타난다. 이를 방지하기 위하여 복사나 삭제 위치가 다른 여러개의 스케일 테이블을 사용한다. 그러나, 메모리 크기의 제한이 있으므로 너무 많은 스케일 테이블을 사용하는 것은 바람직하지 않고 4개의 테이블을 이용하면 95%나 100% 정도의 변환에서도 양호한 화질을 얻을 수 있다. 4개의 스케일 테이블은 다음의 (수학식 3)과 같이 생성된다.In the case of Lin = 7 and Lout = 5, S (0) to S (7) have values of 0,0,1,2,2,3,4,5. Here, the difference between S (1) and S (0), S (4) and S (3) is 0, which means that the first pixel and the fourth pixel of the input line are deleted. However, copying or deleting pixels at a certain position may cause annoying vertical lines, particularly for the halftone image. This phenomenon is more severe as the rate of change approaches 100%. To avoid this, use multiple scale tables with different copy or delete locations. However, it is not preferable to use too many scale tables because of the limitation of the memory size. With four tables, good image quality can be obtained even at about 95% or 100% conversion. Four scale tables are generated as shown in Equation 3 below.

[수학식 3][Equation 3]

Figure kpo00003
Figure kpo00003

그런데, 변환비율이 150% 정도이거나 67% 정도인 경우에는 상기 (수학식 3)에서 S0(x) = S2(x)가 되므로 다음의 (수학식 4)으로 구해지는 3개의 스케일 테이블을 사용하는 것이 더 좋은 결과를 얻을 수 있다.However, when the conversion ratio is about 150% or about 67%, S 0 (x) = S 2 (x) in Equation (3) above, so three scale tables obtained by Equation (4) below are obtained. Using it will yield better results.

[수학식 4][Equation 4]

Figure kpo00004
Figure kpo00004

이렇게 생성한 스케일 테이블을 순차적으로 적용하더라도 속도에는 거의 영향이 없고, 단지 스케일 테이블을 위한 메모리만 할당하면 된다.Applying the scale table created in this way has little effect on speed, and only needs to allocate memory for the scale table.

그런데, 모든 팩시밀리가 흰 종이에 검은 색으로 문자나 그림을 표시하고, 특히 중간조로 처리된 영상에서는 개개의 점이 아니라 어떤 영역내의 흰 점과 검은 점의 개수와 그 분포 양식이 영상을 바라보는 사람의 눈에 영향을 끼치게 된다. 따라서, 단순히 검은 점과 흰 점의 비율을 똑같이 유지하는 것만으로는 부족하다고 할 수 있다.By the way, all facsimiles display letters or pictures in black on white paper, and especially in halftone processed images, the number of white and black dots in a certain area and their distribution patterns are not individual points, It will affect your eyes. Therefore, simply maintaining the same ratio of black and white points is not enough.

다양한 비율의 축소변환에 대한 실험 결과를 살펴보면 축소 영상이 원 영상보다 희미한 느낌을 주는데, 이는 실제 인쇄된 출력 영상에서 검은 점의 크기가 흰 점의 크기보다 크기 때문이다. 4×4 크기의 매트릭스가 2×2 크기의 매트릭스로 변환되는 50% 축소의 경우를 예로 하면, 홀수째 라인은 홀수째 화소가, 짝수째 라인은 짝수째 화소가 삭제되고, 후술한 수직변환에 의하여 제1도에서와 같이 변환된다.Experimental results show that the reduced image is faint than the original image because the size of the black dot is larger than the size of the white dot in the actual printed output image. In the case of 50% reduction in which a 4 × 4 matrix is converted into a 2 × 2 matrix, an odd-numbered line is deleted from an odd-numbered pixel, and an even-numbered line is deleted from an even-numbered pixel. Is converted as in FIG.

전체점의 개수에 대한 검은 점의 개수의 비는 원 영상이나 축소 영상이나 모두 0.5로 같지만, 전체 면적에 대한 검은 면적의 비는 서로 다르다. 왜냐하면, 레이저 프린터나 잉크젯 프린터에서 실제 검은 점의 모양은 상기 제1도에서와 같이 정사각형으로 표시되는 화소보다 큰 원형의 형태에 가깝기 때문이다. 정사각형의 한 변의 길이를 a, 원의 지름을 √2a라고 하면 원 영상에서 검은 면적의 비율은 다음과 같이 계산된다.The ratio of the number of black points to the total number of points is equal to 0.5 for both the original image and the reduced image, but the ratio of the black area to the total area is different. This is because, in a laser printer or an inkjet printer, the shape of the actual black spot is closer to the circular shape larger than the pixels displayed in the square as shown in FIG. If the length of one side of the square is a and the diameter of the circle is √2a, the ratio of the black area in the circle image is calculated as follows.

Figure kpo00005
Figure kpo00005

또한, 축소 영상에서 검은 면적의 비율은 다음과 같이 계산된다.In addition, the ratio of the black area in the reduced image is calculated as follows.

Figure kpo00006
Figure kpo00006

결국, 상기의 계산 결과에서와 같이 축소 영상이 원 영상보다 밝다는 것을 알 수 있다. 물론 이 차이는 검은 점의 분포 양식에 따라 달라지고, 경우에 따라서는 축소 영상이 더 어두워질 수도 있다.As a result, it can be seen that the reduced image is brighter than the original image as in the above calculation result. Of course, this difference depends on the distribution pattern of the black dots, and in some cases, the reduced image may be darker.

이를 보정해 주기 위해 스켈링을 할 때 검은 점을 보호하는 방법을 적용하면 보다 진한 결과를 얻을 수 있다. 즉, 검은 색에 해당하는 Rn의 값이 0이면 그 왼쪽 점을 검은 색으로 바꿈으로써 검은 점을 보호하는 효과를 얻을 수 있다. 실험 결과 축소의 경우에는 점을 강조하는 것이 더 좋은 느낌을 주었다.To compensate for this, you can achieve darker results by applying a method that protects black spots when scaling. That is, if the value of R n corresponding to black is 0, the left point is changed to black, thereby protecting the black point. In the case of reduction, emphasizing the point gave a better feeling.

이제, 2×2 크기의 매트릭스가 3×3 크기의 매트릭스로 변환되는 150%의 확대의 경우를 예를 들어보자. 이와 같은 경우 홀수째 라인은 홀수째 화소가, 짝수째 라인은 짝수째 화소가 복사되고, 다음 후술할 수직변환에 의하면 제2도와 같이 된다.Now let's take the case of 150% magnification, where a 2x2 matrix is transformed into a 3x3 matrix. In this case, odd-numbered lines are copied to odd-numbered pixels, even-numbered lines are copied to even-numbered pixels, and according to vertical conversion, which will be described later, as shown in FIG. 2.

축소의 경우와 마찬가지로 원 영상의 검은 면적의 비는 0.57이지만 확대 영상의 검은 면적의 비는 다음과 같이 계산된다.As in the case of the reduction, the ratio of the black area of the original image is 0.57, but the ratio of the black area of the enlarged image is calculated as follows.

Figure kpo00007
Figure kpo00007

따라서, 축소의 경우와는 반대로 확대 영상이 원 영상보다 어둡게 된다는 것을 알수 있다. 물론, 이 차이는 검은 점의 분포 양식에 따라 달라지며, 일반적으로 확대 영상이 더 밝아진다.Accordingly, it can be seen that the enlarged image is darker than the original image as opposed to the case of the reduced image. Of course, this difference depends on the distribution pattern of the black dots, and the magnified image is usually brighter.

이를 보정해주기 위해 검은 점보다 흰 점을 강조하면 보다 깨끗한 결과를 얻을 수 있다. 즉, 검은 점에 해당하는 Pn의 값이 문턱값(실험에서 32)보다 작고 Rn의 값이 Pn보다 크면 Rn의 값을 하나 줄임으로써 이러한 효과를 얻을 수 있다. 실험 결과 확대의 경우에는 흰 점을 강조하는 것이 더 깨끗한 느낌을 주었다.To correct this, emphasize white points rather than black ones for cleaner results. That is, the value of P n corresponding to the black dots is smaller than the threshold value (32 in the experiment), the value of R n can be obtained such an effect by one the value of R is greater than the n decreasing P n. Experimental results show that in the case of magnification, emphasizing the white point gives a cleaner feeling.

한편, 상기 수직 해상도변환 과정을 설명한다.Meanwhile, the vertical resolution conversion process will be described.

수직 해상도 변환은 수평 해상도 변환으로부터 얻은 비트맵을 이용하여 적절한 필터링을 통해 이루어지는데, 이때의 데이터는 수평 해상도 변환을 거친 비트맵 형식의 데이터이므로 바이트(byte) 단위로 처리함으로써 처리속도를 보다 빠르게 할 수 있다. 여기서는 속도 향상을 위해 두 개의 라인을 이용한 것을 예로하였으며, 이를 C 언어로 표현하면 다음과 같다.The vertical resolution conversion is done through proper filtering using the bitmap obtained from the horizontal resolution conversion. In this case, the data is in bitmap format after the horizontal resolution conversion. Can be. In this example, two lines are used to improve the speed, and they are expressed in C as follows.

[수학식 5][Equation 5]

New_line=(Upper_line&Mask1)|(Lower_line&Mask2);New_line = (Upper_line & Mask1) | (Lower_line &Mask2);

여기서, New_line, Upper_line, Lower_line은 무부호 정수(unsigned int)형의 변수이고, Mask1과 Mask2는 다음의 (수학식 6)을 만족하는 가능한한 불규칙적인 특성을 갖는 적절한 값이다.Here, New_line, Upper_line, and Lower_line are variables of unsigned int type, and Mask1 and Mask2 are appropriate values with possible irregularities satisfying the following Equation (6).

[수학식 6][Equation 6]

(Mask1 | Mask2)=OxFFFFFFFF(Mask1 | Mask2) = OxFFFFFFFF

문자 영상에 대해서는 Mask1과 Mask2의 값이 별다른 영향을 끼치지 않지만, 중간조로 처리된 그림 영상에 대해서는 검은 점의 분포 양식이 중요한 의미를 갖기 때문에 마스크의 값이 큰 영향을 끼친다. 실험 결과 Ox6B3696D9과 Ox96D96B36이 비교적 좋은 특성을 나타냈고, Ox5555555와 OxAAAAAAAA는 오차 확산으로 처리된 중간조 영상에 대해서는 원 영상 자체가 불규칙적인 특성을 가지므로 비교적 좋은 결과를 나타냈지만 디더링(dithering)으로 처리된 중간조 영상에 대해 눈에 거슬릴 정도로 상당히 나쁜 결과를 나타내었다.The value of Mask1 and Mask2 does not have much influence on the text image, but the value of mask has a big influence on the picture image processed by halftone because the distribution pattern of black dots is important. Experimental results showed that Ox6B3696D9 and Ox96D96B36 showed relatively good characteristics, and Ox5555555 and OxAAAAAAAA showed good results because the original image itself had irregular characteristics for halftone images processed by error diffusion, but it was treated by dithering. The results were quite bad for the halftone image.

상기 (수학식 6)을 만족해야하는 이유는 두 개의 검은 라인으로부터 완전한 검은 라인을 만들어야 하기 때문이고, 흰 종이에 검은 색으로 인쇄되기 때문에 검은 점이 흰 점보다 상대적으로 중요한 의미를 지니므로 1의 값을 갖는 비트가 0의 값을 갖는 비트보다 약간 많아야 좋다. Ox6B3696D9의 1의 값을 갖는 비트의 수는 18, 0의 값을 갖는 비트의 수는 14이다.The reason for satisfying Equation (6) is to make a complete black line from two black lines, and because the black point is printed in black on white paper, the black point is more important than the white point. The number of bits to have is slightly more than the bit with a value of zero. The number of bits having a value of 1 of Ox6B3696D9 is 18 and the number of bits having a value of 0 is 14.

상기 (수학식 5)의 방법보다 규칙성을 줄이고, 보다 양호한 결과를 얻기 위하여 다음과 같이 테이블을 이용할 수 있다.In order to reduce regularity and obtain better results than the method of Equation 5, the table can be used as follows.

[수학식 7][Equation 7]

New_line=Mask_table1[Upper_line]|Mask_table2[Lower_line];New_line = Mask_table1 [Upper_line] | Mask_table2 [Lower_line];

여기서, New_line, Upper_line, Lower_line은 테이블 크기를 고려한 unsigned char형의 변수이고, Mask_table1[]과 Mask_table2[]는 특히 중간조 패턴에 잘 대응되도록 정해진 배열이다. 즉, 1과 0의 변화가 작은 값(OxOF, OxEO, OxFF)에 대해서는 문자일 가능성이 높으므로 검은 점의 분포 양식이 비슷하도록 테이블의 값을 정하고, 변화가 큰 값(Ox54, OxAB 등)에 대해서는 그림일 가능성이 높으므로 검은 점의 분포 양식이 불규칙적으로 되도록 테이블의 값을 정한다. 물론, 이 경우에도 하기의 (수학식 8)을 만족하여야 하며, 실험결과 이 방법이 가장 우수한 특성을 나타내었다.Here, New_line, Upper_line, and Lower_line are variables of unsigned char type in consideration of the table size, and Mask_table1 [] and Mask_table2 [] are particularly arranged to correspond to the halftone pattern. In other words, for small values (OxOF, OxEO, OxFF) with small changes of 1 and 0, the values in the table should be determined so that the black dot distribution pattern is similar, and for larger values (Ox54, OxAB, etc.) Since it is most likely to be a picture, determine the values in the table so that the black dot distribution pattern becomes irregular. Of course, even in this case, the following Equation 8 should be satisfied, and the experimental results showed that the method showed the best characteristics.

[수학식 8][Equation 8]

Mask_table1[OxFF]|Mask_table2[OxFF]Mask_table1 [OxFF] | Mask_table2 [OxFF]

확대의 경우에는 새로운 새로운 라인을 두 라인 사이에 삽입하고, 축소의 경우에는 두 라인 대신에 새로운 라인만큼 출력하면 된다. 삽입할 위치나 삭제할 위치는 다음과 같이 결정된다.In the case of zooming in, a new new line is inserted between two lines. In case of zooming out, new lines are printed instead of two lines. The position to insert or delete is determined as follows.

입력 라인수와 출력 라인수의 비를 x:y라고 하면(단, x와 y는 자연수) 축소 확대에 관계없이 소정의 알고리듬을 통해 수직변환 테이블 Vn을 만든다. 여기서, x와 y는 자연수이므로 L과 S는 0이 될 수 없다. 수평변환을 위한 스케일 테이블에서 S(n)-S(n-1)≠1일 때 삭제나 삽입이 이루어지듯이, Vn=0일 때 확대의 경우는 삽입, 축소의 경우는 삭제가 이루어진다.If the ratio of the number of input lines to the number of output lines is x: y (where x and y are natural numbers), the vertical conversion table V n is generated through a predetermined algorithm regardless of the reduction and enlargement. Here, x and y are natural numbers, so L and S cannot be zero. In the scale table for horizontal transformation, deletion or insertion is performed when S (n) -S (n-1) ≠ 1, and when V n = 0, insertion is performed when zooming in or zooming out when V n = 0.

현재 처리중인 입력 라인 카운터를 i, 출력 라인 카운터를 j이라고 하자, 먼저, 확대의 경우를 살펴보면, V[(j-1) mod L]이 0인 경우가 삽입할 위치이므로, (i-1)번째 라인과 i번째 라인으로 만들어진 새로운 라인을 출력하고, 출력 라인 카운터는 하나 증가시키고 입력 라인 카운터는 증가시키지 않는다. 축소의 경우는 V[(i-1) mod L]이 0인 경우가 삭제할 위치이므로, i번째 라인과 (i+1)번째 라인을 이용하여 새로운 라인을 만들어 (i+1)번째 라인을 대체하고, 출력 라인 카운터는 증가시키지 않고 입력 라인 카운터만 하나 증가시킨다. 이 방법은 50% 미만이나 200% 초과의 변환에도 적용이 가능하다.Let the input line counter currently being processed i be the j, and the output line counter be j. First of all, when the zooming is performed, the case where V [(j-1) mod L] is 0 is the position to insert, so (i-1) Outputs a new line consisting of the first and ith lines, increments the output line counter by one, and does not increment the input line counter. In case of reduction, since V [(i-1) mod L] is 0, it is the position to delete, so make a new line using the i-th line and (i + 1) th line to replace the (i + 1) th line. It increments only one input line counter without increasing the output line counter. This method is applicable to conversions below 50% but above 200%.

그러나, 이와 같은 종래의 바이너리 영상 확대, 축소방법에 있어서는 확대 또는 축소를 위한 영상처리 이전에 마스크 테이블을 만들어 주어야 하므로 그에 따라 영상 처리속도가 늦어지게 되는 단점이 있고, 영상 처리를 위해 많은 용량의 메모리를 필요로 하기 때문에 이에 의해 원가가 상승되는 결함이 있었다.However, in the conventional binary image enlargement and reduction method, since a mask table must be made before image processing for enlargement or reduction, image processing speed is slowed accordingly, and a large amount of memory is used for image processing. Because of this, there is a defect that the cost is increased by this.

따라서, 본 발명이 이루고자하는 기술적 과제는 가우스(Gauss) 함수를 사용하여 어느 위치에서 바이너리 영상을 확대할 것인지 또는 축소할 것인지에 대한 테이블을 계산해 내고, 테이블 작성과 병행하여 확대, 축소 계산을 할 수 있는 바이너리 영상의 확대, 축소 방법을 제공함에 있다.Therefore, the technical problem to be achieved by the present invention is to calculate a table for which position to enlarge or reduce the binary image using the Gauss (Gauss) function, and to calculate the enlargement and reduction in parallel with the table creation The present invention provides a method of enlarging and reducing binary images.

제1도는 종래 기술에 의한 영상의 50% 축소 예시도.1 is an exemplary diagram of 50% reduction of an image according to the prior art.

제2도는 종래 기술에 의한 영상의 150% 확대 예시도.Figure 2 is an exemplary view of 150% magnification of the image according to the prior art.

제3도는 종래 기술에 의한 마스크 사용 예시도.3 is an exemplary view of using a mask according to the prior art.

제4도는 본 발명에 의한 바이너리 영상의 확대, 축소 방법의 신호 흐름도.4 is a signal flowchart of a method of enlarging and reducing a binary image according to the present invention.

제5도는 본 발명에 의한 확대, 축소 테이블의 계산 예시도.5 is an exemplary calculation diagram of an enlargement and reduction table according to the present invention.

제6도는 본 발명에 의한 마스크 사용 예시도.6 is an exemplary mask use according to the present invention.

제7도는 본 발명에 의한 마스크 출력 예시표.7 is a mask output example table according to the present invention.

제8(a)도는 원영상, (b)도는 본 발명에 의해 1.5배 확대 처리된 영상.8 (a) is the original image, (b) is a 1.5 times magnified image according to the present invention.

본 발명의 목적을 달성하기 위한 본 발명 바이너리 영상의 확대, 축소 방법은 스케일 테이블 S(x)=[X*(Lout/Lin)], 테이블 값 T(x) = S(x+1)-S(x)로 각기 구하고, 그 T(x)에 따라 해당 픽셀 데이터 라인을 삭제하거나, 그대로 출력하거나, 두 번 출력하는 테이블 계산과정과; 마스크 출력 mask_out = (MASK1&pre_data)|(MARK2&data)을 결정하는 마스크 사용과정을 포함하여 이루어지는 것으로, 이와 같이 이루어진 본 발명의 작용을 첨부한 제4도 내지 제8도를 참조하여 상세히 설명하면 다음과 같다.In order to achieve the object of the present invention, a method of enlarging and reducing the binary image of the present invention includes a scale table S (x) = [X * (L out / L in )], and a table value T (x) = S (x + 1). A table calculation step of obtaining each of S-x and deleting the corresponding pixel data line, outputting it as it is, or outputting twice according to the T (x); The mask output mask_out = (MASK1 & pre_data) | (MARK2 & data) includes a process of using a mask, which will be described in detail with reference to FIGS. 4 to 8 attached to the operation of the present invention.

바이너리 영상을 확대하거나 축소할 때, 가우스 함수를 사용하여 어느 자리에서 확대, 축소를 할 것인지에 대한 테이블을 작성하고, 이와 병행하여 확대, 축소 계산을 할 수 있는 알고리즘으로 수신 확대, 축소 모듈을 구현하는데, 그 가우스 함수를 이용하여 테이블을 계산할 때 다음의 (수학식 9)를 이용한다.When zooming in or out of a binary image, a table of where to zoom in and out is created by using a Gaussian function, and in parallel, an algorithm for implementing zoom in and zoom out is implemented. When calculating a table using the Gaussian function, the following equation (9) is used.

[수학식 9][Equation 9]

S(x) = [X*(Lout/Lin)]S (x) = [X * (L out / L in )]

상기 (수학식 9)에서 Lout은 출력 라인의 수이고, Lin은 입력 라인의 수이다. 따라서, Lout/Lin의 값은 확대, 축소를 결정하는 값(Scale)이 된다. 그리고, x는 0에서 입력 라인의 수까지 변하는 변수이다.In Equation (9), L out is the number of output lines, and L in is the number of input lines. Therefore, the value of L out / L in is a value (Scale) that determines the expansion and contraction. X is a variable that varies from 0 to the number of input lines.

상기 (수학식 9)에서 S(x)를 구하고 난 후, 테이블은 S(x+1)-S(x)라는 식으로 구하게 된다. 이렇게 계산된 테이블 값을 T(x)라 하면, T(x)는 2배 이하의 확대일 경우, 1이나 2의 값만을 가지게 되고, 1/2배 이상의 축소일 경우, T(x)는 0이나 1의 값을 갖게 된다.After obtaining S (x) in Equation (9), the table is obtained as S (x + 1) -S (x). If the calculated table value is T (x), T (x) has a value of 1 or 2 when the magnification is 2 times or less, and T (x) is 0 when the magnification is 1/2 or more times. Or a value of 1.

이 결과 값을 가지고 테이블의 값이 0인 경우, 해당하는 그 픽셀이나 라인은 삭제하고, 그 값이 1인 경우에는 픽셀이나 라인을 그대로 출력하면 되며, 값이 2인 경우에는 두 번 출력하는 방법으로 확대, 축소를 계산한다.If the result value is 0 and the table value is 0, the corresponding pixel or line is deleted. If the value is 1, the pixel or line is output as it is. If the value is 2, the method is output twice. Calculate zoom in, zoom out.

어느 자리에서 확대, 축소할 것인지에 대한 테이블을 가우스 함수로 계산하고, 다시 테이블 계산을 위해 빼기 연산을 하는 경우에는 각 라인마다 일정 시간과 테이블 값 저장을 위한 메모리가 필요하게 된다. 이러한 단점을 해결하기 위하여 정수값을 상위 비트로 두고, 소수점 이하의 값을 하위 비트로 할당하여 정수 값을 테이블로 사용하고, 나머지 값으로 다시 더하기 연산을 하며, 다시 그 결과 값 중에서 정수 부분(상위 비트)을 테이블 값으로 사용하는 방법을 사용한다. 이와 같은 식으로 계산을 하면 기존의 방법에서 계산한 테이블 값과 동일한 결과를 도출해 낼 수 있다.If you calculate a table about where to zoom in or out by using a Gaussian function and then subtract to calculate the table, each line requires a certain amount of time and memory for storing table values. To solve this problem, the integer value is set as the upper bit, the value below the decimal point is assigned as the lower bit, the integer value is used as a table, the addition operation is performed again with the remaining value, and the integer part (high bit) of the result value Is used as a table value. Calculating in this way can produce the same result as the table value calculated by the conventional method.

제5도는 스케일이 1.66인 경우 본 발명에 의한 테이블 계산 예를 보인 것이다.5 shows an example of calculating a table according to the present invention when the scale is 1.66.

상기와 같이 계산을 하면 구현이 간단할 뿐만 아니라, 각 화소값을 읽어 들일 때마다 해당하는 테이블 값을 계산할 수 있으므로 실시간 구현이 용이해 진다. 스케일이나 나머지 부분의 각 비트(bit)는 확대, 축소의 해상도(resolution)에 따라 적당한 비트 수를 할당하면 하드웨어로의 구현이 용이해 진다.The calculation as described above is not only easy to implement, but also the corresponding table value can be calculated for each pixel value, thereby facilitating real-time implementation. Each bit of the scale or the remainder is easily implemented in hardware by allocating an appropriate number of bits according to the resolution of scaling up and down.

한편, 본 발명에서 제안하는 간단한 설계를 위한 마스크 사용방법에 대해 설명한다.Meanwhile, a method of using a mask for a simple design proposed by the present invention will be described.

버퍼에 있는 이전의 데이터를 pre_data라 하면, 하기의 (수학식 10)에 의해 출력이 결정된다.If the previous data in the buffer is called pre_data, the output is determined by Equation 10 below.

[수학식 10][Equation 10]

mask_out = (MASK1&pre_data)|(MASK2&data)mask_out = (MASK1 & pre_data) | (MASK2 & data)

이와 같은 방법으로 마스크를 설계하면 pre_data에 해당하는 1화소의 버퍼만으로 설계를 구현할 수 있으므로 간단한 하드웨어 설계가 가능해 진다. 이때의 마스크(MASK1)와 마스크(MASK2)의 값은 다음과 같은 고정된 값을 사용하여 설계한다.If the mask is designed in this way, the design can be implemented using only one pixel buffer corresponding to pre_data, which enables simple hardware design. The masks MASK1 and MASK2 at this time are designed using the following fixed values.

MASK1 : 0x55555555 (Bin : 01010101010101010101010101010101)MASK1: 0x55555555 (Bin: 01010101010101010101010101010101)

MASK2 : 0xAAAAAAAA (Bin : 10101010101010101010101010101010)MASK2: 0xAAAAAAAA (Bin: 10101010101010101010101010101010)

이 마스크(MASK1), (MASK2)들을 사용하면 실제 구현에서는 “0”과 “1”의 마스크 데이터를 번갈아 가면서 사용하면 되므로, 가로 방향으로 마스크를 사용하던 기존의 설계를 수정하여, 세로 방향으로 마스킹의 적용이 가능하다. 마스크를 적용하는 이유는 동일 패턴의 방지를 위한 것이므로 가로 마스크와 세로 마스크는 동일한 효과를 나타낸다.If these masks (MASK1) and (MASK2) are used, in the actual implementation, the mask data of "0" and "1" may be used alternately, thus modifying the existing design that used the mask in the horizontal direction and masking in the vertical direction. It is possible to apply. The reason for applying the mask is to prevent the same pattern, so the horizontal mask and the vertical mask have the same effect.

제6도에서와 같이, 각 라인마다 마스크가 바뀌어 들어가므로 라인이 중복되어 발생되는 패턴을 방지할 수 있다. 이때, 세로 방향으로의 확대, 축소는 테이블 값에 따라 테이블 값이 2이면 동일한 라인에 대한 중복 패턴을 없애기 위하여 마스크를 달리하면서 다시 처리한다.As shown in FIG. 6, since the mask is changed for each line, a pattern generated by overlapping lines can be prevented. In this case, when the table value is 2 according to the table value, the enlargement and reduction in the vertical direction is processed again while the mask is changed to remove the overlap pattern for the same line.

예로써, data = 0001111For example, data = 0001111

mask = 0101010mask = 0101010

이라고 할 때, 출력(output)은 제7도와 같이 나타난다., The output appears as shown in FIG.

즉, 테이블 값이 1인 경우 입력 데이터를 그대로 출력하고, 테이블 값이 2인 경우에는 그 전 화소값과 각자의 마스크 결과를 출력한 후, 현재 화소를 출력하는 방식으로 확대를 하는 것이다. 축소의 경우에도 동일한 방식으로 삭제되는 화소값과 다음 화소값을 마스크하여 축소하는 것으로 구현하면 된다.That is, when the table value is 1, the input data is output as it is, and when the table value is 2, the previous pixel value and the respective mask result are output, and then the current pixel is enlarged. In the case of the reduction, the pixel value to be deleted and the next pixel value are masked and reduced.

참고로 제8(a)도는 원래의 영상(ED, 256×256)을 보인 것이고, 제8(b)도는 그 원래 영상을 본 발명에 의하여 1.5배로 확대한 영상을 보인 것이다.For reference, FIG. 8 (a) shows the original image (ED, 256 × 256), and FIG. 8 (b) shows the original image magnified 1.5 times by the present invention.

이상에서 상세히 설명한 바와 같이, 본 발명은 가우스 함수를 사용하여 어느 위치에서 바이너리 영상을 확대할 것인지 또는 축소할 것인지에 대한 테이블을 계산해내고, 테이블 작성과 병행하여 확대, 축소 계산을 할 수 있게 함으로써 처리속도가 향상되고, 원가가 절감되는 효과가 있다.As described in detail above, the present invention uses a Gaussian function to calculate a table at which position to enlarge or reduce the binary image, and to perform the enlargement and reduction calculation in parallel with the table creation. Is improved and the cost is reduced.

Claims (3)

하프톤 과정이 수행된 바이너리 영상의 축소, 확대 방법에 있어서, 스케일 테이블 S(x), 테이블 값 T(x)를 하기의 식으로 각기 구하고, 그 T(x)에 따라 해당 픽셀 데이터 라인을 삭제하거나, 그대로 출력하거나, 두 번 출력하는 테이블 계산과정과; 비트열이 서로 대칭적이고 고정된 값을 갖는 마스크(MASK1), (MASK2)을 이용하여 마스크 출력(mask_out)을 하기의 식으로 결정하는 마스크 사용과정을 포함하여 이루어지는 것을 특징으로 하는 바이너리 영상의 확대, 축소 방법.In the binary image reduction and enlargement method in which the halftone process is performed, the scale table S (x) and the table value T (x) are obtained by the following equation, and the corresponding pixel data line is deleted according to the T (x). A table calculation process of outputting the data as it is, or outputting it twice; A magnification of a binary image comprising a mask use process of determining a mask output (mask_out) using the masks MASK1 and MASK2 having bit values symmetrical and fixed to each other, How to shrink. S(x) = [x*(Lout/Lin)]S (x) = [x * (L out / L in )] T(x) = S(x+1)-S(x)로T (x) = S (x + 1) -S (x) mask_out = (MASK1&pre_data)|(MASK2&data)mask_out = (MASK1 & pre_data) | (MASK2 & data) 여기서, Lout: 출력라인 수Where L out : Number of output lines Lin: 입력라인 수L in : Number of input lines X*: 정수X * : integer pre_data : 이전 데이터pre_data: previous data 제1항에 있어서, 테이블 계산과정은 정수 값을 상위 비트로, 소수점 이하의 값을 하위 비트로 각기 할당하여 정수 값을 테이블로 사용하는 단게와, 나머지 값으로 다시 더하기 연산을 하여 그 결과 값 중에서 정수 부분을 테이블 값으로 사용하는 단계를 포함하여 이루어지는 것을 특징으로 하는 바이너리 영상의 확대, 축소 방법.The method of claim 1, wherein the table calculation process uses an integer value as an upper bit, a value below the decimal point as a lower bit, and uses an integer value as a table, and adds to the remaining values to perform an integer part. And using a table as a table value. 제1항에 있어서, 마스크 사용과정은 테이블값이 1인 경우 입력 데이타를 그대로 출력하고, 2인 경우 그 전 화소값과 각자의 마스크 결과를 출력한 후 현재 화소를 출력하는 단계를 포함하여 이루어지는 것을 특징으로 하는 바이너리 영상의 확대, 축소 방법.The method of claim 1, wherein the mask use process comprises outputting the input data as it is when the table value is 1, and outputting the current pixel after outputting the previous pixel value and the respective mask result when the table value is 2. A method of enlarging or reducing a binary image.
KR1019970038988A 1997-08-14 1997-08-14 How to enlarge and reduce binary image KR100279594B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019970038988A KR100279594B1 (en) 1997-08-14 1997-08-14 How to enlarge and reduce binary image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019970038988A KR100279594B1 (en) 1997-08-14 1997-08-14 How to enlarge and reduce binary image

Publications (2)

Publication Number Publication Date
KR19990016437A KR19990016437A (en) 1999-03-05
KR100279594B1 true KR100279594B1 (en) 2001-02-01

Family

ID=66000515

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019970038988A KR100279594B1 (en) 1997-08-14 1997-08-14 How to enlarge and reduce binary image

Country Status (1)

Country Link
KR (1) KR100279594B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100657343B1 (en) * 2005-10-19 2006-12-14 삼성전자주식회사 Apparatus and method for processing image

Also Published As

Publication number Publication date
KR19990016437A (en) 1999-03-05

Similar Documents

Publication Publication Date Title
US5483351A (en) Dilation of images without resolution conversion to compensate for printer characteristics
EP0650287A2 (en) Image processing method and apparatus
JPS6342902B2 (en)
JPH056438A (en) Method of correcting image displayed by printer or display unit and device for correcting output from printer or display unit generating digitized image by dot matrix format
JPH03193472A (en) Highly definite image generating system of image processor
US5410615A (en) Bitmap image resolution converter compensating for write-white xerographic laser printing
US5956470A (en) Text quality enhancement via resolution enhancement technique based on separating jaggedness detection and filtering
JPH07131634A (en) Image processor
JP3844808B2 (en) Coding method for delayed anti-aliasing
KR100279594B1 (en) How to enlarge and reduce binary image
JPH0818790A (en) Compression system for half tone image
JP4050382B2 (en) Multi-value image smoothing apparatus and image forming apparatus
JP3346051B2 (en) Image processing device
JP3669081B2 (en) Image processing device
JPH01312671A (en) Picture processor
JP2831573B2 (en) Pseudo halftone image processing system
JP2915700B2 (en) Image processing method and apparatus
JPS59204378A (en) Image processor
JPH0364166A (en) Picture processing unit
JPH05342340A (en) Method for picture processing and device therefor
JP3589415B2 (en) Image processing device
JPS6335071A (en) Variable power method
JPH05110854A (en) Picture processing method and device
JPH08297739A (en) Picture processor and method therefor
JPS61123272A (en) Intermediate tone picture data converting system

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20040923

Year of fee payment: 5

LAPS Lapse due to unpaid annual fee