JP2007228139A - Labeling method, labeling device, labeling program, and method for eliminating dust from digital image - Google Patents
Labeling method, labeling device, labeling program, and method for eliminating dust from digital image Download PDFInfo
- Publication number
- JP2007228139A JP2007228139A JP2006045209A JP2006045209A JP2007228139A JP 2007228139 A JP2007228139 A JP 2007228139A JP 2006045209 A JP2006045209 A JP 2006045209A JP 2006045209 A JP2006045209 A JP 2006045209A JP 2007228139 A JP2007228139 A JP 2007228139A
- Authority
- JP
- Japan
- Prior art keywords
- label
- pixel
- effective
- child
- target pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000002372 labelling Methods 0.000 title claims abstract description 40
- 238000000034 method Methods 0.000 title claims description 129
- 239000000428 dust Substances 0.000 title claims description 33
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
本発明は、ラベリング方法、ラベリング装置、ラベリングプログラム、及びディジタル画像の埃除去方法に関する。 The present invention relates to a labeling method, a labeling device, a labeling program, and a method for removing dust from a digital image.
従来、原稿を読み取ってディジタル画像を出力する画像読み取り装置では、読み取りの際に写し込まれた埃をディジタル画像上から除去することができるものが知られている(例えば、特許文献1参照。)。しかしながら、特許文献1の画像読み取り装置によると、作業者が埃を除去する作業を行わなければならいので、作業者にとって負担になるという問題がある。
2. Description of the Related Art Conventionally, there has been known an image reading apparatus that reads a document and outputs a digital image, which can remove dust captured during reading from the digital image (see, for example, Patent Document 1). . However, according to the image reading apparatus of
ところで、従来、ディジタル画像の領域を抽出するラベリング処理が公知である。ラベリング処理を用いて抽出した領域のうち所定の閾値より少ない数の画素で構成されている領域を埃領域とし、埃領域に所定の埃除去処理を実行することにより、作業者の手を煩わすことなく埃を除去することが可能になる。
図15は、従来のラベリング処理を説明するための模式図である。従来のラベリング処理では、ラベル未設定の有効画素を順に注目画素として選択して他の有効画素のラベルと重複しないラベルを当該注目画素に設定する第1のループと、第1のループで注目画素にラベルが設定される度に実行される第2のループであって当該注目画素の8近傍にあるラベル未設定の有効画素に当該注目画素と同じラベルを設定する第2のループとが実行される。しかしながら、従来のラベリング処理は、第2のループで最初に見つけたラベル未設定の有効画素に注目画素と同じラベルを設定した後、実行中の第2のループを中断し、当該最初に見つけた有効画素を注目画素に設定して新たな第2のループを呼び出している。図15に示す例では第1のループによってラベルが設定されるのは左上にある有効画素のみであり、他の有効画素は全て第2のループの連鎖によってラベルが設定される。すなわち、従来のラベリング処理は、第2のループから別の第2のループが再帰的に呼び出される多重ループ構造である。一般にループが多重になるほど処理時間が長くなるので、従来のラベリング処理によると処理に長時間を要するという問題がある。
Conventionally, a labeling process for extracting a region of a digital image is known. Of the regions extracted using the labeling process, an area composed of a smaller number of pixels than a predetermined threshold is set as a dust area, and the predetermined dust removal process is performed on the dust area, thereby bothering the operator. It is possible to remove dust without any problems.
FIG. 15 is a schematic diagram for explaining a conventional labeling process. In the conventional labeling process, a valid pixel that has not been labeled is selected as a target pixel in order, and a first pixel that sets a label that does not overlap with the label of another valid pixel as the target pixel, and a target pixel in the first loop And a second loop that is executed each time a label is set, and sets a label that is the same as the pixel of interest to an effective pixel that has not been labeled and is in the vicinity of 8 of the pixel of interest. The However, in the conventional labeling process, after setting the same label as the target pixel to the effective pixel that has not been set, which is found first in the second loop, the second loop being executed is interrupted, and the first label is found. A new second loop is called by setting the effective pixel as the target pixel. In the example shown in FIG. 15, the label is set by the first loop only for the effective pixel in the upper left, and the labels are set for all other effective pixels by the chain of the second loop. That is, the conventional labeling process has a multiple loop structure in which another second loop is recursively called from the second loop. In general, since the processing time becomes longer as the number of loops is increased, the conventional labeling process has a problem that a long time is required for the process.
本発明は、上述の問題を解決するために創作されたものであって、二値画像上の領域を短時間に抽出するラベリング方法、ラベリング装置、およびラベリングプログラムを提供することを第1の目的とする。
また、本発明は、ディジタル画像上の埃を短時間に除去する埃除去方法を提供することを第2の目的とする。
The present invention was created in order to solve the above-mentioned problems, and it is a first object of the present invention to provide a labeling method, a labeling apparatus, and a labeling program for extracting a region on a binary image in a short time. And
A second object of the present invention is to provide a dust removing method for removing dust on a digital image in a short time.
(1)上記第1の目的を達成するためのラベリング方法は、有効画素と非有効画素とで構成されている二値画像の有効画素を順に注目画素として選択し、選択した前記注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルと重複しないラベルを前記注目画素に設定する第1の処理段階と、前記第1の処理段階で前記注目画素が選択される度に実行される第2の処理段階であって、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理段階と、を含む。
第1の処理段階で注目画素を選択する処理を第1のループ、第2の処理段階で注目画素の8近傍にある有効画素を選択する処理を第2のループというとすると、本発明では第1のループから第2のループが呼び出されるとその第2のループだけが実行されて第1のループに戻る。すなわち本発明では第2のループから第2のループは呼び出されず、ループは最大でも2重までしか多重化されない。従って、ループが3重以上に多重化される場合に比べて処理時間を低減できる。よって本発明によると、二値画像上の領域を短時間に抽出できる。
(1) In the labeling method for achieving the first object, effective pixels of a binary image composed of effective pixels and non-effective pixels are sequentially selected as attention pixels, and the selected attention pixels are labeled. Is not set, a first processing step for setting a label that does not overlap with a label set for another effective pixel as the target pixel, and each time the target pixel is selected in the first processing step Setting process for setting the same label as the target pixel for the effective pixel for which the label is not set for the effective pixel in the vicinity of the target pixel in the second processing step And, for an effective pixel for which a label different from the label of the pixel of interest is set, an association process for associating the label of the pixel of interest with the label of the pixel of interest is performed. Comprising a second process stage, the.
If the process of selecting a target pixel in the first processing stage is referred to as a first loop, and the process of selecting an effective pixel in the vicinity of the target pixel in the second processing stage is referred to as a second loop, When the second loop is called from one loop, only the second loop is executed and the process returns to the first loop. That is, in the present invention, the second loop is not called from the second loop, and the loop is multiplexed only up to two layers. Therefore, the processing time can be reduced as compared with the case where the loop is multiplexed three or more times. Therefore, according to the present invention, a region on a binary image can be extracted in a short time.
(2)前記第1の処理段階において、前記二値画像の上の行の有効画素を全て選択してから下の行の有効画素を選択するとともに、各行においては左から右の順で有効画素を選択し、前記第2の処理段階において、前記注目画素の右、右下、下および左下にある有効画素のみについて前記設定処理又は前記関連付け処理を実行してもよい。
本発明によると、第2の処理段階で注目画素の8近傍ではなく4近傍のみについて処理を行えばよいので、第2の処理段階の処理量を低減でき、二値画像上の領域をより短時間に抽出できる。
(2) In the first processing step, all the effective pixels in the upper row of the binary image are selected and then the effective pixels in the lower row are selected, and in each row, the effective pixels are sequentially from left to right. And in the second processing step, the setting process or the association process may be executed only for the effective pixels on the right, lower right, lower and lower left of the pixel of interest.
According to the present invention, since it is only necessary to perform processing not in the vicinity of 8 of the target pixel but in the vicinity of 4 in the second processing stage, the processing amount in the second processing stage can be reduced, and the area on the binary image can be shortened. Can be extracted in time.
(3)互いに異なるラベル間の大小関係が規定されており、前記第1の処理段階において、前記注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルよりも大きいラベルを前記注目画素に設定し、前記関連付け処理において、前記有効画素のラベルが前記注目画素のラベルより小さい場合は前記有効画素のラベルを親ラベル、前記注目画素のラベルを子ラベルとして関連付け、前記有効画素のラベルが前記注目画素のラベルより大きい場合は前記注目画素のラベルを親ラベル、前記有効画素のラベルを子ラベルとして関連付けてもよい。 (3) When a magnitude relationship between different labels is defined, and a label is not set for the pixel of interest in the first processing stage, a label larger than a label set for another effective pixel Is set as the target pixel, and in the association process, when the label of the effective pixel is smaller than the label of the target pixel, the label of the effective pixel is associated as a parent label, and the label of the target pixel is associated as a child label. When the pixel label is larger than the target pixel label, the target pixel label may be associated as a parent label, and the effective pixel label as a child label.
(4)前記関連付け処理において、前記親ラベルが他のラベルに子ラベルとして関連付けられている場合は、前記子ラベルを前記他のラベルに子ラベルとして関連付けてもよい。
本発明によると、親子関係の階層数を低減できるので、関連付けられているラベルの特定に要する時間を短縮できる。
(4) In the association process, when the parent label is associated with another label as a child label, the child label may be associated with the other label as a child label.
According to the present invention, since the number of parent-child relationships can be reduced, it is possible to reduce the time required to identify the associated label.
(5)前記関連付け処理において、前記子ラベルに他のラベルが子ラベルとして関連付けられている場合は、前記子ラベル及び前記他の子ラベルを前記親ラベルに子ラベルとして関連付けてもよい。
本発明によると、親子関係の階層数を低減できるので、関連付けられているラベルの特定に要する時間を短縮できる。
(5) In the association process, when another label is associated with the child label as a child label, the child label and the other child label may be associated with the parent label as a child label.
According to the present invention, since the number of parent-child relationships can be reduced, it is possible to reduce the time required to identify the associated label.
(6)前記関連付け処理において、前記子ラベルが前記親ラベルよりも小さい他のラベルに子ラベルとして関連付けられている場合は、前記親ラベルを前記他のラベルに子ラベルとして関連付けてもよい。
本発明によると、親子関係の階層数を低減できるので、関連付けられているラベルの特定に要する時間を短縮できる。
(6) In the association process, when the child label is associated as a child label with another label smaller than the parent label, the parent label may be associated with the other label as a child label.
According to the present invention, since the number of parent-child relationships can be reduced, it is possible to reduce the time required to identify the associated label.
(7)上記第1の目的を達成するためのラベリング装置は、有効画素と非有効画素とで構成されている二値画像上の有効画素を順に注目画素として選択し、選択した前記注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルと重複しないラベルを前記注目画素に設定する第1の処理手段と、前記第1の処理手段で前記注目画素が選択されると、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理手段と、を備える。
本発明によると、二値画像上の領域を短時間に抽出できる。
(7) A labeling device for achieving the first object sequentially selects effective pixels on a binary image composed of effective pixels and ineffective pixels as target pixels, and selects the selected target pixels. When a label is not set, a first processing unit that sets a label that does not overlap with a label set for another effective pixel as the target pixel, and the target pixel is selected by the first processing unit. And, for the effective pixels in the vicinity of 8 of the target pixel, for the effective pixels for which no label is set, a setting process is performed for setting the same label as the target pixel for the effective pixel, and what is the label of the target pixel? For effective pixels set with different labels, there is provided a second processing means for executing an associating process for associating the label of the effective pixel with the label of the pixel of interest.
According to the present invention, a region on a binary image can be extracted in a short time.
(8)上記第1の目的を達成するためのラベリングプログラムは、有効画素と非有効画素とで構成されている二値画像上の有効画素を順に注目画素として選択し、選択した前記注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルと重複しないラベルを前記注目画素に設定する第1の処理手段と、前記第1の処理手段で前記注目画素が選択されると、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理手段としてコンピュータを機能させる。
本発明によると、二値画像上の領域を短時間に抽出できる。
(8) A labeling program for achieving the first object sequentially selects effective pixels on a binary image composed of effective pixels and ineffective pixels as target pixels, and selects the selected target pixels. When a label is not set, a first processing unit that sets a label that does not overlap with a label set for another effective pixel as the target pixel, and the target pixel is selected by the first processing unit. And, for the effective pixels in the vicinity of 8 of the target pixel, for the effective pixels for which no label is set, a setting process is performed for setting the same label as the target pixel for the effective pixel, and what is the label of the target pixel? For effective pixels set with different labels, a compiling process is performed as second processing means for executing an association process for associating the label of the effective pixel with the label of the pixel of interest. To work over data.
According to the present invention, a region on a binary image can be extracted in a short time.
(9)上記第2の目的を達成するためのディジタル画像の埃除去方法は、ディジタル画像から有効画素と非有効画素とで構成されている二値画像を生成する段階と、前記二値画像に請求項1〜6のいずれか一項に記載のラベリング方法を適用して有効画素にラベルを設定する段階と、全ての有効画素にラベルを設定した後に実行され、他のラベルと関連付けられていないラベルについては当該ラベルが設定されている有効画素で構成される領域を一つの領域として抽出し、他のラベルと関連付けられているラベルについては関連付けられているラベルが設定されている有効画素で構成される領域を結合した領域を一つの領域として抽出する段階と、各前記領域の有効画素数を所定の閾値と比較して埃領域を特定する段階と、前記ディジタル画像の前記埃領域に対応する領域に対して所定の埃除去処理を実行する段階と、を含む。
本発明によると、領域を短時間に抽出できるので、ディジタル画像上の埃を短時間に除去できる。
(9) A method for removing dust from a digital image for achieving the second object includes: generating a binary image composed of effective pixels and ineffective pixels from the digital image; It is executed after applying the labeling method according to any one of
According to the present invention, since the area can be extracted in a short time, dust on the digital image can be removed in a short time.
(10)前記埃除去処理は、メディアンフィルタを適用する処理であってもよい。
本発明によると、メディアンフィルタを適用するので、埃を目立たなくできる。
(10) The dust removal process may be a process of applying a median filter.
According to the present invention, since the median filter is applied, dust can be made inconspicuous.
尚、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせにより実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハードウェア資源で実現されるものに限定されない。 Each function of the plurality of means provided in the present invention is realized by hardware resources whose functions are specified by the configuration itself, hardware resources whose functions are specified by a program, or a combination thereof. Further, the functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other.
以下、本発明の実施の形態を実施例に基づいて説明する。
図2は、本発明の一実施例に係るラベリング装置としてのパーソナルコンピュータ(PC)10のハードウェア構成を示すブロック図である。PC10は、CPU11、ROM12、RAM13、ディスプレイコントローラ14、インタフェース部15、リムーバブルメモリコントローラ(RMC)16、外部記憶部17、および操作部18を備え、これらはバス19で相互に接続されている。
Hereinafter, embodiments of the present invention will be described based on examples.
FIG. 2 is a block diagram showing a hardware configuration of a personal computer (PC) 10 as a labeling apparatus according to an embodiment of the present invention. The PC 10 includes a
CPU11はROM12や外部記憶部17に記憶されているプログラムを実行してPC10の全体を制御する。本実施例ではディジタル画像の埃を除去するための埃除去プログラムがスキャナドライバの一部として実装されており、ラベリングプログラムは埃除去プログラムの一部として実装されている。CPU11はスキャナドライバを実行することによって第1の処理手段、および第2の処理手段としても機能する。ROM12は各種のプログラムやデータを予め記憶しているメモリであり、RAM13は各種のプログラムやデータを一時的に記憶するメモリである。これら各種のプログラムやデータは所定のサーバから通信ネットワークを介してダウンロードして入力してもよいし、リムーバブルメモリなどから読み出して入力してもよい。
The
ディスプレイコントローラ14は、CPU11に制御され、CRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)、FPD(Flat Panel Display)などのディスプレイ20にディジタル画像を表示させる。
インタフェース部15は、イメージスキャナ22などの外部システムと通信するためのUSBコントローラ、USBコネクタなどを備える。通信規格はUSBに限らず、IEEE1394、赤外線、イーサネット(登録商標)などのいかなる規格でもよい。
The
The
RMC16は、図示しないコネクタを介してリムーバブルメモリに接続され、リムーバブルメモリとRAM13との間でデータ転送を制御する。リムーバブルメモリはカード型フラッシュメモリ(所謂メモリカード)でもよいし、その他の繰り返し書き込み可能ないかなる不揮発性記憶媒体であってもよい。
外部記憶部17は、ハードディスクやハードディスクコントローラなどで構成され、オペレーティングシステム(OS)、スキャナドライバ、その他各種のプログラムやデータなどが記憶されている。
操作部18は、キーボード21が接続されるキーボードコントローラや図示しないマウスが接続されるマウスコントローラなどで構成されている。
The
The
The
次に、ラベリング処理について説明する。
図1は、ラベリング処理を説明するための模式図である。二値画像はディジタル画像の輝度成分に基づいて生成したエッジ画像の各画素値を所定の閾値と比較することにより、画素値が所定の閾値以上である有効画素と画素値が所定の閾値未満である非有効画素とに二値化した画像である。例えば有効画素には画素値として1が設定されており、非有効画素には画素値として0が設定されている。
Next, the labeling process will be described.
FIG. 1 is a schematic diagram for explaining the labeling process. In the binary image, each pixel value of the edge image generated based on the luminance component of the digital image is compared with a predetermined threshold value, so that an effective pixel whose pixel value is greater than or equal to the predetermined threshold value and a pixel value less than the predetermined threshold value. It is an image binarized into a certain ineffective pixel. For example, 1 is set as the pixel value for the effective pixel, and 0 is set as the pixel value for the ineffective pixel.
ラベリング処理では、先ず第1の処理が実行される。第1の処理は、二値画像の有効画素を順に注目画素として選択し、選択した注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルと重複しないラベルを注目画素に設定する処理である。ここでラベルとは、本実施例では1から昇順に選択される整数のことをいい、例えば1〜5までが既に他の有効画素に設定されている場合は6が次のラベルとして選択される。本実施例の第1の処理では上の行の有効画素を全て選択してから下の行の有効画素を選択するとともに、各行においては左から右の順で有効画素を選択するものとする。 In the labeling process, first, a first process is executed. In the first process, effective pixels of a binary image are selected as target pixels in order, and if no label is set for the selected target pixel, a label that does not overlap with a label set for another effective pixel is selected as the target pixel. It is a process to set. Here, the label means an integer selected in ascending order from 1 in this embodiment. For example, when 1 to 5 are already set to other effective pixels, 6 is selected as the next label. . In the first process of this embodiment, all the effective pixels in the upper row are selected, and then the effective pixels in the lower row are selected. In each row, the effective pixels are selected in order from left to right.
図1の(1)に示すように、最初は有効画素(0,0)が注目画素として選択される。選択された注目画素(0,0)には他の有効画素のラベルと重複しないラベルである「1」が設定されるとともに、図3(A)に示すようにラベル管理テーブルにラベル「1」が登録される。このときラベル管理テーブルの「ラベル数」列にはラベル「1」が設定されている画素の数である1が登録される。 As shown in (1) of FIG. 1, the effective pixel (0, 0) is initially selected as the target pixel. The selected pixel of interest (0, 0) is set to “1”, which is a label that does not overlap with the labels of other effective pixels, and the label “1” is displayed in the label management table as shown in FIG. Is registered. At this time, 1 which is the number of pixels for which the label “1” is set is registered in the “number of labels” column of the label management table.
第1の処理で注目画素が選択されると、その度に第2の処理が実行される。第2の処理は、注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に注目画素と同じラベルを設定する設定処理を実行し、注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと注目画素のラベルとを関連付ける関連付け処理を実行する処理である。ここで本実施例では関連付け処理のことをラベル親子関係登録処理というものとする。 When the target pixel is selected in the first process, the second process is executed each time. The second process executes a setting process for setting the same pixel as the target pixel for the effective pixel for which the label is not set for the effective pixel in the vicinity of the target pixel, and the label of the target pixel Is a process of executing an associating process for associating the label of the effective pixel and the label of the target pixel with respect to the effective pixel set with a different label. In this embodiment, the association process is referred to as a label parent-child relationship registration process.
ただし、本実施例では8近傍ではなく注目画素の右、右下、下および左下にある有効画素のみについて設定処理又はラベル親子関係登録処理を実行する。これは前述した第1の処理が上の行の有効画素を全て選択してから下の行の有効画素を選択するとともに、各行においては左から右の順で有効画素を選択するからである。このような順で有効画素が選択される場合、右、右下、下および左下にある有効画素のみに対して設定処理又はラベル親子関係登録処理を実行するだけで、設定処理又はラベル親子関係登録処理が実行されるべき有効画素に対して設定処理又はラベル親子関係登録処理をもれなく実行できる。8近傍ではなく右、右下、下および左下にある4近傍の有効画素のみに対して処理を実行するようにすると、注目画素の4近傍にある画素のみについてその画素が有効画素であるか否かを判定すればよいので、8近傍にある画素についてそれぞれ有効画素であるか否かを判定する場合に比べて判定すべき画素数を半減できる。これにより、従来のラベリング処理に比べて処理速度が大幅に向上する。 However, in the present embodiment, the setting process or the label parent-child relationship registration process is executed only for the effective pixels that are not in the vicinity of 8 but on the right, lower right, lower and lower left of the target pixel. This is because the first process described above selects all the effective pixels in the upper row and then selects the effective pixels in the lower row, and in each row, the effective pixels are selected in order from left to right. When effective pixels are selected in this order, setting processing or label parent-child relationship registration is performed only by performing setting processing or label parent-child relationship registration processing on only the effective pixels on the right, lower right, lower and lower left. The setting process or the label parent-child relationship registration process can be executed without fail for the effective pixels to be processed. If the process is executed only on the four neighboring effective pixels on the right, lower right, lower and lower left, instead of the eight neighboring neighborhoods, whether or not the pixel is an effective pixel for only the four neighboring pixels of the target pixel. Therefore, the number of pixels to be determined can be halved compared to the case of determining whether or not each pixel in the vicinity of 8 is an effective pixel. Thereby, the processing speed is greatly improved as compared with the conventional labeling processing.
図1の(1)に示す例の場合、注目画素(0,0)の下にラベル未設定の有効画素(0,1)があるので、図1の(2)に示すように有効画素(0,1)に注目画素(0,0)と同じラベル「1」が設定され、図3(B)に示すようにラベル管理テーブルのラベル「1」が登録されている行の「ラベル数」列に1が加算される。 In the case of the example shown in (1) of FIG. 1, since there is an unlabeled effective pixel (0, 1) under the target pixel (0, 0), the effective pixel (0, 1) is shown in FIG. 0,1) is set with the same label “1” as the pixel of interest (0,0), and as shown in FIG. 3B, the “label number” of the row in which the label “1” of the label management table is registered 1 is added to the column.
図1の(1)に示す例の場合、注目画素(0,0)の右、右下、下および左下には注目画素(0,0)に設定されているラベル「1」と異なるラベルが設定されている有効画素はないので、ラベル親子関係登録処理は実行されない。
次に、第1の処理に戻り、図1の(3)に示すように有効画素(2,0)が次の注目画素として選択される。選択された注目画素(2,0)にはラベルが設定されていないので、他のいずれの有効画素のラベルとも重複しないラベルである「2」が設定されるとともに、図3(C)に示すようにラベル管理テーブルにラベル「2」が登録される。
In the example shown in (1) of FIG. 1, a label different from the label “1” set for the target pixel (0, 0) is displayed on the right, lower right, lower and lower left of the target pixel (0, 0). Since there is no set effective pixel, the label parent-child relationship registration process is not executed.
Next, returning to the first process, the effective pixel (2, 0) is selected as the next pixel of interest as shown in (3) of FIG. Since no label is set for the selected pixel of interest (2, 0), “2”, which is a label that does not overlap with any other effective pixel label, is set, as shown in FIG. As described above, the label “2” is registered in the label management table.
次に、注目画素(2,0)に対する第2の処理が実行される。図1の(3)に示す例の場合、注目画素(2,0)の下にラベルが設定されていない有効画素(2,1)があるので、図1の(4)に示すように有効画素(2,1)に注目画素(2,0)と同じラベル「2」が設定され、図3(D)に示すようにラベル管理テーブルのラベル「2」が登録されている行の「ラベル数」列に1が加算される。 Next, a second process is performed on the pixel of interest (2, 0). In the case of the example shown in (3) of FIG. 1, since there is an effective pixel (2, 1) for which no label is set under the target pixel (2, 0), it is effective as shown in (4) of FIG. The same label “2” as the target pixel (2, 0) is set to the pixel (2, 1), and the “label” of the row in which the label “2” of the label management table is registered as shown in FIG. 1 is added to the “Number” column.
図1の(3)に示す例の場合、注目画素(2,0)の右、右下、下および左下には注目画素(2,0)に設定されているラベル「2」よりも小さいラベルが設定されている画素はないので、ラベル親子関係登録処理は実行されない。
途中省略して、第1の処理に戻って図1の(5)に示すように有効画素(8,0)が注目画素として選択されると、選択された注目画素(8,0)には他の有効画素のラベルと重複しないラベルである「5」が設定されるとともに、図3(E)に示すようにラベル管理テーブルにラベル「5」が登録される。
In the example shown in (3) of FIG. 1, a label smaller than the label “2” set for the target pixel (2, 0) is displayed on the right, lower right, lower, and lower left of the target pixel (2, 0). Since no pixel is set, the label parent-child relationship registration process is not executed.
If the effective pixel (8, 0) is selected as the target pixel as shown in (5) of FIG. “5”, which is a label that does not overlap with the labels of other effective pixels, is set, and the label “5” is registered in the label management table as shown in FIG.
次に、注目画素(8,0)に対する第2の処理が実行される。図1の(5)の場合、注目画素(8,0)の下にラベル未設定の有効画素(8,1)があるので、有効画素(8,1)に注目画素(8,0)と同じラベル「5」が設定され、図3(F)に示すようにラベル管理テーブルのラベル「5」が登録されている行の「ラベル数」列に1が加算される。 Next, a second process is performed on the pixel of interest (8, 0). In the case of (5) in FIG. 1, since there is an unlabeled effective pixel (8, 1) under the target pixel (8, 0), the target pixel (8, 0) is included in the effective pixel (8, 1). The same label “5” is set, and as shown in FIG. 3F, 1 is added to the “label number” column of the row in which the label “5” of the label management table is registered.
図1の(5)に示す例の場合、注目画素(8,0)の左下には注目画素(8,0)のラベル「5」よりも小さいラベル「4」が設定されている有効画素(7,1)があるので、ラベル「4」にラベル「5」を子として登録するラベル親子関係登録処理が実行される。具体的には、図3(F)に示すようにラベル管理テーブルのラベル「4」が登録されている行の「子ラベル番号数」列に1が加算されるとともに、当該行の「子ラベル番号」列にラベル「5」が登録される。 In the case of the example shown in (5) of FIG. 1, the effective pixel (4) smaller than the label “5” of the target pixel (8, 0) is set to the lower left of the target pixel (8, 0) ( 7, 1), a label parent-child relationship registration process for registering label "5" as a child in label "4" is executed. Specifically, as shown in FIG. 3F, 1 is added to the “number of child label numbers” column of the row in which the label “4” of the label management table is registered, and the “child label of the row” The label “5” is registered in the “number” column.
途中省略して、第1の処理に戻って図1の(6)に示すようにラベル「2」が設定されている有効画素(2,1)が注目画素として選択されると、注目画素(2,1)に対する第2の処理が実行される。
図1の(6)に示す例の場合、注目画素(2,1)の下にあるラベル未設定の有効画素(2,2)、および右下にあるラベル未設定の有効画素(3,2)に注目画素(2,1)と同じラベル「2」がそれぞれ設定され、図3(G)に示すようにラベル管理テーブルのラベル「2」が登録されている行の「ラベル数」列に2が加算される。
If the effective pixel (2, 1) with the label “2” set as shown in (6) of FIG. 2, 2) is executed.
In the example shown in (6) of FIG. 1, an unlabeled effective pixel (2, 2) below the target pixel (2, 1) and an unlabeled effective pixel (3, 2) located at the lower right. ), The same label “2” as that of the target pixel (2, 1) is set, and as shown in FIG. 3G, the label management table label “2” is registered in the “number of labels” column. 2 is added.
図1の(6)に示す例の場合、注目画素(2,1)の左下には注目画素(2,1)のラベル「2」よりも小さいラベル「1」が設定されている有効画素(1,2)があるので、ラベル「1」にラベル「2」を子として登録するラベル親子関係登録処理が実行される。具体的には、図3(G)に示すようにラベル管理テーブルのラベル「1」が登録されている行の「子ラベル番号数」列に1が加算されるとともに、当該行の「子ラベル番号」列にラベル「2」が登録される。 In the case of the example shown in (6) of FIG. 1, an effective pixel (“1”) smaller than the label “2” of the target pixel (2, 1) is set at the lower left of the target pixel (2, 1). 1, 2), a label parent-child relationship registration process for registering label “2” as a child in label “1” is executed. Specifically, as shown in FIG. 3G, 1 is added to the “number of child label numbers” column of the row in which the label “1” of the label management table is registered, and the “child label” of the row Label “2” is registered in the “No.” column.
次に、第1の処理に戻って図1の(7)に示すようにラベル「3」が設定されている有効画素(4,1)が注目画素として選択されると、注目画素(4,1)に対する第2の処理が実行される。
図1の(6)に示すように注目画素(4,1)の下にラベル未設定の有効画素(4,2)があるので、図1の(7)に示すように有効画素(4,2)に注目画素(4,1)と同じラベル「3」が設定され、図4(H)に示すようにラベル管理テーブルのラベル「3」が登録されている行の「ラベル数」列に1が加算される。
Next, returning to the first process, as shown in (7) of FIG. 1, when the effective pixel (4, 1) with the label “3” is selected as the target pixel, the target pixel (4, 4) is selected. The second process for 1) is executed.
As shown in (6) of FIG. 1, since there is an unlabeled effective pixel (4, 2) under the target pixel (4, 1), as shown in (7) of FIG. 2) is set with the same label “3” as the pixel of interest (4, 1), and in the “number of labels” column of the row in which the label “3” of the label management table is registered as shown in FIG. 1 is added.
また、図1の(7)に示す例の場合、注目画素(4,1)の左下には注目画素(4,1)のラベル「3」よりも小さいラベル「2」が設定されている有効画素(3,2)があるので、ラベル「2」にラベル「3」を子として登録するラベル親子関係登録処理が実行される。ただし、前述したようにラベル「2」はラベル「1」の子として登録されている。この場合、ラベル「3」はラベル「2」の子ではなくラベル「1」の子として登録される。具体的には、図4(H)に示すようにラベル管理テーブルのラベル「1」が登録されている行の「子ラベル番号数」列に1が加算されるとともに、当該行の「子ラベル番号」列にラベル「3」が登録される。これにより親子関係の階層数を低減できるので、関連付けられているラベルの特定に要する時間を短縮できる。 In the example shown in (7) of FIG. 1, a label “2” smaller than the label “3” of the target pixel (4, 1) is set to the lower left of the target pixel (4, 1). Since there is a pixel (3, 2), a label parent-child relationship registration process for registering label “3” as a child in label “2” is executed. However, as described above, the label “2” is registered as a child of the label “1”. In this case, the label “3” is registered not as a child of the label “2” but as a child of the label “1”. Specifically, as shown in FIG. 4H, 1 is added to the “number of child label numbers” column of the row in which the label “1” of the label management table is registered, and the “child label” of the row Label “3” is registered in the “No.” column. As a result, the number of parent-child relationships can be reduced, so that the time required to identify the associated label can be shortened.
途中省略して、有効画素(4,2)までが注目画素として選択された結果を図1の(8)および図4(J)に示す。
次に、第1の処理で図1の(9)に示すようにラベル「4」が設定されている有効画素(6,2)が注目画素として選択されると、注目画素(6,2)に対する第2の処理が実行される。
FIG. 1 (8) and FIG. 4 (J) show the results of omitting halfway and selecting up to the effective pixel (4, 2) as the target pixel.
Next, when the effective pixel (6, 2) with the label “4” set as shown in (9) of FIG. 1 is selected as the target pixel in the first process, the target pixel (6, 2) A second process is executed for.
図1の(8)に示すように注目画素(6,2)の下にはラベル未設定の有効画素(6,3)があるので、図1の(9)に示すように有効画素(6,3)に注目画素(6,2)と同じラベル「4」が設定され、図4(K)に示すようにラベル管理テーブルのラベル「4」が登録されている行の「ラベル数」列に1が加算される。 As shown in (8) of FIG. 1, there are effective pixels (6, 3) that have not been labeled under the target pixel (6, 2). Therefore, as shown in (9) of FIG. , 3) is set with the same label “4” as the pixel of interest (6, 2), and the “number of labels” column of the row in which the label “4” of the label management table is registered as shown in FIG. 1 is added to.
また、図1の(9)に示す例の場合、注目画素(6,2)の左下には注目画素(6,2)のラベル「4」よりも小さいラベル「3」が設定されている有効画素(5,3)があるので、ラベル「3」にラベル「4」を子として登録するラベル親子関係登録処理が実行される。ただし、前述したようにラベル「3」はラベル「1」の子として登録されているので、ラベル「4」はラベル「3」ではなくラベル「1」の子として登録される。具体的には、ラベル管理テーブルのラベル「1」が登録されている行の「子ラベル番号数」列に1が加算されるとともに、当該行の「子ラベル番号」列にラベル「4」が登録される。これにより親子関係の階層数を低減できるので、関連付けられているラベルの特定に要する時間を短縮できる。 In the example shown in (9) of FIG. 1, a label “3” smaller than the label “4” of the target pixel (6, 2) is set at the lower left of the target pixel (6, 2). Since there is a pixel (5, 3), label parent-child relationship registration processing for registering label “4” as a child in label “3” is executed. However, since the label “3” is registered as a child of the label “1” as described above, the label “4” is registered as a child of the label “1” instead of the label “3”. Specifically, 1 is added to the “child label number” column of the row in which the label “1” of the label management table is registered, and the label “4” is added to the “child label number” column of the row. be registered. As a result, the number of parent-child relationships can be reduced, so that the time required to identify the associated label can be shortened.
また、前述したようにラベル「5」はラベル「4」の子として登録されているので、ラベル「5」はラベル「1」の子として登録し直され、ラベル「4」は子ラベルが登録されていない状態に戻される。具体的には、ラベル管理テーブルのラベル「4」が登録されている行の「子ラベル番号数」列に登録されている値、および「子ラベル番号」列に登録されている番号が、図4(K)に示すようにラベル「1」が登録されている行にそれぞれ移される。これにより親子関係の階層数をより低減できるので、関連付けられているラベルの特定に要する時間をより短縮できる。 Since the label “5” is registered as a child of the label “4” as described above, the label “5” is re-registered as a child of the label “1”, and the child label is registered as the label “4”. It is returned to the state that has not been done. Specifically, the value registered in the “number of child label numbers” column of the row in which the label “4” of the label management table is registered, and the number registered in the “child label number” column are shown in FIG. As shown in 4 (K), the label “1” is moved to each registered line. As a result, the number of parent-child relationships can be further reduced, so that the time required to identify the associated label can be further shortened.
次に、第1の処理に戻って図1の(10)に示すようにラベル「3」が設定されている有効画素(5,3)が注目画素として選択されると、注目画素(5,3)に対する第2の処理が実行される。
図1の(9)に示すように注目画素(5,3)の右下にラベル未設定の有効画素(6,4)があるので、図1の(10)に示すように有効画素(6,4)に注目画素(5,3)と同じラベル「3」が設定され、図4(L)に示すようにラベル管理テーブルのラベル「3」が登録されている行の「ラベル数」列に1が加算される。
Next, returning to the first process, as shown in (10) of FIG. 1, when the effective pixel (5, 3) with the label “3” is selected as the target pixel, the target pixel (5, 5) is selected. The second process for 3) is executed.
As shown in (9) of FIG. 1, since there is an unlabeled effective pixel (6, 4) at the lower right of the target pixel (5, 3), an effective pixel (6) as shown in (10) of FIG. , 4) is set with the same label “3” as the target pixel (5, 3), and the “number of labels” column of the row in which the label “3” of the label management table is registered as shown in FIG. 1 is added to.
図1の(10)に示す例の場合、注目画素(5,3)の右にラベル「4」が設定されている有効画素(6,3)があるが、ラベル「4」は既にラベル「3」の親であるラベル
「1」の子として登録されているので、ラベル親子関係登録処理では何も行われずに処理が終了する。
In the example shown in (10) of FIG. 1, there is an effective pixel (6, 3) to which the label “4” is set to the right of the target pixel (5, 3), but the label “4” has already been labeled “ Since it is registered as a child of the label “1”, which is the parent of “3”, nothing is performed in the label parent-child relationship registration process, and the process ends.
次に、第1の処理に戻ってラベル「4」が設定されている有効画素(6,3)が注目画素として選択されると、注目画素(6,3)に対する第2の処理が実行される。
図1の(10)に示す例の場合、注目画素(6,3)の近傍にはラベル未設定の有効画素はないので近傍の画素にラベルを設定する処理は実行されない。
Next, returning to the first process, when the effective pixel (6, 3) for which the label “4” is set is selected as the target pixel, the second process for the target pixel (6, 3) is executed. The
In the case of the example shown in (10) of FIG. 1, since there is no valid pixel that has not been labeled in the vicinity of the target pixel (6, 3), the process for setting the label in the neighboring pixel is not executed.
また、ラベル「4」が設定されている有効画素(6,3)の下にラベル「3」が設定されている有効画素(6,4)があるが、ラベル「4」は既にラベル「3」の親であるラベル「1」の子として登録されているので、ラベル親子関係登録処理では何も行われずに処理が終了する。
途中省略して、二値画像に対するラベリング処理が終了した結果を図1の(11)および図4(M)に示す。
Further, there is an effective pixel (6, 4) for which the label “3” is set below the effective pixel (6, 3) for which the label “4” is set, but the label “4” has already been labeled “3”. ”Is registered as a child of the label“ 1 ”, which is the parent of“ ”, the process ends without performing anything in the label parent-child relationship registration process.
FIG. 1 (11) and FIG. 4 (M) show the result of the labeling process for the binary image that is omitted halfway.
次に、本発明の一実施例に係るラベリング方法を用いたディジタル画像の埃除去について説明する。
図5および図6は、PC10が実行するディジタル画像の埃除去処理の流れを示すフローチャートである。
S105では、CPU11はイメージスキャナ22からディジタル画像を取得する。
Next, the dust removal of the digital image using the labeling method according to an embodiment of the present invention will be described.
5 and 6 are flowcharts showing the flow of the dust removal processing of the digital image executed by the
In S <b> 105, the
S110では、CPU11はイメージスキャナ22から取得したディジタル画像のエッジ画像を生成する。
S115では、CPU11はエッジ画像の各画素値を所定の閾値と比較して二値画像を生成する。
S120では、CPU11は二値画像から画素を一つ選択する。
In S110, the
In S115, the
In S120, the
S125では、CPU11は選択した画素が有効画素であるかを判定する。CPU11は選択した画素が有効画素であればその画素を注目画素にしてS130に進み、有効画素でなければS145に進む。
S130では、CPU11は注目画素にラベルが設定されているか否かを判定し、ラベルが設定されていない場合はS135に進み、設定されている場合はS140に進む。
In S125, the
In S130, the
S135では、CPU11は注目画素に他のいずれの有効画素とも重複しないラベルを設定する。
S140では、CPU11は注目画素に対する第2の処理を実行する。以下、第2の処理について説明する。
In S135, the
In S140, the
図7および図8は、第2の処理の流れを示すフローチャートである。
S205では、CPU11は注目画素の右、左下、下および右下にある画素を一つ選択する。
S210では、CPU11は選択した画素が有効画素であるかを判定し、有効画素であればS215に進み、有効画素でなければS245に進む。
S215では、CPU11は選択した有効画素にラベルが設定されているかを判定し、ラベル未設定であればS220に進み、既にラベルが設定されている場合はS225に進む。
7 and 8 are flowcharts showing the flow of the second process.
In S <b> 205, the
In S210, the
In S215, the
S220では、CPU11は選択した有効画素に対する設定処理を実行する。具体的には、CPU11は選択した有効画素に注目画素と同じラベルを設定するとともに、ラベル管理テーブルにおいて当該注目画素に設定されているラベルが登録されている行の「ラベル数」列に1を加算する。
S225では、CPU11は選択した有効画素に設定されているラベルが注目画素に設定されているラベルより小さいかを判定し、小さい場合はS230に進み、それ以外の場合はS235に進む。
In S220, the
In S225, the
S230では、CPUは有効画素のラベルを親ラベル、注目画素のラベルを子ラベルとしてラベル親子関係登録処理を実行する。以下、ラベル親子関係登録処理について説明する。 In S230, the CPU executes a label parent-child relationship registration process using the effective pixel label as a parent label and the target pixel label as a child label. Hereinafter, the label parent-child relationship registration process will be described.
図9および図10は、ラベル親子関係登録処理の流れを示すフローチャートである。
S305では、CPU11は当該親ラベルと当該子ラベルとの親子関係が既に登録されているかを判定する。具体的には、CPU11はラベル管理テーブルにおいて親ラベルが登録されている行の「子ラベル番号」列に当該子ラベルが既に登録されていれば登録済みと判定する。また、CPU11は、親ラベルが他のラベルの子として登録されており、子ラベルも当該他のラベルの子として登録されていれば登録済みと判定する。CPU11は登録されていなければS310に進み、登録済みであればラベル親子関係登録処理を終了して戻る。
9 and 10 are flowcharts showing the flow of label parent-child relationship registration processing.
In S305, the
S310では、CPU11は親ラベルが他のラベルの子として登録されているかを判定する。CPU11は親ラベルが他のラベルの子として登録されていればS315に進み、親ラベルが他のラベルの子として登録されていなければS330に進む。
S315では、CPU11は子ラベルを当該他のラベルの子としてラベル管理テーブルに登録する。具体的には、CPU11は当該他のラベルが登録されている行の「子ラベル番号数」列に1を加算するとともに、当該行の「子ラベル番号」列に子ラベルの番号を登録する。
In S310, the
In S315, the
S320では、CPU11は子ラベルに他のラベルが子として登録されているかを判定する。具体的には、CPU11はラベル管理テーブルにおいて子ラベルが登録されている行の「子ラベル番号数」列の値が1以上であれば他のラベルが子として登録されていると判定する。CPU11は子ラベルに他のラベルが子として登録されている場合はS325に進み、子ラベルに他のラベルが子として登録されていない場合はラベル親子関係登録処理を終了して戻る。
In S320, the
S325では、CPU11は子ラベルに登録されている他の子ラベルを親ラベルの子として再登録する。具体的には、CPU11はラベル管理テーブルにおいて子ラベルが登録されている行の「子ラベル番号数」列に登録されている値、および「子ラベル番号」列に登録されている番号を、親ラベルが登録されている行にそれぞれ移す。
In S325, the
S330では、CPU11は子ラベルが親ラベルより小さい他のラベルの子として登録されているかを判定する。CPU11は子ラベルが親ラベルより小さい他のラベルの子として登録されていればS335に進み、登録されていなければS340に進む。
S335では、CPUは親ラベルを当該他のラベルの子として登録する。ここでS335が実行されるケースを図11に示す。図11において有効画素(1,2)が注目画素として選択された場合、ラベル「2」が親、ラベル「3」が子となってラベル親子関係登録処理が実行される。この場合、子ラベル「3」は親ラベル「2」よりも小さい他のラベル「1」の子として既に登録されているはずなので、S335において親ラベル「2」が他のラベル「1」の子として登録されることになる。これにより親子関係の階層数をより低減できるので、関連付けられているラベルの特定に要する時間をより短縮できる。
S340では、CPUは子ラベルを親ラベルの子として登録する。
In S330, the
In S335, the CPU registers the parent label as a child of the other label. FIG. 11 shows a case where S335 is executed. When the effective pixel (1, 2) is selected as the target pixel in FIG. 11, the label parent-child relationship registration process is executed with the label “2” as the parent and the label “3” as the child. In this case, since the child label “3” should already be registered as a child of another label “1” smaller than the parent label “2”, the parent label “2” is a child of the other label “1” in S335. Will be registered as As a result, the number of parent-child relationships can be further reduced, so that the time required to identify the associated label can be further shortened.
In S340, the CPU registers the child label as a child of the parent label.
図8に示す第2の処理に戻って、S235では、CPU11は選択した有効画素に設定されているラベルが注目画素に設定されているラベルより大きいかを判定し、大きい場合はS240に進み、それ以外の場合はS245に進む。
S240では、CPUは注目画素のラベルを親、有効画素のラベルを子としてラベル親子関係登録処理を実行する。
S245では、CPU11は右、左下、下および右下にある画素の選択が終了したかを判定し、選択が終了していれば処理を終了し、選択が終了していなければS205に戻って選択が終了するまで処理を繰り返す。
Returning to the second process shown in FIG. 8, in S235, the
In S240, the CPU executes a label parent-child relationship registration process using the target pixel label as a parent and the effective pixel label as a child.
In S245, the
図5に示す第1の処理に戻って、S145では、CPU11は二値画像の全ての画素の選択が終了したかを判定し、選択が終了していれば図6に示すS150に進み、選択が終了していなければS120に戻って選択が終了するまで処理を繰り返す。S120〜S145は特許請求の範囲に記載の「第1の処理段階」に相当する。
Returning to the first process shown in FIG. 5, in S145, the
S150では、CPU11はラベル管理テーブルを再構築するラベル親子関係再構築処理を実行する。以下、ラベル親子関係再構築処理について説明する。
図12はラベル親子関係再構築処理の流れを示すフローチャートであり、図13はラベル親子関係再構築処理を行った後のラベル管理テーブルを示す模式図である。
In S150, the
FIG. 12 is a flowchart showing the flow of the label parent-child relationship reconstruction process, and FIG. 13 is a schematic diagram showing the label management table after the label parent-child relationship reconstruction process.
S405では、CPU11はラベル管理テーブルから「子ラベル番号」列に子ラベル番号が登録されている行を一つ選択する。
S410では、CPU11は選択した行の「ラベル数」列に登録されているラベル数と、選択した行の「子ラベル番号」列に登録されている各子ラベル番号が登録されている行の「ラベル数」列に登録されているラベル数を合計する。
In S405, the
In S410, the
S415では、CPU11は選択した行の「ラベル数」列、および選択した行の「子ラベル番号」列に登録されている各子ラベル番号が登録されている行の「ラベル数」列に、S410で求めた合計をそれぞれ登録する。
S420では、CPU11はラベル管理テーブルから「子ラベル番号」列に子ラベル番号が登録されている全ての行の選択が終了したかを判定し、終了していなければ選択が終了するまで処理を繰り返し、選択が終了していればラベル親子関係再構築処理を終了する。ラベル親子関係再構築処理を行うと、有効領域判定時に毎回ラベル数の加算をしなくてよくなる。
In S415, the
In S420, the
図6に示す第1の処理に戻って、S155では、CPU11は第3の処理を実行する。具体的には、CPU11は他のラベルと関連付けられていないラベルについては当該ラベルが設定されている有効画素で構成される領域を一つの領域として抽出し、他のラベルと関連付けられているラベルについては関連付けられているラベルが設定されている有効画素で構成される領域を結合した領域を一つの領域として抽出する。例えば図1の(11)に示す例の場合、図14に示すように3つの領域31、32および33が抽出される。
Returning to the first process shown in FIG. 6, in S155, the
S160では、CPU11は各領域の有効画素数を所定の閾値と比較して埃領域を特定する。具体的には例えば、CPU11は再構築処理されたラベル管理テーブルでラベル番号を順に選択し、選択したラベル番号の「ラベル数」列に登録されている値が所定の閾値未満であれば当該ラベルが設定されている有効画素で構成される領域は埃領域であると特定する。
In S160, the
S165では、CPU11はディジタル画像において埃領域に対応する領域に対して所定の埃除去処理を実行する。具体的には例えば、CPU11は埃領域に対応する領域に対して公知のメディアンフィルタを適用する。メディアンフィルタは周辺の画素値から突出して大きい画素値または突出して小さい画素値によって生じるノイズの除去能力に優れたフィルタである。
In S165, the
以上説明した本発明の一実施例に係るラベリング方法によると、S120〜S145を第1のループ、S205〜S245を第2のループというとすると、第1のループから第2のループが呼び出されるとその第2のループだけが実行されて第1のループに戻る。すなわち本実施例では第2のループから第2のループが呼び出されず、ループは最大でも2重までしか多重化されない。従って、ループが3重以上に多重化される場合に比べて処理時間を低減できる。よって本発明によると、二値画像上の領域を短時間に抽出できる。 According to the labeling method according to the embodiment of the present invention described above, when S120 to S145 are referred to as a first loop and S205 to S245 are referred to as a second loop, when the second loop is called from the first loop. Only that second loop is executed and returns to the first loop. That is, in the present embodiment, the second loop is not called from the second loop, and the loop is multiplexed only up to a maximum of two. Therefore, the processing time can be reduced as compared with the case where the loop is multiplexed three or more times. Therefore, according to the present invention, a region on a binary image can be extracted in a short time.
なお、本発明は、上記実施形態に限定されるものではなく、その要旨を逸脱しない範囲で種々の実施形態に適用可能である。 In addition, this invention is not limited to the said embodiment, In the range which does not deviate from the summary, it is applicable to various embodiment.
11 CPU(第1の処理手段、第2の処理手段)、10 パーソナルコンピュータ(ラベリング装置) 11 CPU (first processing means, second processing means), 10 personal computer (labeling device)
Claims (10)
前記第1の処理段階で前記注目画素が選択される度に実行される第2の処理段階であって、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理段階と、
を含むラベリング方法。 When a valid pixel of a binary image composed of valid pixels and non-valid pixels is selected as a target pixel in order, and a label is not set for the selected target pixel, a label set for another valid pixel A first processing step of setting a label that does not overlap with the pixel of interest;
In a second processing step that is executed each time the target pixel is selected in the first processing step, the effective pixels that are not set for the effective pixels in the vicinity of 8 of the target pixel. A setting process for setting the same label as the target pixel for the effective pixel is executed, and for the effective pixel in which a label different from the label of the target pixel is set, the label of the effective pixel and the label of the target pixel are set. A second processing stage for performing an associating association process;
Including labeling method.
前記第2の処理段階において、前記注目画素の右、右下、下および左下にある有効画素のみについて前記設定処理又は前記関連付け処理を実行する請求項1に記載のラベリング方法。 In the first processing step, all effective pixels in the upper row of the binary image are selected and then effective pixels in the lower row are selected, and in each row, effective pixels are selected in order from left to right. ,
2. The labeling method according to claim 1, wherein in the second processing stage, the setting process or the association process is executed only for effective pixels on the right, lower right, lower and lower left of the target pixel.
前記第1の処理段階において、前記注目画素にラベルが設定されていない場合は他の有効画素に設定されているラベルよりも大きいラベルを前記注目画素に設定し、
前記関連付け処理において、前記有効画素のラベルが前記注目画素のラベルより小さい場合は前記有効画素のラベルを親ラベル、前記注目画素のラベルを子ラベルとして関連付け、前記有効画素のラベルが前記注目画素のラベルより大きい場合は前記注目画素のラベルを親ラベル、前記有効画素のラベルを子ラベルとして関連付ける請求項1又は2に記載のラベリング方法。 The size relationship between different labels is defined,
In the first processing step, when a label is not set for the target pixel, a label larger than a label set for another effective pixel is set for the target pixel.
In the association process, when the effective pixel label is smaller than the target pixel label, the effective pixel label is associated as a parent label and the target pixel label as a child label, and the effective pixel label is the target pixel label. The labeling method according to claim 1, wherein, when the label is larger than the label, the label of the pixel of interest is associated as a parent label, and the label of the effective pixel is associated as a child label.
前記第1の処理手段で前記注目画素が選択されると、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理手段と、
を備えるラベリング装置。 Effective pixels on the binary image composed of effective pixels and non-effective pixels are selected as target pixels in order, and if no label is set for the selected target pixel, it is set to another effective pixel. First processing means for setting a label that does not overlap with a label as the pixel of interest;
When the target pixel is selected by the first processing means, for the effective pixel in the vicinity of the target pixel, for the effective pixel for which no label is set, the same label as the target pixel is set for the effective pixel. Second processing means for executing an association process for associating a label of the effective pixel and a label of the target pixel with respect to an effective pixel in which a label different from the label of the target pixel is set. ,
A labeling device comprising:
前記第1の処理手段で前記注目画素が選択されると、前記注目画素の8近傍にある有効画素について、ラベルが設定されていない有効画素については当該有効画素に前記注目画素と同じラベルを設定する設定処理を実行し、前記注目画素のラベルとは異なるラベルが設定されている有効画素については当該有効画素のラベルと前記注目画素のラベルとを関連付ける関連付け処理を実行する第2の処理手段としてコンピュータを機能させるラベリングプログラム。 Effective pixels on the binary image composed of effective pixels and non-effective pixels are selected as target pixels in order, and if no label is set for the selected target pixel, it is set to another effective pixel. First processing means for setting a label that does not overlap with a label as the pixel of interest;
When the target pixel is selected by the first processing means, for the effective pixel in the vicinity of the target pixel, for the effective pixel for which no label is set, the same label as the target pixel is set for the effective pixel. As a second processing means for executing an association process for associating the effective pixel label and the label of the target pixel with respect to the effective pixel for which a label different from the label of the target pixel is set. A labeling program that makes a computer work.
前記二値画像に請求項1〜6のいずれか一項に記載のラベリング方法を適用して有効画素にラベルを設定する段階と、
全ての有効画素にラベルを設定した後に実行され、他のラベルと関連付けられていないラベルについては当該ラベルが設定されている有効画素で構成される領域を一つの領域として抽出し、他のラベルと関連付けられているラベルについては関連付けられているラベルが設定されている有効画素で構成される領域を結合した領域を一つの領域として抽出する段階と、
各前記領域の有効画素数を所定の閾値と比較して埃領域を特定する段階と、
前記ディジタル画像の前記埃領域に対応する領域に対して所定の埃除去処理を実行する段階と、
を含むディジタル画像の埃除去方法。 Generating a binary image composed of effective pixels and non-effective pixels from the digital image;
Applying a labeling method according to any one of claims 1 to 6 to the binary image to set a label on effective pixels;
It is executed after setting labels for all effective pixels, and for labels that are not associated with other labels, an area composed of effective pixels for which the label is set is extracted as one area, For the associated label, extracting a region obtained by combining regions composed of effective pixels in which the associated label is set as one region;
Comparing the number of effective pixels in each of the regions with a predetermined threshold to identify a dust region;
Performing a predetermined dust removal process on an area corresponding to the dust area of the digital image;
A method for removing dust from a digital image.
The digital image dust removing method according to claim 9, wherein the dust removing process is a process of applying a median filter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006045209A JP2007228139A (en) | 2006-02-22 | 2006-02-22 | Labeling method, labeling device, labeling program, and method for eliminating dust from digital image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006045209A JP2007228139A (en) | 2006-02-22 | 2006-02-22 | Labeling method, labeling device, labeling program, and method for eliminating dust from digital image |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007228139A true JP2007228139A (en) | 2007-09-06 |
Family
ID=38549523
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006045209A Pending JP2007228139A (en) | 2006-02-22 | 2006-02-22 | Labeling method, labeling device, labeling program, and method for eliminating dust from digital image |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007228139A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101030430B1 (en) | 2007-09-12 | 2011-04-20 | 주식회사 코아로직 | Apparatus and method for processing image and computer readable medium stored thereon computer executable instruction for performing the method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62287385A (en) * | 1986-06-06 | 1987-12-14 | Sumitomo Special Metals Co Ltd | Removing method for fine particle |
JPH03206574A (en) * | 1990-01-09 | 1991-09-09 | Fujitsu Ltd | Raster scan type labeling processing system |
JP2001086369A (en) * | 1999-09-09 | 2001-03-30 | Dainippon Screen Mfg Co Ltd | Image processor |
-
2006
- 2006-02-22 JP JP2006045209A patent/JP2007228139A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62287385A (en) * | 1986-06-06 | 1987-12-14 | Sumitomo Special Metals Co Ltd | Removing method for fine particle |
JPH03206574A (en) * | 1990-01-09 | 1991-09-09 | Fujitsu Ltd | Raster scan type labeling processing system |
JP2001086369A (en) * | 1999-09-09 | 2001-03-30 | Dainippon Screen Mfg Co Ltd | Image processor |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101030430B1 (en) | 2007-09-12 | 2011-04-20 | 주식회사 코아로직 | Apparatus and method for processing image and computer readable medium stored thereon computer executable instruction for performing the method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1873685B (en) | Image processing device and method | |
RU2012145349A (en) | METHOD AND DEVICE FOR PROCESSING IMAGES FOR REMOVING DEPTH ARTIFacts | |
JP2022505303A (en) | Frame processing for ML-based upscaling | |
CN104966092B (en) | A kind of image processing method and device | |
JP5436104B2 (en) | Image search apparatus and image search method | |
JP2015125509A (en) | Image processing apparatus, image processing method, and program | |
CN112419132B (en) | Video watermark detection method, device, electronic equipment and storage medium | |
CN110766068B (en) | Verification code identification method and computing equipment | |
CN105787874A (en) | Method and device used for mosaic processing of captured image | |
US8600171B2 (en) | Image labeling using parallel processing | |
JP2007228139A (en) | Labeling method, labeling device, labeling program, and method for eliminating dust from digital image | |
CN111133474B (en) | Image processing apparatus, image processing method, and computer-readable recording medium | |
CN108804652B (en) | Method and device for generating cover picture, storage medium and electronic device | |
JP4756650B2 (en) | Image processing apparatus, reading order setting method, and program | |
US8107758B2 (en) | Block based image processing | |
KR101225196B1 (en) | Method and apparatus for blob labelling in image processing | |
JP7159582B2 (en) | Method and apparatus for extending data in surveillance video | |
CN115291992B (en) | Auxiliary labeling method for graphic user interface picture, electronic equipment and storage medium | |
JP2015222517A (en) | Information processing device and program generation method | |
CN115665335B (en) | Image processing method, image processing apparatus, image forming apparatus, and medium | |
WO2024116392A1 (en) | Training data generation device, training data generation method, and training data generation program | |
US8941881B2 (en) | Method and apparatus for rasterizing transparent page | |
JP6430086B1 (en) | Image providing apparatus, image providing method, and image providing program | |
JP2016018254A (en) | Correction candidate determining device, correction candidate determining method, and program | |
JP6565287B2 (en) | Display position acquisition program, display position acquisition device, and display position acquisition method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20081204 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100216 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100309 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100507 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20100706 |