JP2020098497A - Image processing method, image processing program, and image processing device - Google Patents

Image processing method, image processing program, and image processing device Download PDF

Info

Publication number
JP2020098497A
JP2020098497A JP2018236696A JP2018236696A JP2020098497A JP 2020098497 A JP2020098497 A JP 2020098497A JP 2018236696 A JP2018236696 A JP 2018236696A JP 2018236696 A JP2018236696 A JP 2018236696A JP 2020098497 A JP2020098497 A JP 2020098497A
Authority
JP
Japan
Prior art keywords
pixel
edge
internal
pixels
adjacent
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.)
Pending
Application number
JP2018236696A
Other languages
Japanese (ja)
Inventor
自広 山谷
Yorihiro Yamatani
自広 山谷
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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2018236696A priority Critical patent/JP2020098497A/en
Publication of JP2020098497A publication Critical patent/JP2020098497A/en
Pending legal-status Critical Current

Links

Landscapes

  • Record Information Processing For Printing (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Analysis (AREA)

Abstract

To provide an image processing method which enables appropriate and high speed thinning processing.SOLUTION: An image processing method includes: scanning image data in a predetermined direction in an image based on the image data and detecting an edge pixel pair of an object; imparting attribute of an internal edge to the pixel forming the contour of the object and imparting attribute of an external edge to a pixel adjacent to the internal edge outside the object; imparting attribute of an internal non-edge to the pixel determined to be the pixel inside the object on the basis of a positional relationship between the internal edge pixel and the outer edge pixel; and, when determining the internal edge pixel as an attraction pixel, determining whether or not to replace a pixel value of the attraction pixel with a pixel value of the pixel adjacent in a direction opposite the predetermined direction with respect to the attraction pixel, on the basis of the total number of the internal edge pixel and the internal non-edge pixel in an adjacent pixel adjacent to the attraction pixel and the positional relationship therebetween.SELECTED DRAWING: Figure 10

Description

本発明は、画像処理方法、画像処理プログラム、および画像処理装置に関する。 The present invention relates to an image processing method, an image processing program, and an image processing device.

スキャナーによりスキャンされた原稿の文字画像がスキャナー特性により太くなってしまうことがある。また、電子写真方式の画像形成装置は、ドットゲインが比較的大きいため、記録媒体上で文字画像が太く形成されてしまうことがある。このような場合に対応して一般的に行われる画像処理の一つとして、細線化処理が知られている。 The character image of the document scanned by the scanner may become thick due to the scanner characteristics. Further, since the electrophotographic image forming apparatus has a relatively large dot gain, the character image may be formed thick on the recording medium. A thinning process is known as one of the image processes generally performed in such a case.

細線化処理に関連し、下記特許文献1には次の技術が知られている。画像データに基づいて文字または線画の輪郭領域を抽出するとともに、画像データに基づいて細線構造を有する領域を検出する。そして、輪郭領域から細線構造を有する領域を除いた修正領域に対し、画素値の入力レベルに基づいて出力レベルを調整する細線化処理を行うことで、細線化処理による細線の消失を防止する。 The following technique is known in Japanese Patent Application Laid-Open No. 2004-242242 related to the thinning process. A contour area of a character or a line drawing is extracted based on the image data, and an area having a fine line structure is detected based on the image data. Then, thinning processing for adjusting the output level based on the input level of the pixel value is performed on the modified area excluding the area having the thin line structure from the contour area, thereby preventing the thin line from disappearing due to the thinning processing.

特願2005−341249号公報Japanese Patent Application No. 2005-341249

しかし、特許文献1に開示された技術は、2、3画素以下の線幅を有する細線構造の領域を検出して細線化処理の対象から除外する必要があるため、細線化処理が複雑化し、細線化処理の高速化が比較的困難であるという問題がある。 However, in the technique disclosed in Patent Document 1, it is necessary to detect a region having a thin line structure having a line width of 2 or 3 pixels or less and exclude the region from the target of the thinning process, which makes the thinning process complicated, There is a problem that it is relatively difficult to speed up the thinning process.

本発明は、このような問題を解決するためになされたものである。すなわち、適切かつ高速な細線化処理が可能な画像処理方法、画像処理プログラム、および画像処理装置を提供することを目的とする。 The present invention has been made to solve such a problem. That is, it is an object of the present invention to provide an image processing method, an image processing program, and an image processing apparatus capable of performing appropriate and high-speed thinning processing.

本発明の上記課題は、以下の手段によって解決される。 The above problems of the present invention are solved by the following means.

(1)多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する段階(a)と、前記段階(a)において検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする段階(b)と、前記段階(b)において前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする段階(c)と、前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する段階(d)と、を有する、画像処理方法。 (1) scanning multi-valued image data for each color in a predetermined direction in an image based on the multi-valued image data to detect an edge pixel pair forming an edge of an object; Of the pair of edge pixels detected in (a), the attribute forming the outline of the object is given the attribute of the internal edge to form the internal edge pixel, and the pixel adjacent to the internal edge outside the object is externally output. The step (b) in which an edge attribute is added to form an external edge pixel, and the internal pixel is added to the pixel in which neither the internal edge attribute nor the external edge attribute is added in the step (b). Based on the positional relationship between the edge pixel and the external edge pixel, it is determined whether the pixel is an internal pixel of the object, and an internal non-edge attribute is added to the pixel determined to be the internal pixel of the object. And (c), and when the internal edge pixel is set as the target pixel, the internal edge pixel and the internal non-edge pixel of the adjacent pixels that are close to each other within the predetermined number of pixels from the target pixel are selected. Based on the total number and the positional relationship between the internal edge pixel and the internal non-edge pixel among the adjacent pixels, the pixel value of the target pixel is set to the predetermined direction with respect to the target pixel. And (d) determining whether to replace the pixel value of a pixel adjacent in the opposite direction.

(2)前記多値画像データは、カラーの画像データである、上記(1)に記載の画像処理方法。 (2) The image processing method according to (1), wherein the multi-valued image data is color image data.

(3)前記段階(a)は、エッジ検出注目画素と、前記エッジ検出注目画素の前後の2画素とを含む3画素の画素値に関するフィルタリング処理する、3×1のラプラシアンフィルターを、前記所定の方向に走査して、前記エッジ検出注目画素のエッジ値を算出していき、少なくとも1色のエッジ値の絶対値が閾値以上の画素が隣接する画素対を、前記エッジ画素対として検出する、上記(1)または(2)に記載の画像処理方法。 (3) In the step (a), the predetermined 3×1 Laplacian filter for filtering pixel values of three pixels including the edge detection target pixel and two pixels before and after the edge detection target pixel is used. Scanning in the direction, and calculating the edge value of the edge detection target pixel, and detecting a pixel pair adjacent to a pixel whose absolute value of the edge value of at least one color is a threshold value or more as the edge pixel pair. The image processing method according to (1) or (2).

(4)前記段階(b)は、前記段階(a)において検出された前記エッジ画素対についてそれぞれ明度を算出し、明度の低い方の画素に前記内部エッジの属性を付与し、明度の高い方の画素に前記外部エッジの属性を付与する、上記(1)〜(3)のいずれかに記載の画像処理方法。 (4) In the step (b), the brightness is calculated for each of the edge pixel pairs detected in the step (a), the attribute of the internal edge is given to the pixel with the lower brightness, and the pixel with the higher brightness is given. The image processing method according to any one of (1) to (3) above, wherein the attribute of the external edge is given to the pixel.

(5)前記段階(b)は、前記段階(a)において前記エッジ画素対が検出されるごとに、検出された前記エッジ画素対のそれぞれの画素に対し前記属性を付与し、前記段階(c)は、前記段階(b)において、前記内部エッジの属性を付与された後に最初に付与された前記属性が前記内部エッジの属性だった場合、前記内部エッジの属性を付与された2つの前記内部エッジ画素の間に存在する全ての画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、上記(1)〜(4)のいずれかに記載の画像処理方法。 (5) In the step (b), each time the edge pixel pair is detected in the step (a), the attribute is given to each pixel of the detected edge pixel pair, and the step (c) is performed. ), in the step (b), if the attribute firstly given after the attribute of the internal edge is given is the attribute of the internal edge, the two internals given the attribute of the internal edge are given. The image processing method according to any one of (1) to (4) above, wherein the attribute of the internal non-edge is added to all the pixels existing between edge pixels to make the internal non-edge pixels.

(6)前記段階(c)は、前記画像の端部と前記内部エッジ画素との間に、前記エッジ画素対のいずれの画素も存在しない場合、前記画像の端部と前記内部エッジ画素との間の画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、上記(1)〜(5)のいずれかに記載の画像処理方法。 (6) In the step (c), if no pixel of the edge pixel pair exists between the edge of the image and the internal edge pixel, the edge of the image and the internal edge pixel are separated from each other. 6. The image processing method according to any one of (1) to (5) above, wherein the internal non-edge attribute is given to pixels in between to be the internal non-edge pixels.

(7)前記段階(c)は、第1のエッジ画素対の前記外部エッジ画素が出現した後、前記所定の方向に、前記エッジ画素対を構成する画素として最初に出現した画素が、前記第1のエッジ画素対と異なる第2のエッジ画素対の前記内部エッジ画素であった場合、前記第2のエッジ画素対の前記内部エッジ画素の前記所定の方向に対し反対方向に隣接する画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とし、第3のエッジ画素対の前記内部エッジ画素が出現した後、前記所定の方向に、前記エッジ画素対を構成する画素として最初に出現した画素が、前記第3のエッジ画素対と異なる第4のエッジ画素対の前記外部エッジ画素であった場合、前記第3のエッジ画素対の前記内部エッジ画素の前記所定の方向に隣接する画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、上記(1)〜(6)のいずれかに記載の画像処理方法。 (7) In the step (c), after the external edge pixel of the first edge pixel pair appears, a pixel that first appears in the predetermined direction as a pixel forming the edge pixel pair is the first edge pixel pair. If the inner edge pixel of the second edge pixel pair different from the first edge pixel pair is the pixel adjacent to the inner edge pixel of the second edge pixel pair in a direction opposite to the predetermined direction of the inner edge pixel. An attribute of internal non-edge is given to the internal non-edge pixel, and after the internal edge pixel of the third edge pixel pair appears, first appears as a pixel forming the edge pixel pair in the predetermined direction. When the determined pixel is the external edge pixel of the fourth edge pixel pair different from the third edge pixel pair, the pixel adjacent to the internal edge pixel of the third edge pixel pair in the predetermined direction. The image processing method according to any one of (1) to (6) above, wherein the internal non-edge attribute is added to the internal non-edge pixel to make the internal non-edge pixel.

(8)前記段階(d)における前記所定の画素数は1で、前記近接画素は8つの隣接画素であり、前記段階(d)は、前記8つの隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記8つの隣接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する、上記(1)〜(7)のいずれかに記載の画像処理方法。 (8) In the step (d), the predetermined number of pixels is 1, the adjacent pixels are eight adjacent pixels, and in the step (d), among the eight adjacent pixels, the internal edge pixel and The pixel value of the target pixel is set to the target pixel based on the total number of the internal non-edge pixels and the positional relationship between the internal edge pixel and the internal non-edge pixel among the eight adjacent pixels. On the other hand, the image processing method according to any one of (1) to (7), wherein it is determined whether or not the pixel value of a pixel adjacent in the opposite direction to the predetermined direction is replaced.

(9)前記段階(d)は、前記合計数および前記位置関係が、[1]前記合計数が0または7の場合、[2]前記合計数が1で、かつ8つの前記隣接画素にそれぞれ隣接する8つの画素のうち前記内部エッジ画素および前記内部非エッジ画素の数を加算した値が2以下の場合、[3]前記合計数が2で、前記合計数として数が加算された画素が隣接している場合、[4]前記合計数が3で、前記合計数として数が加算された画素が隣接している場合、[5]前記合計数が4で、前記合計数として数が加算された画素が隣接している場合、[6]前記合計数が5で、前記隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素のいずれでもない画素が、前記注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、および、[7]前記合計数が6で、前記隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素のいずれでもない画素が、前記注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、のいずれかである場合は、前記注目画素の画素値を、前記注目画素の走査の直前に走査された、前記注目画素に隣接する前記外部エッジ画素の画素値に置換しないと判定し、前記合計数および前記位置関係が、前記[1]〜[7]のいずれでもない場合は、前記注目画素の画素値を、前記注目画素の走査の直前に走査された、前記注目画素に隣接する前記外部エッジ画素の画素値に置換すると判定する、上記(8)に記載の画像処理方法。 (9) In the step (d), when the total number and the positional relationship are [1] the total number is 0 or 7, [2] the total number is 1 and eight adjacent pixels are respectively provided. If the value obtained by adding the number of the internal edge pixels and the number of the internal non-edge pixels among the eight adjacent pixels is 2 or less, [3] the total number is 2 and the pixel to which the number is added as the total number is When adjacent, [4] when the total number is 3 and the pixel to which the number is added as the total number is adjacent, [5] when the total number is 4 and the number is added to the total number [6] If the total number is 5, and a pixel that is neither the internal edge pixel nor the internal non-edge pixel among the adjacent pixels is 6 with respect to the pixel of interest, When both the upper and lower sides, both the left and right sides, or both in the diagonal direction are present, and [7] the total number is 6 and the internal edge pixel and the internal non-edge pixel among the adjacent pixels are If any of the pixels exists in both the upper and lower sides, both the left and right sides, or both in the diagonal direction with respect to the target pixel, the pixel value of the target pixel is set to the target pixel. It is determined that the pixel value of the external edge pixel adjacent to the pixel of interest, which is scanned immediately before the pixel scanning, is not replaced, and the total number and the positional relationship are any of the above [1] to [7]. If not, it is determined that the pixel value of the target pixel is to be replaced with the pixel value of the external edge pixel that is scanned immediately before the target pixel is scanned and that is adjacent to the target pixel. Image processing method.

(10)細線化処理の強弱の選択を受け付ける段階(e)をさらに有し、前記段階(e)において弱の選択が受け付けられた場合、前記所定の方向を第1方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第1方向と直交する第2方向として前記段階(a)〜(d)を行い、前記段階(e)において強の選択が受け付けられた場合、前記所定の方向を前記第1方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第2方向として前記段階(a)〜(d)を行い、さらに、前記所定の方向を前記第1方向に対し反対方向の第3方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第2方向に対し反対方向の第4方向として前記段階(a)〜(d)を行う、上記(1)〜(9)のいずれかに記載の画像処理方法。 (10) The method further includes a step (e) of accepting the selection of the strength of the thinning process, and when the weak selection is accepted in the step (e), the predetermined direction is set as the first direction and the step (a) is performed. After performing (d) to (d), the steps (a) to (d) are performed with the predetermined direction as a second direction orthogonal to the first direction, and a strong selection is accepted in the step (e). In this case, after performing the steps (a) to (d) with the predetermined direction as the first direction, the steps (a) to (d) are performed with the predetermined direction as the second direction, and further, After performing the steps (a) to (d) with the predetermined direction as a third direction opposite to the first direction, the predetermined direction is set as a fourth direction opposite to the second direction. The image processing method according to any one of (1) to (9), wherein the steps (a) to (d) are performed.

(11)前記所定の方向を第5方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第5方向に直交する方向として前記段階(a)〜(d)を行う、上記(1)〜(9)のいずれかに記載の画像処理方法。 (11) After performing the steps (a) to (d) with the predetermined direction as a fifth direction, the steps (a) to (d) are performed with the predetermined direction as a direction orthogonal to the fifth direction. The image processing method according to any one of (1) to (9) above.

(12)前記所定の方向を第6方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第6方向に対し反対方向として前記段階(a)〜(d)を行う、上記(1)〜(9)のいずれかに記載の画像処理方法。 (12) After performing the steps (a) to (d) with the predetermined direction as a sixth direction, the steps (a) to (d) are performed with the predetermined direction opposite to the sixth direction. The image processing method according to any one of (1) to (9) above.

(13)前記多値画像データを、前記多値画像データに基づく画像の複数の領域に対応して分割することで複数の分割データを生成する段階(f)をさらに有し、前記段階(a)〜(d)を、前記複数の分割データに対し、並列に行う、上記(1)〜(12)のいずれかに記載の画像処理方法。 (13) The method further includes a step (f) of generating a plurality of divided data by dividing the multi-valued image data corresponding to a plurality of regions of an image based on the multi-valued image data, and the step (a). The image processing method according to any one of (1) to (12) above, wherein steps (a) to (d) are performed in parallel on the plurality of divided data.

(14)前記段階(f)は、前記多値画像データを、前記多値画像データに基づく画像の複数の領域に対応して分割するとともに、分割後の前記分割データに基づく画像の、分割方向の上下の端部に2画素以上のマージン部分を付加し、前記マージン部分が付加された分割画像にそれぞれ対応する前記複数の分割データを生成する、上記(13)に記載の画像処理方法。 (14) In the step (f), the multi-valued image data is divided corresponding to a plurality of regions of the image based on the multi-valued image data, and a division direction of the image based on the divided data after the division is divided. The image processing method according to (13) above, wherein a margin portion of 2 pixels or more is added to the upper and lower end portions of the, and the plurality of divided data corresponding to the divided images to which the margin portion is added are generated.

(15)前記段階(d)において、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換すると判定された場合に、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換し、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換すると判定されない場合は、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換しない段階(g)をさらに有する、上記(1)〜(14)のいずれかに記載の画像処理方法。 (15) In the step (d), if it is determined that the pixel value of the target pixel is replaced with the pixel value of a pixel adjacent to the target pixel in the opposite direction to the predetermined direction, the target value is determined. The pixel value of the pixel is replaced with the pixel value of a pixel adjacent to the target pixel in the direction opposite to the predetermined direction, and the pixel value of the target pixel is set in the predetermined direction with respect to the target pixel. On the other hand, if it is not determined that the pixel value of the pixel adjacent in the opposite direction is to be replaced, the pixel value of the target pixel is not replaced with the pixel value of the pixel adjacent to the target pixel in the opposite direction to the predetermined direction. The image processing method according to any one of (1) to (14), further including step (g).

(16)多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する手順(a)と、前記段階(a)において検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする手順(b)と、前記手順(b)において前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする手順(c)と、前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する手順(d)と、を有する処理を、コンピューターに実行させるための画像処理プログラム。 (16) A step (a) of detecting multi-valued image data for each color in a predetermined direction in an image based on the multi-valued image data to detect an edge pixel pair forming an edge of an object, and the step (a). Of the pair of edge pixels detected in (a), the attribute forming the outline of the object is given the attribute of the internal edge to form the internal edge pixel, and the pixel adjacent to the internal edge outside the object is externally output. The procedure (b) in which an attribute of an edge is added to form an external edge pixel, and the internal pixel is added to a pixel to which neither the attribute of the internal edge nor the attribute of the external edge is added in the procedure (b). Based on the positional relationship between the edge pixel and the external edge pixel, it is determined whether the pixel is an internal pixel of the object, and an internal non-edge attribute is added to the pixel determined to be the internal pixel of the object. (C) and the internal edge pixel and the internal non-edge pixel among the adjacent pixels that are close to each other within a predetermined number of pixels from the target pixel when the internal edge pixel is the target pixel. Based on the total number and the positional relationship between the internal edge pixel and the internal non-edge pixel among the adjacent pixels, the pixel value of the target pixel is set to the predetermined direction with respect to the target pixel. An image processing program for causing a computer to execute a process including a step (d) of determining whether or not to replace a pixel value of a pixel adjacent in the opposite direction.

(17)多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する検出部と、前記検出部により検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする第1属性付与部と、前記第1属性付与部により前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする第2属性付与部と、前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する判定部と、を有する、画像処理装置。 (17) A detection unit configured to scan the multivalued image data for each color in a predetermined direction in an image based on the multivalued image data to detect an edge pixel pair forming an edge of an object, and the detection unit. Of the detected edge pixel pairs, the attribute forming the outline of the object is given an internal edge attribute to make it an internal edge pixel, and the pixel adjacent to the internal edge outside the object is given the external edge attribute. A first attribute assigning unit that assigns an external edge pixel, and the internal edge pixel to a pixel to which neither the attribute of the internal edge nor the attribute of the external edge is assigned by the first attribute assigning unit Based on the positional relationship between the pixel and the external edge pixel, it is determined whether the pixel is inside the object, and the pixel determined to be the pixel inside the object is given an internal non-edge attribute to be an internal non-edge pixel. A total of the internal edge pixel and the internal non-edge pixel among the adjacent pixels that are within a predetermined number of pixels from the pixel of interest when the second attribute assigning unit and the internal edge pixel are pixels of interest. The pixel value of the target pixel is opposite to the target pixel in the predetermined direction based on the number and the positional relationship between the internal edge pixel and the internal non-edge pixel among the adjacent pixels. An image processing apparatus, comprising: a determination unit that determines whether or not the pixel values of pixels adjacent in the direction are to be replaced.

画像に含まれるオブジェクトのエッジをなす画素対にそれぞれオブジェクト内外のエッジの属性を付与し、当該属性が付与された各画素の位置関係に基づいて、当該画素以外で、オブジェクト内部と判断した画素に、オブジェクト内の属性を付与する。そして、オブジェクト内のエッジの属性をもつ注目画素に近接する画素のうち、オブジェクト内の属性をもつ画素の、数および位置関係に基づいて、当該注目画素を当該注目画素の直前に走査された画素の画素値に置換するかどうか判定する。これにより、適切かつ高速な細線化処理ができる。 Attributes of edges inside and outside the object are assigned to pixel pairs forming the edge of the object included in the image, and pixels other than the pixel concerned are determined to be inside the object based on the positional relationship of the pixels to which the attribute is assigned. , Add attributes in the object. Then, among the pixels adjacent to the target pixel having the edge attribute in the object, the target pixel is scanned immediately before the target pixel based on the number and positional relationship of the pixels having the attribute in the object. It is determined whether or not the pixel value is replaced. This enables appropriate and high-speed thinning processing.

画像形成装置の構成を示す概略図である。It is a schematic diagram showing a configuration of an image forming apparatus. 画像形成装置の構成を示すブロック図である。FIG. 3 is a block diagram showing a configuration of an image forming apparatus. 画像データの細線化処理のフローチャートである。It is a flowchart of a thinning process of image data. 図3のステップS101のサブルーチンフローチャートである。It is a subroutine flowchart of step S101 of FIG. 画像データの分割について説明するための説明図である。It is an explanatory view for explaining division of image data. 図3のステップS102のサブルーチンフローチャートである。4 is a flowchart of a subroutine of step S102 of FIG. 図6のステップS309のサブルーチンフローチャートである。7 is a flowchart of a subroutine of step S309 of FIG. 対象画像の各画素の属性の埋込み処理を説明するための説明図である。It is an explanatory view for explaining embedding processing of an attribute of each pixel of a target image. 図6のステップS311のサブルーチンフローチャートである。7 is a flowchart of a subroutine of step S311 of FIG. 図3のステップS103のサブルーチンフローチャートである。It is a subroutine flowchart of step S103 of FIG. オブジェクトの左側エッジを置換える置換条件を示す図である。It is a figure which shows the replacement conditions which replace the left edge of an object. オブジェクトの左側エッジを置換える置換条件を示す図である。It is a figure which shows the replacement conditions which replace the left edge of an object. オブジェクトの左側エッジを置換える置換条件を示す図である。It is a figure which shows the replacement conditions which replace the left edge of an object. オブジェクトの左側エッジを置換える置換条件を示す図である。It is a figure which shows the replacement conditions which replace the left edge of an object. オブジェクトの左側エッジを置換える置換条件を示す図である。It is a figure which shows the replacement conditions which replace the left edge of an object. 細線化処理の結果を示す図である。It is a figure which shows the result of a thinning process.

以下、図面を参照して、本発明の実施形態に係る、画像処理方法、画像処理プログラム、および画像処理装置について説明する。なお、図面において、同一の要素には同一の符号を付し、重複する説明を省略する。また、図面の寸法比率は、説明の都合上誇張されており、実際の比率とは異なる場合がある。 Hereinafter, an image processing method, an image processing program, and an image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings. In addition, in the drawings, the same elements are denoted by the same reference numerals, and overlapping description will be omitted. Further, the dimensional ratios in the drawings are exaggerated for convenience of description, and may differ from the actual ratios.

図1は、本発明の実施形態に係る画像処理装置を含む画像形成装置100の構成を示す概略図である。図2は、画像形成装置100の構成を示すブロック図である。 FIG. 1 is a schematic diagram showing the configuration of an image forming apparatus 100 including an image processing apparatus according to an embodiment of the present invention. FIG. 2 is a block diagram showing the configuration of the image forming apparatus 100.

画像形成装置100は、制御部110、記憶部120、通信部130、操作表示部140、画像読取部150、画像制御部160、および画像形成部170を有する。これらの構成要素は、バス180により互いに通信可能に連結されている。画像形成装置100は、MFP(MultiFunction Peripheral)により構成され得る。制御部110は、検出部、第1属性付与部、第2属性付与部、および判定部を構成する。 The image forming apparatus 100 includes a control unit 110, a storage unit 120, a communication unit 130, an operation display unit 140, an image reading unit 150, an image control unit 160, and an image forming unit 170. These components are communicatively coupled to each other by a bus 180. The image forming apparatus 100 may be configured by an MFP (MultiFunction Peripheral). The control unit 110 constitutes a detection unit, a first attribute assignment unit, a second attribute assignment unit, and a determination unit.

制御部110は、CPU(Central Processing Unit)および各種メモリを備えており、プログラムにしたがって上記各部の制御や各種の演算処理を行う。制御部110の作用の詳細については後述する。 The control unit 110 includes a CPU (Central Processing Unit) and various memories, and controls each of the above units and performs various arithmetic processes according to a program. Details of the operation of the control unit 110 will be described later.

記憶部120は、HDD(Hard Disc Drive)、またはSDD(Solid State Drive)等により構成され、各種プログラムおよび各種データを記憶する。 The storage unit 120 includes an HDD (Hard Disc Drive), an SDD (Solid State Drive), or the like, and stores various programs and various data.

通信部130は、画像形成装置100と外部機器との間で通信を行うためのインターフェースである。通信部130として、イーサネット(登録商標)、SATA、IEEE1394などの規格によるネットワークインターフェースが用いられる。また、通信部130として、Bluetooth(登録商標)、IEEE802.11などの無線通信インターフェースなどの各種ローカル接続インターフェースなどが用いられる。 The communication unit 130 is an interface for communicating between the image forming apparatus 100 and an external device. As the communication unit 130, a network interface according to standards such as Ethernet (registered trademark), SATA, and IEEE 1394 is used. Further, as the communication unit 130, various local connection interfaces such as a wireless communication interface such as Bluetooth (registered trademark) and IEEE 802.11 are used.

操作表示部140は、タッチパネル、テンキー、スタートボタン、およびストップボタン等を備えており、各種情報を表示するとともに、各種指示の入力を受け付ける。 The operation display unit 140 includes a touch panel, a numeric keypad, a start button, a stop button, and the like, displays various kinds of information, and receives inputs of various kinds of instructions.

画像読取部150は、蛍光ランプなどの光源およびCCD(Charge Coupled Device)イメージセンサーなどの撮像素子を有する。画像読取部150は、所定の読み取り位置にセットされた原稿に光源から光を当て、その反射光を撮像素子で光電変換して、その電気信号から画像データを生成する。 The image reading unit 150 includes a light source such as a fluorescent lamp and an image sensor such as a CCD (Charge Coupled Device) image sensor. The image reading unit 150 applies light from a light source to a document set at a predetermined reading position, photoelectrically converts the reflected light by an image sensor, and generates image data from the electric signal.

画像制御部160は、通信部130により受信された印刷ジョブ等に含まれる印刷データのレイアウト処理およびラスタライズ処理を行い、ビットマップ形式の画像データを生成する。 The image control unit 160 performs layout processing and rasterization processing of print data included in the print job or the like received by the communication unit 130, and generates bitmap image data.

印刷ジョブとは、画像形成装置100に対する印刷命令の総称であり、印刷データおよび印刷設定が含まれる。印刷データとは、印刷の対象である文書のデータであり、印刷データには、例えば、イメージデータ、ベクタデータ、テキストデータといった各種データが含まれ得る。具体的には、印刷データは、PDL(Page Description Language)データ、PDF(Portable Document Format)データまたはTIFF(Tagged Image File Format)データであり得る。印刷設定とは、用紙への画像形成に関する設定であり、たとえば、ページ数、印刷部数、紙種、カラーまたはモノクロの選択、およびページ割付などの各種設定が含まれる。 The print job is a general term for print commands to the image forming apparatus 100, and includes print data and print settings. The print data is data of a document to be printed, and the print data may include various data such as image data, vector data, and text data. Specifically, the print data may be PDL (Page Description Language) data, PDF (Portable Document Format) data, or TIFF (Tagged Image File Format) data. The print setting is a setting relating to image formation on a sheet, and includes various settings such as the number of pages, the number of copies, a paper type, color or monochrome, and page layout.

画像形成部170は、作像部40、定着部50、給紙部60、および用紙搬送部70を有する。 The image forming unit 170 includes an image forming unit 40, a fixing unit 50, a paper feeding unit 60, and a paper transporting unit 70.

作像部40は、Y(イエロー)、M(マゼンタ)、C(シアン)、およびK(ブラック)の各色のトナーに対応した作像ユニット41Y、41M、41C、41Kを有する。各作像ユニット41Y、41M、41C、41Kにより、画像データに基づいて、帯電、露光、および現像のプロセスを経て感光体ドラム上にトナー画像が形成される。露光は、レーザー光により感光体ドラム上を走査することで行われる。当該レーザー光による感光体ドラム上の走査方向を、以下、主走査方向と称し、主走査方向に直交する方向を副走査方向と称する。感光体ドラム上に形成されたトナー画像は、中間転写ベルト42上に順次重ねられて、2次転写ローラー43により用紙900上に転写される。 The image forming unit 40 includes image forming units 41Y, 41M, 41C, and 41K corresponding to toners of Y (yellow), M (magenta), C (cyan), and K (black), respectively. The image forming units 41Y, 41M, 41C, 41K form a toner image on the photosensitive drum through a process of charging, exposing, and developing based on the image data. The exposure is performed by scanning the photosensitive drum with a laser beam. Hereinafter, the scanning direction on the photosensitive drum by the laser light will be referred to as a main scanning direction, and the direction orthogonal to the main scanning direction will be referred to as a sub scanning direction. The toner images formed on the photoconductor drum are sequentially superposed on the intermediate transfer belt 42 and transferred onto the sheet 900 by the secondary transfer roller 43.

定着部50は、加熱ローラー51および加圧ローラー52を有し、両ローラー51、52の定着ニップに搬送された用紙900を加熱および加圧して、用紙900上のトナー画像をその表面に溶融定着する。 The fixing unit 50 has a heating roller 51 and a pressure roller 52, and heats and presses the paper 900 conveyed to the fixing nip of the rollers 51 and 52 to melt and fix the toner image on the paper 900 on the surface thereof. To do.

定着部50によりトナー画像が定着された用紙900は、印刷物(出力物)として排紙トレイ190に排紙される。 The sheet 900 on which the toner image has been fixed by the fixing unit 50 is discharged to the sheet discharge tray 190 as a printed matter (output matter).

給紙部60は、複数の給紙トレイ61、62を有し、給紙トレイ61、62に収容された用紙900を1枚ずつ下流側の搬送経路に送り出す。 The sheet feeding unit 60 has a plurality of sheet feeding trays 61 and 62, and sends out the sheets 900 accommodated in the sheet feeding trays 61 and 62 one by one to a downstream transport path.

用紙搬送部70は、用紙900を搬送するための複数の搬送ローラーを有し、作像部40、定着部50、および給紙部60の各部間で用紙900を搬送する。複数の搬送ローラーには、用紙900の傾きを矯正するためのレジストローラー71や、用紙900に所定量のループを形成するためのループローラー72が含まれる。用紙搬送部70は、画像形成された用紙900を排紙トレイ90に排紙する。 The paper conveyance unit 70 has a plurality of conveyance rollers for conveying the paper 900, and conveys the paper 900 among the image forming unit 40, the fixing unit 50, and the paper feeding unit 60. The plurality of transport rollers include a registration roller 71 for correcting the inclination of the sheet 900 and a loop roller 72 for forming a predetermined amount of loops on the sheet 900. The paper transport unit 70 discharges the paper 900 on which an image has been formed to the paper discharge tray 90.

制御部110の作用の詳細について説明する。 Details of the operation of the control unit 110 will be described.

図3は、画像データの細線化処理のフローチャートである。本フローチャートは、制御部110により、記憶部120に記憶されたプログラムに従い実行され得る。画像データは、例えば、各色の画素値が0〜255のいずれかの値をもつ多値画像データである。画像には、カラーおよびモノクロの画像データが含まれる。画像データには、画像制御部160により生成された画像データ、および画像読取部150に生成された画像データが含まれる。以下、細線化処理の対象となる、画像データに基づく画像を「対象画像」とも称する。 FIG. 3 is a flowchart of the image data thinning processing. This flowchart can be executed by the control unit 110 according to a program stored in the storage unit 120. The image data is, for example, multi-valued image data in which the pixel value of each color has any value from 0 to 255. The image includes color and monochrome image data. The image data includes the image data generated by the image control unit 160 and the image data generated by the image reading unit 150. Hereinafter, the image based on the image data, which is the target of the thinning process, is also referred to as “target image”.

制御部110は、画像データを複数の分割データに分割する(S101)。すなわち、制御部110は、画像データを、当該画像データに基づく画像の複数の領域に対応して分割する。複数の分割データは、それぞれステップS102〜S110において並列に処理される。以下、説明を簡単にするために、分割データに基づく分割画像も、それぞれ対象画像と称して説明する。 The control unit 110 divides the image data into a plurality of divided data (S101). That is, the control unit 110 divides the image data into a plurality of regions of an image based on the image data. The plurality of pieces of divided data are processed in parallel in steps S102 to S110. Hereinafter, in order to simplify the description, the divided images based on the divided data will also be referred to as target images.

図4は、図3のステップS101のサブルーチンフローチャートである。図5は、画像データの分割について説明するための説明図である。 FIG. 4 is a subroutine flowchart of step S101 of FIG. FIG. 5 is an explanatory diagram for explaining division of image data.

制御部110は、ユーザーにより設定された分割数に基づいて、分割画像のサイズを算出する(S201)。図5の例においては、分割前の対象画像のサイズが、1500画素(横)×2000画素(縦)(以下、画像のサイズを「1500×2000」というように記載する)である。分割数が3である場合、例えば、1500×667、1500×667、および1500×666のサイズの3つの分割画像に分割する。分割の方向は、所定の方向に直交する副走査方向(縦)であり得る。 The control unit 110 calculates the size of the divided image based on the number of divisions set by the user (S201). In the example of FIG. 5, the size of the target image before division is 1500 pixels (horizontal)×2000 pixels (vertical) (hereinafter, the image size is described as “1500×2000”). When the number of divisions is 3, the image is divided into three divided images of sizes 1500×667, 1500×667, and 1500×666, for example. The division direction may be a sub-scanning direction (vertical) that is orthogonal to the predetermined direction.

制御部110は、画像の分割位置を算出する(S202)。図5の例においては、分割位置は、画像の副走査方向の座標における、667画素、1334画素の位置としている。 The control unit 110 calculates the division position of the image (S202). In the example of FIG. 5, the division position is the position of 667 pixels and 1334 pixels in the coordinate of the image in the sub-scanning direction.

制御部110は、対象画像を、算出した分割位置で分割する(S203)。 The control unit 110 divides the target image at the calculated division position (S203).

制御部110は、マージン部分を付加した分割画像の画像データ(分割データ)を生成する(S204)。図5の例においては、マージン部分は、副走査方向に2画素分等とされている。従って、マージン部分を付加した各分割画像のサイズは、1500×671、1500×671、1500×670である。分割画像にマージン部分を付加するのは、後述するステップS103における、3×3のフィルターによる処理を、分割画像の、副走査方向上下端の画素についても、当該画素を注目画素として実行できるようにするためである。なお、分割画像の、主走査方向および主走査方向の端部(左右端)にもマージン部分を付加し得る。 The control unit 110 generates image data (divided data) of the divided image with the margin portion added (S204). In the example of FIG. 5, the margin portion is made up of two pixels or the like in the sub-scanning direction. Therefore, the size of each divided image to which the margin part is added is 1500×671, 1500×671, 1500×670. The margin portion is added to the divided image so that the processing by the 3×3 filter in step S103 described below can be executed as the target pixel for the pixels at the upper and lower ends in the sub-scanning direction of the divided image. To do so. A margin portion may be added to the main scanning direction and the end portions (left and right ends) of the divided image in the main scanning direction.

図3に戻り、説明を継続する。ステップS102およびステップS103は、対象画像の画素を所定の方向である主走査方向(第1方向)に走査することで、以下に説明するように、オブジェクトの左側のエッジの検出、およびオブジェクトの左側のエッジの置換えを行う。オブジェクトには、文字および図形が含まれる。 Returning to FIG. 3, the description will be continued. In steps S102 and S103, the pixels of the target image are scanned in the main scanning direction (first direction), which is a predetermined direction, to detect the left edge of the object and the left side of the object, as described below. Replace the edge of. Objects include characters and graphics.

制御部110は、対象画像について、オブジェクトの左側のエッジを検出する(S102)。具体的には、制御部110は、対象画像について、オブジェクトのエッジを構成するエッジ画素対を検出する。エッジ画素対は、オブジェクトの輪郭を形成する内部エッジ画素(以下、「IE」とも称する)と、当該オブジェクトの外側で当該内部エッジ画素に隣接する外部エッジ画素(以下、「OE」とも称する)との組である。なお、以下に説明するように、ステップS102においては、対象画像について、オブジェクトの左側のエッジ画素対を検出するとともに、各画素にオブジェクトのエッジに関する属性を付与する。 The control unit 110 detects the left edge of the object in the target image (S102). Specifically, the control unit 110 detects an edge pixel pair forming an edge of the object in the target image. The edge pixel pair includes an inner edge pixel (hereinafter, also referred to as “IE”) forming an outline of the object, and an outer edge pixel (hereinafter, also referred to as “OE”) adjacent to the inner edge pixel outside the object. It is a group of. As will be described below, in step S102, the edge pixel pair on the left side of the object is detected in the target image, and an attribute related to the edge of the object is added to each pixel.

図6は、図3のステップS102のサブルーチンフローチャートである。 FIG. 6 is a subroutine flowchart of step S102 of FIG.

制御部110は、対象画像の全ての画素に対し、当該画素の属性を外部非エッジの属性に初期化して、外部非エッジ画素(以下、「ON」とも称する)とする(S301)。ここで、外部非エッジ画素とは、オブジェクトの外部の画素で上記の外部エッジ画素以外の画素であり、内部非エッジ画素(後述)とは、オブジェクトの内部の上記の内部エッジ画素以外の画素である。 The control unit 110 initializes the attributes of all the pixels of the target image to the attributes of external non-edge, and sets them as external non-edge pixels (hereinafter, also referred to as “ON”) (S301). Here, the external non-edge pixels are pixels outside the object and are pixels other than the external edge pixels, and the internal non-edge pixels (described later) are pixels other than the internal edge pixels inside the object. is there.

制御部110は、注目画素と、当該注目画素の前後の2画素とを含む3画素の画素値に関するフィルタリング処理を行うための、3×1のラプラシアンフィルターを、画像データに基づく対象画像における主走査方向に走査することで、画像データに対する畳込み演算を行う。当該3×1のラプラシアンフィルターは、換言すれば、注目画素と、主走査方向、および主走査方向に対し反対方向で当該注目画素にそれぞれ隣接する2画素とを含む3画素の画素値に関するフィルタリング処理を行うためフィルターである。これにより、制御部110は、注目画素のエッジ値を算出する(S302)。以下、エッジ値を算出するための、ラプラシアンフィルターにおける注目画素を、「エッジ検出注目画素」と称する。主走査方向に対し反対方向でエッジ検出注目画素に隣接する画素は、上記ラプラシアンフィルターにより当該エッジ検出注目画素の直前に走査されるため、以下、当該画素を「直前画素」と称する。主走査方向でエッジ検出注目画素に隣接する画素は、上記ラプラシアンフィルターにより当該エッジ検出注目画素の直後に走査されるため、以下、当該画素を「直後画素」と称する。 The control unit 110 uses a 3×1 Laplacian filter for performing a filtering process on a pixel value of three pixels including the target pixel and two pixels before and after the target pixel, in the main scanning of the target image based on the image data. By scanning in the direction, the convolution operation is performed on the image data. In other words, the 3×1 Laplacian filter is a filtering process for a pixel value of three pixels including a target pixel and two pixels adjacent to the target pixel in the main scanning direction and in a direction opposite to the main scanning direction. Is a filter to do. As a result, the control unit 110 calculates the edge value of the pixel of interest (S302). Hereinafter, the target pixel in the Laplacian filter for calculating the edge value is referred to as “edge detection target pixel”. Pixels adjacent to the edge detection target pixel in the direction opposite to the main scanning direction are scanned immediately before the edge detection target pixel by the Laplacian filter, and hence the pixel is hereinafter referred to as the “previous pixel”. A pixel adjacent to the edge-detected pixel of interest in the main scanning direction is scanned immediately after the edge-detected pixel of interest by the Laplacian filter, and hence the pixel is hereinafter referred to as an “immediate pixel”.

ラプラシアンフィルターによる畳込み演算は、エッジ検出注目画素のエッジ値を、下記式(1)により算出する演算である。 The convolution operation using the Laplacian filter is an operation for calculating the edge value of the pixel of interest for edge detection by the following equation (1).

直前画素の画素値+直後画素の画素値−2×エッジ検出注目画素の画素値 …(1)
制御部110は、エッジ検出注目画素のエッジ値の絶対値が閾値以上かどうか判断する(S303)。閾値は、実験等により適当な値に設定でき、例えば80とし得る。
Pixel value of immediately preceding pixel+pixel value of immediately following pixel−2×pixel value of target pixel for edge detection (1)
The control unit 110 determines whether the absolute value of the edge value of the edge detection target pixel is equal to or more than the threshold value (S303). The threshold value can be set to an appropriate value by experiment or the like, and can be set to 80, for example.

制御部110は、エッジ検出注目画素のエッジ値の絶対値が閾値以上でないと判断した場合は(S303:NO)、ステップS302に戻り処理を継続する。 When the control unit 110 determines that the absolute value of the edge value of the edge detection target pixel is not greater than or equal to the threshold value (S303: NO), the process returns to step S302 and continues the processing.

制御部110は、エッジ検出注目画素のエッジ値の絶対値が閾値以上と判断した場合は(S303:YES)、エッジ検出注目画素を、対象画像に含まれるオブジェクトのエッジと判定する(S304)。エッジ検出注目画素を、対象画像に含まれるオブジェクトのエッジと判定した場合は、直前画素もエッジかどうか判断する(S305)。 When the control unit 110 determines that the absolute value of the edge value of the edge detection target pixel is equal to or larger than the threshold value (S303: YES), the edge detection target pixel is determined to be the edge of the object included in the target image (S304). When it is determined that the edge detection target pixel is the edge of the object included in the target image, it is determined whether the immediately preceding pixel is also an edge (S305).

制御部110は、直前画素がエッジでない場合は(S305:NO)、ステップS302に戻り処理を継続する。 If the immediately preceding pixel is not an edge (S305: NO), the control unit 110 returns to step S302 and continues the processing.

制御部110は、直前画素がエッジである場合は(S305:YES)、当該直前画素とエッジ検出注目画素の組をエッジ画素対であると判断する。これにより、エッジ画素対が検出される。 If the immediately preceding pixel is an edge (S305: YES), the control unit 110 determines that the set of the immediately preceding pixel and the edge detection target pixel is an edge pixel pair. Thereby, the edge pixel pair is detected.

ステップS301〜S305は、色(Y(イエロー)、M(マゼンタ)、C(シアン)、およびK(ブラック))毎に実行され得る。ここで、色毎に実行されるとは、対象画像のオブジェクトが単色(例えば、黒色)であって、当該単色について実行される場合を含む。従って、ステップS302においては、色毎にエッジ値が算出され、ステップS303においては、色毎にエッジ値の絶対値が閾値以上かどうか判断される。よって、少なくとも1色のエッジ値の絶対値が閾値以上である画素が隣接する画素対がエッジ画素対として検出される。なお、ステップS301〜S305は、所定の色(例えば、シアン)のみについて実行されてもよい。 Steps S301 to S305 can be executed for each color (Y (yellow), M (magenta), C (cyan), and K (black)). Here, the execution for each color includes the case where the object of the target image is a single color (for example, black) and is executed for the single color. Therefore, in step S302, the edge value is calculated for each color, and in step S303, it is determined whether the absolute value of the edge value is greater than or equal to the threshold value for each color. Therefore, a pixel pair adjacent to a pixel in which the absolute value of the edge value of at least one color is equal to or larger than the threshold value is detected as an edge pixel pair. Note that steps S301 to S305 may be executed only for a predetermined color (for example, cyan).

制御部110は、ステップS305において直前画素がエッジであると判断した場合、直前画素と、エッジ検出注目画素のL値を算出する(S306)。L値は、CIE規格における明度である。なお、Lに代えて、輝度に対応した他の値が算出されてもよい。 When the control unit 110 determines in step S305 that the immediately previous pixel is an edge, the control unit 110 calculates the L * values of the immediately previous pixel and the edge detection target pixel (S306). The L * value is the lightness in the CIE standard. Instead of L * , another value corresponding to the brightness may be calculated.

制御部110は、直前画素のL値がエッジ検出注目画素より大きいかどうか判断する(S307)。 The control unit 110 determines whether the L * value of the immediately preceding pixel is larger than the edge detection target pixel (S307).

制御部110は、直前画素のL値がエッジ検出注目画素より大きいと判断した場合は(S307:YES)、直前画素をOE、エッジ検出注目画素をIEと判定し(S308)、ステップS309を実行する。 When the control unit 110 determines that the L * value of the immediately preceding pixel is larger than the edge detection target pixel (S307: YES), the control unit 110 determines the immediately previous pixel as OE and the edge detection target pixel as IE (S308), and proceeds to step S309. Execute.

制御部110は、直前画素のL値がエッジ検出注目画素より大きくないと判断した場合は(S307:NO)、直前画素をIE、エッジ検出注目画素をOEと判定し(S310)、ステップS311を実行する。 When the control unit 110 determines that the L * value of the immediately preceding pixel is not larger than the edge detection target pixel (S307: NO), the control unit 110 determines that the previous pixel is IE and the edge detection target pixel is OE (S310), and step S311. To execute.

図7は、図6のステップS309のサブルーチンフローチャートである。図8は、対象画像の各画素の属性の埋込み処理を説明するための説明図である。図7のサブルーチンフローチャートは、上述したように、直前画素がOE、エッジ検出注目画素がIEと判定された場合に実行される。 FIG. 7 is a subroutine flowchart of step S309 of FIG. FIG. 8 is an explanatory diagram for explaining the embedding process of the attribute of each pixel of the target image. As described above, the subroutine flowchart of FIG. 7 is executed when it is determined that the immediately preceding pixel is OE and the edge detection target pixel is IE.

制御部110は、エッジ検出注目画素と主走査方向に並んだ画素であって副走査方向の座標を共通にする画素(対象画像上でエッジ検出注目画素と同じ行の画素)に関し、直前画素がエッジと検出される直前にエッジと判断した画素(以下、「画素P」と称する)が、OEもしくはIEか、または画素Pがないか、を判断する(S401)。 The control unit 110 determines that the immediately preceding pixel is a pixel arranged in the main scanning direction with the edge detection target pixel and having a common coordinate in the sub scanning direction (a pixel in the same row as the edge detection target pixel on the target image). It is determined whether the pixel that has been determined to be an edge immediately before being detected as an edge (hereinafter, referred to as “pixel P”) is OE or IE, or whether there is no pixel P (S401).

制御部110は、画素PがOEである場合は、画素Pと直前画素との間の全ての画素をONとする(S402)。図8の例においては、対象画像(画像)の画素と、当該画素に付与された属性とが示されている。対象画像の画素のうちオブジェクトを構成する画素は、グレーの色で示されており、同じ色の画素は同じオブジェクトを構成する画素である。ステップS402において属性の埋込み処理がなされるのは、図8のBにおいて示す区間aである。具体的には、区間aにおいてエッジ検出注目画素(iで示す)がIE、直前画素(pで示す)がOEと判定されており、直前画素がエッジと検出される直前にエッジと判断された画素P(Pで示す)がOEである。このため、画素PであるOEと直前画素であるOEとの間の画素をONにする埋込み処理がなされている。なお、ステップS301で、全ての画素の属性が初期化されて、ONとなっている。このため、ステップS402の埋込み処理は省略され得る。 When the pixel P is OE, the control unit 110 turns on all the pixels between the pixel P and the immediately preceding pixel (S402). In the example of FIG. 8, the pixel of the target image (image) and the attribute given to the pixel are shown. Pixels forming the object among the pixels of the target image are shown in gray color, and pixels of the same color are pixels forming the same object. In step S402, the attribute embedding process is performed in the section a shown in B of FIG. Specifically, the edge detection target pixel (shown by i) is determined to be IE and the immediately preceding pixel (shown as p) is determined to be OE in the section a, and it is determined to be an edge immediately before the immediately preceding pixel is detected as an edge. The pixel P (indicated by P) is OE. Therefore, an embedding process is performed to turn on the pixels between the OE that is the pixel P and the OE that is the immediately preceding pixel. In step S301, the attributes of all pixels are initialized and set to ON. Therefore, the embedding process of step S402 can be omitted.

制御部110は、画素PがIEである場合は、画素Pに主走査方向で隣接する画素のみ内部非エッジ画素(以下、「IN」とも称する)にする(S403)。図8の例においては、ステップS403において属性の埋込み処理がなされるのは、図8のBにおいて示す区間bである。具体的には、区間bにおいてエッジ検出注目画素(iで示す)がIE、直前画素(pで示す)がOEと判定されており、画素P(Pで示す)がIEである。このため、IEである画素Pに主走査方向で隣接する画素のみINにする埋込み処理がなされている。このような埋込み処理がなされるのは、対象画像が、一のオブジェクト上に他のオブジェクトが配置される多層構造を有する場合である。なお、ステップS403においては、画素Pと直前画素との間の全ての画素をINにしてもよい。上記画素Pを構成する画素IEを含むエッジ画素対は、第3のエッジ画素対を構成する。上記エッジ検出注目画素を構成する画素IE、および上記直前画素を構成するOEは第4のエッジ画素対を構成する。 When the pixel P is the IE, the control unit 110 sets only pixels adjacent to the pixel P in the main scanning direction as internal non-edge pixels (hereinafter, also referred to as “IN”) (S403). In the example of FIG. 8, the attribute embedding process performed in step S403 is the section b shown in B of FIG. Specifically, in the section b, the edge detection target pixel (indicated by i) is determined to be IE, the immediately preceding pixel (indicated by p) is determined to be OE, and the pixel P (indicated by P) is IE. For this reason, an embedding process is performed in which only pixels adjacent to the pixel P, which is an IE, in the main scanning direction are set to IN. Such embedding processing is performed when the target image has a multilayer structure in which another object is arranged on one object. Note that in step S403, all pixels between the pixel P and the immediately preceding pixel may be set to IN. The edge pixel pair including the pixel IE forming the pixel P forms a third edge pixel pair. The pixel IE forming the edge detection target pixel and the OE forming the immediately preceding pixel form a fourth edge pixel pair.

制御部110は、画素Pがない場合は、エッジ検出注目画素に対して、主走査方向に対し反対方向の端部と当該エッジ検出注目画素との間の全ての画素をONにする(S404)。図8の例においては、ステップS404において属性の埋込み処理がなされるのは図8のAにおいて示す区間cである。具体的には、区間cにおいてエッジ検出注目画素(iで示す)がIE、直前画素(pで示す)がOEと判定されており、画素Pが存在しない。このため、エッジ検出注目画素に対し、主走査方向に対し反対方向の端部と当該エッジ検出注目画素との間の画素をONとする埋込み処理がなされている。 When there is no pixel P, the control unit 110 turns on all the pixels between the edge detection target pixel and the edge detection target pixel opposite to the main scanning direction (S404). .. In the example of FIG. 8, the attribute embedding process is performed in step S404 in the section c shown in A of FIG. Specifically, in the section c, it is determined that the pixel of interest for edge detection (indicated by i) is IE and the immediately preceding pixel (indicated by p) is OE, and the pixel P does not exist. For this reason, the edge detection target pixel is subjected to embedding processing in which the pixel between the edge portion in the direction opposite to the main scanning direction and the edge detection target pixel is turned on.

図9は、図6のステップS311のサブルーチンフローチャートである。図9のサブルーチンフローチャートは、上述したように、直前画素をIE、エッジ検出注目画素をOEと判定された場合に実行される。 FIG. 9 is a subroutine flowchart of step S311 of FIG. As described above, the subroutine flowchart of FIG. 9 is executed when it is determined that the immediately preceding pixel is IE and the edge detection target pixel is OE.

制御部110は、エッジ検出注目画素と主走査方向の座標を共通にする画素に関し、画素Pが、IEもしくはOEか、または画素Pがないか、を判断する(S501)。 The control unit 110 determines whether the pixel P has IE or OE or does not have the pixel P with respect to the pixel having the common coordinates in the main scanning direction with the edge detection target pixel (S501).

制御部110は、画素PがIEである場合は、画素Pと直前画素との間の全ての画素をINとする(S502)。図8の例においては、ステップS502において属性の埋込み処理がなされるのは図8のAにおいて示す区間dである。具体的には、区間dにおいてエッジ検出注目画素(iで示す)がOE、直前画素(pで示す)がIEと判定されており、直前画素がエッジと検出される直前にエッジと判断された画素P(Pで示す)がIEである。このため、画素PであるIEと、直前画素であるIEとの間の画素をINとする埋込み処理がなされている。 When the pixel P is IE, the control unit 110 sets all the pixels between the pixel P and the immediately preceding pixel to IN (S502). In the example of FIG. 8, the attribute embedding processing is performed in step S502 in the section d shown in A of FIG. Specifically, in the section d, it is determined that the target pixel for edge detection (indicated by i) is OE and the immediately preceding pixel (indicated by p) is IE, and it is determined that the pixel is an edge immediately before the preceding pixel is detected as an edge. The pixel P (denoted by P) is the IE. Therefore, an embedding process is performed in which a pixel between the IE that is the pixel P and the IE that is the immediately preceding pixel is set to IN.

制御部110は、画素PがOEである場合は、主走査方向に対し反対方向で直前画素に隣接する画素のみINにする(S503)。図8の例においては、ステップS503において属性の埋込み処理がなされるのは図8のBにおいて示す区間eである。具体的には、区間eにおいてエッジ検出注目画素(iで示す)がOE、直前画素(pで示す)がIEと判定されており、画素P(Pで示す)がOEである。このため、OEである直前画素に、主走査方向に対し反対方向で隣接する画素のみINにする埋込み処理がなされている。このような埋込み処理がなされるのは、対象画像が多層構造を有する場合である。なお、ステップS503においては、画素Pと直前画素との間の全ての画素をINにしてもよい。上記画素Pを構成する画素OEを含むエッジ画素対は、第1のエッジ画素対を構成する。上記エッジ検出注目画素を構成する画素OE、および上記直前画素を構成するIEは第2のエッジ画素対を構成する。 When the pixel P is OE, the control unit 110 sets only the pixel adjacent to the immediately preceding pixel in the direction opposite to the main scanning direction to IN (S503). In the example of FIG. 8, the attribute embedding process is performed in step S503 in the section e shown in B of FIG. Specifically, in the section e, the edge detection target pixel (indicated by i) is determined to be OE, the immediately preceding pixel (indicated by p) is determined to be IE, and the pixel P (indicated by P) is OE. For this reason, the embedding process is performed on the immediately preceding pixel which is OE so that only the pixel adjacent in the opposite direction to the main scanning direction is IN. Such embedding processing is performed when the target image has a multilayer structure. Note that in step S503, all the pixels between the pixel P and the immediately preceding pixel may be set to IN. The edge pixel pair including the pixel OE forming the pixel P forms a first edge pixel pair. The pixel OE forming the edge detection target pixel and the IE forming the immediately preceding pixel form a second edge pixel pair.

制御部110は、画素Pがない場合は、エッジ検出注目画素に対して、主走査方向に対し反対方向の端部と直前画素との間の全ての画素をINにする(S504)。図8の例においては、ステップS504において属性の埋込み処理がなされるのは図8のCにおいて示す区間fである。具体的には、区間fにおいてエッジ検出注目画素(iで示す)がOE、直前画素(pで示す)がIEと判定されており、画素Pが存在しない。このため、エッジ検出注目画素に対し、主走査方向に対し反対方向の端部と直前画素であるIEとの間の画素をINとする埋込み処理がなされている。 If the pixel P is not present, the control unit 110 sets all the pixels between the edge portion in the opposite direction to the main scanning direction and the immediately preceding pixel to IN with respect to the edge detection target pixel (S504). In the example of FIG. 8, the attribute embedding process is performed in step S504 in the section f shown in C of FIG. Specifically, in the section f, it is determined that the pixel of interest for edge detection (shown by i) is OE and the immediately preceding pixel (shown by p) is IE, and the pixel P does not exist. Therefore, the edge detection target pixel is subjected to the embedding process in which the pixel between the end portion in the direction opposite to the main scanning direction and the immediately previous pixel IE is set to IN.

図6に戻り、説明を継続する。制御部110は、対象画像の全ての画素について、左側エッジの検出処理が終了したかどうか判断する(S312)。制御部110は、全ての画素について、左側エッジの検出処理が終了したと判断しない場合は(S312:NO)、ステップS302に戻り、処理を継続する。制御部110は、全ての画素について、左側エッジの検出処理が終了したと判断した場合は(S312:YES)、図3のフローチャートに戻り、ステップS103の処理を実行する。 Returning to FIG. 6, the description will be continued. The control unit 110 determines whether the left edge detection processing has been completed for all pixels of the target image (S312). When the control unit 110 does not determine that the left edge detection processing has been completed for all pixels (S312: NO), the control unit 110 returns to step S302 and continues the processing. When the control unit 110 determines that the left edge detection processing has been completed for all pixels (S312: YES), the control unit 110 returns to the flowchart of FIG. 3 and executes the processing of step S103.

図10は、図3のステップS103のサブルーチンフローチャートである。 FIG. 10 is a subroutine flowchart of step S103 of FIG.

制御部110は、各画素を注目画素として、対象画像を、1行目から最終行まで順に各行を、所定の方向である主走査方向に走査して各画素の属性を確認する(S601)。 The control unit 110 scans each row from the first row to the last row in the main scanning direction, which is a predetermined direction, with each pixel as a pixel of interest, and confirms the attribute of each pixel (S601).

制御部110は、注目画素がIEかどうか判断する(S602)。制御部110は、注目画素がIEでないと判断した場合は(S602:NO)、ステップS601に戻り、処理を継続する。 The control unit 110 determines whether the pixel of interest is IE (S602). When the control unit 110 determines that the target pixel is not the IE (S602: NO), the control unit 110 returns to step S601 and continues the processing.

制御部110は、注目画素がIEであると判断した場合は(S602;YES)、注目画素に近接する、INおよびIEの合計数(オブジェクトの内部の属性をもつ画素であるインナーの合計数)を算出する(S603)。 When the control unit 110 determines that the pixel of interest is the IE (S602; YES), the total number of INs and IEs that are close to the pixel of interest (the total number of inners that are the pixels having the attribute inside the object). Is calculated (S603).

ステップS601〜S603は、注目画素を中央として、注目画素に所定の画素数以内に近接する近接画素のうちINおよびIEの合計数を算出する、3×3のフィルターを用いて実行され得る。以下、例として、中央の注目画素に1画素数以内に近接(すなわち、注目画素の周りで注目画素に隣接)する8つの近接画素(以下、単に「近接画素」とも称する)のうちの、INおよびIEの合計数を算出する、3×3のフィルターを用いて、ステップS601〜S603を実行するものとして説明する。 Steps S601 to S603 can be executed using a 3×3 filter that calculates the total number of IN and IE among the neighboring pixels that are close to the target pixel within a predetermined number of pixels, with the target pixel as the center. In the following, as an example, IN of eight adjacent pixels (hereinafter, also simply referred to as “adjacent pixels”) that are close to the central pixel of interest within one pixel number (that is, adjacent to the pixel of interest around the pixel of interest) It is assumed that steps S601 to S603 are executed using a 3×3 filter for calculating the total number of IEs and IEs.

制御部110は、近接画素のうちの、INおよびIEの合計数、および当該近接画素のうちの、INとIEとの位置関係に基づいて、オブジェクトの左側エッジを置換える置換条件を判定する(S604)。以下、近接画素のうちの、INおよびIEの画素を「近接インナー画素」と称する。また、近接インナー画素の合計数を、「近接インナー画素数」と称する。オブジェクトの左側エッジを置換えるとは、注目画素の画素値を、当該注目画素に、所定の方向である主走査方向に対し、反対方向(左側)に隣接する画素の画素値で置換えることをいい、以下、単に「置換処理」ともいう。 The control unit 110 determines a replacement condition for replacing the left edge of the object based on the total number of INs and IEs of the adjacent pixels and the positional relationship between IN and IE of the adjacent pixels ( S604). Hereinafter, among the adjacent pixels, the IN and IE pixels are referred to as “adjacent inner pixels”. In addition, the total number of adjacent inner pixels is referred to as “the number of adjacent inner pixels”. Replacing the left edge of the object means replacing the pixel value of the pixel of interest with the pixel value of the pixel adjacent to the pixel of interest in the main scanning direction which is the predetermined direction in the opposite direction (left side). Hereinafter, it is also simply referred to as “replacement processing”.

図11A〜11Eは、オブジェクトの左側エッジを置換える置換条件を示す図である。図11A〜11Eにおいては、近接インナー画素数ごとに、注目画素の画素値を、当該注目画素に、所定の方向である主走査方向に対し反対方向に隣接する画素の画素値で置換えるかどうかを、近接インナー画素であるINとIEとの位置関係により区分して、3×3のフィルターとともに示している。図11A〜11Eに示した、3×3のフィルターの中央の画素(「I」で示した画素)は注目画素であり、近接インナー画素は、黒背景に白抜きの「1」で示されている。なお、周辺画素のうち、近接インナー画素でない画素は、白背景の「0」で示されている。なお、図11A〜11Eにおいては、注目画素がINとはなり得ない場合の、注目画素と近接インナー画素との組み合わせ(3×3のフィルターの左下に黒い星印が付記されたもの(図11C等))も示されている。このような、INでない注目画素については、左側エッジの置換えの対象とはならない(ステップS602参照)。 11A to 11E are diagrams showing replacement conditions for replacing the left edge of the object. 11A to 11E, whether or not the pixel value of the target pixel can be replaced with the pixel value of the pixel adjacent to the target pixel in the opposite direction to the main scanning direction, which is the predetermined direction, for each adjacent inner pixel number. Are divided by the positional relationship between IN and IE, which are the inner inner pixels, and are shown together with the 3×3 filter. The central pixel (pixel indicated by “I”) of the 3×3 filter shown in FIGS. 11A to 11E is the target pixel, and the adjacent inner pixel is indicated by a white “1” on the black background. There is. Note that among the peripheral pixels, the pixels that are not the adjacent inner pixels are indicated by “0” on the white background. 11A to 11E, in the case where the pixel of interest cannot be IN, the combination of the pixel of interest and the adjacent inner pixel (the one with a black star mark at the lower left of the 3×3 filter (see FIG. 11C Etc.)) is also shown. Such a pixel of interest that is not IN is not a target for replacing the left edge (see step S602).

図11Aに示すような近接インナー画素数が0の場合は、置換処理せずに、注目画素の画素値を維持する。近接インナー画素数が0の場合は、IEである注目画素が、例えば、孤立点を含む文字(例えば、文字「i」および「j」)の当該孤立点として存在し得る一方、置換処理を行うことで、文字化け(例えば、文字「i」を構成する点が消滅)が生じ得るからである。 When the number of adjacent inner pixels as shown in FIG. 11A is 0, the pixel value of the target pixel is maintained without performing the replacement process. When the number of adjacent inner pixels is 0, the pixel of interest that is IE may be present as the isolated point of a character including the isolated point (for example, the characters “i” and “j”), but the replacement process is performed. This may cause garbled characters (for example, the points forming the character “i” disappear).

近接インナー画素数が1の場合は、当該近接インナー画素に(さらに)隣接するINおよびIEの画素(注目画素を含む)の数が3つ以上の場合、オブジェクトの置換処理を行う。一方、それ以外の場合は、置換処理を行わない。これは、近接インナー画素数が1で、当該近接インナー画素に隣接するINおよびIEの画素(注目画素を含む)の数が2つ以下の場合、近接インナー画素が孤立線として存在し得る一方、置換処理を行うことで、存在するはずの孤立線が消滅し得るからである。 If the number of adjacent inner pixels is 1, and if the number of IN and IE pixels (including the pixel of interest) adjacent (further) to the adjacent inner pixel is three or more, the object replacement process is performed. On the other hand, in other cases, the replacement process is not performed. This means that when the number of adjacent inner pixels is 1 and the number of IN and IE pixels (including the pixel of interest) adjacent to the adjacent inner pixel is 2 or less, the adjacent inner pixel can exist as an isolated line, This is because by performing the replacement process, the isolated line that should exist may disappear.

図11A〜図11Cに示すように近接インナー画素数が2〜4の場合は、当該近接インナー画素が互いに隣接している場合、置換処理を行う。一方、それ以外の場合は、置換処理を行わない。これは、近接インナー画素が互いに隣接していない場合、近接インナー画素が連続線を構成している場合が多い一方で、置換処理を行うことで、当該連続線が分断され得るからである。 As shown in FIGS. 11A to 11C, when the number of adjacent inner pixels is 2 to 4, when the adjacent inner pixels are adjacent to each other, the replacement process is performed. On the other hand, in other cases, the replacement process is not performed. This is because when the adjacent inner pixels are not adjacent to each other, the adjacent inner pixels often form a continuous line, but the continuous line may be divided by performing the replacement process.

近接インナー画素数が5および6の場合は、近接画素のうちの、近接インナー画素以外の画素の少なくともいずれかが注目画素を中心として点対称となる場合、置換処理を行わない。一方、それ以外の場合は、置換処理を行う。これは、近接画素のうちの、近接インナー画素以外の画素が注目画素を中心として点対称となる場合、近接インナー画素が、ある領域の接続点を構成している場合が多い一方、置換処理を行うことで、当該接続点が分断され得るからである。なお、近接インナー画素であるINとIEとの位置関係が、図11D、11Eにおいて破線枠内に示すものである場合は、置換処理を実行することで抜き文字が切れるという不具合が発生する可能性がある。従って、このような不具合が発生する場合は、図11D、11Eにおいて破線枠内の、近接インナー画素であるINとIEとの位置関係となる際に、置換処理を行わなくてもよい。 When the number of adjacent inner pixels is 5 and 6, if at least one of the adjacent pixels other than the adjacent inner pixel is point-symmetric with respect to the pixel of interest, the replacement process is not performed. On the other hand, in other cases, the replacement process is performed. This is because when the pixels other than the proximity inner pixel among the proximity pixels are point-symmetric with respect to the pixel of interest, the proximity inner pixel often constitutes a connection point of a certain region, while the replacement processing is performed. By doing so, the connection point can be divided. If the positional relationship between IN and IE, which are the inner pixels close to each other, is shown in the broken line frame in FIGS. 11D and 11E, a defect that a blank character may be cut off by performing the replacement process may occur. There is. Therefore, when such a problem occurs, the replacement process does not have to be performed when the positional relationship between the adjacent inner pixels IN and IE in the broken line frame in FIGS. 11D and 11E is reached.

近接インナー画素数が7の場合は、置換処理を行わず、注目画素の画素値を維持する。近接インナー画素数が7の場合は、置換処理を行うことにより、不適切な細線化処理となることが多いからである。 When the number of adjacent inner pixels is 7, the replacement process is not performed and the pixel value of the target pixel is maintained. This is because if the number of adjacent inner pixels is 7, the replacement process may often result in an inappropriate thinning process.

なお、近接インナー画素数が8になることはない。これは、近接インナー画素数が8になると仮定すると、注目画素がIEとなることはあり得ず、近接インナー画素の前提を欠くことになるからである。 Note that the number of adjacent inner pixels does not become 8. This is because assuming that the number of adjacent inner pixels is 8, the target pixel cannot be IE, and the assumption of the adjacent inner pixels is lacking.

制御部110は、置換条件を判定した結果、置換処理すると判断しない場合は(S605:NO)、ステップS607の処理を実行する。 As a result of determining the replacement condition, if the control unit 110 does not determine to perform the replacement process (S605: NO), the control unit 110 executes the process of step S607.

制御部110は、置換処理すると判断した場合は(S605:YES)、注目画素の画素値を直前画素の画素値で置換える(S606)。例えば、対象画像がカラー画像である場合は、注目画素の、Y、M、C、およびKの全ての画素値で、注目画素の、Y、M、C、およびKの全ての画素値を置換える。 When the control unit 110 determines to perform the replacement process (S605: YES), it replaces the pixel value of the target pixel with the pixel value of the immediately preceding pixel (S606). For example, when the target image is a color image, all pixel values of Y, M, C, and K of the target pixel are replaced with all pixel values of Y, M, C, and K of the target pixel. It

制御部110は、全ての画素について置換処理を終了したかどうか判断し(S607)、終了していない場合は(S607:NO)、ステップS601に戻り、処理を続行する。 The control unit 110 determines whether or not the replacement processing has been completed for all pixels (S607), and if not completed (S607: NO), returns to step S601 and continues the processing.

制御部110は、全ての画素について置換処理を終了したと判断した場合は(S607:YES)、処理を終了する。 When the control unit 110 determines that the replacement process has been completed for all pixels (S607: YES), the process ends.

このように、近接インナー画素数、および近接インナー画素相互の位置関係に基づいて、オブジェクトの左側エッジを置換えることで、適切かつ高速な細線化処理ができる。 In this way, by replacing the left edge of the object based on the number of adjacent inner pixels and the positional relationship between the adjacent inner pixels, it is possible to perform appropriate and high-speed thinning processing.

図3に戻り、説明を継続する。制御部110は、所定の方向を主走査方向として、左側エッジの検出(S102)、および左側エッジの置換え(S103)を実行した後、所定の方向を主走査方向に直交する副走査方向(第2方向)として、オブジェクトの上側のエッジの検出(S104)、およびオブジェクトの上側のエッジの置換え(S105)を行う。これにより、オブジェクトの上側の細線化処理がさらに実行され、細線化処理による細線化の度合いが増大する。ステップS104およびS105における処理は、所定の方向(ラプラシアンフィルターの向きを含む)が異なる以外、それぞれステップS103およびS104における処理と同様であるため、説明を省略する。 Returning to FIG. 3, the description will be continued. The control unit 110 detects the left edge (S102) and replaces the left edge (S103) with the predetermined direction as the main scanning direction, and then executes the predetermined direction in the sub-scanning direction (first As the two directions, the upper edge of the object is detected (S104) and the upper edge of the object is replaced (S105). As a result, the thinning processing on the upper side of the object is further executed, and the degree of thinning by the thinning processing increases. The processing in steps S104 and S105 is the same as the processing in steps S103 and S104, respectively, except that the predetermined direction (including the orientation of the Laplacian filter) is different, and thus the description thereof is omitted.

制御部110は、細線化処理の設定が「強」に設定されているかどうか判断する(S106)。細線化処理の強弱の設定は、操作表示部140においてユーザーにより入力された細線化処理の強弱の選択に基づいて制御部110が設定する。細線化処理の強弱の設定は、画像形成装置100において予め設定されていてもよく、印刷ジョブにおいて設定されてもよい。 The control unit 110 determines whether the thinning process setting is set to “strong” (S106). The strength of the thinning process is set by the control unit 110 based on the selection of the strength of the thinning process input by the user on the operation display unit 140. The setting of the strength of the thinning process may be set in advance in the image forming apparatus 100 or may be set in the print job.

制御部110は、細線化処理の設定が「強」に設定されていない場合(すなわち、「弱」に設定されている場合)は(S106:NO)、処理を終了する。 When the setting of the thinning process is not set to "strong" (that is, when it is set to "weak") (S106: NO), the control unit 110 ends the process.

制御部110は、細線化処理の設定が「強」に設定されている場合は(S106:YES)、所定の方向を主走査方向に対し反対方向(第3方向)として、オブジェクトの右側のエッジの検出(S107)、およびオブジェクトの右側のエッジの置換え(S108)を行う。その後、制御部110は、所定の方向を副走査方向に対し反対方向(第4方向)として、オブジェクトの下側のエッジの検出(S109)、およびオブジェクトの下側のエッジの置換え(S110)を行う。オブジェクトの右側のエッジの置換え(S108)により、オブジェクトの右側の細線化処理がなされ、オブジェクトの下側のエッジの置換え(S108)により、オブジェクトの下側の細線化処理がなされる。これにより、細線化処理による細線化の度合いをさらに増大させることができる。ステップS107およびS108における処理、ならびに、ステップS109およびS110における処理は、所定の方向が異なる以外、それぞれステップS103およびS104における処理と同様であるため、説明を省略する。 When the setting of the thinning process is set to “strong” (S106: YES), the control unit 110 regards the predetermined direction as the opposite direction (third direction) to the main scanning direction, and the right edge of the object. Is detected (S107), and the right edge of the object is replaced (S108). After that, the control unit 110 sets the predetermined direction to the direction opposite to the sub-scanning direction (the fourth direction), and detects the lower edge of the object (S109) and replaces the lower edge of the object (S110). To do. By replacing the right edge of the object (S108), the thinning processing on the right side of the object is performed, and by replacing the lower edge of the object (S108), the thinning processing on the lower side of the object is performed. Thereby, the degree of thinning by the thinning processing can be further increased. The processes in steps S107 and S108 and the processes in steps S109 and S110 are the same as the processes in steps S103 and S104, respectively, except that the predetermined directions are different, and thus the description thereof is omitted.

なお、図3のフローチャートは、一部のステップを省略してもよく、他のステップが追加されてもよい。例えば、ステップS101を省略して、対象画像を分割せずに、ステップS102〜S110を実行してもよい。また、ステップS102〜ステップS105のみが実行されてもよい。また、ステップS102およびステップS103、ならびに、ステップS107およびステップS108のみが実行されてもよい。また各ステップの一部は同時に実行されてもよく、一つのステップが複数のステップに分割されて実行されてもよい。また、各ステップの順番は変更され得る。 Note that some steps may be omitted in the flowchart of FIG. 3 and other steps may be added. For example, step S101 may be omitted, and steps S102 to S110 may be executed without dividing the target image. Further, only steps S102 to S105 may be executed. Further, only steps S102 and S103, and steps S107 and S108 may be executed. Further, some of the steps may be executed simultaneously, or one step may be divided into a plurality of steps and executed. Also, the order of each step may be changed.

図12は、細線化処理の結果を示す図である。図12のAは、黒色の文字(テキスト)の対象画像に対する細線化処理の結果を、細線化処理がされていない場合と比較して示す図である。図12のBは、白抜きの文字の対象画像に対する細線化処理の結果を、細線化処理がされていない場合と比較して示す図である。図12においては、細線化未処理の結果と、「弱」設定の細線化処理の結果と、「強」設定の細線化処理の結果とが、原画像と出力画像とが比較されて示されている。原画像とは、画像形成部170により形成される前の対象画像であり、出力画像とは、画像形成部170により用紙900上に形成された対象画像である。 FIG. 12 is a diagram showing a result of the thinning process. FIG. 12A is a diagram showing the result of the thinning process for the target image of black characters (text) in comparison with the case where the thinning process is not performed. FIG. 12B is a diagram showing the result of the thinning process for the target image of the white characters, in comparison with the case where the thinning process is not performed. In FIG. 12, the result of thinning unprocessed, the result of thinning process of “weak” setting, and the result of thinning process of “strong” setting are shown by comparing the original image and the output image. ing. The original image is a target image before being formed by the image forming unit 170, and the output image is a target image formed on the sheet 900 by the image forming unit 170.

図12のAに示すように、原画像では、細線化未処理の画像と比較して、細線化処理された画像は文字の線が細くなっている。一方、原画像と出力画像を比較すると、出力画像の方が文字の線が太くなっている。細線化処理をすることにより、出力画像の文字の線の太さが、細線化未処理の原画像に近づけられていることが判る。 As shown in A of FIG. 12, in the original image, the line of the character is thinner in the image subjected to the thinning processing than in the image not subjected to the thinning processing. On the other hand, when comparing the original image and the output image, the output image has thicker character lines. By performing the thinning processing, it can be seen that the line thickness of the characters in the output image is brought closer to the original image that has not been thinned.

図12のBに示すように、原画像では、細線化未処理の画像と比較して、細線化処理された画像は文字の線が太くなっている。これは、明度が低い画素がオブジェクトの内部(IE等)と判断されることから、文字以外の黒色の部分に対しエッジの置換えの処理がなされたためである。一方、原画像と出力画像を比較すると、出力画像の方が文字の線が細くなっている。細線化処理をすることにより、出力画像の文字の線の太さが、細線化未処理の原画像に近づけられていることが判る。 As shown in FIG. 12B, in the original image, the thinned image has thicker character lines than the image that has not been thinned. This is because the pixels with low lightness are determined to be inside the object (IE or the like), and thus the edge replacement process is performed on the black portion other than the character. On the other hand, when comparing the original image and the output image, the lines of the characters in the output image are thinner. By performing the thinning processing, it can be seen that the line thickness of the characters in the output image is brought closer to the original image that has not been thinned.

上述した実施形態は、以下の効果を奏する。 The embodiment described above has the following effects.

画像に含まれるオブジェクトのエッジをなす画素対にそれぞれオブジェクト内外の属性を付与し、当該属性が付与された各画素の位置関係に基づいて、当該画素以外で、オブジェクト内部と判断した画素に、オブジェクト内の属性を付与する。そして、注目画素に近接する画素のうちオブジェクト内の属性の画素の、数および位置関係に基づいて、当該注目画素を当該注目画素の直前に走査された画素の画素値に置換するかどうか判定する。これにより、画像の各画素の属性が既知でなくても、適切かつ高速な細線化処理ができる。 An attribute inside and outside the object is given to each pixel pair forming the edge of the object included in the image, and the pixel other than the pixel is determined to be the inside of the object based on the positional relationship between the pixels to which the attribute is given. Add the attributes in. Then, it is determined whether or not the pixel of interest is replaced with the pixel value of the pixel scanned immediately before the pixel of interest, based on the number and positional relationship of the pixels having the attribute in the object among the pixels adjacent to the pixel of interest. .. As a result, even if the attribute of each pixel of the image is not known, appropriate and high-speed thinning processing can be performed.

さらに、画像データを、カラーの画像データとする。これにより、カラーの画像データに対して、効果的に、適切かつ高速な細線化処理ができる。 Further, the image data is color image data. As a result, it is possible to effectively and appropriately perform the thinning process on the color image data.

さらに、エッジ検出注目画素と、エッジ検出注目画素の前後の2画素とを含む3画素の画素値に関するフィルタリング処理する、3×1のラプラシアンフィルターを、所定の方向に走査して、エッジ検出注目画素のエッジ値を算出していき、少なくとも1色のエッジ値の絶対値が閾値以上の画素が隣接する画素対を、エッジ画素対として検出する。これにより、高速かつ高精度にエッジ画素対を検出できる。 Further, a 3×1 Laplacian filter, which performs filtering processing on pixel values of three pixels including the edge detection target pixel and two pixels before and after the edge detection target pixel, is scanned in a predetermined direction to detect the edge detection target pixel. The edge value is calculated, and a pixel pair in which pixels whose absolute value of the edge value of at least one color is equal to or larger than the threshold is adjacent is detected as an edge pixel pair. Thereby, the edge pixel pair can be detected at high speed and with high accuracy.

さらに、検出されたエッジ画素対についてそれぞれ明度を算出し、明度の低い方の画素に内部エッジの属性を付与し、明度の低い方の画素に外部エッジの属性を付与する。これにより、高速かつ高精度に、エッジ画素対にオブジェクト内外の属性を付与できる。 Further, the brightness is calculated for each of the detected edge pixel pairs, the attribute of the inner edge is given to the pixel having the lower lightness, and the attribute of the outer edge is given to the pixel having the lower lightness. As a result, the attributes inside and outside the object can be added to the edge pixel pair at high speed and with high accuracy.

さらに、エッジ画素対が検出されるごとに、エッジ画素対のそれぞれの画素に対し属性を付与し、内部エッジの属性を付与された後に最初に付与された属性が内部エッジの属性だった場合、当該内部エッジの属性を付与された2つの内部エッジ画素の間に存在する全ての画素に内部非エッジの属性を付与して内部非エッジ画素とする。これにより、高速かつ高精度に、オブジェクト内部の画素に属性を付与できる。 Further, each time an edge pixel pair is detected, an attribute is given to each pixel of the edge pixel pair, and the attribute first given after the attribute of the internal edge is given is the attribute of the internal edge, The internal non-edge attribute is added to all the pixels existing between the two internal edge pixels to which the internal edge attribute has been added to make the pixel an internal non-edge pixel. As a result, attributes can be added to pixels inside the object at high speed and with high accuracy.

さらに、対象画像の端部と内部エッジ画素との間に、エッジ画素対のいずれの画素も存在しない場合、当該端部と当該内部エッジ画素との間の画素に内部非エッジの属性を付与して内部非エッジ画素とする。これにより、高速かつ高精度に、対象画像の端に配置されたオブジェクトの内部の画素に属性を付与できる。 Further, when no pixel of the edge pixel pair exists between the edge of the target image and the internal edge pixel, the attribute of the internal non-edge is given to the pixel between the edge and the internal edge pixel. To be internal non-edge pixels. As a result, the attribute can be added to the pixels inside the object arranged at the edge of the target image at high speed and with high accuracy.

さらに、第1のエッジ画素対の外部エッジ画素が出現した後、所定の方向に、エッジ画素対を構成する画素として最初に出現した画素が、第1のエッジ画素対と異なる第2のエッジ画素対の内部エッジ画素であった場合、第2のエッジ画素対の内部エッジ画素の所定の方向に対し反対方向に隣接する画素に内部非エッジの属性を付与して内部非エッジ画素とする。そして、第3のエッジ画素対の内部エッジ画素が出現した後、所定の方向に、エッジ画素対を構成する画素として最初に出現した画素が、第3のエッジ画素対と異なる第4のエッジ画素対の外部エッジ画素であった場合、第3のエッジ画素対の内部エッジ画素の所定の方向に隣接する画素に内部非エッジの属性を付与して内部非エッジ画素とする。これにより、複数のオブジェクトが重なることで多層構造をなす対象画像に対しても、適切かつ高速な細線化処理ができる。 Furthermore, after the external edge pixel of the first edge pixel pair appears, the first pixel that appears in the predetermined direction as a pixel forming the edge pixel pair is the second edge pixel different from the first edge pixel pair. In the case of the internal edge pixel of the pair, the internal non-edge attribute is given to the pixel adjacent to the internal edge pixel of the second edge pixel pair in the direction opposite to the predetermined direction to make the internal non-edge pixel. Then, after the internal edge pixel of the third edge pixel pair appears, the pixel that first appears in the predetermined direction as a pixel forming the edge pixel pair is a fourth edge pixel different from the third edge pixel pair. If the pixel is an external edge pixel of a pair, the pixel adjacent to the internal edge pixel of the third edge pixel pair in the predetermined direction is given an attribute of internal non-edge to be an internal non-edge pixel. This makes it possible to perform appropriate and high-speed thinning processing even on a target image having a multi-layered structure by overlapping a plurality of objects.

さらに、注目画素に隣接する8つの隣接画素のうちの、内部エッジ画素および内部非エッジ画素の合計数、ならびに、8つの隣接画素のうちの、内部エッジ画素と内部非エッジ画素との位置関係に基づいて、注目画素の画素値を、注目画素の走査の直前に走査された、注目画素に隣接する外部エッジ画素の画素値に置換するかどうか判定する。これにより、オブジェクトの特徴に対応して、より適切に細線化処理ができる。 Furthermore, regarding the total number of internal edge pixels and internal non-edge pixels among the eight adjacent pixels adjacent to the pixel of interest, and the positional relationship between the internal edge pixels and the internal non-edge pixels among the eight adjacent pixels, Based on this, it is determined whether to replace the pixel value of the target pixel with the pixel value of the external edge pixel adjacent to the target pixel, which is scanned immediately before the target pixel is scanned. Thereby, the thinning process can be performed more appropriately according to the feature of the object.

さらに、(1)上記合計数が0または7の場合、(2)上記合計数が1で、かつ8つの隣接画素にそれぞれ隣接する8つの画素のうち内部エッジ画素および内部非エッジ画素の数を加算した値が2以下の場合、(3)上記合計数が2で、上記合計数として数が加算された画素が隣接している場合、(4)上記合計数が3で、上記合計数として数が加算された画素が隣接している場合、(5)上記合計数が4で、上記合計数として数が加算された画素が隣接している場合、(6)上記合計数が5で、上記隣接画素のうちの、内部エッジ画素および内部非エッジ画素のいずれでもない画素が、注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、および、(7)上記合計数が6で、上記隣接画素のうちの、内部エッジ画素および内部非エッジ画素のいずれでもない画素が、注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、のいずれかである場合は、注目画素の画素値を、注目画素の走査の直前に走査された、注目画素に隣接する外部エッジ画素の画素値に置換しないと判定する。それ以外の場合は、注目画素の画素値を、注目画素の走査の直前に走査された、注目画素に隣接する外部エッジ画素の画素値に置換すると判定する。これにより、オブジェクトの特徴に対応して、さらに適切かつ高精度に細線化処理ができる。 Further, (1) when the total number is 0 or 7, (2) when the total number is 1 and the number of internal edge pixels and internal non-edge pixels among the eight pixels adjacent to eight adjacent pixels is When the added value is 2 or less, (3) when the total number is 2 and the pixels whose numbers are added as the total number are adjacent to each other, (4) when the total number is 3 and the total number is When the pixels to which the numbers are added are adjacent, (5) the total number is 4, and when the pixels to which the numbers are added as the total number are adjacent, (6) the total number is 5, Among the adjacent pixels, when a pixel that is neither an internal edge pixel nor an internal non-edge pixel exists in both upper and lower sides, both left and right sides, or both in an oblique direction with respect to the target pixel, and ( 7) The total number is 6, and among the adjacent pixels, a pixel that is neither an internal edge pixel nor an internal non-edge pixel is located above or below the target pixel, both to the left or right, or both in a diagonal direction. When it exists, in either case, it is determined that the pixel value of the target pixel is not replaced with the pixel value of the external edge pixel adjacent to the target pixel, which is scanned immediately before the target pixel is scanned. In other cases, it is determined that the pixel value of the target pixel is replaced with the pixel value of the external edge pixel that is scanned immediately before the target pixel and that is adjacent to the target pixel. As a result, it is possible to perform the thinning processing more appropriately and with high accuracy according to the characteristics of the object.

さらに、細線化処理の強弱の選択を受け付け、弱の選択が受け付けられた場合、所定の方向を第1方向として上記細線化処理を行った後、所定の方向を第1方向と直交する第2方向として上記細線化処理を行う。そして、強の選択が受け付けられた場合、所定の方向を第1方向として上記細線化処理を行った後、所定の方向を第2方向として上記細線化処理を行い、さらに、所定の方向を第1方向に対し反対方向の第3方向として上記細線化処理を行った後、所定の方向を第2方向に対し反対方向の第4方向として上記細線化処理を行う。これにより、ユーザーの希望に応じた、適切な細線化処理ができる。 Further, if the selection of the strength of the thinning process is accepted, and if the selection of the weakness is accepted, the thinning process is performed with the predetermined direction as the first direction, and then the predetermined direction is orthogonal to the first direction. The thinning process is performed as the direction. When a strong selection is accepted, the thinning process is performed with the predetermined direction as the first direction, and then the thinning process is performed with the predetermined direction as the second direction, and the predetermined direction is set as the first direction. The thinning process is performed as a third direction that is the opposite direction to the one direction, and then the thinning process is performed as a fourth direction that is the opposite direction to the second direction. Thereby, it is possible to perform an appropriate thinning process according to the user's request.

さらに、所定の方向を第5方向として上記細線化処理を行った後、所定の方向を第5方向に直交する方向として上記細線化処理を行う。これにより、細線化処理の設定に関するユーザーへの負担を低減できるとともに、適切な細線化処理を実現できる。 Further, after performing the thinning process with the predetermined direction as the fifth direction, the thinning process is performed with the predetermined direction as a direction orthogonal to the fifth direction. As a result, it is possible to reduce the burden on the user regarding the setting of the thinning processing and to realize the appropriate thinning processing.

さらに、所定の方向を第6方向として上記細線化処理を行った後、所定の方向を第6方向に対し反対方向として上記細線化処理を行う。これにより、細線化処理の設定に関するユーザーへの負担を低減できるとともに、適切な細線化処理を実現できる。 Further, after performing the thinning process with the predetermined direction as the sixth direction, the thinning process is performed with the predetermined direction as the direction opposite to the sixth direction. As a result, it is possible to reduce the burden on the user regarding the setting of the thinning processing and to realize the appropriate thinning processing.

さらに、多値画像データを、当該多値画像データに基づく画像の複数の領域に対応して分割することで複数の分割データを生成し、当該複数の分割データに対し、並列に上記細線化処理を行う。これにより、細線化処理のさらなる高速化を実現できる。 Further, a plurality of divided data is generated by dividing the multivalued image data corresponding to a plurality of regions of an image based on the multivalued image data, and the thinning processing is performed in parallel on the plurality of divided data. I do. As a result, it is possible to further speed up the thinning process.

さらに、多値画像データを、当該多値画像データに基づく画像の複数の領域に対応して分割するとともに、分割データに基づく画像の、分割方向の上下の端部に2画素以上のマージン部分を付加し、マージン部分が付加された分割画像にそれぞれ対応する複数の分割データに対し、並列に上記細線化処理を行う。これにより、細線化処理のさらなる高速化と高精度化を実現できる。 Further, the multi-valued image data is divided corresponding to a plurality of regions of the image based on the multi-valued image data, and a margin portion of 2 pixels or more is provided at upper and lower ends in the division direction of the image based on the divided data. The thinning processing is performed in parallel on a plurality of divided data corresponding to the divided images to which the added margins have been added. As a result, it is possible to further speed up and improve the accuracy of the thinning process.

本発明は、上述した実施形態に限定されない。 The present invention is not limited to the above embodiments.

例えば、実施形態においては、IEを注目画素としたときの8つの隣接画素を近接画素とし、近接画素のうちの、IEおよびINの合計数、ならびに当該IEとINとの位置関係に基づいて、注目画素の画素値を、当該注目画素の走査の直前に走査された、当該注目画素に隣接するOEの画素値に置換するかどうか判定している。しかし、近接画素は、注目画素との距離が近い順に選択された9つ以上の画素であってもよい。 For example, in the embodiment, the eight adjacent pixels when the IE is the target pixel are the adjacent pixels, and based on the total number of IE and IN among the adjacent pixels and the positional relationship between the IE and IN, It is determined whether or not the pixel value of the target pixel is replaced with the pixel value of the OE adjacent to the target pixel, which is scanned immediately before the target pixel is scanned. However, the adjacent pixels may be nine or more pixels selected in ascending order of the distance to the pixel of interest.

また、細線化処理の設定は強弱の2段階でなくてもよく、例えば、強弱中の3段階であってもよい。この場合、中の設定がされたときは、例えば、ステップS101〜S108による細線化処理を実行し得る。 Further, the setting of the thinning process does not have to be in two levels of strength and weakness, and may be in three levels of strength and weakness. In this case, when the medium setting is made, for example, the thinning processing in steps S101 to S108 can be executed.

また、実施形態においては、記憶媒体として用紙を例に説明したが、記録媒体は用紙に限定されず、樹脂フィルム等であってもよい。 Further, in the embodiment, the sheet is described as an example of the storage medium, but the recording medium is not limited to the sheet and may be a resin film or the like.

また、本発明は、インクジェット方式の画像形成装置にも適用可能である。 The present invention is also applicable to an inkjet image forming apparatus.

また、実施形態においてプログラムにより実行される処理の一部または全部を回路などのハードウェアに置き換えて実行され得る。 Further, in the embodiment, part or all of the processing executed by the program may be replaced with hardware such as a circuit and executed.

40 作像部、
50 定着部、
60 給紙部、
70 用紙搬送部、
100 画像形成装置、
110 制御部、
120 記憶部、
130 通信部、
140 操作表示部、
150 画像読取部、
160 画像制御部、
170 画像形成部、
900 用紙。
40 Imaging department,
50 fixing section,
60 paper feed section,
70 paper transport section,
100 image forming apparatus,
110 control unit,
120 storage unit,
130 Communication unit,
140 Operation display,
150 image reading unit,
160 image control unit,
170 image forming unit,
900 sheets.

Claims (17)

多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する段階(a)と、
前記段階(a)において検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする段階(b)と、
前記段階(b)において前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする段階(c)と、
前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する段階(d)と、
を有する、画像処理方法。
Scanning the multi-valued image data for each color in a predetermined direction in an image based on the multi-valued image data to detect an edge pixel pair forming an edge of an object;
Among the edge pixel pairs detected in the step (a), the pixels forming the outline of the object are given the attribute of the internal edge to be the internal edge pixels, and the pixels adjacent to the internal edge outside the object. A step (b) in which the attribute of the external edge is given to the external edge pixel, and
Based on the positional relationship between the internal edge pixel and the external edge pixel, for the pixel to which neither the internal edge attribute nor the external edge attribute is given in the step (b), A step (c) of judging whether the pixel is an internal pixel and giving an internal non-edge attribute to the pixel judged to be an internal pixel of the object to be an internal non-edge pixel;
The total number of the internal edge pixel and the internal non-edge pixel among the adjacent pixels that are close to each other within a predetermined number of pixels from the target pixel when the internal edge pixels are the target pixels, and the adjacent pixel The pixel value of the target pixel based on the positional relationship between the internal edge pixel and the internal non-edge pixel, and the pixel value of the pixel adjacent to the target pixel in the opposite direction to the predetermined direction. A step (d) of determining whether to replace with a value
An image processing method comprising:
前記多値画像データは、カラーの画像データである、請求項1に記載の画像処理方法。 The image processing method according to claim 1, wherein the multi-valued image data is color image data. 前記段階(a)は、エッジ検出注目画素と、前記エッジ検出注目画素の前後の2画素とを含む3画素の画素値に関するフィルタリング処理する、3×1のラプラシアンフィルターを、前記所定の方向に走査して、前記エッジ検出注目画素のエッジ値を算出していき、少なくとも1色のエッジ値の絶対値が閾値以上の画素が隣接する画素対を、前記エッジ画素対として検出する、請求項1または2に記載の画像処理方法。 In the step (a), a 3×1 Laplacian filter that performs a filtering process on a pixel value of three pixels including an edge detection target pixel and two pixels before and after the edge detection target pixel is scanned in the predetermined direction. Then, the edge value of the edge detection target pixel is calculated, and a pixel pair in which at least one pixel whose absolute value of the edge value of one color is a threshold value or more is adjacent is detected as the edge pixel pair. 2. The image processing method described in 2. 前記段階(b)は、前記段階(a)において検出された前記エッジ画素対についてそれぞれ明度を算出し、明度の低い方の画素に前記内部エッジの属性を付与し、明度の高い方の画素に前記外部エッジの属性を付与する、請求項1〜3のいずれか一項に記載の画像処理方法。 In the step (b), the brightness is calculated for each of the edge pixel pairs detected in the step (a), the attribute of the internal edge is given to the pixel having the lower brightness, and the pixel having the higher brightness is assigned to the pixel having the higher brightness. The image processing method according to claim 1, wherein the attribute of the external edge is added. 前記段階(b)は、前記段階(a)において前記エッジ画素対が検出されるごとに、検出された前記エッジ画素対のそれぞれの画素に対し前記属性を付与し、
前記段階(c)は、前記段階(b)において、前記内部エッジの属性を付与された後に最初に付与された前記属性が前記内部エッジの属性だった場合、前記内部エッジの属性を付与された2つの前記内部エッジ画素の間に存在する全ての画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、請求項1〜4のいずれか一項に記載の画像処理方法。
The step (b) assigns the attribute to each pixel of the detected edge pixel pair every time the edge pixel pair is detected in the step (a),
In the step (c), in the step (b), if the attribute firstly given after the attribute of the internal edge is given is the attribute of the internal edge, the attribute of the internal edge is given. The image processing method according to claim 1, wherein the attribute of the internal non-edge is given to all the pixels existing between the two internal edge pixels to make the internal non-edge pixel.
前記段階(c)は、前記画像の端部と前記内部エッジ画素との間に、前記エッジ画素対のいずれの画素も存在しない場合、前記画像の端部と前記内部エッジ画素との間の画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、請求項1〜5のいずれか一項に記載の画像処理方法。 In the step (c), if no pixel of the edge pixel pair exists between the edge of the image and the internal edge pixel, the pixel between the edge of the image and the internal edge pixel is displayed. The image processing method according to claim 1, wherein the internal non-edge attribute is given to the internal non-edge pixel to obtain the internal non-edge pixel. 前記段階(c)は、
第1のエッジ画素対の前記外部エッジ画素が出現した後、前記所定の方向に、前記エッジ画素対を構成する画素として最初に出現した画素が、前記第1のエッジ画素対と異なる第2のエッジ画素対の前記内部エッジ画素であった場合、前記第2のエッジ画素対の前記内部エッジ画素の前記所定の方向に対し反対方向に隣接する画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とし、
第3のエッジ画素対の前記内部エッジ画素が出現した後、前記所定の方向に、前記エッジ画素対を構成する画素として最初に出現した画素が、前記第3のエッジ画素対と異なる第4のエッジ画素対の前記外部エッジ画素であった場合、前記第3のエッジ画素対の前記内部エッジ画素の前記所定の方向に隣接する画素に前記内部非エッジの属性を付与して前記内部非エッジ画素とする、請求項1〜6のいずれか一項に記載の画像処理方法。
The step (c) includes
After the external edge pixel of the first edge pixel pair appears, a second pixel that first appears in the predetermined direction as a pixel forming the edge pixel pair is different from the first edge pixel pair. In the case of the internal edge pixel of the edge pixel pair, the internal non-edge attribute is given to the pixel adjacent to the internal edge pixel of the second edge pixel pair in the opposite direction to the predetermined direction. Internal non-edge pixels,
After the appearance of the inner edge pixel of the third edge pixel pair, a pixel first appearing as a pixel forming the edge pixel pair in the predetermined direction is different from the third edge pixel pair in the fourth direction. If the pixel is the outer edge pixel of the edge pixel pair, the inner non-edge pixel is given the attribute of the inner non-edge to the pixel adjacent to the inner edge pixel of the third edge pixel pair in the predetermined direction. The image processing method according to any one of claims 1 to 6.
前記段階(d)における前記所定の画素数は1で、前記近接画素は8つの隣接画素であり、前記段階(d)は、前記8つの隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記8つの隣接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する、請求項1〜7のいずれか一項に記載の画像処理方法。 In the step (d), the predetermined number of pixels is 1, the adjacent pixels are eight adjacent pixels, and in the step (d), the internal edge pixel and the internal non-pixel among the eight adjacent pixels are included. Based on the total number of edge pixels and the positional relationship between the internal edge pixel and the internal non-edge pixel among the eight adjacent pixels, the pixel value of the pixel of interest is set to the pixel of interest. The image processing method according to claim 1, wherein it is determined whether or not the pixel value of a pixel adjacent in the opposite direction to the predetermined direction is replaced. 前記段階(d)は、
前記合計数および前記位置関係が、
(1)前記合計数が0または7の場合、
(2)前記合計数が1で、かつ8つの前記隣接画素にそれぞれ隣接する8つの画素のうち前記内部エッジ画素および前記内部非エッジ画素の数を加算した値が2以下の場合、
(3)前記合計数が2で、前記合計数として数が加算された画素が隣接している場合、
(4)前記合計数が3で、前記合計数として数が加算された画素が隣接している場合、
(5)前記合計数が4で、前記合計数として数が加算された画素が隣接している場合、
(6)前記合計数が5で、前記隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素のいずれでもない画素が、前記注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、および、
(7)前記合計数が6で、前記隣接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素のいずれでもない画素が、前記注目画素に対し、上下の両方、左右の両方、または斜め方向の両方に存在している場合、
のいずれかである場合は、前記注目画素の画素値を、前記注目画素の走査の直前に走査された、前記注目画素に隣接する前記外部エッジ画素の画素値に置換しないと判定し、
前記合計数および前記位置関係が、前記(1)〜(7)のいずれでもない場合は、前記注目画素の画素値を、前記注目画素の走査の直前に走査された、前記注目画素に隣接する前記外部エッジ画素の画素値に置換すると判定する、請求項8に記載の画像処理方法。
The step (d) includes
The total number and the positional relationship are
(1) When the total number is 0 or 7,
(2) When the total number is 1 and the value obtained by adding the numbers of the internal edge pixels and the internal non-edge pixels among the eight pixels adjacent to the eight adjacent pixels is 2 or less,
(3) When the total number is 2 and the pixels whose numbers are added as the total number are adjacent to each other,
(4) When the total number is 3 and the pixels whose numbers are added as the total number are adjacent to each other,
(5) When the total number is 4 and the pixels whose numbers are added as the total number are adjacent to each other,
(6) The total number is 5, and among the adjacent pixels, a pixel that is neither the internal edge pixel nor the internal non-edge pixel is above and below the attention pixel, both left and right, or diagonal. If present in both directions, and
(7) The total number is 6, and among the adjacent pixels, a pixel that is neither the internal edge pixel nor the internal non-edge pixel is both above and below the left and right, or diagonally with respect to the target pixel. If present in both directions,
In any of the above, it is determined that the pixel value of the target pixel is not replaced with the pixel value of the external edge pixel that is scanned immediately before the target pixel and that is adjacent to the target pixel.
When the total number and the positional relationship are none of (1) to (7), the pixel value of the target pixel is adjacent to the target pixel scanned immediately before the target pixel is scanned. The image processing method according to claim 8, wherein it is determined that the pixel value of the external edge pixel is replaced.
細線化処理の強弱の選択を受け付ける段階(e)をさらに有し、
前記段階(e)において弱の選択が受け付けられた場合、前記所定の方向を第1方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第1方向と直交する第2方向として前記段階(a)〜(d)を行い、
前記段階(e)において強の選択が受け付けられた場合、前記所定の方向を前記第1方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第2方向として前記段階(a)〜(d)を行い、さらに、前記所定の方向を前記第1方向に対し反対方向の第3方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第2方向に対し反対方向の第4方向として前記段階(a)〜(d)を行う、請求項1〜9のいずれか一項に記載の画像処理方法。
The method further includes a step (e) of accepting selection of strength of thinning processing,
When the weak selection is accepted in the step (e), the predetermined direction is orthogonal to the first direction after performing the steps (a) to (d) with the predetermined direction as the first direction. Performing steps (a) to (d) as a second direction,
When a strong selection is accepted in the step (e), the steps (a) to (d) are performed with the predetermined direction as the first direction, and then the predetermined direction is set as the second direction. After performing steps (a) to (d) and further performing steps (a) to (d) with the predetermined direction as a third direction opposite to the first direction, the predetermined direction is changed. The image processing method according to claim 1, wherein the steps (a) to (d) are performed as a fourth direction which is an opposite direction to the second direction.
前記所定の方向を第5方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第5方向に直交する方向として前記段階(a)〜(d)を行う、請求項1〜9のいずれか一項に記載の画像処理方法。 The steps (a) to (d) are performed with the predetermined direction as a fifth direction, and then the steps (a) to (d) are performed with the predetermined direction as a direction orthogonal to the fifth direction. Item 10. The image processing method according to any one of Items 1 to 9. 前記所定の方向を第6方向として前記段階(a)〜(d)を行った後、前記所定の方向を前記第6方向に対し反対方向として前記段階(a)〜(d)を行う、請求項1〜9のいずれか一項に記載の画像処理方法。 The steps (a) to (d) are performed with the predetermined direction as a sixth direction, and then the steps (a) to (d) are performed with the predetermined direction as an opposite direction to the sixth direction. Item 10. The image processing method according to any one of Items 1 to 9. 前記多値画像データを、前記多値画像データに基づく画像の複数の領域に対応して分割することで複数の分割データを生成する段階(f)をさらに有し、
前記段階(a)〜(d)を、前記複数の分割データに対し、並列に行う、請求項1〜12のいずれか一項に記載の画像処理方法。
The method further includes a step (f) of generating a plurality of divided data by dividing the multi-valued image data corresponding to a plurality of regions of an image based on the multi-valued image data,
The image processing method according to claim 1, wherein steps (a) to (d) are performed in parallel on the plurality of divided data.
前記段階(f)は、前記多値画像データを、前記多値画像データに基づく画像の複数の領域に対応して分割するとともに、分割後の前記分割データに基づく画像の、分割方向の上下の端部に2画素以上のマージン部分を付加し、前記マージン部分が付加された分割画像にそれぞれ対応する前記複数の分割データを生成する、請求項13に記載の画像処理方法。 In the step (f), the multi-valued image data is divided corresponding to a plurality of regions of the image based on the multi-valued image data, and the image based on the divided data after the division is divided into upper and lower parts in the division direction. 14. The image processing method according to claim 13, wherein a margin portion of 2 pixels or more is added to an end portion, and the plurality of divided data corresponding to the divided images to which the margin portion is added are generated. 前記段階(d)において、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換すると判定された場合に、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換し、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換すると判定されない場合は、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換しない段階(g)をさらに有する、請求項1〜14のいずれか一項に記載の画像処理方法。 The pixel of the pixel of interest when it is determined in the step (d) that the pixel value of the pixel of interest is to be replaced with the pixel value of a pixel adjacent to the pixel of interest in the opposite direction to the predetermined direction. The value is replaced with the pixel value of a pixel adjacent to the target pixel in the opposite direction to the predetermined direction, and the pixel value of the target pixel is opposite to the target pixel in the opposite direction to the predetermined direction. If it is not determined that the pixel value of the pixel adjacent to the pixel of interest is to be replaced with the pixel value of the pixel of interest, the pixel value of the pixel of interest is not replaced with the pixel value of the pixel adjacent to the pixel of interest in the direction opposite to the predetermined direction (g The image processing method according to claim 1, further comprising: 多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する手順(a)と、
前記段階(a)において検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする手順(b)と、
前記手順(b)において前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする手順(c)と、
前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する手順(d)と、
を有する処理を、コンピューターに実行させるための画像処理プログラム。
A step (a) of scanning the multivalued image data for each color in a predetermined direction in an image based on the multivalued image data to detect edge pixel pairs forming an edge of an object;
Among the edge pixel pairs detected in the step (a), the pixels forming the outline of the object are given the attribute of the internal edge to be the internal edge pixels, and the pixels adjacent to the internal edge outside the object. A step (b) in which the attribute of the external edge is added to the external edge pixel, and
Based on the positional relationship between the internal edge pixel and the external edge pixel, for the pixel to which neither the internal edge attribute nor the external edge attribute has been given in the step (b), A step (c) of determining whether the pixel is an internal pixel and adding an attribute of internal non-edge to the pixel determined to be an internal pixel of the object to be an internal non-edge pixel;
The total number of the internal edge pixel and the internal non-edge pixel among the adjacent pixels that are close to each other within a predetermined number of pixels from the target pixel when the internal edge pixels are the target pixels, and the adjacent pixel The pixel value of the target pixel based on the positional relationship between the internal edge pixel and the internal non-edge pixel, and the pixel value of the pixel adjacent to the target pixel in the opposite direction to the predetermined direction. A procedure (d) for determining whether to replace with a value,
An image processing program for causing a computer to execute the processing including the above.
多値画像データを、色毎に、前記多値画像データに基づく画像における所定の方向に走査して、オブジェクトのエッジを構成するエッジ画素対を検出する検出部と、
前記検出部により検出された前記エッジ画素対のうち、前記オブジェクトの輪郭を形成する画素に内部エッジの属性を付与して内部エッジ画素とし、前記オブジェクトの外側で前記内部エッジに隣接する画素に外部エッジの属性を付与して外部エッジ画素とする第1属性付与部と、
前記第1属性付与部により前記内部エッジの属性および前記外部エッジの属性のいずれの属性も付与されなかった画素に対し、前記内部エッジ画素と前記外部エッジ画素との位置関係に基づいて、前記オブジェクトの内部の画素かどうか判断し、前記オブジェクトの内部の画素と判断した画素に内部非エッジの属性を付与して内部非エッジ画素とする第2属性付与部と、
前記内部エッジ画素をそれぞれ注目画素としたときの、前記注目画素から所定の画素数以内に近接する近接画素のうちの、前記内部エッジ画素および前記内部非エッジ画素の合計数、ならびに、前記近接画素のうちの、前記内部エッジ画素と前記内部非エッジ画素との位置関係に基づいて、前記注目画素の画素値を、前記注目画素に対して前記所定の方向に対し反対方向に隣接する画素の画素値に置換するかどうか判定する判定部と、
を有する、画像処理装置。
A multi-valued image data, for each color, scanning in a predetermined direction in an image based on the multi-valued image data, a detection unit for detecting an edge pixel pair forming an edge of an object;
Of the edge pixel pairs detected by the detection unit, the pixels forming the outline of the object are given the attribute of the internal edge to be internal edge pixels, and the pixels adjacent to the internal edge outside the object are externally output. A first attribute assigning unit that assigns an edge attribute to an external edge pixel;
Based on the positional relationship between the internal edge pixel and the external edge pixel, for the pixel for which neither the internal edge attribute nor the external edge attribute has been assigned by the first attribute assigning unit, the object A second attribute assigning unit that determines whether the pixel is an internal non-edge pixel by assigning an internal non-edge attribute to the pixel determined to be an internal pixel of the object.
The total number of the internal edge pixel and the internal non-edge pixel among the adjacent pixels that are close to each other within a predetermined number of pixels from the target pixel when the internal edge pixels are the target pixels, and the adjacent pixel The pixel value of the target pixel based on the positional relationship between the internal edge pixel and the internal non-edge pixel, and the pixel value of the pixel adjacent to the target pixel in the opposite direction to the predetermined direction. A determination unit that determines whether to replace with a value,
An image processing apparatus having:
JP2018236696A 2018-12-18 2018-12-18 Image processing method, image processing program, and image processing device Pending JP2020098497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018236696A JP2020098497A (en) 2018-12-18 2018-12-18 Image processing method, image processing program, and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018236696A JP2020098497A (en) 2018-12-18 2018-12-18 Image processing method, image processing program, and image processing device

Publications (1)

Publication Number Publication Date
JP2020098497A true JP2020098497A (en) 2020-06-25

Family

ID=71106834

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018236696A Pending JP2020098497A (en) 2018-12-18 2018-12-18 Image processing method, image processing program, and image processing device

Country Status (1)

Country Link
JP (1) JP2020098497A (en)

Similar Documents

Publication Publication Date Title
US10404877B2 (en) Image inspection apparatus, image inspection system, and method for determining image position
US10019792B2 (en) Examination device, examination method, and computer program product
US10657635B2 (en) Inspection apparatus, inspection method and storage medium
JP7206595B2 (en) Inspection device, inspection system, inspection method and program
JP2013024564A (en) Image inspection apparatus, image inspection system and image inspection method
US11606467B2 (en) Information processing apparatus, output method, and non-transitory computer-readable storage medium which highlights an abnormality before correction
JP2013111946A (en) Article inspecting device, article inspecting method, and program
JP6464722B2 (en) Information processing apparatus, defect transmission method, and program
US9826118B2 (en) Image formation apparatus
JP2016061603A (en) Projection device and projection method
JP2016035418A (en) Image processing device, output object inspection method, and program
JP2018004276A (en) Inspection device, inspection method and program
JP2017053673A (en) Inspection device, inspection method, and program
JP7236925B2 (en) image forming device
US11451685B2 (en) Color conversion table corrector that corrects the color conversion table according to data related to a first captured image excluding a specified area
JP2020098497A (en) Image processing method, image processing program, and image processing device
JP2013233764A (en) System, method, and program of print image inspection
JP4871211B2 (en) Image processing apparatus and image forming apparatus
JP2021111117A (en) Image inspection device and image formation device and program
JP2016176822A (en) Color measurement device, color measurement method, and program
US20230239412A1 (en) Inspection apparatus, method of controlling the same, and storage medium
JP2015053561A (en) Printed matter inspection device, printed matter inspection method, and program
US10939010B2 (en) Information processing system, information processing apparatus, image forming apparatus
US20240037891A1 (en) Image processing apparatus, image processing method, and storage medium
JP7159699B2 (en) Abnormal conveyance inspection device and image forming device