Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4802898B2 - Device and method for correcting an image having linear elements - Google Patents
[go: Go Back, main page]

JP4802898B2 - Device and method for correcting an image having linear elements - Google Patents

Device and method for correcting an image having linear elements Download PDF

Info

Publication number
JP4802898B2
JP4802898B2 JP2006188767A JP2006188767A JP4802898B2 JP 4802898 B2 JP4802898 B2 JP 4802898B2 JP 2006188767 A JP2006188767 A JP 2006188767A JP 2006188767 A JP2006188767 A JP 2006188767A JP 4802898 B2 JP4802898 B2 JP 4802898B2
Authority
JP
Japan
Prior art keywords
image
shift
pixel
distance
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2006188767A
Other languages
Japanese (ja)
Other versions
JP2008015952A (en
Inventor
直樹 河合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2006188767A priority Critical patent/JP4802898B2/en
Publication of JP2008015952A publication Critical patent/JP2008015952A/en
Application granted granted Critical
Publication of JP4802898B2 publication Critical patent/JP4802898B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Description

本発明は、線状要素を有する画像の修正装置および修正方法に関し、特に、万線やヘアラインと呼ばれる不定形の線状要素を多数配置してなる画像について、線状要素の密度分布を修正する技術に関する。   The present invention relates to a correction device and a correction method for an image having linear elements, and in particular, corrects the density distribution of linear elements for an image formed by arranging a large number of irregular linear elements called lines or hairlines. Regarding technology.

細長い線状要素を多数配置してなる画像は、様々な分野で利用されている。たとえば、
壁紙や床材をはじめとする建材の表面装飾や、家具の表面装飾には、万線やヘアラインと呼ばれる線状要素を多数配置してなる模様が施されることが少なくない。これらの模様は、通常の印刷によってインキ層として表面に形成される場合もあるし、箔押しの方法によって金属光沢をもった層として形成される場合もあるし、エンボス加工により表面の凹凸構造として形成される場合もある。特に、エンボス加工により形成された多数の線状要素からなる模様は、光の反射に方向性をもたせる機能を果たすことができるため、いわゆる「照り」の表現を行う上で有用である。
An image formed by arranging a large number of elongated linear elements is used in various fields. For example,
In many cases, the surface decoration of building materials such as wallpaper and flooring, and the surface decoration of furniture are provided with a pattern in which a large number of linear elements called lines and hairlines are arranged. These patterns may be formed on the surface as an ink layer by normal printing, may be formed as a layer with a metallic luster by a foil pressing method, or formed as an uneven structure on the surface by embossing. Sometimes it is done. In particular, a pattern composed of a large number of linear elements formed by embossing can serve a function of imparting directivity to the reflection of light, and thus is useful in expressing so-called “shine”.

たとえば、下記の特許文献1には、木材表面の照りの移動を表現するために、木目模様をもった建材表面に万線からなる多数の溝をエンボス加工によって形成する技術が開示されており、特許文献2には、コンピュータを利用して人工的に木目の導管断面パターンを生成する技術が開示されている。また、特許文献3には、天然木材の繊維質の配向性を表現するために、コンピュータを利用して、繊維潜り角の二次元スカラー場を定義し、この二次元スカラー場に基づいて万線パターンからなる画像を生成する方法が開示されている。更に、特許文献4には、任意の立体模様を多数のヘアライン状の溝からなるパターンによって表現する方法が開示されている。
特開平5−289302号公報 特開平9−327969号公報 特開2000−351263号公報 特開2001−138700号公報
For example, the following Patent Document 1 discloses a technique for embossing a large number of grooves made of lines on a building material surface having a wood grain pattern in order to express the movement of light on the surface of a wood. Patent Document 2 discloses a technique for artificially generating a cross-sectional pattern of a wood grain using a computer. Patent Document 3 defines a two-dimensional scalar field of fiber submerged angles using a computer in order to express the fiber orientation of natural wood, and the lines based on this two-dimensional scalar field. A method for generating an image consisting of a pattern is disclosed. Furthermore, Patent Document 4 discloses a method of expressing an arbitrary three-dimensional pattern by a pattern composed of a number of hairline-shaped grooves.
Japanese Patent Laid-Open No. 5-289302 JP-A-9-327969 JP 2000-351263 A JP 2001-138700 A

万線やヘアラインと呼ばれる線状要素を多数配置してなる模様としては、同一の幅や長さを有する規格化された線状要素を規則的に配置したものも利用されているが、逆に、それぞれが不規則な不定形形状を有する多数の線状要素を、不規則に配置したものが利用される場合も少なくない。特に、木材や石材などの天然素材の自然な風合いを表現する上では、多数の不定形の線状要素を多数配置してなる模様が好んで用いられる。このような模様をコンピュータで人工的に発生させるための手法として、乱数を用いて個々の線状要素の形状や位置を決定する手法や、フラクタル場を利用して線状要素の形状や位置に自然の揺らぎを加える手法が知られている。   As a pattern formed by arranging a large number of linear elements called lines or hairlines, a standard arrangement of standardized linear elements having the same width and length is also used. In many cases, an irregular arrangement of a large number of linear elements each having an irregular shape is used. In particular, in expressing the natural texture of natural materials such as wood and stone, a pattern formed by arranging a large number of irregularly shaped linear elements is preferably used. As a method for artificially generating such a pattern with a computer, a method for determining the shape and position of each linear element using random numbers, or a shape and position of the linear element using a fractal field are used. A technique for adding natural fluctuations is known.

しかしながら、このようにコンピュータを利用した手法で、不定形の線状要素を不規則に配置した画像を作成すると、線状要素の密度分布が一様にならない、という問題が生じる。もちろん、天然木板に現れる木目導管断面パターンなどでも、個々の導管断面(線状要素)の密度分布は一様ではないが、コンピュータを利用した手法で作成した画像の場合、人為的に発生させたパターンであるため、どうしても密度分布に不自然さが残ってしまう。   However, when an image in which irregular linear elements are irregularly arranged is created by a technique using a computer in this way, there arises a problem that the density distribution of the linear elements is not uniform. Of course, the density distribution of individual pipe cross-sections (linear elements) is not uniform even in the wood grain pipe cross-section patterns that appear on natural wood boards, but in the case of images created by a computer-based technique, they were generated artificially. Since it is a pattern, unnaturalness remains in the density distribution.

このような線状要素を有する画像における密度分布の不自然な不均一性は、意匠上の問題にとどまらず、当該画像を建材や包装材の表面装飾に利用するにあたって、製造プロセス上の問題をも生じさせる。たとえば、画像の部分ごとに極端に密度の粗密があると、印刷を行う際のインキ量が部分ごとに異なってくるため、印刷不良が生じやすくなる。また、箔押しの方法によって画像の転写を行う場合であれば、箔層が部分的にはげ落ちてしまうような事態も生じやすくなり、エンボス加工により凹凸を形成する場合であれば、エンボス圧が部分ごとに相違し、正しいエンボス加工ができない事態も生じやすくなる。   Such an unnatural non-uniformity of density distribution in an image having a linear element is not only a problem in design, but a problem in the manufacturing process when using the image for surface decoration of building materials and packaging materials. Also cause. For example, if there is an extremely dense density for each part of the image, the amount of ink at the time of printing varies from part to part, and printing defects tend to occur. In addition, if the image is transferred by the foil pressing method, the foil layer is likely to be partially peeled off. If the unevenness is formed by embossing, the embossing pressure is partially Every situation is different, and a situation where correct embossing cannot be performed easily occurs.

そこで本発明は、不定形の線状要素を多数配置してなる画像について、線状要素の密度分布を全体的に違和感が生じないように修正する技術を提供することを目的とする。   Therefore, an object of the present invention is to provide a technique for correcting the density distribution of linear elements so as not to cause a sense of incongruity as a whole for an image in which a large number of irregular linear elements are arranged.

(1) 本発明の第1の態様は、線状要素を多数配置してなる画像について、線状要素の密度分布を修正する画像の修正装置において、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像を入力する原画像入力部と、
入力した原画像を初期画像として格納する修正作業用画像格納部と、
入力した原画像を初期画像として格納するシフト画像格納部と、
修正作業用画像格納部内の画像について、個々の画素についての最近接黒画素に対する距離を求める距離演算部と、
距離演算部で演算された距離を示す値を画素値としてもつ距離画像を格納する距離画像格納部と、
所定のシフト量Δおよび空隙幅Wをパラメータとして設定するパラメータ設定部と、
シフト画像格納部内の画像を所定方向にシフト量Δだけシフトして更新するシフト処理部と、
シフト画像格納部内の画像の黒画素のうち、距離画像格納部内の画像の対応位置にある画素の画素値が空隙幅Wを超えている黒画素を、修正作業用画像格納部内の画像の対応位置にコピーするコピー処理部と、
を設けるようにしたものである。
(1) A first aspect of the present invention is an image correction apparatus for correcting a density distribution of linear elements for an image formed by arranging a large number of linear elements.
An original image input unit for inputting an original image to be corrected as a binary image composed of an aggregate of black pixels constituting a linear element portion and white pixels constituting a background portion;
A correction work image storage unit that stores the input original image as an initial image;
A shift image storage unit that stores the input original image as an initial image;
For the image in the correction work image storage unit, a distance calculation unit for obtaining a distance to the closest black pixel for each pixel;
A distance image storage unit for storing a distance image having a value indicating a distance calculated by the distance calculation unit as a pixel value;
A parameter setting unit for setting the predetermined shift amount Δ and the gap width W as parameters;
A shift processing unit that shifts and updates the image in the shift image storage unit by a shift amount Δ in a predetermined direction;
Among the black pixels of the image in the shift image storage unit, the black pixel in which the pixel value of the pixel at the corresponding position of the image in the distance image storage unit exceeds the gap width W is determined as the corresponding position of the image in the correction work image storage unit. A copy processing unit for copying to
Is provided.

(2) 本発明の第2の態様は、上述の第1の態様に係る線状要素を有する画像の修正装置において、
コピー処理部が、シフト画像格納部内の画像の個々の黒画素について、距離画像格納部内の画像の対応位置にある画素の画素値をそれぞれの参照画素値として求める処理を行い、この参照画素値が空隙幅Wを超えている黒画素が発見されたら、当該黒画素に対応する位置にある修正作業用画像格納部内の画像の白画素を黒画素に置換する処理を行うようにしたものである。
(2) According to a second aspect of the present invention, in the image correction apparatus having the linear element according to the first aspect described above,
The copy processing unit performs processing for obtaining the pixel value of the pixel at the corresponding position of the image in the distance image storage unit as each reference pixel value for each black pixel of the image in the shift image storage unit. When a black pixel exceeding the gap width W is found, a process of replacing the white pixel of the image in the correction work image storage unit at the position corresponding to the black pixel with the black pixel is performed.

(3) 本発明の第3の態様は、上述の第1の態様に係る線状要素を有する画像の修正装置において、
コピー処理部が、修正作業用画像格納部内の画像の個々の白画素について、「対応する位置にあるシフト画像格納部内の画像の画素が黒画素」かつ「対応する位置にある距離画像格納部内の画像の画素の画素値が空隙幅Wを超えている」という条件を満たすかどうかを判定し、当該条件を満たしていた場合には、当該白画素を黒画素に置換する処理を行うようにしたものである。
(3) According to a third aspect of the present invention, in the image correction apparatus having the linear element according to the first aspect described above,
For each white pixel of the image in the correction work image storage unit, the copy processing unit determines that “the pixel of the image in the shift image storage unit at the corresponding position is a black pixel” and “the pixel in the distance image storage unit at the corresponding position”. It is determined whether or not the condition that the pixel value of the pixel of the image exceeds the gap width W is satisfied, and when the condition is satisfied, a process of replacing the white pixel with a black pixel is performed. Is.

(4) 本発明の第4の態様は、線状要素を多数配置してなる画像について、線状要素の密度分布を修正する画像の修正装置において、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像を入力する原画像入力部と、
入力した原画像を初期画像として格納する修正作業用画像格納部と、
入力した原画像を初期画像として格納するシフト画像格納部と、
修正作業用画像格納部内の画像について、個々の画素についての最近接黒画素に対する距離を求める距離演算部と、
所定のシフト量Δおよび空隙幅Wをパラメータとして設定するパラメータ設定部と、
シフト画像格納部内の画像を所定方向にシフト量Δだけシフトして更新するシフト処理部と、
シフト画像格納部内の画像の黒画素のうち、修正作業用画像格納部内の画像の対応位置にある画素についての距離演算部によって求められた距離が空隙幅Wを超えている黒画素を、修正作業用画像格納部内の画像の対応位置にコピーするコピー処理部と、
を設けるようにしたものである。
(4) According to a fourth aspect of the present invention, there is provided an image correction apparatus for correcting a density distribution of linear elements with respect to an image formed by arranging a large number of linear elements.
An original image input unit for inputting an original image to be corrected as a binary image composed of an aggregate of black pixels constituting a linear element portion and white pixels constituting a background portion;
A correction work image storage unit that stores the input original image as an initial image;
A shift image storage unit that stores the input original image as an initial image;
For the image in the correction work image storage unit, a distance calculation unit for obtaining a distance to the closest black pixel for each pixel;
A parameter setting unit for setting the predetermined shift amount Δ and the gap width W as parameters;
A shift processing unit that shifts and updates the image in the shift image storage unit by a shift amount Δ in a predetermined direction;
Among the black pixels of the image in the shift image storage unit, the black pixel whose distance obtained by the distance calculation unit for the pixel at the corresponding position of the image in the correction work image storage unit exceeds the gap width W is corrected. A copy processing unit for copying to a corresponding position of the image in the image storage unit;
Is provided.

(5) 本発明の第5の態様は、上述の第1〜第4の態様に係る線状要素を有する画像の修正装置において、
シフト処理部が、シフト処理を複数回だけ繰り返し実行し、
コピー処理部が、各回のシフト処理が行われるごとにそれぞれコピー処理(実質的なコピーが全く行われない空コピー処理も含む)を実行し、
距離演算部が、原画像に対する距離演算処理およびコピー処理後の画像に対する距離演算処理を実行するようにしたものである。
(5) According to a fifth aspect of the present invention, in the image correction apparatus having the linear element according to the first to fourth aspects described above,
The shift processing unit repeatedly performs the shift process only a plurality of times,
The copy processing unit executes a copy process (including an empty copy process where no substantial copy is performed at all) each time the shift process is performed,
The distance calculation unit executes distance calculation processing for the original image and distance calculation processing for the image after the copy processing.

(6) 本発明の第6の態様は、上述の第5の態様に係る線状要素を有する画像の修正装置において、
シフト処理部が、距離演算処理により空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下になるまで、シフト処理を繰り返し実行するようにしたものである。
(6) According to a sixth aspect of the present invention, in the image correction apparatus having the linear element according to the fifth aspect described above,
The shift processing unit repeatedly executes the shift processing until the total number of pixels from which the distance exceeding the gap width W is obtained by the distance calculation processing is equal to or less than a predetermined reference value.

(7) 本発明の第7の態様は、上述の第5の態様に係る線状要素を有する画像の修正装置において、
シフト処理部が、空コピー処理が所定回数だけ連続して実行されるまで、シフト処理を繰り返し実行するようにしたものである。
(7) According to a seventh aspect of the present invention, in the image correction apparatus having the linear element according to the fifth aspect described above,
The shift processing unit repeatedly executes the shift process until the empty copy process is continuously executed a predetermined number of times.

(8) 本発明の第8の態様は、上述の第1〜第7の態様に係る線状要素を有する画像の修正装置において、
距離演算部が、2つの画素の中心点間のユークリッド距離もしくは当該ユークリッド距離を所定有効桁でまるめた値を演算値として求めるようにしたものである。
(8) According to an eighth aspect of the present invention, in the image correction apparatus having the linear element according to the first to seventh aspects described above,
The distance calculation unit obtains the Euclidean distance between the center points of the two pixels or a value obtained by rounding the Euclidean distance by a predetermined effective digit as the calculated value.

(9) 本発明の第9の態様は、上述の第1〜第7の態様に係る線状要素を有する画像の修正装置において、
距離演算部が、2つの画素の四近傍距離もしくは八近傍距離を演算値として求めるようにしたものである。
(9) According to a ninth aspect of the present invention, in the image correction apparatus having the linear element according to the first to seventh aspects described above,
The distance calculation unit obtains the four-neighbor distance or the eight-neighbor distance between two pixels as a calculation value.

(10) 本発明の第10の態様は、上述の第1〜第9の態様に係る線状要素を有する画像の修正装置において、
シフト処理部が、シフトにより画像の一方から食み出た画素を、シフトにより画像の他方に生じた空白部分に配置するローテーションシフトを行うようにしたものである。
(10) According to a tenth aspect of the present invention, in the image correction apparatus having the linear element according to the first to ninth aspects described above,
The shift processing unit performs a rotation shift in which a pixel protruding from one side of the image by the shift is arranged in a blank portion generated in the other side of the image by the shift.

(11) 本発明の第11の態様は、上述の第1〜第10の態様に係る線状要素を有する画像の修正装置において、
パラメータ設定部が、シフト方向をパラメータとして設定する機能を有し、
シフト処理部が、設定したシフト方向にシフト処理を実行するようにしたものである。
(11) According to an eleventh aspect of the present invention, in the image correction apparatus having the linear element according to the first to tenth aspects described above,
The parameter setting unit has a function of setting the shift direction as a parameter,
The shift processing unit executes shift processing in the set shift direction.

(12) 本発明の第12の態様は、上述の第1〜第11の態様に係る線状要素を有する画像の修正装置を、コンピュータに専用のプログラムを組み込むことにより実現したものである。   (12) According to a twelfth aspect of the present invention, the image correction apparatus having the linear elements according to the first to eleventh aspects described above is realized by incorporating a dedicated program into a computer.

(13) 本発明の第13の態様は、線状要素を多数配置してなる画像について、線状要素の密度分布を修正する画像の修正方法において、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像をコンピュータに入力し、入力した原画像を初期状態の修正作業用画像および初期状態のシフト画像として設定する原画像入力段階と、
所定のシフト量Δおよび空隙幅Wをパラメータとしてコンピュータに対して設定するパラメータ設定段階と、
コンピュータが、初期状態もしくはその後の状態の修正作業用画像の個々の画素についての最近接黒画素に対する距離を求める距離演算段階と、
コンピュータが、初期状態もしくはその後の状態のシフト画像を所定方向にシフト量Δだけシフトして更新する画像シフト段階と、
コンピュータが、シフト画像の黒画素のうち、修正作業用画像の対応位置にある画素について距離演算段階で求められた距離が空隙幅Wを超えている黒画素を、修正作業用画像の対応位置にコピーして更新する画像コピー段階と、
コンピュータが、更新後の修正作業用画像を修正済画像として出力する修正済画像出力段階と、
を実行するようにしたものである。
(13) According to a thirteenth aspect of the present invention, in an image correction method for correcting a density distribution of linear elements for an image formed by arranging a large number of linear elements,
The original image to be corrected is input to the computer as a binary image consisting of an aggregate of black pixels forming the linear element portion and white pixels forming the background portion, and the input original image is corrected in the initial state. Original image input stage to be set as an image for use and a shifted image in the initial state;
A parameter setting step for setting the predetermined shift amount Δ and the gap width W as parameters to the computer;
A distance calculating step for obtaining a distance from the nearest black pixel for each pixel of the correction work image in the initial state or the subsequent state;
An image shift stage in which the computer shifts and updates the shifted image in the initial state or the subsequent state by a shift amount Δ in a predetermined direction;
The computer uses, as the corresponding position of the correction work image, the black pixel whose distance obtained in the distance calculation step exceeds the gap width W for the pixel at the corresponding position of the correction work image among the black pixels of the shift image. An image copy stage to copy and update;
A corrected image output stage in which the computer outputs the updated image for correction work as a corrected image;
Is to be executed.

(14) 本発明の第14の態様は、上述の第13の態様に係る線状要素を有する画像の修正方法において、
距離演算段階、画像シフト段階、画像コピー段階(実質的なコピーが全く行われない空コピー段階も含む)を、複数回だけ繰り返し実行した後に、修正済画像出力段階を実行するようにしたものである。
(14) According to a fourteenth aspect of the present invention, in the method for correcting an image having a linear element according to the thirteenth aspect,
The corrected image output stage is executed after the distance calculation stage, the image shift stage, and the image copy stage (including the empty copy stage where no substantial copy is performed) are repeatedly executed a plurality of times. is there.

(15) 本発明の第15の態様は、上述の第14の態様に係る線状要素を有する画像の修正方法において、
距離演算段階で、空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下となった時点で、修正済画像出力段階を実行するようにしたものである。
(15) According to a fifteenth aspect of the present invention, in the correction method for an image having a linear element according to the fourteenth aspect described above,
In the distance calculation stage, the corrected image output stage is executed when the total number of pixels from which the distance exceeding the gap width W is obtained is equal to or less than a predetermined reference value.

(16) 本発明の第16の態様は、上述の第14の態様に係る線状要素を有する画像の修正方法において、
空コピー段階が所定回数だけ連続して実行された時点で、修正済画像出力段階を実行するようにしたものである。
(16) According to a sixteenth aspect of the present invention, in the method for correcting an image having a linear element according to the fourteenth aspect described above,
The corrected image output stage is executed when the empty copy stage is continuously executed a predetermined number of times.

(17) 本発明の第17の態様は、上述の第13〜第16の態様に係る線状要素を有する画像の修正方法において、
距離演算段階で、2つの画素の中心点間のユークリッド距離もしくは当該ユークリッド距離を所定有効桁でまるめた値を演算値として求めるようにしたものである。
(17) According to a seventeenth aspect of the present invention, in the image correction method having a linear element according to the thirteenth to sixteenth aspects described above,
In the distance calculation stage, a Euclidean distance between the center points of two pixels or a value obtained by rounding the Euclidean distance by a predetermined effective digit is obtained as a calculation value.

(18) 本発明の第18の態様は、上述の第13〜第16の態様に係る線状要素を有する画像の修正方法において、
距離演算段階で、2つの画素の四近傍距離もしくは八近傍距離を演算値として求めるようにしたものである。
(18) According to an eighteenth aspect of the present invention, in the image correction method having a linear element according to the thirteenth to sixteenth aspects described above,
In the distance calculation stage, the 4-neighbor distance or the 8-neighbor distance between two pixels is obtained as a calculated value.

(19) 本発明の第17の態様は、上述の第13〜第18の態様に係る線状要素を有する画像の修正方法において、
画像シフト段階で、シフトにより画像の一方から食み出た画素を、シフトにより画像の他方に生じた空白部分に配置するローテーションシフトを行うようにしたものである。
(19) According to a seventeenth aspect of the present invention, in the image correction method having a linear element according to the thirteenth to eighteenth aspects described above,
In the image shift stage, a rotation shift is performed in which pixels protruding from one side of the image by the shift are arranged in a blank portion generated in the other side of the image by the shift.

(20) 本発明の第20の態様は、上述の第13〜第19の態様に係る線状要素を有する画像の修正方法において、
パラメータ設定段階で、空隙幅Wとして、各線状要素の平均的な幅値にほぼ等しい値を設定するようにしたものである。
(20) According to a twentieth aspect of the present invention, in the image correction method having a linear element according to the thirteenth to nineteenth aspects described above,
In the parameter setting stage, the gap width W is set to a value substantially equal to the average width value of each linear element.

(21) 本発明の第21の態様は、上述の第13〜第20の態様に係る線状要素を有する画像の修正方法において、
パラメータ設定段階で、シフト量Δとして、空隙幅Wの2倍の値を設定するようにしたものである。
(21) According to a twenty-first aspect of the present invention, in the image correction method having a linear element according to the thirteenth to twentieth aspects described above,
In the parameter setting stage, a value twice the gap width W is set as the shift amount Δ.

(22) 本発明の第22の態様は、上述の第13〜第21の態様に係る線状要素を有する画像の修正方法において、
画像シフト段階で、全線状要素に共通する大まかな長手方向をコンピュータに対して指示し、コンピュータが、長手方向に対して直交する方向をシフト方向とするシフト処理を実行するようにしたものである。
(22) According to a twenty-second aspect of the present invention, in the image correction method having a linear element according to the thirteenth to twenty-first aspects described above,
In the image shift stage, a rough longitudinal direction common to all linear elements is instructed to the computer, and the computer executes a shift process with the direction orthogonal to the longitudinal direction as the shift direction. .

本発明によれば、不定形の線状要素を多数配置してなる画像について、線状要素の分布が粗となる領域に、既存の線状要素の全部もしくは一部をコピーするようにしたため、全体的に違和感のない密度分布の修正が可能になる。   According to the present invention, for an image in which a large number of irregular linear elements are arranged, all or part of the existing linear elements are copied to an area where the distribution of the linear elements is coarse. It is possible to correct the density distribution without any sense of incongruity.

以下、本発明を図示する実施形態に基づいて説明する。   Hereinafter, the present invention will be described based on the illustrated embodiments.

<<< §1.本発明の基本概念 >>>
図1は、本発明に係る修正方法による修正前の画像の一例を示す平面図であり、図2は、この図1に示す画像に対して、本発明に係る修正方法を適用することによって得られた修正後の画像の一例を示す平面図である。図1に示す修正前画像は、乱数を用いたアルゴリズムに基づき、コンピュータで人為的に発生させた画像であり、多数の不定形線状要素から構成されている。この修正前画像上の模様は、全体的には、葉脈のようなモチーフとなっており、自然の流れを表現するために、その発生過程において乱数を用いたアルゴリズムが利用されている。
<<< §1. Basic concept of the present invention >>
FIG. 1 is a plan view showing an example of an image before correction by the correction method according to the present invention, and FIG. 2 is obtained by applying the correction method according to the present invention to the image shown in FIG. It is a top view which shows an example of the obtained image after correction. The pre-correction image shown in FIG. 1 is an image artificially generated by a computer based on an algorithm using random numbers, and is composed of a large number of irregular linear elements. The pattern on the image before correction is a motif like a vein as a whole, and an algorithm using random numbers is used in the generation process in order to express a natural flow.

このように、不定形の線状要素を不規則に配置した画像をコンピュータを利用して作成すると、線状要素の密度分布が一様にならないという問題が生じる。たとえば、図1に示す例では、ところどころに空隙領域(白地の背景部分)が目立っており、線状要素の密度分布が不均一となっている。このような線状要素の密度分布の不均一性は、意匠上好ましくなく、また、印刷、箔押し、エンボス加工などの方法で建材や包装材の表面模様として利用した場合にも、製造プロセス上の様々な問題が生じることは、既に述べたとおりである。   As described above, when an image in which irregular linear elements are irregularly arranged is created using a computer, there is a problem that the density distribution of the linear elements is not uniform. For example, in the example shown in FIG. 1, the void region (white background portion) is conspicuous in some places, and the density distribution of the linear elements is uneven. Such non-uniformity of the density distribution of the linear elements is not desirable in terms of design, and also when used as a surface pattern of building materials or packaging materials by methods such as printing, foil stamping, embossing, etc. As described above, various problems occur.

この図1に示す修正前画像に対して、本発明に係る修正装置および修正方法を適用して得られた画像が、図2に示す修正後画像である。図1の画像において目立っていた白地の空隙領域が、図2の画像では解消しており、線状要素の密度分布が、より均一化されていることがわかる。しかも、図2に示す結果を見ると、修正を加えた部分が特段不自然に見えるようなこともない。実際、図2の画像を見る限り、どの部分が修正個所であるかを認識することはできず、修正を施すことにより、全体的に違和感は生じていない。   An image obtained by applying the correction device and the correction method according to the present invention to the image before correction shown in FIG. 1 is the image after correction shown in FIG. The white void region that was conspicuous in the image of FIG. 1 is eliminated in the image of FIG. 2, and it can be seen that the density distribution of the linear elements is made more uniform. In addition, when the result shown in FIG. 2 is seen, the part to which the correction is made does not appear to be particularly unnatural. Actually, as long as the image of FIG. 2 is viewed, it is impossible to recognize which part is the correction portion, and the overall feeling of incongruity does not occur by applying the correction.

本発明の特徴は、このように、不定形の線状要素を多数配置してなる画像について、線状要素の密度分布を全体的に違和感が生じないように修正することができる点にある。その基本原理は、修正対象となる原画像上の線状要素もしくはその一部分を、空隙部分に平行移動してコピーする、というものである。この基本原理によると、原画像において線状要素が「密」に配置されていた部分に対する修正はできないが、線状要素が「粗」に配置されていた部分には、新たな線状要素が配置されることになり、密度を向上させることができる。   The feature of the present invention is that the density distribution of linear elements can be corrected so as not to cause a sense of incongruity as a whole for an image formed by arranging a large number of irregular linear elements. The basic principle is that a linear element on the original image to be corrected or a part of the linear element is translated to a gap and copied. According to this basic principle, it is impossible to correct the portion where the linear elements are arranged “densely” in the original image, but new linear elements are added to the portion where the linear elements are arranged “roughly”. As a result, the density can be improved.

続いて、この基本原理を、図3〜図6の平面図を参照しながら、もう少し詳しく説明しよう。いま、図3に示すような原画像が修正対象として与えられたものとしよう。この原画像は、4本の線状要素L1〜L4からなる単純な画像であるが、実際には、多数の画素の集合から構成されている。ここでは、各線状要素L1〜L4の部分(ハッチングを施した部分)を構成する画素を「黒画素」と呼び、背景部分(図の白い部分)を構成する画素を「白画素」と呼ぶことにする。「黒画素」と「白画素」とは、画素値によって区別される。たとえば、「黒画素」を画素値「1」、「白画素」を画素値「0」で表わすことにすれば、この原画像は、1ビットの画素値をもつ多数の画素の集合体として表現される。   Next, this basic principle will be described in more detail with reference to the plan views of FIGS. Assume that an original image as shown in FIG. 3 is given as a correction target. This original image is a simple image made up of four linear elements L1 to L4, but is actually composed of a set of many pixels. Here, the pixels constituting the portions (hatched portions) of the linear elements L1 to L4 are referred to as “black pixels”, and the pixels constituting the background portion (white portion in the figure) are referred to as “white pixels”. To. “Black pixels” and “white pixels” are distinguished by pixel values. For example, if “black pixel” is represented by a pixel value “1” and “white pixel” is represented by a pixel value “0”, the original image is expressed as an aggregate of a large number of pixels having a 1-bit pixel value. Is done.

図3に示す原画像の線状要素L1とL2との間には、空隙領域SPが存在するため、全体的に、線状要素の分布密度にムラが生じている。そこで、この空隙領域SPに、たとえば、図4に示すように既存の線状要素L1をコピーし、新たな線状要素L1aとして追加すれば、空隙領域SPは解消し、線状要素の分布密度はより均一化されることになる。この例の場合、線状要素L1aは、元の線状要素L1と全く同じ形状をした要素であり、元の線状要素L1を、図に白矢印で示す方向に平行移動してコピーしたものになる。   Since there is a gap region SP between the linear elements L1 and L2 of the original image shown in FIG. 3, the distribution density of the linear elements is uneven as a whole. Therefore, for example, if the existing linear element L1 is copied to the void area SP as shown in FIG. 4 and added as a new linear element L1a, the void area SP is eliminated, and the distribution density of the linear elements is increased. Will be made more uniform. In this example, the linear element L1a is an element having exactly the same shape as the original linear element L1, and is a copy of the original linear element L1 translated in the direction indicated by the white arrow in the figure. become.

ただ、実際には、元の線状要素L1をそっくりコピーするのが好ましくない場合もある。たとえば、図5に示すような原画像に対して修正を行うことを考えてみる。この図5に示す原画像は、図3に示す原画像に線状要素L5を付加したものであるが、やはり線状要素L5の左側部分に空隙領域SPが生じてしまっている。ただ、この空隙領域SPを埋めるために、既存の線状要素L1をそっくりそのままコピーすると、線状要素L5と干渉してしまうため好ましくない。   However, in practice, it may not be preferable to copy the original linear element L1. For example, consider correcting an original image as shown in FIG. The original image shown in FIG. 5 is obtained by adding the linear element L5 to the original image shown in FIG. 3, but the void region SP is also generated in the left portion of the linear element L5. However, if the existing linear element L1 is copied as it is in order to fill the gap region SP, it is not preferable because it interferes with the linear element L5.

このような場合には、図6に示すように、既存の線状要素L1の一部分のみをコピーし、新たな線状要素L1bとして追加すればよい。すなわち、元の線状要素L1の左から2/3程の部分のみを、図に白矢印で示す方向に平行移動してコピーし、右から1/3程の部分はコピーしないようにすればよい。   In such a case, as shown in FIG. 6, only a part of the existing linear element L1 may be copied and added as a new linear element L1b. That is, if only the part of about 2/3 from the left of the original linear element L1 is translated and copied in the direction indicated by the white arrow in the figure, the part of about 1/3 from the right is not copied. Good.

このように、修正対象となる原画像上に既存の線状要素もしくはその一部分を、空隙領域にコピーする、という手法を採れば、コピーされた線状要素の形状は、既存の線状要素の形状に準じたものになるため、全体的に違和感が生じない修正が可能になる。また、コピーする際に、元の線状要素を平行移動する、という手法を採ることにより、コピーされた線状要素の向きも、既存の線状要素の向きに準じたものになるため、やはり全体的に違和感が生じない修正が可能になる。このように、新たに追加する線状要素の向きを、既存の線状要素の向きに合わせる、という手法は、特に、木材の「照り」を表現するための万線など、配向性が重要な機能を果たす線状模様の場合には有効である。   In this way, if a method of copying an existing linear element or a part of the existing linear element to the void area on the original image to be corrected is adopted, the shape of the copied linear element is the same as that of the existing linear element. Since it conforms to the shape, it is possible to make corrections that do not cause a sense of incongruity as a whole. In addition, by copying the original linear element when copying, the direction of the copied linear element will also conform to the direction of the existing linear element. It is possible to make corrections that do not cause a sense of discomfort overall. In this way, the orientation of the newly added linear element matches the orientation of the existing linear element, and in particular, the orientation is important, such as a line for expressing the “shine” of wood. This is effective in the case of a linear pattern that fulfills the function.

さて、上述したように、修正対象となる原画像上の線状要素もしくはその一部分を、空隙領域に平行移動してコピーする、という基本原理に従った修正を、コンピュータ上で行うためには、何らかのアルゴリズムが必要になる。すなわち、特定の線状要素の特定部分を、空隙領域の特定部分へコピーする、という処理をコンピュータに実行させるためには、具体的なアルゴリズムに基づいてプログラムを作成する必要がある。   As described above, in order to perform correction on the computer in accordance with the basic principle that the linear element on the original image to be corrected or a part of the linear element is translated and copied to the gap area, Some kind of algorithm is required. That is, in order for the computer to execute the process of copying the specific part of the specific linear element to the specific part of the gap region, it is necessary to create a program based on a specific algorithm.

そこで、本発明では、次のようなアルゴリズムにより、この修正処理を実行させるようにした。まず、原画像の個々の白画素について、それぞれ空間的に最も近い位置に存在する黒画素(最近接黒画素)に対する距離値を求める。その結果、既存の線状要素から遠い白画素ほど、大きな距離値が与えられることになる。そして、各距離値を画素値としてもつ距離画像を生成する。次に、原画像全体を所定方向に所定ピッチだけシフトさせたシフト画像を生成し、このシフト画像上の黒画素のうち、対応する距離画像上の画素値が所定値を超える画素をコピー対象画素と定め、当該コピー対象画素からなる線状要素を原画像上にコピーすることにより密度分布の修正を行うようにする。以下、このアルゴリズムについて、より具体的な説明を行う。   Therefore, in the present invention, this correction processing is executed by the following algorithm. First, for each white pixel of the original image, a distance value with respect to a black pixel (closest black pixel) existing in the spatially closest position is obtained. As a result, a larger distance value is given to the white pixel farther from the existing linear element. Then, a distance image having each distance value as a pixel value is generated. Next, a shift image is generated by shifting the entire original image by a predetermined pitch in a predetermined direction, and among the black pixels on the shifted image, pixels whose pixel values on the corresponding distance image exceed a predetermined value are to be copied. And the density distribution is corrected by copying the linear element composed of the copy target pixels onto the original image. Hereinafter, this algorithm will be described more specifically.

<<< §2.本発明に係る修正装置の構成 >>>
ここでは、上述したアルゴリズムに基づく修正処理を実行することが可能な修正装置の基本構成を図7のブロック図を参照しながら説明する。この修正装置は、図示のとおり、原画像入力部10、シフト画像格納部20、修正作業用画像格納部30、コピー処理部40、シフト処理部50、パラメータ設定部60、距離演算部70、距離画像格納部80によって構成されており、線状要素を多数配置してなる原画像P0について、線状要素の密度分布を修正する処理を行う機能を有している。
<<< §2. Configuration of correction apparatus according to the present invention >>
Here, a basic configuration of a correction apparatus capable of executing the correction process based on the above-described algorithm will be described with reference to the block diagram of FIG. As illustrated, the correction apparatus includes an original image input unit 10, a shift image storage unit 20, a correction work image storage unit 30, a copy processing unit 40, a shift processing unit 50, a parameter setting unit 60, a distance calculation unit 70, a distance calculation unit 70, The image storage unit 80 is configured to have a function of performing processing for correcting the density distribution of the linear elements on the original image P0 in which a large number of linear elements are arranged.

もっとも、実際には、この修正装置は、コンピュータに専用のプログラムを組み込むことにより実現されるものであり、上述した各構成要素は、いずれもコンピュータのハードウエアおよびソフトウエアの組合わせによって具現化されることになる。たとえば、シフト画像格納部20、修正作業用画像格納部30、距離画像格納部80は、いずれも画像データを格納する機能をもった構成要素であるが、実際には、コンピュータメモリなどの記憶装置によって構成されることになる。また、原画像入力部10やパラメータ設定部60は、外部からのデータや指示を入力するためのコンピュータ用入力機器を利用して構成され、コピー処理部40、シフト処理部50、距離演算部70は、所定の演算処理用プログラムと演算処理装置との組合わせによって実現されることになる。   However, in practice, this correction device is realized by incorporating a dedicated program into the computer, and each of the above-described components is embodied by a combination of computer hardware and software. Will be. For example, the shift image storage unit 20, the correction work image storage unit 30, and the distance image storage unit 80 are all components having a function of storing image data, but actually, a storage device such as a computer memory or the like. Will be configured. The original image input unit 10 and the parameter setting unit 60 are configured using a computer input device for inputting data and instructions from the outside, and include a copy processing unit 40, a shift processing unit 50, and a distance calculation unit 70. Is realized by a combination of a predetermined arithmetic processing program and an arithmetic processing device.

原画像入力部10は、修正対象となる原画像P0を二値画像として入力する構成要素である。前述したように、ここでは、線状要素を含む画像において、線状要素部分を構成する画素を「黒画素」と呼び、背景部分を構成する画素を「白画素」と呼ぶことにする。したがって、原画像入力部10は、黒画素と白画素との集合体からなる二値画像として、修正対象となる原画像P0を入力する構成要素ということになる。   The original image input unit 10 is a component that inputs the original image P0 to be corrected as a binary image. As described above, in the image including the linear elements, the pixels constituting the linear element portion are referred to as “black pixels” and the pixels constituting the background portion are referred to as “white pixels”. Therefore, the original image input unit 10 is a component that inputs the original image P0 to be corrected as a binary image composed of an aggregate of black pixels and white pixels.

なお、本願における「黒画素」,「白画素」という用語は、単に、「線状要素部分を構成する画素」,「背景部分を構成する画素」を意味する用語として用いるものであり、「第1属性の画素」,「第2属性の画素」と同義である。ここで「第1属性の画素」,「第2属性の画素」という語句の代わりに、「黒」や「白」という色を示す語句を敢えて用いているのは、図面を参照しながら実施例の説明を行う上での便宜を図るため(視覚的把握を容易にするため)のものであり、「黒画素」,「白画素」は、画像上の実際の色を示すものではない。   Note that the terms “black pixel” and “white pixel” in the present application are simply used as terms meaning “a pixel constituting the linear element portion” and “a pixel constituting the background portion”. This is synonymous with “one attribute pixel” and “second attribute pixel”. Here, instead of the words “first attribute pixel” and “second attribute pixel”, the word “black” or “white” indicating the color is used in the embodiment with reference to the drawings. The “black pixel” and the “white pixel” do not indicate actual colors on the image, for the sake of convenience (in order to facilitate visual understanding).

原画像入力部10によって入力された原画像P0は、シフト画像格納部20および修正作業用画像格納部30にそれぞれ格納される。ここに示す実施形態では、原画像P0は、I行J列の二次元画素配列からなるデータであり、第i行第j列目の位置にある画素をP0(i,j)で表わすことにする。上述したとおり、この原画像P0を構成する画素は、黒画素か白画素かのいずれか一方である。すなわち、原画像P0は二値画像であり、任意の画素P0(i,j)は、画素値「1」(黒画素の場合)もしくは画素値「0」(白画素の場合)のいずれか一方の画素値を有している。   The original image P0 input by the original image input unit 10 is stored in the shift image storage unit 20 and the correction work image storage unit 30, respectively. In the embodiment shown here, the original image P0 is data composed of a two-dimensional pixel array of I rows and J columns, and the pixel at the position of the i-th row and j-th column is represented by P0 (i, j). To do. As described above, the pixels constituting the original image P0 are either black pixels or white pixels. That is, the original image P0 is a binary image, and an arbitrary pixel P0 (i, j) has either a pixel value “1” (for black pixels) or a pixel value “0” (for white pixels). Of pixel values.

シフト画像格納部20は、I行J列の二次元画素配列からなる画像データを格納する機能をもった記憶領域である。ここでは、このシフト画像格納部20に格納されることになる画像を「シフト画像Sk」と呼ぶことにし、このシフト画像Skの第i行第j列目の位置にある画素をSk(i,j)で表わすことにする。ここで、「シフト画像Sk」や「画素Sk(i,j)」における添字の「k」は、1,2,3,…という整数である。シフト画像Skは、元になる原画像P0を、所定方向に、所定のシフト量だけ、k回だけシフトさせることにより得られる画像である。元になる原画像P0自身を、シフト画像と呼ばないことにすれば、上述のようにシフト画像Skの添字の「k」は1から始まることになるが、原画像P0自身を初期状態のシフト画像(原画像を0回だけシフトさせることにより得られる画像)として把握すれば、添字の「k」は、0から始まることになる。   The shift image storage unit 20 is a storage area having a function of storing image data composed of a two-dimensional pixel array of I rows and J columns. Here, the image to be stored in the shift image storage unit 20 is referred to as “shift image Sk”, and the pixel at the position of the i-th row and the j-th column of the shift image Sk is defined as Sk (i, j). Here, the subscript “k” in “shift image Sk” and “pixel Sk (i, j)” is an integer of 1, 2, 3,. The shift image Sk is an image obtained by shifting the original original image P0 by a predetermined shift amount by k times in a predetermined direction. If the original image P0 itself is not called a shifted image, the subscript “k” of the shifted image Sk starts from 1 as described above, but the original image P0 itself is shifted in the initial state. If it is grasped as an image (an image obtained by shifting the original image only 0 times), the subscript “k” starts from 0.

同様に、修正作業用画像格納部30も、I行J列の二次元画素配列からなる画像データを格納する機能をもった記憶領域である。ここでは、この修正作業用画像格納部30に格納されることになる画像を「修正作業用画像Pk」と呼ぶことにし、この修正作業用画像Pkの第i行第j列目の位置にある画素をPk(i,j)で表わすことにする。ここでの添字の「k」は、0,1,2,…という整数である。なお、ここでは、便宜上、元になる原画像P0自身も、修正作業用画像Pkと呼ぶことにし、修正作業用画像Pkの添字の「k」は0から始まることにする。   Similarly, the correction work image storage unit 30 is also a storage area having a function of storing image data composed of a two-dimensional pixel array of I rows and J columns. Here, the image to be stored in the correction work image storage unit 30 is referred to as “correction work image Pk”, and is located at the position of the i-th row and j-th column of the correction work image Pk. Let the pixel be represented by Pk (i, j). Here, the subscript “k” is an integer of 0, 1, 2,. Here, for convenience, the original original image P0 itself is also called a correction work image Pk, and the subscript “k” of the correction work image Pk starts from 0.

結局、原画像入力部10から入力された原画像P0は、シフト画像格納部20内に、シフト画像を生成するための元になる初期画像として格納されるとともに、修正作業用画像格納部30内に、最初の修正作業用画像として格納されることになる。別言すれば、シフト画像格納部20内に格納される初期画像と、修正作業用画像格納部30内に格納される初期画像とは、いずれも原画像P0に一致する。   Eventually, the original image P0 input from the original image input unit 10 is stored in the shift image storage unit 20 as an initial image for generating a shift image, and in the correction work image storage unit 30. The first correction work image is stored. In other words, the initial image stored in the shift image storage unit 20 and the initial image stored in the correction work image storage unit 30 both match the original image P0.

パラメータ設定部60は、所定のシフト量Δおよび空隙幅Wをパラメータとして設定する機能を有する。これらのパラメータの値として、常に固定値を用いるのであれば、当該固定値をパラメータ設定部60に記憶させておけばよい。ただ、後述するように、このパラメータは、修正処理の内容に影響を与えることになるので、実用上は、オペレータが任意の値をパラメータとして自由に設定できるようにしておくのが好ましい。具体的には、キーボードなどから、ΔおよびWの値をオペレータが直接入力できるようにしておいてもよいし、ディスプレイ画面上に表示されたツマミなどをマウスでドラッグすることにより、数値を増減できるインターフェイスを用意しておき、オペレータがツマミなどを所望の位置に移動させることにより、所望の数値をパラメータとして設定できるようにしておいてもよい。   The parameter setting unit 60 has a function of setting a predetermined shift amount Δ and a gap width W as parameters. If fixed values are always used as the values of these parameters, the fixed values may be stored in the parameter setting unit 60. However, as will be described later, since this parameter affects the contents of the correction process, it is preferable that the operator can freely set an arbitrary value as a parameter in practice. Specifically, the value of Δ and W may be directly input by an operator from a keyboard or the like, and the numerical value can be increased or decreased by dragging a knob or the like displayed on the display screen with a mouse. An interface may be prepared so that an operator can set a desired numerical value as a parameter by moving a knob or the like to a desired position.

シフト処理部50は、シフト画像格納部20内に格納されている画像を所定方向に、シフト量Δ(パラメータ設定部60に設定した値)だけシフトして更新する処理を実行する。ここに示す実施形態の場合、シフト画像格納部20内には、I行J列の二次元画素配列からなる画像が格納されているので、この画像を下方向にシフト量Δだけローテーションシフトする処理が行われる。たとえば、シフト量Δ=1画素に設定した場合、第1行目の画素は第2行目へ移動し、第2行目の画素は第3行目へ移動し、第3行目の画素は第4行目へ移動し、……、第I行目(最下行)の画素は第1行目(最上行)へ移動することになる。もちろん、「画像をシフトする」と言っても、実際には、個々の配列要素に格納されている画素値を移動させる演算が行われることになる。   The shift processing unit 50 executes a process of updating the image stored in the shift image storage unit 20 by shifting the image by a shift amount Δ (value set in the parameter setting unit 60) in a predetermined direction. In the case of the embodiment shown here, since an image composed of a two-dimensional pixel array of I rows and J columns is stored in the shift image storage unit 20, the image is rotated by a shift amount Δ in the downward direction. Is done. For example, when the shift amount Δ is set to 1 pixel, the pixels in the first row move to the second row, the pixels in the second row move to the third row, and the pixels in the third row Moving to the fourth row, the pixels in the I-th row (bottom row) move to the first row (top row). Of course, even if “shifting the image” is actually performed, an operation for moving the pixel values stored in the individual array elements is performed.

距離演算部70は、修正作業用画像格納部30内の画像について、個々の画素についての最近接黒画素に対する距離を求める演算を行い、この距離演算部70で演算された距離を示す値を画素値としてもつ距離画像Dkが、距離画像格納部80に格納される。この距離画像Dkも、I行J列の二次元画素配列からなる画像データであり、この距離画像Dkの第i行第j列目の位置にある画素をDk(i,j)で表わすことにする。したがって、距離画像Dkを格納する機能をもった距離画像格納部80も、I行J列の二次元画素配列からなる画像データを格納する機能をもった記憶領域ということになる。   The distance calculation unit 70 calculates a distance from the nearest black pixel for each pixel for the image in the correction work image storage unit 30 and sets a value indicating the distance calculated by the distance calculation unit 70 to the pixel. A distance image Dk having a value is stored in the distance image storage unit 80. This distance image Dk is also image data composed of a two-dimensional pixel array of I rows and J columns, and the pixel at the position of the i-th row and j-th column of the distance image Dk is represented by Dk (i, j). To do. Therefore, the distance image storage unit 80 having a function of storing the distance image Dk is also a storage area having a function of storing image data including a two-dimensional pixel array of I rows and J columns.

ここでの添字の「k」は、修正作業用画像Pkの添字「k」に対応するものであり、やはり0,1,2,…という整数になる。たとえば、修正作業用画像格納部30内には、初期画像として、修正作業用画像P0(原画像と同一)が格納されているが、この修正作業用画像P0について距離演算部70が行った演算により得られた画像は、最初の距離画像D0として、距離画像格納部80に格納されることになる。同様に、第k番目の修正作業用画像Pkについて距離演算部70が行った演算により得られた画像は、第k番目の距離画像Dkとして、距離画像格納部80に格納されることになる。このように、距離画像格納部80内の距離画像は、修正作業用画像格納部30内の画像が更新されるたびに、新たな画像に更新されることになる。   The subscript “k” here corresponds to the subscript “k” of the correction work image Pk, and is also an integer of 0, 1, 2,. For example, the correction work image storage unit 30 stores a correction work image P0 (same as the original image) as an initial image. The calculation performed by the distance calculation unit 70 on the correction work image P0. The image obtained by the above is stored in the distance image storage unit 80 as the first distance image D0. Similarly, the image obtained by the calculation performed by the distance calculation unit 70 on the kth correction work image Pk is stored in the distance image storage unit 80 as the kth distance image Dk. In this manner, the distance image in the distance image storage unit 80 is updated to a new image every time the image in the correction work image storage unit 30 is updated.

コピー処理部40は、シフト画像格納部20内に格納されているシフト画像Sk内の線状要素もしくはその一部を、修正作業用画像格納部30に格納されている修正作業用画像Pkの上にコピーする処理を実行する。具体的には、シフト画像格納部20内の画像の黒画素のうち、距離画像格納部80内の画像の対応位置にある画素の画素値が空隙幅W(パラメータ設定部60に設定した値)を超えている黒画素を、コピー対象画素として決定し、修正作業用画像格納部30内の画像の対応位置にコピーする処理を実行する。いわば、図4に示す線状要素L1aや図6に示す線状要素L1bを新たな線状要素として追加する処理を実行する機能を有している。   The copy processing unit 40 converts the linear element in the shift image Sk stored in the shift image storage unit 20 or a part thereof onto the correction work image Pk stored in the correction work image storage unit 30. Execute the copy process. Specifically, among the black pixels of the image in the shift image storage unit 20, the pixel value of the pixel at the corresponding position of the image in the distance image storage unit 80 is the gap width W (value set in the parameter setting unit 60). Is determined as a copy target pixel, and a process of copying to a corresponding position of the image in the correction work image storage unit 30 is executed. In other words, it has a function of executing processing for adding the linear element L1a shown in FIG. 4 or the linear element L1b shown in FIG. 6 as a new linear element.

<<< §3.本発明に係る修正方法の手順 >>>
続いて、図8の流れ図を参照しながら、本発明に係る修正方法の手順を説明する。まず、ステップS1において、原画像入力段階が行われる。この段階は、線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像をコンピュータに入力し、入力した原画像を初期状態の修正作業用画像および初期状態のシフト画像として設定する段階である。たとえば、図7に示す例の場合、原画像P0が、初期状態のシフト画像S0としてシフト画像格納部20へ格納されるとともに、初期状態の修正作業用画像P0として修正作業用画像格納部30へ格納される。
<<< §3. Procedure of correction method according to the present invention >>
Next, the procedure of the correction method according to the present invention will be described with reference to the flowchart of FIG. First, in step S1, an original image input stage is performed. In this stage, the original image to be corrected is input to the computer as a binary image composed of a collection of black pixels constituting the linear element portion and white pixels constituting the background portion. This is a stage of setting as a state correction work image and an initial shift image. For example, in the case of the example shown in FIG. 7, the original image P0 is stored in the shift image storage unit 20 as the shifted image S0 in the initial state, and to the correction work image storage unit 30 as the correction work image P0 in the initial state. Stored.

続くステップS2では、所定のシフト量Δおよび空隙幅Wをパラメータとしてコンピュータに対して設定する段階が行われる。ここに示す実施形態の場合、シフト量Δ,空隙幅Wともに「画素」を単位とする整数値として設定される。以上、ステップS1,S2は、コンピュータに修正処理を実行させるための準備段階というべき処理である。実質的な修正処理の手順は、続くステップS3〜S5によって行われる。   In the subsequent step S2, a step of setting the predetermined shift amount Δ and the gap width W as parameters to the computer is performed. In the case of the embodiment shown here, both the shift amount Δ and the gap width W are set as integer values in units of “pixels”. As described above, steps S1 and S2 are processes that should be called preparation steps for causing the computer to execute the correction process. Substantial correction processing procedures are performed in subsequent steps S3 to S5.

まず、ステップS3の距離演算段階では、コンピュータ(距離演算部70)が、初期状態もしくはその後の状態の修正作業用画像Pk(修正作業用画像格納部30に格納されている画像)の個々の画素についての最近接黒画素に対する距離を求める処理が行われ、その結果として得られる距離画像Dkが、距離画像格納部80に格納される。ステップS2に続いて、最初にステップS3が実行された場合、修正作業用画像格納部30内には、原画像P0が初期状態の修正作業用画像P0として格納されているので、この原画像P0についての距離画像D0が演算によって求められ、距離画像格納部80内に格納されることになる。   First, in the distance calculation stage of step S3, the computer (distance calculation unit 70) causes the individual pixels of the correction work image Pk (image stored in the correction work image storage unit 30) in the initial state or the subsequent state. Is obtained, and the distance image Dk obtained as a result is stored in the distance image storage unit 80. When Step S3 is first executed following Step S2, the original image P0 is stored in the correction work image storage unit 30 as the correction work image P0 in the initial state. Is obtained by calculation and stored in the distance image storage unit 80.

ステップS4の画像シフト段階では、コンピュータ(シフト処理部50)が、初期状態もしくはその後の状態のシフト画像(シフト画像格納部20に格納されている画像)を所定方向にシフト量Δ(ステップS2で設定したパラメータ)だけシフトして更新する処理が行われる。初期状態では、シフト画像格納部20内には、原画像P0が格納されているので、この原画像P0に対してシフト量Δだけローテーションシフトして得られるシフト画像によって、シフト画像格納部20内の画像が書き換えられることになる。   At the image shift stage of step S4, the computer (shift processing unit 50) shifts the shift image in the initial state or the subsequent state (image stored in the shift image storage unit 20) by a shift amount Δ (in step S2). A process of shifting and updating by the set parameter) is performed. In the initial state, since the original image P0 is stored in the shift image storage unit 20, the shift image storage unit 20 uses a shift image obtained by rotating the original image P0 by the shift amount Δ. Will be rewritten.

続くステップS5の画像コピー段階では、コンピュータ(コピー処理部40)が、シフト画像Sk(シフト画像格納部20に格納されている画像)の黒画素について、修正作業用画像Pk(修正作業用画像格納部30に格納されている画像)の対応位置にある画素について距離演算段階で求められた距離(すなわち、距離画像格納部80に格納されている距離画像Dk内の画素値)を調べ、当該距離が空隙幅W(ステップS2で設定したパラメータ)を超えていた場合には、当該黒画素を、修正作業用画像Pkの対応位置にコピーして更新する処理が行われる。   In the subsequent image copy stage of step S5, the computer (copy processing unit 40) performs correction work image Pk (correction work image storage) for the black pixels of the shift image Sk (image stored in the shift image storage unit 20). The distance (that is, the pixel value in the distance image Dk stored in the distance image storage unit 80) obtained in the distance calculation step for the pixel at the corresponding position of the image stored in the unit 30) Is larger than the gap width W (the parameter set in step S2), the black pixel is copied to the corresponding position of the correction work image Pk and updated.

たとえば、シフト画像Sk内の第i行第j列目の画素Sk(i,j)が黒画素であったものとしよう。この場合、修正作業用画像Pkの同じ位置の画素Pk(i,j)についての距離(最近接黒画素に対する距離)は、ステップS3の距離演算段階で求められており、距離画像Dkの同じ位置の画素Dk(i,j)の画素値として記録されている。そこで、この画素Dk(i,j)の画素値を空隙幅Wと比較し、前者が後者を超えていた場合には、黒画素Sk(i,j)を、修正作業用画像Pkの同じ位置へコピーする処理が行われる。実際には、修正作業用画像Pkの同じ位置の画素Pk(i,j)の画素値を黒画素を示す画素値「1」に変更する処理が行われることになる。シフト画像Sk内のすべての黒画素について、同様の処理を行えば、ステップS5の画像コピー段階は完了である。   For example, let it be assumed that the pixel Sk (i, j) in the i-th row and j-th column in the shift image Sk is a black pixel. In this case, the distance (distance to the closest black pixel) for the pixel Pk (i, j) at the same position in the correction work image Pk is obtained in the distance calculation stage in step S3, and the same position in the distance image Dk. Is recorded as the pixel value of the pixel Dk (i, j). Therefore, the pixel value of the pixel Dk (i, j) is compared with the gap width W, and when the former exceeds the latter, the black pixel Sk (i, j) is placed at the same position in the correction work image Pk. The process of copying to is performed. Actually, a process of changing the pixel value of the pixel Pk (i, j) at the same position in the correction work image Pk to the pixel value “1” indicating the black pixel is performed. If the same processing is performed for all the black pixels in the shift image Sk, the image copy stage in step S5 is completed.

以上のステップS3〜S5の処理段階により、修正作業用画像Pk内の空隙領域に、シフト画像Skの適当な箇所から線状要素のコピーが行われることになり、線状要素の密度分布の均一化が進むことになる。ただ、実際には、ステップS5において、条件を満たす黒画素(コピー対象となる黒画素)が1つも見つからず、実質的な黒画素のコピーが全く行われないケースもあり得る。この場合、ステップS5の画像コピー段階は、単なる「空コピー段階」ということになる。また、ステップS5において、実質的なコピーが行われたとしても、それだけでは不十分な場合も少なくない。そこで、実用上は、ステップS3の距離演算段階、ステップS4の画像シフト段階、ステップS5の画像コピー段階(実質的なコピーが全く行われない空コピー段階も含む)を、複数回だけ繰り返し実行するのが好ましい。   Through the processing steps of steps S3 to S5, the linear elements are copied from the appropriate positions of the shift image Sk to the void area in the correction work image Pk, and the density distribution of the linear elements is uniform. Will progress. However, in practice, in step S5, no black pixel satisfying the condition (a black pixel to be copied) is found, and there may be a case where no substantial black pixel is copied. In this case, the image copy stage in step S5 is simply an “empty copy stage”. Even if substantial copying is performed in step S5, it is not sufficient in many cases. Therefore, in practice, the distance calculation stage in step S3, the image shift stage in step S4, and the image copy stage in step S5 (including an empty copy stage in which no substantial copy is performed) are repeatedly executed a plurality of times. Is preferred.

そのために、図8の流れ図に示す手順では、ステップS6の分岐を経て、再びステップS3へと戻るループを形成し、ステップS6において「終了」との判断がなされるまで、ステップS3〜S5の処理段階が繰り返し実行されるようにしている。ステップS6では、たとえば、繰り返し回数が予め定めた所定の設定値に達したか否か、というような所定の条件(より実用的な条件設定については後述する)を定めておき、ステップS3へ戻るか、ステップS7へ進むかの判断を行うようにすればよい。   Therefore, in the procedure shown in the flowchart of FIG. 8, a loop is formed through the branch of step S6 and then back to step S3, and the processing of steps S3 to S5 is performed until it is determined “end” in step S6. The steps are executed repeatedly. In step S6, for example, a predetermined condition (whether more practical condition setting will be described later) such as whether or not the number of repetitions has reached a predetermined value set in advance is determined, and the process returns to step S3. Alternatively, it may be determined whether to proceed to step S7.

最後のステップS7の修正済画像出力段階では、更新後の修正作業用画像Pk(その時点で、修正作業用画像格納部30内に格納されている画像)を修正済画像としてコンピュータから出力する処理が行われる。   In the corrected image output stage of the last step S7, a process of outputting the updated correction work image Pk (the image stored in the correction work image storage unit 30 at that time) from the computer as a corrected image. Is done.

<<< §4.具体例に基づく手順説明 >>>
ここでは、具体的な原画像について、図7に示す修正装置を用いて、図8に示す修正方法の手順を実行した例を詳細に説明する。まず、図8のステップS1「原画像入力段階」において、図9に示すような原画像P0が入力された場合を考えてみる。この図9に示す原画像P0は、図1に示す実際の原画像に比べるとかなり粗い画像であるが、説明の便宜を考慮して、以下、このような原画像P0に対する修正処理の手順を述べる。
<<< §4. Procedure explanation based on specific example >>>
Here, an example in which the procedure of the correction method shown in FIG. 8 is executed on a specific original image using the correction device shown in FIG. 7 will be described in detail. First, let us consider a case where an original image P0 as shown in FIG. 9 is input in step S1 “original image input stage” of FIG. The original image P0 shown in FIG. 9 is considerably coarser than the actual original image shown in FIG. 1, but for the convenience of explanation, the procedure of the correction process for the original image P0 will be described below. State.

この原画像P0は、I行J列の二次元画素配列からなる画像であり、図示のとおり、3つの線状要素L11,L12,L13を有している。図にハッチングを施して示す小さな正方形は、個々の黒画素(たとえば、画素値「1」をもつ画素)を示しており、各線状要素L11,L12,L13は、いずれもこの黒画素の集合体によって構成されている。一方、白地の背景として示されている領域は、白画素(たとえば、画素値「0」をもつ画素)の集合体によって構成されている。なお、ここでは、図が繁雑になるのを避けるため、個々の画素の輪郭(小さな正方形の輪郭)は、黒画素についてのみ表示し、白画素の輪郭は図示を省略してある。   The original image P0 is an image made up of a two-dimensional pixel array of I rows and J columns, and has three linear elements L11, L12, and L13 as shown in the figure. The small squares shown by hatching in the figure indicate individual black pixels (for example, pixels having a pixel value “1”), and each of the linear elements L11, L12, and L13 is an aggregate of the black pixels. It is constituted by. On the other hand, a region shown as a white background is composed of an aggregate of white pixels (for example, pixels having a pixel value “0”). Here, in order to avoid complication of the figure, the outline of each pixel (small square outline) is displayed only for the black pixel, and the outline of the white pixel is omitted.

図8のステップS1「原画像入力段階」では、図7の原画像入力部10から、図9に示す原画像P0を入力して、シフト画像格納部20および修正作業用画像格納部30内に初期画像として格納する処理が行われる。したがって、この時点では、シフト画像格納部20に格納されている初期状態のシフト画像S0と、修正作業用画像格納部30に格納されている初期状態の修正作業用画像P0とは、いずれも図9に示す原画像P0ということになる。   In step S1 “original image input stage” of FIG. 8, the original image P0 shown in FIG. 9 is input from the original image input unit 10 of FIG. 7, and the shift image storage unit 20 and the correction work image storage unit 30 are input. A process of storing as an initial image is performed. Therefore, at this time, the initial shift image S0 stored in the shift image storage unit 20 and the initial correction work image P0 stored in the correction work image storage unit 30 are both illustrated in FIG. That is, the original image P0 shown in FIG.

続くステップS2「パラメータ設定段階」では、シフト量Δと空隙幅Wとが、パラメータとして設定される。ここでは、シフト量Δ=1画素、空隙幅W=2画素、という具体的な数値によってパラメータ設定がなされたものとして、以下の説明を続けることにする。このようなパラメータ設定は、前述したとおり、図7のパラメータ設定部60に対して行われる。   In the subsequent step S2 “parameter setting stage”, the shift amount Δ and the gap width W are set as parameters. Here, the following description will be continued assuming that the parameters are set with specific numerical values such as the shift amount Δ = 1 pixel and the gap width W = 2 pixels. Such parameter setting is performed on the parameter setting unit 60 of FIG. 7 as described above.

さて、続いて、ステップS3〜S5の実質的な修正作業に入ることになる。このステップS3〜S5は、前述したとおり、何回か繰り返して実行される手順である。そこで、以下、各繰り返しごとに順を追って説明する。前述したように「k」は、繰り返し回数を示す変数である。   Subsequently, the substantial correction work of steps S3 to S5 is started. Steps S3 to S5 are steps that are repeatedly executed as described above. Therefore, the following description will be given step by step for each repetition. As described above, “k” is a variable indicating the number of repetitions.

<第1回目の繰り返し>
はじめに、ステップS3「距離演算段階」が実行される。ここでは、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像Pkの各画素について、最近接黒画素に対する距離を求め、求めた距離を示す値を画素値としてもつ距離画像Dkを作成して、距離画像格納部80に格納する処理が実行される。現時点で修正作業用画像格納部30内に格納されている画像は、初期段階の修正作業用画像P0、すなわち、図9に示す原画像P0である。そこで、この図9に示す原画像P0について、図10に示すような距離画像D0が作成され、距離画像格納部80に格納されることになる。
<First repetition>
First, step S3 “distance calculation stage” is executed. Here, the distance calculation unit 70 obtains the distance to the closest black pixel for each pixel of the correction work image Pk stored in the correction work image storage unit 30, and sets a value indicating the obtained distance to a pixel value. A distance image Dk is created and stored in the distance image storage unit 80. The image currently stored in the correction work image storage unit 30 is the initial correction work image P0, that is, the original image P0 shown in FIG. Therefore, a distance image D0 as shown in FIG. 10 is created and stored in the distance image storage unit 80 for the original image P0 shown in FIG.

図10に示す距離画像D0は、やはりI行J列の二次元画素配列からなる画像であり、図9に示す原画像P0と、全く同一の画素配列を有している。したがって、距離画像D0内の任意の画素D0(i,j)は、原画像P0内の同じ位置にある特定の画素P0(i,j)に1対1に対応する。そして、距離画像D0上の画素D0(i,j)の画素値は、原画像P0上の対応する画素P0(i,j)についての「最近接黒画素に対する距離」を示している。なお、図10に示す距離画像D0上には、説明の便宜上、図9に示す原画像P0上の黒画素の輪郭(小さな正方形)を描いてある。これにより、対応する原画像P0上の黒画素の位置を容易に認識することができる。   The distance image D0 shown in FIG. 10 is also an image made up of a two-dimensional pixel array of I rows and J columns, and has exactly the same pixel array as the original image P0 shown in FIG. Therefore, an arbitrary pixel D0 (i, j) in the distance image D0 corresponds to a specific pixel P0 (i, j) at the same position in the original image P0 on a one-to-one basis. The pixel value of the pixel D0 (i, j) on the distance image D0 indicates “distance to the nearest black pixel” for the corresponding pixel P0 (i, j) on the original image P0. In addition, on the distance image D0 shown in FIG. 10, the outline (small square) of the black pixel on the original image P0 shown in FIG. 9 is drawn for convenience of explanation. Thereby, the position of the black pixel on the corresponding original image P0 can be easily recognized.

図10において、この小さな正方形の輪郭内に描かれている数値がすべて「0」になっているのは、黒画素についての最近接黒画素は自分自身であるから、「最近接黒画素に対する距離」が「0」であることを示しているからである。これに対して、図10において「1以上の数値」が描かれている画素は、対応する原画像P0上に白画素が配置されている画素である。数値は、1〜6と様々であるが、数値が小さいほど、近隣に黒画素が存在していることになる。たとえば、数値「1」が描かれている画素は、数値「0」が描かれている画素に隣接する画素となっており、「最近接黒画素に対する距離」が1であることを示している。   In FIG. 10, all the numerical values drawn in the outline of the small square are “0” because the nearest black pixel for the black pixel is itself. This is because “” indicates “0”. On the other hand, in FIG. 10, a pixel on which “a numerical value of 1 or more” is drawn is a pixel in which a white pixel is arranged on the corresponding original image P0. The numerical values vary from 1 to 6, but the smaller the numerical value, the more black pixels exist in the vicinity. For example, a pixel in which the numerical value “1” is drawn is a pixel adjacent to a pixel in which the numerical value “0” is drawn, and “distance to the nearest black pixel” is 1. .

なお、ここで述べる実施形態の場合、「最近接黒画素に対する距離」として、画素の配列ピッチ(縦横等ピッチとする)を単位距離とした場合の2つの画素の中心点間のユークリッド距離(純粋な幾何学上の距離)を用いている。これを図11の拡大画素図を用いて説明しよう。   In the case of the embodiment described here, as the “distance to the nearest black pixel”, the Euclidean distance (pure pure) between the center points of two pixels when the pixel arrangement pitch (the vertical and horizontal equal pitches) is a unit distance. Geometric distance). This will be described using the enlarged pixel diagram of FIG.

図11は8行7列の二次元画素配列を示しており、ハッチングを施した画素が黒画素、白地の画素が白画素である。また、Q1〜Q9は、個々の画素を示すとともに、その中心点をも示している。ここで、各画素Q1〜Q9の「最近接黒画素に対する距離」を、それぞれD(Q1)〜D(Q9)とした場合、各距離の値は、図11の下段に示すような数値になる。   FIG. 11 shows a two-dimensional pixel array of 8 rows and 7 columns, in which hatched pixels are black pixels, and white pixels are white pixels. Further, Q1 to Q9 indicate individual pixels and the center points thereof. Here, when the “distance to the nearest black pixel” of each of the pixels Q1 to Q9 is D (Q1) to D (Q9), the value of each distance is a numerical value as shown in the lower part of FIG. .

たとえば、D(Q3)=0となっているが、これは、画素Q3についての最近接黒画素は自分自身であるから、中心点Q3と中心点Q3との間のユークリッド距離が0になるためである。同様に、黒画素Q4,Q6,Q7,Q9についての距離D(Q4),D(Q6),D(Q7),D(Q9)は、いずれも0である。一方、画素Q1についての距離D(Q1)=2となっているのは、画素Q1についての最近接黒画素はQ3であり、中心点Q1,Q3間のユークリッド距離が2になるためである。同様に、画素Q2についての距離D(Q2)=1となっているのは、画素Q2についての最近接黒画素はQ3であり、中心点Q2,Q3間のユークリッド距離が2になるためである。   For example, D (Q3) = 0. This is because the nearest black pixel for the pixel Q3 is itself, and the Euclidean distance between the center point Q3 and the center point Q3 is 0. It is. Similarly, the distances D (Q4), D (Q6), D (Q7), and D (Q9) for the black pixels Q4, Q6, Q7, and Q9 are all zero. On the other hand, the distance D (Q1) = 2 for the pixel Q1 is that the closest black pixel for the pixel Q1 is Q3, and the Euclidean distance between the center points Q1 and Q3 is 2. Similarly, the distance D (Q2) = 1 for the pixel Q2 is that the closest black pixel for the pixel Q2 is Q3 and the Euclidean distance between the center points Q2 and Q3 is 2. .

また、画素Q5については、黒画素Q6に対する距離(中心点Q5,Q6間の距離)が2であるのに対して、黒画素Q4に対する距離(中心点Q5,Q4間の距離)が√5であるので、最近接黒画素はQ6ということになり、距離D(Q5)=2となっている。これに対して、画素Q8については、黒画素Q7に対する距離(中心点Q8,Q7間の距離)が2であるのに対して、黒画素Q9に対する距離(中心点Q8,Q9間の距離)が√2であるので、最近接黒画素はQ9ということになり、距離D(Q8)=√2となっている。   For the pixel Q5, the distance to the black pixel Q6 (the distance between the center points Q5 and Q6) is 2, whereas the distance to the black pixel Q4 (the distance between the center points Q5 and Q4) is √5. Therefore, the closest black pixel is Q6, and the distance D (Q5) = 2. In contrast, for the pixel Q8, the distance to the black pixel Q7 (distance between the center points Q8 and Q7) is 2, whereas the distance to the black pixel Q9 (distance between the center points Q8 and Q9) is 2. Since √2, the closest black pixel is Q9, and the distance D (Q8) = √2.

このように、個々の画素について、それぞれ最近接黒画素に対するユークリッド距離を求める演算は単純な幾何学演算であり、コンピュータ上でこのような演算を行う手法は種々の方法が公知であるため、ここでは詳しい説明は省略する。なお、ここに示す実施形態では、√2や√5など、整数にならない距離値を、距離画像Dk上にそのまま描くと図が繁雑になるため、距離の値としては、小数点以下を四捨五入してまるめた値を用いた例を示すことにする。もちろん、実用上も、本来のユークリッド距離を所定有効桁でまるめた値を距離の演算値として用いるようにするのが好ましい。   As described above, for each pixel, the calculation for obtaining the Euclidean distance with respect to the nearest black pixel is a simple geometric calculation, and various methods are known for performing such calculation on a computer. Then, detailed explanation is omitted. In the embodiment shown here, if a distance value that does not become an integer, such as √2 or √5, is drawn on the distance image Dk as it is, the figure becomes complicated. Therefore, the distance value is rounded off to the nearest decimal point. An example using rounded values will be shown. Of course, in practice, it is preferable to use a value obtained by rounding the original Euclidean distance by a predetermined significant digit as the calculated value of the distance.

こうしてステップS3「距離演算段階」が完了すると、続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S0(図9に示す原画像P0と同一)に対して、シフト処理部50がローテーションシフト処理を実行する。図12は、このようなシフト処理によって得られたシフト画像S1を示す平面図である。ここに示す例では、シフト方向は下方向、シフト量Δ=1画素に設定されているため、図12に示すシフト画像S1は、図9に示す原画像P0を1行分だけ下方にローテーションシフトしたものとなっている。シフト画像S1の第I行目(最下行)の画素は、旧(I−1)行目の画素であり、シフト画像S1の第1行目(最上行)の画素は、旧I行目(最下行)の画素である。   When step S3 “distance calculation stage” is completed in this way, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S0 (the same as the original image P0 shown in FIG. 9) currently stored in the shift image storage unit 20. FIG. 12 is a plan view showing a shift image S1 obtained by such a shift process. In the example shown here, since the shift direction is set to the downward direction and the shift amount Δ = 1 pixel, the shift image S1 shown in FIG. 12 is rotated downward by one line from the original image P0 shown in FIG. It has become. The pixel in the I-th row (bottom row) of the shift image S1 is the pixel in the old (I-1) row, and the pixel in the first row (top row) of the shift image S1 is in the old I-row ( (Bottom row) pixels.

このようなローテーションシフトを行うには、たとえば、まず、第I行目の画素の各画素値を一時的なレジスタに退避させておき、第(I−1)行目の画素の各画素値を、それぞれ第I行目の画素の各画素値として書き込み、第(I−2)行目の画素の各画素値を、それぞれ第(I−1)行目の画素の各画素値として書き込み、……、第1行目の画素の各画素値を、それぞれ第2行目の画素の各画素値として書き込み、最後に、レジスタに退避させていた画素値を、第1行目の画素の各画素値として書き込む、という処理を行えばよい。   In order to perform such a rotation shift, for example, first, each pixel value of the pixel in the I-th row is saved in a temporary register, and each pixel value of the pixel in the (I-1) -th row is set. , Each pixel value of the pixel in the I-th row is written, each pixel value of the pixel in the (I-2) -th row is written as each pixel value of the pixel in the (I-1) -th row,. ..., each pixel value of the pixel in the first row is written as each pixel value of the pixel in the second row, and finally, the pixel value saved in the register is written in each pixel of the pixel in the first row A process of writing as a value may be performed.

最後に、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内の画像(この例の場合、図12に示すシフト画像S1)の黒画素S1(i,j)のうち、距離画像格納部80内の画像(この例の場合、図10に示す距離画像D0)の対応位置にある画素D0(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S1(i,j)を、修正作業用画像格納部30内の画像(この例の場合、図9に示す原画像P0)の対応位置にコピーする処理である。   Finally, step S5 “image copy stage” is executed. This is because the copy processing unit 40 uses the black pixel S1 (i, j) of the image in the shift image storage unit 20 (in this example, the shift image S1 shown in FIG. 12) in the distance image storage unit 80. Black pixel in which the pixel value of the pixel D0 (i, j) at the corresponding position of the image (in this example, the distance image D0 shown in FIG. 10) exceeds the gap width W (in this example, W = 2) This is a process of copying S1 (i, j) to the corresponding position of the image in the correction work image storage unit 30 (in this example, the original image P0 shown in FIG. 9).

図13は、このコピー処理において参照されるシフト画像S1と距離画像D0との関係図である。図13に示す個々の数値は、図10に示す距離画像D0の画素値を示す数値と全く同一であるが、図13に示す小さな正方形の輪郭は、図12に示すシフト画像S1の黒画素の位置を示すものになっている。別言すれば、図10と図13との相違は、図10に示す小さな正方形の輪郭が原画像P0の黒画素の位置を示しているのに対して、図13に示す小さな正方形の輪郭はシフト画像S1の黒画素の位置を示していることになる。その結果、図10では、輪郭内の数値はすべて「0」であったのに対し、図13では、輪郭内の数値は「0」と「1」との混合になっている。   FIG. 13 is a relationship diagram between the shift image S1 and the distance image D0 that are referred to in this copy process. The individual numerical values shown in FIG. 13 are exactly the same as the numerical values indicating the pixel values of the distance image D0 shown in FIG. 10, but the small square outline shown in FIG. 13 is the black pixel of the shift image S1 shown in FIG. It shows the position. In other words, the difference between FIG. 10 and FIG. 13 is that the small square outline shown in FIG. 10 indicates the position of the black pixel of the original image P0, whereas the small square outline shown in FIG. This indicates the position of the black pixel in the shift image S1. As a result, in FIG. 10, the numerical values in the contour are all “0”, whereas in FIG. 13, the numerical values in the contour are a mixture of “0” and “1”.

コピー処理部40は、この図13において、輪郭内の数値がW=2を超える画素(すなわち、この例では、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。図13に示す例の場合、輪郭内の数値は0または1のみであり、3以上の画素は存在しない。したがって、この時点でのステップS5「画像コピー段階」は、実質的なコピーが全く行われない空コピー処理ということになるが、ここでは、便宜上、このような空コピー処理により、修正作業用画像格納部30内に格納されていた修正作業用画像P0が、修正作業用画像P1に更新されたものとする。もちろん、修正作業用画像P1は、修正作業用画像P0(すなわち原画像P0)と全く同一の画像であり、実際には、データの書換作業は何ら行われない。   In FIG. 13, the copy processing unit 40 searches for pixels whose numerical value in the contour exceeds W = 2 (that is, in this example, the numerical value in the contour is 3 or more), and if there is such a pixel, Using this as a copy target pixel, the image in the correction work image storage unit 30 is copied and updated. In the case of the example shown in FIG. 13, the numerical value in the outline is only 0 or 1, and there are no three or more pixels. Therefore, step S5 “image copy stage” at this point is an empty copy process in which no substantial copy is performed. Here, for convenience, the image for correction work is performed by such an empty copy process. It is assumed that the correction work image P0 stored in the storage unit 30 is updated to the correction work image P1. Of course, the correction work image P1 is the same image as the correction work image P0 (that is, the original image P0), and no data rewriting work is actually performed.

結局、ステップS5の処理が完了した時点では、シフト画像格納部20内には、図12に示すシフト画像S1が格納され、修正作業用画像格納部30内には、図9に示す原画像P0と全く同一の修正作業用画像P1が格納され、距離画像格納部80には、図10に示す距離画像D0が格納された状態となっている。   After all, when the process of step S5 is completed, the shift image S1 shown in FIG. 12 is stored in the shift image storage unit 20, and the original image P0 shown in FIG. 9 is stored in the correction work image storage unit 30. 10 is stored in the distance image storage unit 80, and the distance image D0 shown in FIG. 10 is stored in the distance image storage unit 80.

このようなステップS3〜S5の実質的な修正作業が、ステップS6を介したループにより、繰り返し実行される。図7のブロック図に示した、シフト画像Sk,修正作業用画像Pk,距離画像Dkの添字「k」は、この繰り返し回数に対応するものである。すなわち、シフト画像Skは、第k回目のシフト処理後に得られるシフト画像を示し、修正作業用画像Pkは、このシフト画像Skに基づくコピー処理後(実質的なコピーが全く行われない空コピー処理も含む)に得られる修正作業用画像を示し、距離画像Dkは、この修正作業用画像Pkについての距離演算によって得られる距離画像を示している。   Such substantial correction work of steps S3 to S5 is repeatedly executed by the loop through step S6. The subscript “k” of the shift image Sk, the correction work image Pk, and the distance image Dk shown in the block diagram of FIG. 7 corresponds to the number of repetitions. That is, the shift image Sk indicates a shift image obtained after the k-th shift process, and the correction work image Pk is a copy process based on the shift image Sk (empty copy process in which no substantial copy is performed). The distance image Dk is a distance image obtained by the distance calculation for the correction work image Pk.

結局、ステップS3〜S5の処理は、ステップS6を介したループにより、繰り返し実行されることになるが、第k回目の繰り返し実行時には、ステップS3の距離演算処理は、修正作業用画像P(k−1)についての距離演算を行い、その結果として得られる距離画像D(k−1)を距離画像格納部80に格納する処理ということになり、ステップS4の画像シフト処理は、シフト画像S(k−1)に対してローテーションシフトを行い、その結果として得られる新たなシフト画像Skをシフト画像格納部20に格納する処理ということになり、ステップS5のコピー処理は、シフト画像Skの黒画素のうち、距離画像D(k−1)の対応位置にある画素の画素値が空隙幅Wを超えている黒画素を、修正作業用画像P(k−1)の対応位置にコピーして、その結果として得られる新たな修正作業用画像Pkを修正作業用画像格納部30に格納する処理ということになる。   Eventually, the processing of steps S3 to S5 is repeatedly executed by a loop through step S6. However, during the k-th repeated execution, the distance calculation processing of step S3 performs the correction work image P (k -1) is a process of performing the distance calculation for the distance image D (k-1) obtained as a result, and storing the distance image D (k-1) in the distance image storage unit 80. This is a process of performing a rotation shift on k-1) and storing the resulting new shift image Sk in the shift image storage unit 20. The copy process in step S5 is a black pixel of the shift image Sk. Among them, the black pixel whose pixel value at the corresponding position of the distance image D (k−1) exceeds the gap width W is determined as the corresponding position of the correction work image P (k−1). Copy, it comes to processing to store the new modified working image Pk obtained as a result of the correction work image storage unit 30.

<第2回目の繰り返し>
それでは、図8のステップS6からステップS3へと戻り、第2回目の繰り返しが実行された場合の処理手順を続けて説明する。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P1について距離演算を行い、得られた距離画像D1を距離画像格納部80に格納する処理が行われる。もっとも、ここに示す例の場合、前回のコピー処理は空コピー処理であったため、修正作業用画像P1は、修正作業用画像P0(すなわち原画像P0)と全く同一である。したがって、当然ながら、距離画像D1は距離画像D0と全く同一であり、新たに距離演算を行う必要はない。そこで、実用上は、前回のコピー処理が空コピー処理であった場合、ステップS3「距離演算段階」の実質的な演算処理は省略することができる。
<Second repetition>
Then, it returns to step S3 from FIG.8 S6, and it continues and demonstrates the process sequence in case the 2nd repetition is performed. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs distance calculation on the correction work image P1 stored in the correction work image storage unit 30, and uses the obtained distance image D1 as the distance image. A process of storing in the storage unit 80 is performed. However, in the example shown here, the previous copy process was the empty copy process, so the correction work image P1 is exactly the same as the correction work image P0 (that is, the original image P0). Therefore, as a matter of course, the distance image D1 is exactly the same as the distance image D0, and it is not necessary to perform a new distance calculation. Therefore, practically, when the previous copy process was an empty copy process, the substantial calculation process in step S3 “distance calculation stage” can be omitted.

続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S1(図12)に対して、シフト処理部50がローテーションシフト処理を実行する。図14は、このようなシフト処理によって得られたシフト画像S2を示す平面図である。図示のとおり、下方向に1行ずつローテーションシフトしたため、もとの線状要素L13は、3つの線状要素L13−1,L13−2,L13−3に分割されてしまっている。   Subsequently, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S1 (FIG. 12) currently stored in the shift image storage unit 20. FIG. 14 is a plan view showing a shift image S2 obtained by such a shift process. As shown in the figure, since the line is shifted downward by one row, the original linear element L13 is divided into three linear elements L13-1, L13-2, and L13-3.

そして、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内のシフト画像S2(図14)の黒画素S2(i,j)のうち、距離画像格納部80内の距離画像D1(図10に示す距離画像D0と同じ)の対応位置にある画素D1(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S2(i,j)を、修正作業用画像格納部30内の修正作業用画像(図9に示す原画像P0と同じ)の対応位置にコピーする処理である。   Then, step S5 “image copy stage” is executed. This is because the copy processing unit 40 uses the distance image D1 (shown in FIG. 10) in the distance image storage unit 80 among the black pixels S2 (i, j) of the shift image S2 (FIG. 14) in the shift image storage unit 20. The black pixel S2 (i, j) in which the pixel value of the pixel D1 (i, j) at the corresponding position of the distance image D0) exceeds the gap width W (W = 2 in this example) is corrected. This is a process of copying to the corresponding position of the correction work image (same as the original image P0 shown in FIG. 9) in the work image storage unit 30.

図15は、このコピー処理において参照されるシフト画像S2と距離画像D1との関係図である。図15に示す小さな正方形の輪郭は、図14に示すシフト画像S2の黒画素の位置を示すものになっており、この輪郭内の数値は「1」と「2」との混合になっている。   FIG. 15 is a diagram showing the relationship between the shift image S2 and the distance image D1 that are referred to in this copy process. The small square outline shown in FIG. 15 indicates the position of the black pixel in the shift image S2 shown in FIG. 14, and the numerical value in this outline is a mixture of “1” and “2”. .

コピー処理部40は、この図15において、輪郭内の数値がW=2を超える画素(すなわち、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。ただ、図15に示す例の場合も、3以上の画素は存在しないので、やはり空コピー処理が行われることになる。   In FIG. 15, the copy processing unit 40 searches for a pixel whose numerical value in the outline exceeds W = 2 (that is, a numerical value in the outline of 3 or more), and if there is such a pixel, this is copied. As a pixel, the image in the correction work image storage unit 30 is copied and updated. However, in the example shown in FIG. 15 as well, since there are no more than three pixels, an empty copy process is also performed.

結局、第2回目の繰り返し手順が完了した時点では、シフト画像格納部20内には、図14に示すシフト画像S2が格納され、修正作業用画像格納部30内には、図9に示す原画像P0と全く同一の修正作業用画像P2が格納され、距離画像格納部80には、図15に示す距離画像D1(図10の距離画像D0と同じ)が格納された状態となっている。   After all, when the second iteration procedure is completed, the shift image S2 shown in FIG. 14 is stored in the shift image storage unit 20, and the original image shown in FIG. 9 is stored in the correction work image storage unit 30. The correction work image P2 that is exactly the same as the image P0 is stored, and the distance image storage unit 80 is in a state in which the distance image D1 shown in FIG. 15 (same as the distance image D0 in FIG. 10) is stored.

<第3回目の繰り返し>
次に、図8のステップS6からステップS3へと戻り、第3回目の繰り返しが実行された場合の処理手順を続けて説明する。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P2について距離演算を行い、得られた距離画像D2を距離画像格納部80に格納する処理が行われる。ここに示す例の場合、前回のコピー処理は空コピー処理であったため、修正作業用画像P2は、修正作業用画像P1(すなわち原画像P0)と全く同一であり、実質的な演算処理は省略することができる。
<3rd iteration>
Next, returning to step S3 from step S6 in FIG. 8, the processing procedure when the third iteration is executed will be described. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs a distance calculation on the correction work image P2 stored in the correction work image storage unit 30, and uses the obtained distance image D2 as a distance image. A process of storing in the storage unit 80 is performed. In the example shown here, since the previous copy process was an empty copy process, the correction work image P2 is exactly the same as the correction work image P1 (that is, the original image P0), and the substantial calculation process is omitted. can do.

続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S2(図14)に対して、シフト処理部50がローテーションシフト処理を実行する。図16は、このようなシフト処理によって得られたシフト画像S3を示す平面図である。図示のとおり、原画像P0では最も下に位置していた線状要素L13が、シフト画像S3では、最も上に位置している。   Subsequently, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S2 (FIG. 14) currently stored in the shift image storage unit 20. FIG. 16 is a plan view showing a shift image S3 obtained by such a shift process. As shown in the figure, the linear element L13 located at the bottom in the original image P0 is located at the top in the shift image S3.

そして、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内のシフト画像S3(図16)の黒画素S3(i,j)のうち、距離画像格納部80内の距離画像D2(図10に示す距離画像D0と同じ)の対応位置にある画素D2(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S3(i,j)を、修正作業用画像格納部30内の修正作業用画像P2(図9に示す原画像P0と同じ)の対応位置にコピーする処理である。   Then, step S5 “image copy stage” is executed. This is because the copy processing unit 40 uses the distance image D2 (shown in FIG. 10) in the distance image storage unit 80 among the black pixels S3 (i, j) of the shift image S3 (FIG. 16) in the shift image storage unit 20. The black pixel S3 (i, j) in which the pixel value of the pixel D2 (i, j) at the corresponding position of the distance image D0) exceeds the air gap width W (W = 2 in this example) is corrected. This is a process of copying to the corresponding position of the correction work image P2 (same as the original image P0 shown in FIG. 9) in the work image storage unit 30.

図17は、このコピー処理において参照されるシフト画像S3と距離画像D2との関係図である。図17に示す小さな正方形の輪郭は、図16に示すシフト画像S3の黒画素の位置を示すものになっており、この輪郭内の数値は「1」,「2」,「3」の混合になっている。   FIG. 17 is a diagram showing the relationship between the shift image S3 and the distance image D2 that are referred to in this copy process. The small square outline shown in FIG. 17 indicates the position of the black pixel in the shift image S3 shown in FIG. 16, and the numerical value in this outline is a mixture of “1”, “2”, and “3”. It has become.

コピー処理部40は、この図17において、輪郭内の数値がW=2を超える画素(すなわち、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。この例の場合、輪郭内の数値が「3」を示している画素が、コピー対象画素ということになる。図18は、このコピー対象画素のみを抽出して示す平面図である。ここでは、説明の便宜上、このコピー対象画素については、ドットによるハッチングを施して示している。   In FIG. 17, the copy processing unit 40 searches for a pixel whose numerical value in the contour exceeds W = 2 (that is, a numerical value in the contour of 3 or more), and if there is such a pixel, it copies this. As a pixel, the image in the correction work image storage unit 30 is copied and updated. In this example, a pixel whose numerical value in the outline indicates “3” is a copy target pixel. FIG. 18 is a plan view showing only this copy target pixel. Here, for the convenience of explanation, the copy target pixel is indicated by hatching with dots.

図18に示すとおり、これらのコピー対象画素は、3つの要素L21,L22,L23を形成する。これら3つの要素L21,L22,L23は、コピー対象となった部分線状要素である。すなわち、図18に示す部分線状要素L21,L22,L23は、図16に示すシフト画像S3上の線状要素L11の一部分に対応する要素である。ここに示す例で、線状要素L11全体がコピー対象とならなかったのは、全体をコピーしてしまうと、他の線状要素に対して接近しすぎてしまう部分(空隙幅Wが確保できなくなる部分)が生じるためである。これは、図6において、コピー対象となった線状要素L1bが、元の線状要素L1全体ではなく、その一部分となっていることと同じ理由である。   As shown in FIG. 18, these copy target pixels form three elements L21, L22, and L23. These three elements L21, L22, and L23 are partial linear elements to be copied. That is, the partial linear elements L21, L22, and L23 shown in FIG. 18 are elements corresponding to a part of the linear element L11 on the shift image S3 shown in FIG. In the example shown here, the entire linear element L11 was not to be copied because if the entire line was copied, it would be too close to other linear elements (the gap width W could be secured). This is because a part that disappears occurs. This is the same reason that the linear element L1b to be copied is not a whole of the original linear element L1 but a part thereof in FIG.

結局、コピー処理部40により、図18に示す部分線状要素L21,L22,L23を、修正作業用画像格納部30内の修正作業用画像P2(図9に示す原画像P0と同じ)の対応位置にコピーする処理が行われる。図19は、このようなコピー処理によって得られた修正作業用画像P3の平面図である。図において、斜線によるハッチングを施して示す線状要素L11,L12,L13は、元の修正作業用画像P2(原画像P0)に含まれていた既存の線状要素であり、ドットによるハッチングを施して示す部分線状要素L21,L22,L23は、新たに追加された線状要素である。もちろん、実際には、斜線によるハッチングを施した画素も、ドットによるハッチングを施した画素も、画素値「1」をもった同じ黒画素であり、データ上は何ら区別はない。   Eventually, the copy processing unit 40 causes the partial linear elements L21, L22, and L23 shown in FIG. 18 to correspond to the correction work image P2 in the correction work image storage unit 30 (same as the original image P0 shown in FIG. 9). Processing to copy to the position is performed. FIG. 19 is a plan view of the correction work image P3 obtained by such a copy process. In the figure, linear elements L11, L12, and L13 indicated by hatching with diagonal lines are existing linear elements included in the original correction work image P2 (original image P0), and are hatched with dots. The partial linear elements L21, L22, and L23 shown are newly added linear elements. Of course, in fact, the hatched pixel and the hatched pixel are the same black pixel having the pixel value “1”, and there is no distinction in data.

なお、実際には、コピ−処理部40による上述のようなコピー処理は、次の2通りの方法により実行することができる。第1の方法は、シフト画像格納部20内のシフト画像S3の個々の黒画素S3(i,j)について、距離画像格納部80内の距離画像D2の対応位置にある画素D2(i,j)の画素値をそれぞれの参照画素値として求める処理を行い、この参照画素値が空隙幅Wを超えている黒画素S3(i,j)が発見されたら、当該黒画素S3(i,j)に対応する位置にある修正作業用画像格納部30内の修正作業用画像P2の白画素P2(i,j)を黒画素に置換する処理(画素値「0」を画素値「1」に書き換える処理)を行う方法である。いわば、シフト画像側の黒画素をスキャンする方法ということができる。   Actually, the copy processing as described above by the copy processing unit 40 can be executed by the following two methods. In the first method, for each black pixel S3 (i, j) of the shift image S3 in the shift image storage unit 20, the pixel D2 (i, j) at the corresponding position of the distance image D2 in the distance image storage unit 80 is used. ) Is obtained as each reference pixel value, and when a black pixel S3 (i, j) whose reference pixel value exceeds the gap width W is found, the black pixel S3 (i, j) To replace the white pixel P2 (i, j) of the correction work image P2 in the correction work image storage unit 30 at the position corresponding to the black pixel (rewrite the pixel value “0” to the pixel value “1”). Process). In other words, it can be said to be a method of scanning black pixels on the shifted image side.

第2の方法は、修正作業用画像格納部30内の修正作業用画像P2の個々の白画素P2(i,j)について、「対応する位置にあるシフト画像格納部20内のシフト画像S3の画素S3(i,j)が黒画素(画素値が「1」)」かつ「対応する位置にある距離画像格納部80内の距離画像D2の画素D2(i,j)の画素値が空隙幅Wを超えている」という条件を満たすかどうかを判定し、当該条件を満たしていた場合には、当該白画素P2(i,j)を黒画素に置換する処理(画素値「0」を画素値「1」に書き換える処理)を行う方法である。いわば修正作業用画像側の白画素をスキャンする方法ということができる。   In the second method, for each white pixel P2 (i, j) of the correction work image P2 in the correction work image storage unit 30, “the shift image S3 in the shift image storage unit 20 in the corresponding position” is displayed. Pixel S3 (i, j) is a black pixel (pixel value is “1”) ”and the pixel value of the pixel D2 (i, j) of the distance image D2 in the distance image storage unit 80 at the corresponding position is the gap width It is determined whether or not the condition “exceeds W” is satisfied. If the condition is satisfied, the process of replacing the white pixel P2 (i, j) with a black pixel (pixel value “0” This is a method of performing a process of rewriting to the value “1”). In other words, it is a method of scanning white pixels on the correction work image side.

結局、第3回目の繰り返し手順が完了した時点では、シフト画像格納部20内には、図16に示すシフト画像S3が格納され、修正作業用画像格納部30内には、図19に示す修正作業用画像P3が格納され、距離画像格納部80には、図17に示す距離画像D2(図10の距離画像D0と同じ)が格納された状態となっている。   After all, when the third iteration procedure is completed, the shift image S3 shown in FIG. 16 is stored in the shift image storage unit 20, and the correction image storage unit 30 shown in FIG. The work image P3 is stored, and the distance image storage unit 80 stores the distance image D2 shown in FIG. 17 (same as the distance image D0 in FIG. 10).

<第4回目の繰り返し>
更に続けて、図8のステップS6からステップS3へと戻り、第4回目の繰り返しが実行された場合の処理手順を説明する。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P3について距離演算を行い、得られた距離画像D3を距離画像格納部80に格納する処理が行われる。修正作業用画像P3は、図19に示すように、新たな線状要素L21〜L23の付加によって修正が施された画像であるから、この修正作業用画像P3についての演算によって得られた距離画像D3は、図20に示すようなものになる。この図20に示す距離画像D3を、図10に示す距離画像D0と比べてみると、新たな線状要素L21〜L23が付加された部分近傍の距離の値が低下していることがわかる。このように実質的なコピー処理が実行されて、修正作業用画像に実質的な修正が施されると、コピー処理が行われた部分の距離値が低下することになるので、本発明に係る修正処理手順を順次繰り返してゆくことにより、距離画像の画素値を徐々に減少させてゆくことができる。
<4th iteration>
Further, the processing procedure when the fourth iteration is executed after returning from step S6 in FIG. 8 to step S3 will be described. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs a distance calculation on the correction work image P3 stored in the correction work image storage unit 30, and uses the obtained distance image D3 as a distance image. A process of storing in the storage unit 80 is performed. Since the correction work image P3 is an image corrected by adding new linear elements L21 to L23, as shown in FIG. 19, the distance image obtained by the calculation for the correction work image P3. D3 is as shown in FIG. When comparing the distance image D3 shown in FIG. 20 with the distance image D0 shown in FIG. 10, it can be seen that the value of the distance in the vicinity of the part to which the new linear elements L21 to L23 are added is lowered. When the substantial copy processing is executed in this way and the correction work image is substantially corrected, the distance value of the portion where the copy processing has been performed is reduced. By sequentially repeating the correction processing procedure, the pixel value of the distance image can be gradually decreased.

続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S3(図16)に対して、シフト処理部50がローテーションシフト処理を実行する。図21は、このようなシフト処理によって得られたシフト画像S4を示す平面図である。   Subsequently, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S3 (FIG. 16) currently stored in the shift image storage unit 20. FIG. 21 is a plan view showing a shift image S4 obtained by such a shift process.

そして、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内のシフト画像S4(図21)の黒画素S4(i,j)のうち、距離画像格納部80内の距離画像D3(図20)の対応位置にある画素D3(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S4(i,j)を、修正作業用画像格納部30内の修正作業用画像P3(図19)の対応位置にコピーする処理である。   Then, step S5 “image copy stage” is executed. This is because the copy processing unit 40 uses the distance image D3 (FIG. 20) in the distance image storage unit 80 among the black pixels S4 (i, j) of the shift image S4 (FIG. 21) in the shift image storage unit 20. The black pixel S4 (i, j) in which the pixel value of the pixel D3 (i, j) at the corresponding position exceeds the gap width W (W = 2 in this example) is selected as the correction work image storage unit 30. This is a process of copying to the corresponding position of the correction work image P3 (FIG. 19).

図22は、このコピー処理において参照されるシフト画像S4と距離画像D3との関係図である。図22に示す小さな正方形の輪郭は、図21に示すシフト画像S4の黒画素の位置を示すものになっており、この輪郭内の数値は「0」と「1」との混合になっている。   FIG. 22 is a diagram showing the relationship between the shift image S4 and the distance image D3 that are referred to in this copy process. The small square outline shown in FIG. 22 indicates the position of the black pixel of the shift image S4 shown in FIG. 21, and the numerical value in this outline is a mixture of “0” and “1”. .

コピー処理部40は、この図22において、輪郭内の数値がW=2を超える画素(すなわち、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。ただ、図22に示す例の場合も、3以上の画素は存在しないので、空コピー処理が行われることになる。   In FIG. 22, the copy processing unit 40 searches for a pixel whose numerical value in the contour exceeds W = 2 (that is, a numerical value in the contour of 3 or more), and if there is such a pixel, copies it. As a pixel, the image in the correction work image storage unit 30 is copied and updated. However, in the case of the example shown in FIG. 22, since there are no more than three pixels, an empty copy process is performed.

結局、第4回目の繰り返し手順が完了した時点では、シフト画像格納部20内には、図21に示すシフト画像S4が格納され、修正作業用画像格納部30内には、図19に示す修正作業用画像P3と全く同一の修正作業用画像P4が格納され、距離画像格納部80には、図20に示す距離画像D3が格納された状態となっている。   After all, when the fourth iteration procedure is completed, the shift image S4 shown in FIG. 21 is stored in the shift image storage unit 20, and the correction operation shown in FIG. 19 is stored in the correction work image storage unit 30. A correction work image P4 that is exactly the same as the work image P3 is stored, and the distance image D3 shown in FIG. 20 is stored in the distance image storage unit 80.

<第5回目の繰り返し>
再び、図8のステップS6からステップS3へと戻り、第5回目の繰り返しが実行される。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P4について距離演算を行い、得られた距離画像D4を距離画像格納部80に格納する処理が行われる。この場合、前回のコピー処理が空コピー処理であったため、距離画像D4は距離画像D3と全く同一であり、ステップS3「距離演算段階」の実質的な演算処理は省略することができる。
<5th iteration>
Again, the process returns from step S6 in FIG. 8 to step S3, and the fifth iteration is executed. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs distance calculation on the correction work image P4 stored in the correction work image storage unit 30, and uses the obtained distance image D4 as a distance image. A process of storing in the storage unit 80 is performed. In this case, since the previous copy process was the blank copy process, the distance image D4 is exactly the same as the distance image D3, and the substantial calculation process in step S3 “distance calculation stage” can be omitted.

続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S4(図21)に対して、シフト処理部50がローテーションシフト処理を実行する。図23は、このようなシフト処理によって得られたシフト画像S5を示す平面図である。図示のとおり、下方向に1行ずつローテーションシフトしたため、もとの線状要素L12は、2つの線状要素L12−1,L12−2に分割されてしまっている。   Subsequently, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S4 (FIG. 21) currently stored in the shift image storage unit 20. FIG. 23 is a plan view showing a shift image S5 obtained by such a shift process. As shown in the figure, since the line is shifted downward by one line, the original linear element L12 is divided into two linear elements L12-1 and L12-2.

そして、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内のシフト画像S5(図23)の黒画素S5(i,j)のうち、距離画像格納部80内の距離画像D4(図20に示す距離画像D3と同じ)の対応位置にある画素D4(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S5(i,j)を、修正作業用画像格納部30内の修正作業用画像P4(図19に示す修正作業用画像P3と同じ)の対応位置にコピーする処理である。   Then, step S5 “image copy stage” is executed. This is because the copy processing unit 40 uses the distance image D4 (shown in FIG. 20) in the distance image storage unit 80 among the black pixels S5 (i, j) of the shift image S5 (FIG. 23) in the shift image storage unit 20. The black pixel S5 (i, j) in which the pixel value of the pixel D4 (i, j) at the corresponding position of the distance image D3) exceeds the air gap width W (W = 2 in this example) is corrected. This is a process of copying to the corresponding position of the correction work image P4 (same as the correction work image P3 shown in FIG. 19) in the work image storage unit 30.

図24は、このコピー処理において参照されるシフト画像S5と距離画像D4との関係図である。図24に示す小さな正方形の輪郭は、図23に示すシフト画像S5の黒画素の位置を示すものになっており、この輪郭内の数値は「0」,「1」,「2」の混合になっている。   FIG. 24 is a diagram showing the relationship between the shift image S5 and the distance image D4 that are referred to in this copy process. The small square outline shown in FIG. 24 indicates the position of the black pixel in the shift image S5 shown in FIG. 23, and the numerical value in this outline is a mixture of “0”, “1”, and “2”. It has become.

コピー処理部40は、この図24において、輪郭内の数値がW=2を超える画素(すなわち、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。ただ、図24に示す例の場合も、3以上の画素は存在しないので、やはり空コピー処理が行われることになる。   In FIG. 24, the copy processing unit 40 searches for pixels whose numerical value in the contour exceeds W = 2 (that is, those whose numerical value in the contour is 3 or more), and if there is such a pixel, this is copied. As a pixel, the image in the correction work image storage unit 30 is copied and updated. However, in the case of the example shown in FIG. 24, since there are no more than three pixels, an empty copy process is also performed.

結局、第5回目の繰り返し手順が完了した時点では、シフト画像格納部20内には、図23に示すシフト画像S5が格納され、修正作業用画像格納部30内には、図19に示す修正作業用画像P3と全く同一の修正作業用画像P5が格納され、距離画像格納部80には、図24に示す距離画像D4(図20の距離画像D3と同じ)が格納された状態となっている。   After all, when the fifth iteration procedure is completed, the shift image S5 shown in FIG. 23 is stored in the shift image storage unit 20, and the correction work shown in FIG. 19 is stored in the correction work image storage unit 30. The correction work image P5 that is exactly the same as the work image P3 is stored, and the distance image D4 shown in FIG. 24 (same as the distance image D3 in FIG. 20) is stored in the distance image storage unit 80. Yes.

<第6回目の繰り返し>
もう一度、図8のステップS6からステップS3へと戻り、第6回目の繰り返しが実行される。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P5について距離演算を行い、得られた距離画像D5を距離画像格納部80に格納する処理が行われる。ここに示す例の場合、前回のコピー処理は空コピー処理であったため、実質的な演算処理は省略することができる。
<6th iteration>
Again, the process returns from step S6 in FIG. 8 to step S3, and the sixth iteration is executed. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs distance calculation on the correction work image P5 stored in the correction work image storage unit 30, and uses the obtained distance image D5 as a distance image. A process of storing in the storage unit 80 is performed. In the case of the example shown here, since the previous copy process was an empty copy process, the substantial calculation process can be omitted.

続いて、ステップS4「画像シフト段階」が行われる。すなわち、シフト画像格納部20内に現時点で格納されているシフト画像S5(図23)に対して、シフト処理部50がローテーションシフト処理を実行する。図25は、このようなシフト処理によって得られたシフト画像S6を示す平面図である。図示のとおり、下方向に1行ずつローテーションシフトしたため、もとの線状要素L12は、3つの線状要素L12−1,L12−2,L12−3に分割されてしまっている。   Subsequently, step S4 “image shift stage” is performed. That is, the shift processing unit 50 performs a rotation shift process on the shift image S5 (FIG. 23) currently stored in the shift image storage unit 20. FIG. 25 is a plan view showing a shift image S6 obtained by such a shift process. As shown in the figure, since the line is shifted by one row downward, the original linear element L12 is divided into three linear elements L12-1, L12-2, and L12-3.

そして、ステップS5「画像コピー段階」が実行される。これは、コピー処理部40が、シフト画像格納部20内のシフト画像S6(図25)の黒画素S6(i,j)のうち、距離画像格納部80内の距離画像D5の対応位置にある画素D5(i,j)の画素値が、空隙幅W(この例の場合W=2)を超えている黒画素S6(i,j)を、修正作業用画像格納部30内の修正作業用画像P5の対応位置にコピーする処理である。   Then, step S5 “image copy stage” is executed. This is because the copy processing unit 40 is in the corresponding position of the distance image D5 in the distance image storage unit 80 among the black pixels S6 (i, j) of the shift image S6 (FIG. 25) in the shift image storage unit 20. A black pixel S6 (i, j) in which the pixel value of the pixel D5 (i, j) exceeds the air gap width W (W = 2 in this example) is used for the correction work in the correction work image storage unit 30. This is a process of copying to the corresponding position of the image P5.

図26は、このコピー処理において参照されるシフト画像S6と距離画像D5との関係図である。図25に示す小さな正方形の輪郭は、図25に示すシフト画像S6の黒画素の位置を示すものになっており、この輪郭内の数値は[0],「1」,「2」,「3」の混合になっている。   FIG. 26 is a diagram showing the relationship between the shift image S6 and the distance image D5 that are referred to in this copy process. The small square outline shown in FIG. 25 indicates the position of the black pixel in the shift image S6 shown in FIG. 25, and the numerical values in this outline are [0], “1”, “2”, “3”. ”.

コピー処理部40は、この図26において、輪郭内の数値がW=2を超える画素(すなわち、輪郭内の数値が3以上のもの)を探し、そのような画素があれば、これをコピー対象画素として、修正作業用画像格納部30内の画像に対してコピーを行って更新する。この例の場合、輪郭内の数値が「3」を示している画素が、コピー対象画素ということになる。図27は、このコピー対象画素のみを抽出して示す平面図である。ここでも、説明の便宜上、このコピー対象画素については、ドットによるハッチングを施して示している。   In FIG. 26, the copy processing unit 40 searches for a pixel having a numerical value in the contour exceeding W = 2 (that is, a numerical value in the contour being 3 or more), and if there is such a pixel, this is copied. As a pixel, the image in the correction work image storage unit 30 is copied and updated. In this example, a pixel whose numerical value in the outline indicates “3” is a copy target pixel. FIG. 27 is a plan view showing only this copy target pixel. Here too, for the convenience of explanation, the copy target pixel is shown hatched with dots.

図27に示すとおり、今回のコピー対象画素は、たった1つの画素からなる部分線状要素L31である。そこで、コピー処理部40により、図27に示す部分線状要素L31を、修正作業用画像格納部30内の修正作業用画像P5(図19に示す修正作業用画像P3と同じ)の対応位置にコピーする処理が行われる。図28は、このようなコピー処理によって得られた修正作業用画像P6の平面図である。図において、斜線によるハッチングを施して示す線状要素L11,L12,L13は、原画像P0に含まれていた既存の線状要素であり、ドットによるハッチングを施して示す部分線状要素L21,L22,L23は、前述した第3回目の繰り返し時点で追加された線状要素であり、ドットによるハッチングを施して示す部分線状要素L31が、今回の繰り返し時点で追加された線状要素である。もちろん、実際には、斜線によるハッチングを施した画素も、ドットによるハッチングを施した画素も、画素値「1」をもった同じ黒画素であり、データ上は何ら区別はない。   As shown in FIG. 27, the current copy target pixel is a partial linear element L31 including only one pixel. Therefore, the copy processing unit 40 moves the partial linear element L31 shown in FIG. 27 to the corresponding position of the correction work image P5 (same as the correction work image P3 shown in FIG. 19) in the correction work image storage unit 30. Processing to copy is performed. FIG. 28 is a plan view of the correction work image P6 obtained by such a copy process. In the figure, linear elements L11, L12, and L13 indicated by hatching with diagonal lines are existing linear elements included in the original image P0, and partial linear elements L21, L22 indicated by hatching with dots. , L23 are linear elements added at the third repetition point described above, and a partial linear element L31 shown by hatching with dots is a linear element added at the current repetition point. Of course, in fact, the hatched pixel and the hatched pixel are the same black pixel having the pixel value “1”, and there is no distinction in data.

結局、第6回目の繰り返し手順が完了した時点では、シフト画像格納部20内には、図25に示すシフト画像S6が格納され、修正作業用画像格納部30内には、図28に示す修正作業用画像P6が格納され、距離画像格納部80には、図26に示す距離画像D5(図20の距離画像D3と同じ)が格納された状態となっている。   After all, when the sixth iteration procedure is completed, the shift image S6 shown in FIG. 25 is stored in the shift image storage unit 20, and the correction shown in FIG. 28 is stored in the correction work image storage unit 30. The work image P6 is stored, and the distance image storage unit 80 stores the distance image D5 shown in FIG. 26 (same as the distance image D3 in FIG. 20).

<第7回目の繰り返し>
更に続けて、図8のステップS6からステップS3へと戻り、第7回目の繰り返しが実行される。まず、ステップS3「距離演算段階」では、距離演算部70が、修正作業用画像格納部30内に格納されている修正作業用画像P6について距離演算を行い、得られた距離画像D6を距離画像格納部80に格納する処理が行われる。修正作業用画像P6は、図28に示すように、新たな線状要素L31の付加によって修正が施された画像であるから、この修正作業用画像P6についての演算によって得られた距離画像D6は、図29に示すようなものになる。この図29に示す距離画像D6を、図20に示す距離画像D3と比べてみると、新たな線状要素L31が付加された部分近傍の距離の値が低下していることがわかる。
<7th iteration>
Subsequently, the process returns from step S6 in FIG. 8 to step S3, and the seventh iteration is executed. First, in step S3 “distance calculation stage”, the distance calculation unit 70 performs distance calculation on the correction work image P6 stored in the correction work image storage unit 30, and uses the obtained distance image D6 as a distance image. A process of storing in the storage unit 80 is performed. As shown in FIG. 28, the correction work image P6 is an image that has been corrected by adding a new linear element L31. Therefore, the distance image D6 obtained by the calculation for the correction work image P6 is As shown in FIG. When the distance image D6 shown in FIG. 29 is compared with the distance image D3 shown in FIG. 20, it can be seen that the distance value in the vicinity of the portion to which the new linear element L31 is added is lowered.

ここで、この図29の距離画像D6を観察すると、左右両端を除いた中央部分の画素の画素値は、ほとんど「0」,「1」,「2」の混合になっていることがわかる。すなわち、空隙幅W=2を超える画素は、中央部分にはほとんど存在していない状態となっている。この後、ステップS4「シフト段階」およびステップS5「画像コピー段階」が実行され、ステップS6へと到達するが、ここに示す実施形態では、この第7回目の繰り返しが完了した時点で、ステップS6からステップS7へと進み、繰り返しループから抜け出るものとする。   Here, when the distance image D6 in FIG. 29 is observed, it can be seen that the pixel values of the pixels in the central portion excluding the left and right ends are almost a mixture of “0”, “1”, and “2”. That is, the pixel exceeding the gap width W = 2 is hardly present in the central portion. Thereafter, step S4 “shift stage” and step S5 “image copy stage” are executed to reach step S6. In the embodiment shown here, however, when the seventh iteration is completed, step S6 is completed. From step S7, it is assumed that the loop is repeatedly exited.

その結果、ステップS7における修正済画像出力が実行される。すなわち、この時点で修正作業用画像格納部30内に格納されていた修正作業用画像P7(図28に示す修正作業用画像P6と同一)が、最終的な修正済画像として出力されることになる。結局、図9に示す原画像が、図28に示すような画像に修正されたことになる。   As a result, the corrected image output in step S7 is executed. That is, the correction work image P7 (same as the correction work image P6 shown in FIG. 28) stored in the correction work image storage unit 30 at this time is output as the final corrected image. Become. Eventually, the original image shown in FIG. 9 is corrected to an image as shown in FIG.

なお、図8のステップS6において、ステップS3へ戻る繰り返しループから抜け出て、ステップS7の修正済画像出力段階へと進む判断条件としては、たとえば、「合計100回だけ繰り返しループを実行し終えたとき」のような条件を設定することもできるが、より実用的な条件としては、次のような条件設定を行うことができる。   In step S6 in FIG. 8, a determination condition for exiting from the iteration loop returning to step S3 and proceeding to the corrected image output stage in step S7 is, for example, “When the iteration loop has been executed 100 times in total. However, as a more practical condition, the following condition setting can be performed.

1つの条件設定としては、「距離演算段階S3で、空隙幅Wを超える距離が得られる画素が1つも存在しなくなったとき」のような条件設定を行うことができる。たとえば、上述した具体例の場合、W=2という設定を行っていたので、距離演算段階S3で求めた距離画像Dkのすべての画素値が2以下となったときに、この条件が満たされることになる。   As one condition setting, a condition setting such as “when there is no longer any pixel that can obtain a distance exceeding the gap width W in the distance calculation step S3” can be performed. For example, in the case of the specific example described above, since W = 2 is set, this condition is satisfied when all the pixel values of the distance image Dk obtained in the distance calculation step S3 are 2 or less. become.

上述の具体例の場合、図9に示すように、原画像P0には、左右両端まで延びる線状要素が含まれていない。このため、上述の具体例では、無限にループを繰り返したとしても、画像の左右両端付近には、新たな線状要素が付加されることはなく、距離画像Dk上において「3」以上の画素値をもった画素が永遠に残ってしまうことになる。しかしながら、実際の原画像(たとえば、図1に示すような原画像)を用いれば、このような状況は稀であり、上述した条件設定は、実用上、十分に機能する。   In the case of the specific example described above, as shown in FIG. 9, the original image P <b> 0 does not include linear elements that extend to the left and right ends. Therefore, in the above specific example, even if the loop is repeated infinitely, no new linear element is added near the left and right ends of the image, and “3” or more pixels on the distance image Dk Pixels with values will remain forever. However, if an actual original image (for example, an original image as shown in FIG. 1) is used, such a situation is rare, and the above-described condition setting functions sufficiently in practice.

もっとも、より柔軟な条件設定を行うには、「距離演算段階S3で、空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下となったとき」のような条件設定を行うのが好ましい。このような条件設定に基づく修正処理を行うのであれば、図7に示すシフト処理部50に、「距離演算部70における距離演算処理において、空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下になるまで、シフト処理を繰り返し実行する」機能をもたせておけばよい。   However, in order to perform more flexible condition setting, the condition setting such as “when the total number of pixels that can obtain a distance exceeding the gap width W is equal to or less than a predetermined reference value in the distance calculation step S3” is performed. Is preferred. If correction processing based on such a condition setting is performed, the shift processing unit 50 shown in FIG. 7 indicates that the total number of pixels that can obtain a distance exceeding the gap width W in the distance calculation processing in the distance calculation unit 70 is predetermined. It is sufficient to provide a function of “executing the shift process repeatedly until the reference value becomes less than or equal to the reference value”.

別な条件設定としては、「実質的なコピーが全く行われない空コピー段階が所定回数だけ連続して実行されたとき」のような条件を設定することもできる。上述の具体例の場合、第1回目、第2回目のループでは空コピーが行われたが、第3回目のループでは実質的なコピーが行われ、更に、第4回目、第5回目のループで空コピーが行われ、第6回目のループで実質的なコピーが行われている。この場合、空コピーの連続実行回数は2回である。したがって、「空コピー段階が3回以上連続して実行されたとき」のような条件を設定しておいた場合、少なくとも第8回目のループまでは実行されることになる。そして、第7回目、第8回目のループで空コピーが行われ、更に、第9回目のループでも空コピーが行われた場合には、その時点で繰り返しループから抜け出て、ステップS7の修正済画像出力段階へと進むことになる。   As another condition setting, a condition such as “when an empty copy stage in which no substantial copy is performed at all is continuously executed a predetermined number of times” can be set. In the case of the specific example described above, empty copy was performed in the first and second loops, but substantial copying was performed in the third loop, and further, the fourth and fifth loops. In this case, an empty copy is performed, and a substantial copy is performed in the sixth loop. In this case, the number of continuous executions of the empty copy is two. Therefore, when a condition such as “when the empty copy stage is continuously executed three times or more” is set, the process is executed at least until the eighth loop. If the empty copy is performed in the seventh and eighth loops, and if the empty copy is also performed in the ninth loop, the process exits the loop repeatedly at that time, and the corrected step S7 has been completed. Proceed to the image output stage.

このような条件設定に基づく修正処理を行うのであれば、図7に示すシフト処理部50に、「空コピー処理が所定回数だけ連続して実行されるまで、シフト処理を繰り返し実行する」機能をもたせておけばよい。もちろん、修正作業用画像格納部30内の画像をオペレータにモニタさせ、オペレータの指示により、ステップS6の判定を行わせるようにしてもよい。   If correction processing based on such condition setting is performed, the shift processing unit 50 shown in FIG. 7 has a function of “repeatedly execute shift processing until the empty copy processing is continuously executed a predetermined number of times”. Just leave it on. Of course, the image in the correction work image storage unit 30 may be monitored by the operator, and the determination in step S6 may be performed according to the operator's instruction.

<<< §5.パラメータの意味 >>>
上述の§4では、図9に示す原画像P0に対して、パラメータとして、シフト量Δ=1,空隙幅W=2という設定を行い、第6回目の繰り返し処理(第6回目に実行されたステップS3〜S5の処理)を行った段階で、図28に示すような修正作業用画像P6を得ることができた。ここでは、まず、この図28の画像P6において、新たに追加された線状要素L21,L22,L23,L31(ドットによるハッチング部分)の形態を考えてみる。
<<< §5. Meaning of parameter >>>
In the above §4, the shift amount Δ = 1 and the gap width W = 2 are set as parameters for the original image P0 shown in FIG. 9, and the sixth iterative process (executed at the sixth time) At the stage of performing steps S3 to S5), a correction work image P6 as shown in FIG. 28 was obtained. Here, first, the form of newly added linear elements L21, L22, L23, and L31 (hatched portions by dots) in the image P6 of FIG. 28 will be considered.

既に述べたとおり、これらの線状要素のうち、L21,L22,L23は、第3回目の繰り返し処理でコピーされた画素から構成され、L31は、第6回目の繰り返し処理でコピーされた画素から構成されている。いずれも、コピー元となったのは、原画像P0に既存の線状要素L11である。   As described above, among these linear elements, L21, L22, and L23 are composed of pixels copied in the third iteration, and L31 is composed of pixels copied in the sixth iteration. It is configured. In both cases, the original linear element L11 in the original image P0 is the copy source.

すなわち、L21,L22,L23は、L11を3行分だけ下方向にシフトし、その一部分をコピー対象としてコピーすることにより得られた線状要素である。したがって、L21,L22,L23の形態を全体的に捉えると、コピー元であるL11の特徴を残していることがわかる。すなわち、L11は、左端が上方に湾曲し、右端が下方に湾曲している特徴をもった線状要素であるが、L21,L22,L23の形態全体にも、このような特徴がそのまま現れている。また、L31は、L11を6行分だけ下方向にシフトし、その一部分(左端の1画素のみ)をコピー対象としてコピーすることにより得られた要素である。1画素のみであるため、コピー元であるL11の特徴は明確には現れていないが、原理的には、L11の特徴が反映されていることになる。   That is, L21, L22, and L23 are linear elements obtained by shifting L11 downward by three lines and copying a portion thereof as a copy target. Therefore, when the forms of L21, L22, and L23 are grasped as a whole, it can be seen that the characteristics of the copy source L11 remain. That is, L11 is a linear element having a feature that the left end is curved upward and the right end is curved downward. However, such a feature appears as it is in the entire form of L21, L22, and L23. Yes. L31 is an element obtained by shifting L11 downward by 6 lines and copying a part (only one pixel at the left end) as a copy target. Since there is only one pixel, the feature of the copy source L11 does not appear clearly, but in principle, the feature of L11 is reflected.

このように、本発明の基本原理は、修正対象となる原画像上の線状要素もしくはその一部分を、空隙領域に平行移動してコピーする、というものであるが、このような基本原理に基づく修正を行えば、コピーされた線状要素の形状は、既存の線状要素の形状に準じたものになり、更に、平行移動(前掲の例では、下方向へのシフト)を行った後のコピーであるから、コピーされた線状要素の向きも、既存の線状要素の向きに準じたものになる。このため、全体的に違和感が生じない修正が可能になる。   As described above, the basic principle of the present invention is that the linear element on the original image to be corrected or a part of the linear element is translated and copied to the void area, and is based on such a basic principle. If the correction is made, the shape of the copied linear element becomes the same as the shape of the existing linear element, and further, after the parallel movement (shifting downward in the above example) is performed. Since it is a copy, the direction of the copied linear element also conforms to the direction of the existing linear element. For this reason, it is possible to make corrections that do not cause a sense of discomfort overall.

ところで、図28に示す画像P6において、新たに追加された線状要素L21,L22,L23,L31の位置および形状を決定する要因を考えてみると、パラメータとして設定した、シフト量Δおよび空隙幅Wが大きく関わっていることが理解できよう。   By the way, in the image P6 shown in FIG. 28, considering the factors that determine the positions and shapes of the newly added linear elements L21, L22, L23, and L31, the shift amount Δ and the gap width set as parameters are set. You can understand that W is greatly involved.

まず、新たな線状要素L21,L22,L23と既存の線状要素L11との空隙をみると、いずれも空隙部分の幅は2画素分となっていることがわかる。同様に、新たな線状要素L31と既存の線状要素L12との間の空隙部分の幅も2画素分となっている。これは、パラメータとして空隙幅W=2に設定したことが要因である。また、新たな線状要素L21とL31との間の空隙幅が2画素分となっているのも、W=2に設定したことが要因である。このように、空隙幅Wというパラメータは、文字どおり、線状要素間の空隙部分の幅を左右するパラメータということになる。たとえば、空隙幅W=1に設定すれば、線状要素L21,L22,L23は1画素分上方にコピーされていたことになるし、空隙幅W=3に設定すれば、線状要素L21,L22は1画素分下方にコピーされていたことになる。   First, looking at the gaps between the new linear elements L21, L22, L23 and the existing linear element L11, it can be seen that the width of the gap part is two pixels. Similarly, the width of the gap between the new linear element L31 and the existing linear element L12 is also two pixels. This is because the gap width W = 2 is set as a parameter. The reason why the gap width between the new linear elements L21 and L31 is two pixels is that W = 2 is set. Thus, the parameter of the gap width W is literally a parameter that affects the width of the gap between the linear elements. For example, if the gap width W = 1 is set, the linear elements L21, L22, L23 are copied upward by one pixel, and if the gap width W = 3, the linear elements L21, L21, L22 has been copied downward by one pixel.

これに対して、シフト量Δは、新たな線状要素の形状を左右するパラメータである。上述したように、新たな線状要素L21,L22,L23は、既存の線状要素L11の一部をコピーすることにより生まれた要素である。この新たな線状要素L21,L22,L23が生まれる過程は、図17の関係図を参照すれば容易に理解できる。すなわち、図17において、小さな正方形の輪郭が示された画素(図16のシフト画像S3上の黒画素)のうち、画素値(距離を示す値)が3以上の画素が、コピー対象画素となる。その結果、図18に示すように、線状要素L21,L22,L23がコピー対象として抽出されたわけである。   On the other hand, the shift amount Δ is a parameter that affects the shape of the new linear element. As described above, the new linear elements L21, L22, and L23 are elements born by copying a part of the existing linear element L11. The process in which these new linear elements L21, L22, and L23 are born can be easily understood with reference to the relationship diagram of FIG. That is, in FIG. 17, a pixel having a pixel value (a value indicating a distance) of 3 or more among pixels having a small square outline (a black pixel on the shift image S3 in FIG. 16) is a copy target pixel. . As a result, as shown in FIG. 18, the linear elements L21, L22, and L23 are extracted as copy targets.

ここで、図16に示すシフト画像S3上の各線状要素L11〜L13の位置が、それぞれ1画素分下にずれていた場合を考えてみよう。その場合は、図17における正方形の輪郭もそれぞれ1画素分下にずれることになるので、中央の輪郭群(L11に対応する輪郭群)内の画素値の多くは3以上になることがわかる。その結果、コピー対象として抽出される線状要素は、より太くなる(2画素分の幅をもつ)。   Here, let us consider a case where the positions of the linear elements L11 to L13 on the shift image S3 shown in FIG. 16 are shifted downward by one pixel. In that case, since the square outlines in FIG. 17 are also shifted down by one pixel, it can be seen that most of the pixel values in the central outline group (the outline group corresponding to L11) are 3 or more. As a result, the linear element extracted as a copy target becomes thicker (has a width corresponding to two pixels).

結局、空隙幅Wは、修正後の画像上の各線状要素間の空隙の幅を支配するパラメータとなり、シフト量Δは、修正後の画像上で新たに追加された線状要素の形状を支配するパラメータとなることがわかる。   Eventually, the gap width W becomes a parameter that governs the width of the gap between each linear element on the corrected image, and the shift amount Δ governs the shape of the newly added linear element on the corrected image. It turns out that it becomes a parameter to do.

このようなパラメータの機能をより明確に示すために、図30に示すような単純な原画像P0が与えられた場合を考えてみよう。この図30に示す原画像P0上には、線状要素L51,L52が配置されている。いずれも幅2画素分、長さ12画素分の矩形からなる線状要素である。この原画像P0についての距離画像D0は、図31に示すようなものになる。なお、図31では、説明の便宜上、距離画像D0の一部のみ(L51とL52との間の部分のみ)を示すことにする。   In order to show the function of such parameters more clearly, consider the case where a simple original image P0 as shown in FIG. 30 is given. Linear elements L51 and L52 are arranged on the original image P0 shown in FIG. Each is a linear element composed of a rectangle of 2 pixels in width and 12 pixels in length. The distance image D0 for the original image P0 is as shown in FIG. In FIG. 31, for convenience of explanation, only a part of the distance image D0 (only a part between L51 and L52) is shown.

図32は、図30に示す原画像P0に対して、「シフト量Δ=1画素、空隙幅W=2画素」なるパラメータ設定を行い、本発明に係る修正処理を施して得られる修正済画像を示している。ここでも、既存の線状要素に対しては斜線によるハッチングを施し、新たに追加された線状要素に対してはドットによるハッチングを施している。図示のとおり、新たな線状要素L61,L62,L63が追加されている。各線状要素の上下方向の空隙幅は概ね2画素分となっている(L63,L52間の空隙幅が4画素分となっているのは、この間に新たな線状要素を入れる余裕がなかったためである)。これは、空隙幅W=2という設定が反映されたものである。また、線状要素L61,L62,L63の幅が1画素分となっているが、これはシフト量Δ=1という設定が反映されたものである。   FIG. 32 shows a corrected image obtained by performing the correction processing according to the present invention by setting the parameter “shift amount Δ = 1 pixel, gap width W = 2 pixels” for the original image P0 shown in FIG. Is shown. Again, the existing linear elements are hatched with diagonal lines, and the newly added linear elements are hatched with dots. As illustrated, new linear elements L61, L62, and L63 are added. The gap width in the vertical direction of each linear element is approximately 2 pixels (the gap width between L63 and L52 is 4 pixels because there was no room for a new linear element between them. Is). This reflects the setting of the gap width W = 2. In addition, the width of the linear elements L61, L62, and L63 is one pixel, which reflects the setting of the shift amount Δ = 1.

図33は、「シフト量Δ=1画素、空隙幅W=3画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L64,L65が追加されている。各線状要素の上下方向の空隙幅は概ね3画素分となっているが、これは、空隙幅W=3という設定が反映されたものである。また、線状要素L64,L65の幅が1画素分となっているが、これはシフト量Δ=1という設定が反映されたものである。   FIG. 33 shows the result of parameter setting “shift amount Δ = 1 pixel, gap width W = 3 pixels”. As shown in the figure, new linear elements L64 and L65 are added. The gap width in the vertical direction of each linear element is approximately 3 pixels, which reflects the setting of the gap width W = 3. In addition, the width of the linear elements L64 and L65 is one pixel, which reflects the setting of the shift amount Δ = 1.

図34は、「シフト量Δ=1画素、空隙幅W=4画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L66が追加されている。線状要素L51,L66の上下方向の空隙幅は4画素分となっているが、これは、空隙幅W=4という設定が反映されたものである。一方、線状要素L66,L52の上下方向の空隙幅は8画素分となっているが、これは、空隙幅W=4という設定では、この間に新たな線状要素を入れる余裕がなかったためである。また、線状要素L66の幅が1画素分となっているが、これはシフト量Δ=1という設定が反映されたものである。   FIG. 34 shows the result of parameter setting “shift amount Δ = 1 pixel, gap width W = 4 pixels”. As illustrated, a new linear element L66 is added. The gap width in the vertical direction of the linear elements L51 and L66 is 4 pixels, which reflects the setting of the gap width W = 4. On the other hand, the vertical gap width of the linear elements L66 and L52 is 8 pixels, because there was no room for a new linear element in the gap width W = 4 setting. is there. Further, the width of the linear element L66 is one pixel, which reflects the setting of the shift amount Δ = 1.

続いて、シフト量Δ=2という設定を行った場合の例を見てみよう。図35は、「シフト量Δ=2画素、空隙幅W=2画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L71,L72,L73が追加されている。各線状要素の上下方向の空隙幅はすべて2画素分となっているが、これは、空隙幅W=2という設定が反映されたものである。また、線状要素L71,L72の幅が2画素分となっているが、これはシフト量Δ=2という設定が反映されたものである。線状要素L73の幅が1画素となっているのは、既存の線状要素L52に接近しているためである。   Next, let's look at an example where the shift amount Δ = 2 is set. FIG. 35 shows the result of parameter setting “shift amount Δ = 2 pixels, gap width W = 2 pixels”. As illustrated, new linear elements L71, L72, and L73 are added. The gap width in the vertical direction of each linear element is equal to two pixels, which reflects the setting of the gap width W = 2. Further, the widths of the linear elements L71 and L72 are two pixels, which reflects the setting of the shift amount Δ = 2. The width of the linear element L73 is one pixel because it is close to the existing linear element L52.

このように、シフト量Δ=2にすると、新たに追加される線状要素の幅が2画素分になる理由は、図31の距離画像D0を参照すると理解できる。シフト量Δ=2に設定すると、既存の線状要素L51を、下方向へ2行分ずつシフトすることによりシフト画像が生成されることになる。図31において、線状要素L51を2行分シフトすると、シフト後の輪郭内に含まれる距離の値は「1」または「2」であるから、W=2という設定の場合、いずれの画素もコピー対象にはならない。ところが、線状要素L51をもう1回、2行分シフトすると(原画像に対して、合計4行分シフトすると)、シフト後の輪郭内に含まれる距離の値は「3」または「4」になるので、輪郭内の画素がすべてコピー対象となる。このため、2行分の画素がそっくりコピー対象となり、図35に示す線状要素L71,L72のように、幅が2画素分の線状要素が追加されることになるのである。   As described above, when the shift amount Δ = 2, the reason why the width of the newly added linear element becomes two pixels can be understood with reference to the distance image D0 in FIG. When the shift amount Δ = 2 is set, a shift image is generated by shifting the existing linear element L51 downward by two lines. In FIG. 31, when the linear element L51 is shifted by two lines, the distance value included in the contour after the shift is “1” or “2”. It cannot be copied. However, if the linear element L51 is shifted by two lines once more (shifted by a total of four lines with respect to the original image), the value of the distance included in the contour after the shift is “3” or “4”. Therefore, all the pixels in the contour are to be copied. For this reason, the pixels for two rows are completely copied, and a linear element having a width of two pixels is added like the linear elements L71 and L72 shown in FIG.

結局、シフト量Δの値を大きく設定すると、1回のシフトにより、シフト後の輪郭内に含まれる距離の値が一気に増加することになり、コピー対象となる画素が一気に増え、比較的幅の広い線状要素が新たに追加され易くなる。シフト量Δは、このような点において、修正後の画像上で新たに追加された線状要素の形状を支配するパラメータとして関与するのである。   After all, if the value of the shift amount Δ is set large, the distance value included in the outline after the shift is increased at a time by one shift, and the number of pixels to be copied increases at a stretch, and the relatively wide width. A wide linear element is easily added. In such a point, the shift amount Δ is involved as a parameter that governs the shape of the newly added linear element on the corrected image.

図36は、「シフト量Δ=2画素、空隙幅W=3画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L74,L75が追加されている。各線状要素の上下方向の空隙幅は概ね3画素分となっているが、これは、空隙幅W=3という設定が反映されたものである。また、シフト量Δ=2という設定を行っているにもかかわらず、線状要素L74,L75の幅が1画素分となっているが、これはシフト量Δと空隙幅Wとの関係に依拠する結果である。すなわち、シフト量Δ=2という設定を行った以上、コピー元となる線状要素L51は、偶数ピッチでシフトされてゆくことになるが、空隙幅についてはW=3という奇数値を設定しているため、線状要素L51の一行分のみがコピー対象として抽出されることになるのである。   FIG. 36 shows the result of parameter setting “shift amount Δ = 2 pixels, gap width W = 3 pixels”. As shown in the figure, new linear elements L74 and L75 are added. The gap width in the vertical direction of each linear element is approximately 3 pixels, which reflects the setting of the gap width W = 3. Further, although the shift amount Δ = 2 is set, the width of the linear elements L74 and L75 is one pixel, which depends on the relationship between the shift amount Δ and the gap width W. This is the result. That is, as long as the shift amount Δ = 2 is set, the linear element L51 as a copy source is shifted at an even pitch, but the gap width is set to an odd value of W = 3. Therefore, only one line of the linear element L51 is extracted as a copy target.

このように、パラメータとして設定したシフト量Δは、必ずしも新たに追加される線状要素の幅を正確に規定するものではなく、実際に追加される線状要素の幅は、コピー元となる線状要素L51の幅、シフト量Δ、空隙幅Wの相互関連により決まることになる。   Thus, the shift amount Δ set as a parameter does not necessarily accurately define the width of the newly added linear element, and the width of the actually added linear element is not limited to the line that is the copy source. This is determined by the correlation among the width of the shape element L51, the shift amount Δ, and the gap width W.

図37は、「シフト量Δ=2画素、空隙幅W=4画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L76が追加されている。線状要素L51,L76の上下方向の空隙幅は4画素分となっているが、これは、空隙幅W=4という設定が反映されたものである。一方、線状要素L76,L52の上下方向の空隙幅は7画素分となっているが、これは、空隙幅W=4という設定では、この間に新たな線状要素を入れる余裕がなかったためである。また、線状要素L76の幅が2画素分となっているが、これはシフト量Δ=2という設定が反映されたものである。   FIG. 37 shows the result of parameter setting “shift amount Δ = 2 pixels, gap width W = 4 pixels”. As illustrated, a new linear element L76 is added. The gap width in the vertical direction of the linear elements L51 and L76 is 4 pixels, and this reflects the setting of the gap width W = 4. On the other hand, the vertical gap width of the linear elements L76 and L52 is 7 pixels, because there was no room for a new linear element in the gap width W = 4 setting. is there. In addition, the width of the linear element L76 is two pixels, which reflects the setting of the shift amount Δ = 2.

今度は、シフト量Δ=3という設定を行った場合の例を見てみよう。図38は、「シフト量Δ=3画素、空隙幅W=2画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L81,L82,L83が追加されている。各線状要素の上下方向の空隙幅は概ね2画素分となっているが、これは、空隙幅W=2という設定が反映されたものである。また、線状要素L81,L82,L83の幅が1画素分となっているが、これはコピー元となる線状要素L51の幅と、シフト量Δ=3と空隙幅W=2という設定値との相互関連により決まったものである。   Next, let's look at an example when the shift amount Δ = 3 is set. FIG. 38 shows the result of the parameter setting “shift amount Δ = 3 pixels, gap width W = 2 pixels”. As shown in the figure, new linear elements L81, L82, and L83 are added. The gap width in the vertical direction of each linear element is approximately two pixels, which reflects the setting of the gap width W = 2. Further, the width of the linear elements L81, L82, and L83 is one pixel. This is the set value of the width of the linear element L51 as a copy source, the shift amount Δ = 3, and the gap width W = 2. It was decided by the mutual relationship.

図39は、「シフト量Δ=3画素、空隙幅W=3画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L84が追加されている。空隙幅W=3という設定を行っているにもかかわらず、実際の線状要素L51,L84の上下方向の空隙幅は4画素分となっているが、これはコピー元となる線状要素L51の幅が2画素分しかないのに、シフト量Δ=3に設定したためである。すなわち、コピー元となる線状要素L51の幅よりも大きなシフト量を設定すると、コピー元が存在しない行(図39の例の場合、第4行目、第7行目、第10行目、第13行目)が発生し、そのような行には、画素のコピーが行われないことになる。線状要素L84,L52の上下方向の空隙幅が7画素分という大きな値になっているのも、第13行目が、コピー元が存在しない行に該当したためである。   FIG. 39 shows the result of the parameter setting of “shift amount Δ = 3 pixels, gap width W = 3 pixels”. As illustrated, a new linear element L84 is added. Despite the setting of the gap width W = 3, the vertical gap widths of the actual linear elements L51 and L84 are 4 pixels. This is the linear element L51 that is the copy source. This is because the shift amount Δ = 3 is set even though the width of is only 2 pixels. That is, if a shift amount larger than the width of the linear element L51 as the copy source is set, the copy source does not exist (in the example of FIG. 39, the fourth row, the seventh row, the tenth row, 13th line) occurs, and no pixel is copied to such a line. The reason why the gap width in the vertical direction of the linear elements L84 and L52 is as large as 7 pixels is that the 13th row corresponds to a row in which no copy source exists.

最後に、シフト量Δ=4という設定を行った場合の例を見てみよう。図40は、「シフト量Δ=4画素、空隙幅W=2画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L91,L92,L93が追加されている。各線状要素の上下方向の空隙幅は概ね2画素分となっているが、これは、空隙幅W=2という設定が反映されたものである。また、線状要素L91,L92,L93の幅は、コピー元となる線状要素L51の幅と、シフト量Δ=4と空隙幅W=2という設定値との相互関連により決まったものである。   Finally, let's look at an example where the shift amount Δ = 4 is set. FIG. 40 shows the result of the parameter setting of “shift amount Δ = 4 pixels, gap width W = 2 pixels”. As illustrated, new linear elements L91, L92, and L93 are added. The gap width in the vertical direction of each linear element is approximately two pixels, which reflects the setting of the gap width W = 2. The widths of the linear elements L91, L92, and L93 are determined by the correlation between the width of the linear element L51 that is the copy source and the set values of the shift amount Δ = 4 and the gap width W = 2. .

図41は、「シフト量Δ=4画素、空隙幅W=3画素」なるパラメータ設定を行った結果である。図示のとおり、新たな線状要素L94,L95が追加されている。各線状要素の上下方向の空隙幅は概ね3画素分となっているが、これは、空隙幅W=3という設定が反映されたものである。また、線状要素L94,L95の幅は、コピー元となる線状要素L51の幅と、シフト量Δ=4と空隙幅W=3という設定値との相互関連により決まったものである。   FIG. 41 shows the result of parameter setting “shift amount Δ = 4 pixels, gap width W = 3 pixels”. As shown in the figure, new linear elements L94 and L95 are added. The gap width in the vertical direction of each linear element is approximately 3 pixels, which reflects the setting of the gap width W = 3. The widths of the linear elements L94 and L95 are determined by the correlation between the width of the linear element L51 as a copy source and the set values of the shift amount Δ = 4 and the gap width W = 3.

以上の例を見てわかるように、パラメータとして設定する空隙幅Wは、必ずしも正確ではないが、文字どおり、線状要素間の空隙部分の幅を左右する因子ということになる。これに対して、パラメータとして設定するシフト量Δは、コピー元となる線状要素の幅や空隙幅Wとの相互関連により、新たに追加される線状要素の幅を左右する因子ということになる。オペレータは、このような予備知識をもって、任意のパラメータ設定を試行錯誤することにより、所望の修正結果を得ることができる。   As can be seen from the above examples, the gap width W set as a parameter is not necessarily accurate, but literally, it is a factor that affects the width of the gap portion between the linear elements. On the other hand, the shift amount Δ set as a parameter is a factor that determines the width of the newly added linear element due to the correlation with the width of the linear element that is the copy source and the gap width W. Become. The operator can obtain a desired correction result by trial and error of arbitrary parameter setting with such prior knowledge.

本願発明者が行った種々の試行錯誤によると、パラメータ設定段階で設定するパラメータとしては、空隙幅Wとして、各線状要素の平均的な幅値にほぼ等しい値を設定すると好ましい修正結果が得られる傾向にあることが判明した。前掲の例の場合、原画像上の線状要素L51,L52の幅は2画素であるので、W=2という設定を行うと、好ましい結果が得られることになる。たとえば、図40に示す例では、新たな線状要素L91,L92,L93が、既存の線状要素L51,L52の間に自然に融合するように付加されていることがわかる。   According to various trials and errors conducted by the inventors of the present application, a preferable correction result can be obtained by setting a value substantially equal to the average width value of each linear element as the gap width W as the parameter set in the parameter setting stage. It turns out that there is a tendency. In the case of the above-mentioned example, since the width of the linear elements L51 and L52 on the original image is 2 pixels, a preferable result can be obtained by setting W = 2. For example, in the example shown in FIG. 40, it can be seen that new linear elements L91, L92, and L93 are added so as to naturally fuse between the existing linear elements L51 and L52.

また、シフト量Δとしては、空隙幅Wの2倍の値を設定すると、好ましい修正結果が得られる傾向にあることも判明した。たとえば、空隙幅W=2に設定した場合、シフト量Δ=4に設定するのが好ましいことになる。具体的には、図40に示す例が、このような設定を行った例である。図32〜図41に示す種々の修正結果を相互に比較すれば、この図40に示す修正結果が最も自然な結果であることが認識できよう。   It has also been found that when the shift amount Δ is set to a value twice the gap width W, a preferable correction result tends to be obtained. For example, when the gap width W = 2 is set, it is preferable to set the shift amount Δ = 4. Specifically, the example shown in FIG. 40 is an example in which such a setting is performed. If the various correction results shown in FIGS. 32 to 41 are compared with each other, it can be recognized that the correction result shown in FIG. 40 is the most natural result.

<<< §6.変形例 >>>
最後に、本発明のいくつかの変形例に係る実施形態を説明する。
<<< §6. Modified example >>>
Finally, embodiments according to some modifications of the present invention will be described.

(1) 距離画像格納部80を用いない形態
図7にブロック図を示す実施形態では、距離演算部70による演算結果を、距離画像格納部80内に距離画像Dkとして格納しておき、コピー処理部40は、この距離画像格納部80内の距離画像Dkを参照することにより、特定の画素について求めた距離(最近接黒画素に対する距離)の値を利用していた。しかしながら、この距離画像格納部80は、本発明を実施する上で、必ずしも必須の構成要素ではない。距離画像格納部80がない場合、距離演算部70による演算結果を距離画像Dkという形式で保存しておくことはできなくなるが、コピー処理部40からの問い合わせを受けて、距離演算部70がその都度、特定の画素に関する「最近接黒画素に対する距離」を演算する処理を行い、結果をコピー処理部40に報告するようにすれば、本発明の基本原理に基づく画像修正は実施可能である。
(1) Form not using the distance image storage unit 80 In the embodiment shown in the block diagram of FIG. 7, the calculation result by the distance calculation unit 70 is stored as the distance image Dk in the distance image storage unit 80, and the copy processing is performed. The unit 40 refers to the distance image Dk in the distance image storage unit 80 and uses the value of the distance (distance to the closest black pixel) obtained for a specific pixel. However, the distance image storage unit 80 is not necessarily an essential component for carrying out the present invention. If there is no distance image storage unit 80, the calculation result by the distance calculation unit 70 cannot be stored in the format of the distance image Dk. However, in response to an inquiry from the copy processing unit 40, the distance calculation unit 70 Image correction based on the basic principle of the present invention can be carried out by performing processing for calculating the “distance to the nearest black pixel” for a specific pixel each time and reporting the result to the copy processing unit 40.

すなわち、距離演算部70は、修正作業用画像格納部30内の画像について、個々の画素についての最近接黒画素に対する距離を求める演算機能を有していれば足り、コピー処理部40は、シフト画像格納部20内の画像の黒画素のうち、修正作業用画像格納部30内の画像の対応位置にある画素についての距離演算部70によって求められた距離が空隙幅Wを超えている黒画素を、修正作業用画像格納部30内の画像の対応位置にコピーする処理を実行すればよい。   That is, it is sufficient that the distance calculation unit 70 has a calculation function for obtaining the distance to the nearest black pixel for each pixel in the image in the correction work image storage unit 30, and the copy processing unit 40 performs the shift. Among the black pixels of the image in the image storage unit 20, the black pixel whose distance obtained by the distance calculation unit 70 for the pixel at the corresponding position of the image in the correction work image storage unit 30 exceeds the gap width W Is copied to the corresponding position of the image in the correction work image storage unit 30.

(2) 図8のステップの順番
本発明に係る画像の修正方法の手順を、図8の流れ図に基づいて説明したが、この流れ図の手順は、必ずしもこのとおりの順番で行う必要はない。たとえば、ステップS1の原画像入力段階を行う前に、ステップS2のパラメータ設定段階を実行することも可能であるし、ステップS3の距離演算段階を行う前に、ステップS4の画像シフト段階を行うことも可能である。要するに、本発明の基本原理から逸脱しない限り、この流れ図の各ステップの順序は適宜変更可能である。
(2) Order of Steps in FIG. 8 The procedure of the image correction method according to the present invention has been described based on the flowchart of FIG. 8, but the procedure of the flowchart need not necessarily be performed in this order. For example, it is possible to execute the parameter setting step of step S2 before performing the original image input step of step S1, or to perform the image shift step of step S4 before performing the distance calculation step of step S3. Is also possible. In short, the order of the steps in this flowchart can be changed as appropriate without departing from the basic principle of the present invention.

(3) 最近接黒画素に対する距離
距離演算部70によって、個々の画素について演算される「最近接黒画素に対する距離」として、これまで述べてきた実施形態では、2つの画素の中心点間のユークリッド距離、もしくは当該ユークリッド距離を所定有効桁でまるめた値(前掲の実施例の場合、小数点以下を四捨五入した値)を演算値として用いてきた。しかしながら、「最近接黒画素に対する距離」としては、必ずしもユークリッド距離を用いる必要はない。たとえば、2つの画素の四近傍距離もしくは八近傍距離を代用することも可能である。
(3) Distance to nearest black pixel As the “distance to nearest black pixel” calculated for each pixel by the distance calculation unit 70, in the embodiments described so far, the Euclidean between the center points of the two pixels is described. A value obtained by rounding the distance or the Euclidean distance by a predetermined significant digit (in the case of the above-described embodiment, a value obtained by rounding off the decimal point) has been used as a calculation value. However, it is not always necessary to use the Euclidean distance as the “distance to the nearest black pixel”. For example, a four-neighbor distance or an eight-neighbor distance of two pixels can be substituted.

ここで、四近傍距離とは、二次元行列からなる画素配列について、任意の画素間の距離を示す値として利用されているものであり、二次元行列の升目上を縦または横に1ますずつ移動した場合に、何回の移動で相手の画素まで到達できるか、を示す数値として示される距離である。たとえば、図11に示す例の場合、画素Q5とQ6との間の四近傍距離は2であるが、画素Q5とQ4との間の四近傍距離は、3ということになる。これは、画素Q5の升目から画素Q4の升目まで、縦または横に1ますずつ移動して到達するためには、合計3回の移動が必要になるためである。同様に、画素Q8とQ9との間の四近傍距離は、斜めへの移動はできないので、2ということになる。   Here, the four-neighbor distance is used as a value indicating the distance between any pixels in a pixel array consisting of a two-dimensional matrix, and is one by one vertically or horizontally on the grid of the two-dimensional matrix. It is a distance indicated as a numerical value indicating how many times the movement can reach the pixel of the other party when moving. For example, in the example shown in FIG. 11, the four-neighbor distance between the pixels Q5 and Q6 is 2, but the four-neighbor distance between the pixels Q5 and Q4 is 3. This is because a total of three movements are required to move from the square of pixel Q5 to the square of pixel Q4 by moving one by one vertically or horizontally. Similarly, the four neighboring distances between the pixels Q8 and Q9 are 2 because they cannot move diagonally.

これに対して、八近傍距離とは、更に斜めへの移動も許した場合の移動回数を示す値である。上例の場合、画素Q5とQ4との間の八近傍距離は、2ということになり、画素Q8とQ9との間の八近傍距離は、1ということになる。   On the other hand, the 8-neighbor distance is a value indicating the number of times of movement when further oblique movement is permitted. In the above example, the 8-neighbor distance between the pixels Q5 and Q4 is 2, and the 8-neighbor distance between the pixels Q8 and Q9 is 1.

本発明で行う修正処理は、原画像上の空隙領域に、既存の線状要素の全部もしくは一部をコピーすることにより、線状要素の密度分布を修正するためのものであるので、距離演算部70において厳密な距離演算は不要である。したがって、本発明を実施する上で、「最近接黒画素に対する距離」として、上述した四近傍距離や八近傍距離のような便宜的な距離を用いても大きな支障は生じない。   Since the correction processing performed in the present invention is for correcting the density distribution of the linear elements by copying all or part of the existing linear elements in the void area on the original image, the distance calculation In the unit 70, a strict distance calculation is unnecessary. Therefore, when the present invention is implemented, there is no great problem even if a convenient distance such as the above-mentioned four-neighbor distance or eight-neighbor distance is used as the “distance to the nearest black pixel”.

(4) ローテーションしないシフト処理
これまでの実施形態では、シフト処理部50が、原画像もしくはシフト画像に対して、ローテーションシフトを行う例を示した。このローテーションシフトは、結局、シフトにより画像の一方から食み出た画素(前掲の実施例の場合、画像の下端から食み出た1行分の画素)を、シフトにより画像の他方に生じた空白部分(前掲の実施例の場合、画像の上端に生じた1行分の空白部分)に配置するシフトであり、画素を有効利用する上では好ましいシフト形態である。
(4) Shift processing without rotation In the embodiments so far, the example in which the shift processing unit 50 performs the rotation shift on the original image or the shift image has been described. This rotation shift eventually resulted in pixels that protruded from one side of the image due to the shift (in the case of the previous embodiment, one row of pixels that protruded from the lower end of the image) to the other side of the image due to the shift. This is a shift arranged in a blank portion (in the case of the above-described embodiment, a blank portion corresponding to one line generated at the upper end of the image), which is a preferable shift form in order to effectively use pixels.

しかしながら、本発明におけるシフト処理は、必ずしもローテーションシフトによって行う必要はない。たとえば、画像の一方から食み出た画素については、そのまま廃棄してしまってもかまわない。この場合、画像の他方からは徐々に空白部分が広がることになるが、トータルのシフト量が、画像の大きさに比較して小さい場合には、本発明を実施する上で大きな支障は生じない。   However, the shift processing in the present invention does not necessarily have to be performed by rotation shift. For example, pixels protruding from one side of the image may be discarded as they are. In this case, the blank portion gradually spreads from the other side of the image, but when the total shift amount is small compared to the size of the image, there is no big trouble in implementing the present invention. .

(5) シフト方向もパラメータ設定する方法
これまでの実施形態では、シフト方向は下方向と決められていたが、シフト方向をパラメータとして任意に設定できるようにすることも可能である。この場合、パラメータ設定部60に、シフト方向をパラメータとして設定する機能をもたせておき、シフト処理部50が、設定されたシフト方向にシフト処理を実行するようにすればよい。斜め方向へのシフトを行ってもかまわない。
(5) Method of setting parameters for the shift direction In the embodiments described so far, the shift direction is determined to be the downward direction, but it is also possible to arbitrarily set the shift direction as a parameter. In this case, the parameter setting unit 60 may have a function of setting the shift direction as a parameter, and the shift processing unit 50 may execute the shift process in the set shift direction. Shifting in an oblique direction may be performed.

これまでの実施例で示した原画像は、いずれも水平方向に伸びた線状要素を含む画像であったが、垂直方向に伸びた線状要素を含む画像に対しては、シフト方向を右もしくは左方向に設定した方が効果的である。そこで、実用上は、オペレータが入力した原画像上の全線状要素に共通する大まかな長手方向を目視確認し、この大まかな長手方向をコンピュータに対して指示してパラメータ設定部60にパラメータとして設定し、シフト処理部50が、当該長手方向に対して直交する方向をシフト方向とするシフト処理を実行するようにするのが好ましい。もっとも、本発明を実施する上で、線状要素の長手方向とシフト方向とを直交させることは必須ではなく、直交していなくても十分修正は可能である。   All of the original images shown in the embodiments so far are images including linear elements extending in the horizontal direction. However, for images including linear elements extending in the vertical direction, the shift direction is set to the right. Or it is more effective to set it to the left. Therefore, in practice, the general longitudinal direction common to all linear elements on the original image input by the operator is visually confirmed, the rough longitudinal direction is instructed to the computer, and set in the parameter setting unit 60 as a parameter. Then, it is preferable that the shift processing unit 50 performs a shift process in which the direction orthogonal to the longitudinal direction is the shift direction. However, in carrying out the present invention, it is not essential that the longitudinal direction of the linear element and the shift direction are orthogonal to each other, and sufficient correction is possible even if they are not orthogonal.

本発明に係る修正方法による修正前の画像の一例を示す平面図である。It is a top view which shows an example of the image before correction by the correction method which concerns on this invention. 図1に示す画像に対して、本発明に係る修正方法を適用することによって得られた修正後の画像の一例を示す平面図である。It is a top view which shows an example of the image after correction obtained by applying the correction method based on this invention with respect to the image shown in FIG. 本発明の基本概念を説明するための単純な原画像を示す平面図である。It is a top view which shows the simple original image for demonstrating the basic concept of this invention. 図3に示す原画像に対して、本発明の基本概念に基づく修正を加えた状態を示す平面図である。It is a top view which shows the state which added the correction based on the basic concept of this invention with respect to the original image shown in FIG. 本発明の基本概念を説明するための別な単純な原画像を示す平面図である。It is a top view which shows another simple original image for demonstrating the basic concept of this invention. 図5に示す原画像に対して、本発明の基本概念に基づく修正を加えた状態を示す平面図である。It is a top view which shows the state which added the correction based on the basic concept of this invention with respect to the original image shown in FIG. 本発明の一実施形態に係る画像の修正装置の基本構成を示すブロック図である。1 is a block diagram illustrating a basic configuration of an image correction apparatus according to an embodiment of the present invention. 本発明の一実施形態に係る画像の修正方法の基本手順を示す流れ図である。It is a flowchart which shows the basic procedure of the correction method of the image which concerns on one Embodiment of this invention. 本発明に係る画像の修正手順を説明するための原画像P0を示す平面図である。It is a top view which shows the original image P0 for demonstrating the correction procedure of the image which concerns on this invention. 図9に示す原画像P0について求められた距離画像D0を示す平面図である(小さな四角い枠は、原画像P0の黒画素の位置を示す)。FIG. 10 is a plan view showing a distance image D0 obtained for the original image P0 shown in FIG. 9 (a small square frame indicates the position of a black pixel in the original image P0). 本発明における各画素の距離値の概念を示す拡大画素図である。It is an enlarged pixel figure which shows the concept of the distance value of each pixel in this invention. 図9に示す原画像P0を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S1を示す平面図である。FIG. 10 is a plan view showing a shifted image S1 obtained by rotating the original image P0 shown in FIG. 9 downward by one pixel. 図12に示すシフト画像S1と図10に示す距離画像D0との関係を示す平面図である(小さな四角い枠は、シフト画像S1の黒画素の位置を示す)。It is a top view which shows the relationship between the shift image S1 shown in FIG. 12, and the distance image D0 shown in FIG. 10 (a small square frame shows the position of the black pixel of the shift image S1). 図12に示すシフト画像S1を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S2を示す平面図である。FIG. 13 is a plan view showing a shift image S2 obtained by rotating the shift image S1 shown in FIG. 12 downward by one pixel. 図14に示すシフト画像S2と距離画像D1(図10に示す距離画像D0と同じ)との関係を示す平面図である(小さな四角い枠は、シフト画像S2の黒画素の位置を示す)。It is a top view which shows the relationship between the shift image S2 shown in FIG. 14, and the distance image D1 (same as the distance image D0 shown in FIG. 10) (a small square frame shows the position of the black pixel of the shift image S2). 図14に示すシフト画像S2を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S3を示す平面図である。FIG. 15 is a plan view showing a shift image S3 obtained by rotating the shift image S2 shown in FIG. 14 downward by one pixel. 図16に示すシフト画像S3と距離画像D2(図10に示す距離画像D0と同じ)との関係を示す平面図である(小さな四角い枠は、シフト画像S3の黒画素の位置を示す)。FIG. 17 is a plan view showing a relationship between a shift image S3 shown in FIG. 16 and a distance image D2 (same as the distance image D0 shown in FIG. 10) (a small square frame indicates the position of a black pixel in the shift image S3). 図16に示すシフト画像S3を構成する黒画素のうち、コピー対象となる黒画素(部分線状要素L21,L22,L23)を示す平面図である。It is a top view which shows the black pixel (partial linear element L21, L22, L23) used as a copy object among the black pixels which comprise the shift image S3 shown in FIG. 図18に示すコピー対象となった黒画素(部分線状要素L21,L22,L23)を、図9に示す原画像上にコピーすることにより得られる修正作業用画像P3を示す平面図である。FIG. 19 is a plan view showing a correction work image P3 obtained by copying the black pixels (partial linear elements L21, L22, L23) shown in FIG. 18 onto the original image shown in FIG. 図19に示す修正作業用画像P3について求められた距離画像D3を示す平面図である。It is a top view which shows the distance image D3 calculated | required about the image P3 for correction work shown in FIG. 図16に示すシフト画像S3を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S4を示す平面図である。FIG. 17 is a plan view showing a shift image S4 obtained by rotating the shift image S3 shown in FIG. 16 downward by one pixel. 図21に示すシフト画像S4と図20に示す距離画像D3との関係を示す平面図である(小さな四角い枠は、シフト画像S4の黒画素の位置を示す)。It is a top view which shows the relationship between the shift image S4 shown in FIG. 21, and the distance image D3 shown in FIG. 20 (a small square frame shows the position of the black pixel of the shift image S4). 図21に示すシフト画像S4を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S5を示す平面図である。FIG. 22 is a plan view showing a shift image S5 obtained by rotating the shift image S4 shown in FIG. 21 downward by one pixel. 図23に示すシフト画像S5と距離画像D4(図20に示す距離画像D3と同じ)との関係を示す平面図である(小さな四角い枠は、シフト画像S5の黒画素の位置を示す)。It is a top view which shows the relationship between the shift image S5 shown in FIG. 23, and the distance image D4 (same as the distance image D3 shown in FIG. 20) (a small square frame shows the position of the black pixel of the shift image S5). 図23に示すシフト画像S5を下方向に1画素分だけローテーションシフトすることにより得られたシフト画像S6を示す平面図である。FIG. 24 is a plan view showing a shift image S6 obtained by rotating the shift image S5 shown in FIG. 23 downward by one pixel. 図25に示すシフト画像S6と距離画像D5(図20に示す距離画像D3と同じ)との関係を示す平面図である(小さな四角い枠は、シフト画像S6の黒画素の位置を示す)。FIG. 26 is a plan view showing the relationship between a shift image S6 shown in FIG. 25 and a distance image D5 (same as the distance image D3 shown in FIG. 20) (a small square frame indicates the position of a black pixel in the shift image S6). 図25に示すシフト画像S6を構成する黒画素のうち、コピー対象となる黒画素(部分線状要素L31)を示す平面図である。It is a top view which shows the black pixel (partial linear element L31) used as a copy object among the black pixels which comprise shift image S6 shown in FIG. 図27に示すコピー対象となった黒画素(部分線状要素L31)を、図19に示す修正作業用画像P3上にコピーすることにより得られる修正作業用画像P6を示す平面図である。It is a top view which shows the image P6 for correction work obtained by copying the black pixel (partial line element L31) used as the copy object shown in FIG. 27 on the image P3 for correction work shown in FIG. 図28に示す修正作業用画像P6について求められた距離画像D6を示す平面図である。It is a top view which shows the distance image D6 calculated | required about the image P6 for correction work shown in FIG. 本発明に係る画像の修正手順におけるパラメータΔおよびWの意味を説明するための原画像P0を示す平面図である。It is a top view which shows the original image P0 for demonstrating the meaning of parameters (DELTA) and W in the correction procedure of the image which concerns on this invention. 図30に示す原画像P0について求められた距離画像D0の一部を示す平面図である(L51,L52は、原画像P0上の線状要素をそのまま示し、数字部分が距離画像を示す)。FIG. 31 is a plan view showing a part of a distance image D0 obtained for the original image P0 shown in FIG. 30 (L51 and L52 indicate linear elements on the original image P0 as they are, and numerical portions indicate distance images). 図30に示す原画像P0に対して、パラメータΔ=1,W=2なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 1 and W = 2 with respect to the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=1,W=3なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 1 and W = 3 for the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=1,W=4なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 1 and W = 4 for the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=2,W=2なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 2 and W = 2 with respect to the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=2,W=3なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 2 and W = 3 for the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=2,W=4なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 2 and W = 4 for the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=3,W=2なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 3 and W = 2 with respect to the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=3,W=3なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 3 and W = 3 for the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=4,W=2なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 4 and W = 2 to the original image P0 shown in FIG. 30. 図30に示す原画像P0に対して、パラメータΔ=4,W=3なる設定を行うことによって得られる修正済画像Pnを示す平面図である。FIG. 31 is a plan view showing a corrected image Pn obtained by setting parameters Δ = 4 and W = 3 for the original image P0 shown in FIG. 30.

符号の説明Explanation of symbols

10:原画像入力部
20:シフト画像格納部
30:修正作業用画像格納部
40:コピー処理部
50:シフト処理部
60:パラメータ設定部
70:距離演算部
80:距離画像格納部
Dk:距離画像(k=0,1,2,3,…)
Dk(i,j):距離画像を構成する画素
D(Q1)〜D(Q9):各画素の距離値
L1〜L5:線状要素
L1a,L1b:コピー対象となった線状要素
L11〜L13:線状要素
L12−1,L12−2,L12−3:分割された線状要素
L13−1,L13−2,L13−3:分割された線状要素
L21,L22,L23,L31:コピー対象となった部分線状要素
L51,L52:線状要素
L61〜L66:コピー対象となった線状要素もしくは部分線状要素
L71〜L76:コピー対象となった線状要素もしくは部分線状要素
L81〜L84:コピー対象となった線状要素もしくは部分線状要素
L91〜L95:コピー対象となった線状要素もしくは部分線状要素
P0:原画像
P0(i,j):原画像を構成する画素
Pk:修正作業用画像(k=0,1,2,3,…)
Pk(i,j):修正作業用画像を構成する画素
Pn:修正済画像
Q1〜Q9:画素およびその中心点
S1〜S7:流れ図の各ステップ
Sk:シフト画像(k=1,2,3,…)
Sk(i,j):シフト画像を構成する画素
SP:空隙領域
W:空隙幅
Δ:シフト量
10: Original image input unit 20: Shift image storage unit 30: Correction work image storage unit 40: Copy processing unit 50: Shift processing unit 60: Parameter setting unit 70: Distance calculation unit 80: Distance image storage unit Dk: Distance image (K = 0, 1, 2, 3, ...)
Dk (i, j): Pixels D (Q1) to D (Q9) constituting the distance image: Distance values L1 to L5 of the respective pixels: Linear elements L1a and L1b: Linear elements L11 to L13 that are to be copied. : Linear elements L12-1, L12-2, L12-3: Divided linear elements L13-1, L13-2, L13-3: Divided linear elements L21, L22, L23, L31: Copy target Partial linear elements L51, L52: Linear elements L61 to L66: Linear elements or partial linear elements L71 to L76 to be copied: Linear elements or partial linear elements L811 to be copied L84: Linear element or partial linear element L91 to L95 to be copied: Linear element or partial linear element to be copied P0: Original image P0 (i, j): Pixel Pk constituting the original image : Correction work Image (k = 0,1,2,3, ...)
Pk (i, j): Pixels constituting the image for correction work Pn: Corrected images Q1 to Q9: Pixels and their center points S1 to S7: Steps in the flowchart Sk: Shift image (k = 1, 2, 3, …)
Sk (i, j): pixel SP constituting the shift image: gap area W: gap width Δ: shift amount

Claims (22)

線状要素を多数配置してなる画像について、線状要素の密度分布を修正する装置であって、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像を入力する原画像入力部と、
入力した前記原画像を初期画像として格納する修正作業用画像格納部と、
入力した前記原画像を初期画像として格納するシフト画像格納部と、
前記修正作業用画像格納部内の画像について、個々の画素についての最近接黒画素に対する距離を求める距離演算部と、
前記距離演算部で演算された距離を示す値を画素値としてもつ距離画像を格納する距離画像格納部と、
所定のシフト量Δおよび空隙幅Wをパラメータとして設定するパラメータ設定部と、
前記シフト画像格納部内の画像を所定方向に前記シフト量Δだけシフトして更新するシフト処理部と、
前記シフト画像格納部内の画像の黒画素のうち、前記距離画像格納部内の画像の対応位置にある画素の画素値が前記空隙幅Wを超えている黒画素を、前記修正作業用画像格納部内の画像の対応位置にコピーするコピー処理部と、
を備えることを特徴とする線状要素を有する画像の修正装置。
An apparatus for correcting the density distribution of linear elements for an image formed by arranging a large number of linear elements,
An original image input unit for inputting an original image to be corrected as a binary image composed of an aggregate of black pixels constituting a linear element portion and white pixels constituting a background portion;
A correction work image storage unit for storing the input original image as an initial image;
A shift image storage unit for storing the input original image as an initial image;
For the image in the correction work image storage unit, a distance calculation unit for obtaining a distance to the nearest black pixel for each pixel;
A distance image storage unit for storing a distance image having a value indicating a distance calculated by the distance calculation unit as a pixel value;
A parameter setting unit for setting the predetermined shift amount Δ and the gap width W as parameters;
A shift processing unit that updates the image in the shift image storage unit by shifting the image by a shift amount Δ in a predetermined direction;
Among the black pixels of the image in the shift image storage unit, the black pixel whose pixel value at the corresponding position of the image in the distance image storage unit exceeds the gap width W is selected as the black pixel in the correction work image storage unit. A copy processing unit for copying to the corresponding position of the image;
A device for correcting an image having a linear element.
請求項1に記載の修正装置において、
コピー処理部が、シフト画像格納部内の画像の個々の黒画素について、距離画像格納部内の画像の対応位置にある画素の画素値をそれぞれの参照画素値として求める処理を行い、この参照画素値が空隙幅Wを超えている黒画素が発見されたら、当該黒画素に対応する位置にある修正作業用画像格納部内の画像の白画素を黒画素に置換する処理を行うことを特徴とする線状要素を有する画像の修正装置。
The correction device according to claim 1,
The copy processing unit performs processing for obtaining the pixel value of the pixel at the corresponding position of the image in the distance image storage unit as each reference pixel value for each black pixel of the image in the shift image storage unit. When a black pixel that exceeds the gap width W is found, a process for replacing the white pixel of the image in the image storage unit for correction work at the position corresponding to the black pixel with a black pixel is performed. Image correction device having elements.
請求項1に記載の修正装置において、
コピー処理部が、修正作業用画像格納部内の画像の個々の白画素について、「対応する位置にあるシフト画像格納部内の画像の画素が黒画素」かつ「対応する位置にある距離画像格納部内の画像の画素の画素値が空隙幅Wを超えている」という条件を満たすかどうかを判定し、前記条件を満たしていた場合には、当該白画素を黒画素に置換する処理を行うことを特徴とする線状要素を有する画像の修正装置。
The correction device according to claim 1,
For each white pixel of the image in the correction work image storage unit, the copy processing unit determines that “the pixel of the image in the shift image storage unit at the corresponding position is a black pixel” and “the pixel in the distance image storage unit at the corresponding position”. It is determined whether or not the condition that the pixel value of the pixel of the image exceeds the gap width W is satisfied, and when the condition is satisfied, a process of replacing the white pixel with a black pixel is performed. An image correction apparatus having a linear element.
線状要素を多数配置してなる画像について、線状要素の密度分布を修正する装置であって、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像を入力する原画像入力部と、
入力した前記原画像を初期画像として格納する修正作業用画像格納部と、
入力した前記原画像を初期画像として格納するシフト画像格納部と、
前記修正作業用画像格納部内の画像について、個々の画素についての最近接黒画素に対する距離を求める距離演算部と、
所定のシフト量Δおよび空隙幅Wをパラメータとして設定するパラメータ設定部と、
前記シフト画像格納部内の画像を所定方向に前記シフト量Δだけシフトして更新するシフト処理部と、
前記シフト画像格納部内の画像の黒画素のうち、前記修正作業用画像格納部内の画像の対応位置にある画素についての前記距離演算部によって求められた距離が前記空隙幅Wを超えている黒画素を、前記修正作業用画像格納部内の画像の前記対応位置にコピーするコピー処理部と、
を備えることを特徴とする線状要素を有する画像の修正装置。
An apparatus for correcting the density distribution of linear elements for an image formed by arranging a large number of linear elements,
An original image input unit for inputting an original image to be corrected as a binary image composed of an aggregate of black pixels constituting a linear element portion and white pixels constituting a background portion;
A correction work image storage unit for storing the input original image as an initial image;
A shift image storage unit for storing the input original image as an initial image;
For the image in the correction work image storage unit, a distance calculation unit for obtaining a distance to the nearest black pixel for each pixel;
A parameter setting unit for setting the predetermined shift amount Δ and the gap width W as parameters;
A shift processing unit that updates the image in the shift image storage unit by shifting the image by a shift amount Δ in a predetermined direction;
Among the black pixels of the image in the shift image storage unit, the black pixel whose distance obtained by the distance calculation unit for the pixel at the corresponding position of the image in the correction work image storage unit exceeds the gap width W Is copied to the corresponding position of the image in the correction work image storage unit,
A device for correcting an image having a linear element.
請求項1〜4のいずれかに記載の修正装置において、
シフト処理部が、シフト処理を複数回だけ繰り返し実行し、
コピー処理部が、各回のシフト処理が行われるごとにそれぞれコピー処理(実質的なコピーが全く行われない空コピー処理も含む)を実行し、
距離演算部が、原画像に対する距離演算処理およびコピー処理後の画像に対する距離演算処理を実行することを特徴とする線状要素を有する画像の修正装置。
In the correction apparatus in any one of Claims 1-4,
The shift processing unit repeatedly performs the shift process only a plurality of times,
The copy processing unit executes a copy process (including an empty copy process where no substantial copy is performed at all) each time the shift process is performed,
An apparatus for correcting an image having linear elements, wherein the distance calculation unit executes a distance calculation process on the original image and a distance calculation process on the image after the copy process.
請求項5に記載の修正装置において、
シフト処理部が、距離演算処理により空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下になるまで、シフト処理を繰り返し実行することを特徴とする線状要素を有する画像の修正装置。
The correction device according to claim 5,
Correction of an image having a linear element, wherein the shift processing section repeatedly executes the shift processing until the total number of pixels from which distance exceeding the gap width W is obtained by the distance calculation processing is equal to or less than a predetermined reference value apparatus.
請求項5に記載の修正装置において、
シフト処理部が、空コピー処理が所定回数だけ連続して実行されるまで、シフト処理を繰り返し実行することを特徴とする線状要素を有する画像の修正装置。
The correction device according to claim 5,
An apparatus for correcting an image having linear elements, wherein the shift processing section repeatedly executes the shift processing until the empty copy processing is continuously executed a predetermined number of times.
請求項1〜7のいずれかに記載の修正装置において、
距離演算部が、2つの画素の中心点間のユークリッド距離もしくは当該ユークリッド距離を所定有効桁でまるめた値を演算値として求めることを特徴とする線状要素を有する画像の修正装置。
In the correction apparatus in any one of Claims 1-7,
An apparatus for correcting an image having a linear element, wherein the distance calculation unit obtains, as a calculation value, a Euclidean distance between center points of two pixels or a value obtained by rounding the Euclidean distance by a predetermined significant digit.
請求項1〜7のいずれかに記載の修正装置において、
距離演算部が、2つの画素の四近傍距離もしくは八近傍距離を演算値として求めることを特徴とする線状要素を有する画像の修正装置。
In the correction apparatus in any one of Claims 1-7,
An apparatus for correcting an image having a linear element, characterized in that a distance calculation unit obtains a 4-neighbor distance or an 8-neighbor distance between two pixels as a computed value.
請求項1〜9のいずれかに記載の修正装置において、
シフト処理部が、シフトにより画像の一方から食み出た画素を、シフトにより画像の他方に生じた空白部分に配置するローテーションシフトを行うことを特徴とする線状要素を有する画像の修正装置。
In the correction apparatus in any one of Claims 1-9,
An apparatus for correcting an image having a linear element, wherein the shift processing unit performs a rotation shift in which a pixel protruding from one side of the image by the shift is arranged in a blank portion generated in the other side of the image by the shift.
請求項1〜10のいずれかに記載の修正装置において、
パラメータ設定部が、シフト方向をパラメータとして設定する機能を有し、
シフト処理部が、前記シフト方向にシフト処理を実行することを特徴とする線状要素を有する画像の修正装置。
In the correction apparatus in any one of Claims 1-10,
The parameter setting unit has a function of setting the shift direction as a parameter,
An image correcting apparatus having a linear element, wherein a shift processing unit executes a shift process in the shift direction.
請求項1〜11のいずれかに記載の修正装置としてコンピュータを機能させるためのプログラム。   The program for functioning a computer as a correction apparatus in any one of Claims 1-11. 線状要素を多数配置してなる画像について、線状要素の密度分布を修正する方法であって、
線状要素部分を構成する黒画素と背景部分を構成する白画素との集合体からなる二値画像として、修正対象となる原画像をコンピュータに入力し、入力した原画像を初期状態の修正作業用画像および初期状態のシフト画像として設定する原画像入力段階と、
所定のシフト量Δおよび空隙幅Wをパラメータとしてコンピュータに対して設定するパラメータ設定段階と、
コンピュータが、初期状態もしくはその後の状態の修正作業用画像の個々の画素についての最近接黒画素に対する距離を求める距離演算段階と、
コンピュータが、初期状態もしくはその後の状態のシフト画像を所定方向に前記シフト量Δだけシフトして更新する画像シフト段階と、
コンピュータが、前記シフト画像の黒画素のうち、前記修正作業用画像の対応位置にある画素について距離演算段階で求められた距離が前記空隙幅Wを超えている黒画素を、前記修正作業用画像の前記対応位置にコピーして更新する画像コピー段階と、
コンピュータが、更新後の前記修正作業用画像を修正済画像として出力する修正済画像出力段階と、
を有することを特徴とする線状要素を有する画像の修正方法。
A method of correcting the density distribution of linear elements for an image formed by arranging a large number of linear elements,
The original image to be corrected is input to the computer as a binary image consisting of an aggregate of black pixels forming the linear element portion and white pixels forming the background portion, and the input original image is corrected in the initial state. Original image input stage to be set as an image for use and a shifted image in the initial state;
A parameter setting step for setting the predetermined shift amount Δ and the gap width W as parameters to the computer;
A distance calculating step for obtaining a distance from the nearest black pixel for each pixel of the correction work image in the initial state or the subsequent state;
An image shift step in which the computer shifts and updates the shifted image in the initial state or the subsequent state by the shift amount Δ in a predetermined direction;
The computer selects a black pixel in which the distance obtained in the distance calculation step for the pixel at the corresponding position of the correction work image among the black pixels of the shift image exceeds the gap width W. An image copy stage for copying and updating to the corresponding position of
A corrected image output stage in which the computer outputs the updated image for correction work as a corrected image;
A method for correcting an image having a linear element characterized by comprising:
請求項13に記載の修正方法において、
距離演算段階、画像シフト段階、画像コピー段階(実質的なコピーが全く行われない空コピー段階も含む)を、複数回だけ繰り返し実行した後に、修正済画像出力段階を実行することを特徴とする線状要素を有する画像の修正方法。
The correction method according to claim 13,
The corrected image output step is executed after the distance calculation step, the image shift step, and the image copy step (including an empty copy step in which no substantial copy is performed) are repeatedly executed a plurality of times. A method for correcting an image having a linear element.
請求項14に記載の修正方法において、
距離演算段階で、空隙幅Wを超える距離が得られる画素の総数が所定の基準値以下となった時点で、修正済画像出力段階を実行することを特徴とする線状要素を有する画像の修正方法。
The correction method according to claim 14,
Correction of an image having a linear element, wherein a corrected image output step is executed when the total number of pixels that can obtain a distance exceeding the gap width W is equal to or less than a predetermined reference value in the distance calculation step Method.
請求項14に記載の修正方法において、
空コピー段階が所定回数だけ連続して実行された時点で、修正済画像出力段階を実行することを特徴とする線状要素を有する画像の修正方法。
The correction method according to claim 14,
A method for correcting an image having linear elements, wherein the corrected image output step is executed when the empty copy step is continuously executed a predetermined number of times.
請求項13〜16のいずれかに記載の修正方法において、
距離演算段階で、2つの画素の中心点間のユークリッド距離もしくは当該ユークリッド距離を所定有効桁でまるめた値を演算値として求めることを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-16,
A method for correcting an image having a linear element, characterized in that a Euclidean distance between center points of two pixels or a value obtained by rounding the Euclidean distance by a predetermined effective digit is obtained as a calculated value in a distance calculation stage.
請求項13〜16のいずれかに記載の修正方法において、
距離演算段階で、2つの画素の四近傍距離もしくは八近傍距離を演算値として求めることを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-16,
A method for correcting an image having a linear element, characterized in that, in a distance calculation stage, a four-neighbor distance or an eight-neighbor distance between two pixels is obtained as a calculated value.
請求項13〜18のいずれかに記載の修正方法において、
画像シフト段階で、シフトにより画像の一方から食み出た画素を、シフトにより画像の他方に生じた空白部分に配置するローテーションシフトを行うことを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-18,
A method of correcting an image having a linear element, characterized in that, in the image shift stage, a rotation shift is performed in which a pixel protruding from one side of the image by the shift is arranged in a blank portion generated in the other side of the image by the shift.
請求項13〜19のいずれかに記載の修正方法において、
パラメータ設定段階で、空隙幅Wとして、各線状要素の平均的な幅値にほぼ等しい値を設定することを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-19,
A method for correcting an image having linear elements, characterized in that, in the parameter setting stage, a value substantially equal to an average width value of each linear element is set as the gap width W.
請求項13〜20のいずれかに記載の修正方法において、
パラメータ設定段階で、シフト量Δとして、空隙幅Wの2倍の値を設定することを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-20,
A method for correcting an image having linear elements, characterized in that a value twice as large as a gap width W is set as a shift amount Δ at a parameter setting stage.
請求項13〜21のいずれかに記載の修正方法において、
画像シフト段階で、全線状要素に共通する大まかな長手方向をコンピュータに対して指示し、コンピュータが、前記長手方向に対して直交する方向をシフト方向とするシフト処理を実行することを特徴とする線状要素を有する画像の修正方法。
In the correction method in any one of Claims 13-21,
In the image shift stage, a rough longitudinal direction common to all linear elements is instructed to the computer, and the computer executes a shift process in which the direction orthogonal to the longitudinal direction is the shift direction. A method for correcting an image having a linear element.
JP2006188767A 2006-07-10 2006-07-10 Device and method for correcting an image having linear elements Active JP4802898B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006188767A JP4802898B2 (en) 2006-07-10 2006-07-10 Device and method for correcting an image having linear elements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006188767A JP4802898B2 (en) 2006-07-10 2006-07-10 Device and method for correcting an image having linear elements

Publications (2)

Publication Number Publication Date
JP2008015952A JP2008015952A (en) 2008-01-24
JP4802898B2 true JP4802898B2 (en) 2011-10-26

Family

ID=39072872

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006188767A Active JP4802898B2 (en) 2006-07-10 2006-07-10 Device and method for correcting an image having linear elements

Country Status (1)

Country Link
JP (1) JP4802898B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2009096356A1 (en) 2008-01-28 2011-05-26 トヨタ自動車株式会社 ELECTRODE CATALYST FOR FUEL CELL, PROCESS FOR PRODUCING THE SAME, AND SOLID POLYMER FUEL CELL USING THE SAME

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4666432B2 (en) * 2001-01-26 2011-04-06 大日本印刷株式会社 Hairline pattern creation device
JP2004179845A (en) * 2002-11-26 2004-06-24 Matsushita Electric Ind Co Ltd Image processing method and apparatus

Also Published As

Publication number Publication date
JP2008015952A (en) 2008-01-24

Similar Documents

Publication Publication Date Title
CN1310176C (en) Knit design method and device
JP6497494B1 (en) Shape correction apparatus and shape correction method for figure pattern
JP6987624B2 (en) Pile construction method and pile construction management system
JP5791312B2 (en) Method and apparatus for creating surface processing data
US10685499B1 (en) Dynamic detail adaptive hair modeling and editing
CN111177809B (en) Texture map generation method and device, electronic equipment and readable storage medium
JP5791733B2 (en) AM screening method and AM screening apparatus
JP2013235583A (en) Designing 3d modeled object
JP2011095178A (en) Method and program for analyzing crack development
JP4802898B2 (en) Device and method for correcting an image having linear elements
CN120874410B (en) A Simulation Method for Space-Dyed Yarn Knitted Fabrics Based on Color and Texture Separation
JPWO2008032593A1 (en) Wrinkle pattern for wrinkle pattern printing, method and program for generating wrinkle pattern, housing building material printed with wrinkle pattern, automobile interior parts, home appliances and information equipment
JPH09277691A (en) Printed matter, embossed product, printing plate, and embossing plate having a wood grain conduit cross-section pattern, and method and apparatus for forming a wood grain conduit cross-section pattern
US7330772B2 (en) Knit design method and apparatus
US10055868B2 (en) Method of rendering a mosaic design
CN118334227B (en) Visual texture mapping method and system based on three-dimensional engine
JP7204583B2 (en) knit design system
US20060125829A1 (en) Silhouette-oriented gray font generation
JPH10326302A (en) Creation method and creation device for crepe pattern
JP6746830B2 (en) Jacquard fabric multicolor weave pattern generation method, device and program
JP2005301349A (en) Analysis model creation support device
JPH10129105A (en) Method and apparatus for producing crease pattern, printed matter and embossed product having crease pattern
JP4597586B2 (en) Thread image creation device, thread image creation method and program for melange yarn
JP3690501B2 (en) 3D modeling method
van Rens et al. A two-dimensional paving mesh generator for triangles with controllable aspect ratio and quadrilaterals with high quality

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090625

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110613

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110712

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110725

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4802898

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140819

Year of fee payment: 3