JPH07114638A - Image processor - Google Patents

Image processor

Info

Publication number
JPH07114638A
JPH07114638A JP5281827A JP28182793A JPH07114638A JP H07114638 A JPH07114638 A JP H07114638A JP 5281827 A JP5281827 A JP 5281827A JP 28182793 A JP28182793 A JP 28182793A JP H07114638 A JPH07114638 A JP H07114638A
Authority
JP
Japan
Prior art keywords
value
pixels
pixel
image
target area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5281827A
Other languages
Japanese (ja)
Inventor
Michiyoshi Tachikawa
道義 立川
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP5281827A priority Critical patent/JPH07114638A/en
Publication of JPH07114638A publication Critical patent/JPH07114638A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To repair and estimate an image at a high speed with high quality by processing only pixels in a specific area in an image. CONSTITUTION:An image process part 2 while determining the value of a specific unknown pixel in an area to be processed by using the values of known pixels when the number of the known pixels having the known values among pixels nearby the specific unknown pixel in the area to be processed is larger than a specific area leave the unknown pixel as it is without determining its value when the number of the known pixels is smaller than the specific threshold value, regards the unknown pixel whose value is determined as a known pixel after processing the respective pixels in the area to be processed with the specific threshold value, and repeats similar processes for the remaining unknown pixels. When those processes are performed, a threshold value initial setting part 5 sets the initial value of the threshold value to an optimum value according to the size of the area to be processed and/or the shape of the area to be processed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、画像の修復などに用い
られる画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus used for image restoration or the like.

【0002】[0002]

【従来の技術】従来、パターン認識などの分野におい
て、例えば原稿上のしみや汚れ,あるいは損傷の影響を
除去するため、読み取った画像データに対して前処理が
施される。この種の前処理技術の代表的なものとして、
例えば著者「森 俊二」による文献「“画像認識の基礎
〔I〕”、オーム社、PP24〜35、1986年」に
示されているような、k最近傍法や、k最近傍法を発展
させた選択平均法,近傍加重平均法等がある。例えば、
k最近傍法は、着目する画素の近傍に所定の大きさのマ
スク(例えば3×3の大きさのマスク)を設定し、このマ
スクに含まれる近傍点(3×3の大きさのマスクでは8
個の近傍点)のうちから一定個数k(kは固定)の近傍点
を選択し、k個の近傍点の平均をとり、その平均値によ
って、着目する画素,すなわち近傍の中心の値を置き換
えるようになっており、これによって、画像上の孤立点
(原稿上のしみなどによる影響)を除去することができ
る。
2. Description of the Related Art Conventionally, in the field of pattern recognition and the like, pre-processing is performed on the read image data in order to remove the influence of stains, stains, or damage on the original. As a representative of this type of pretreatment technology,
For example, the k-nearest neighbor method and the k-nearest neighbor method as shown in the document "Basics of Image Recognition [I]", Ohmsha, Ltd., PP24-35, 1986 by the author "Shunji Mori" are developed. Selective averaging, neighborhood weighted averaging, etc. For example,
In the k-nearest neighbor method, a mask with a predetermined size (for example, a mask with a size of 3 × 3) is set in the vicinity of the pixel of interest, and the neighboring points included in this mask (with a mask with a size of 3 × 3, 8
Select a fixed number k (k is fixed) of neighboring points from among the number of neighboring points), take the average of the k neighboring points, and replace the pixel of interest, that is, the value of the center of the neighborhood with the average value. As a result of which the isolated points on the image
(Effect of stains on the original) can be removed.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、従来で
は、画像の補正を行なうのに、例えば前述したマスクを
画像の左上から右下に向けて順次に移動し、画像中の欠
陥を生じていない画素についても、一率に平均化処理を
行なっていた。このため、相当の処理時間を要し、ま
た、補正を行なう必要のない画素についてまで処理がな
されてしまうので、全体の画像品質が低下してしまうな
どの問題があった。
However, in the prior art, in order to correct an image, for example, the above-mentioned mask is sequentially moved from the upper left corner to the lower right corner of the image, and the pixels in the image which are not defective are generated. As for the above, the averaging process was performed at a rate. For this reason, a considerable processing time is required, and since processing is performed even for pixels that need not be corrected, there is a problem that the overall image quality deteriorates.

【0004】さらに、従来では、画像中に生じた任意の
形状,大きさの欠陥について、これを良好に修復するこ
とができないという欠点があった。
Further, in the past, there was a drawback that defects of arbitrary shape and size that occurred in an image could not be repaired satisfactorily.

【0005】本発明は、画像中の所定領域内の画素につ
いてのみ修復や推定などの処理を行なうことができ、画
像を高速にかつ高品質に修復,推定等することの可能な
画像処理装置を提供することを目的としている。
The present invention provides an image processing apparatus capable of performing processing such as restoration and estimation only on pixels within a predetermined area in an image and capable of restoration and estimation of an image at high speed and high quality. It is intended to be provided.

【0006】[0006]

【課題を解決するための手段および作用】上記目的を達
成するために、請求項1乃至請求項7記載の発明は、処
理対象領域内の各画素が当初、完全に未知の値あるいは
不確かな値をもつ未知画素であるとし、処理対象領域内
の特定の未知画素に着目するとき、該未知画素の近傍画
素のうちで既知の値をもつ既知画素の個数が所定の閾値
よりも大きい場合に限り、近傍画素のうちの既知画素の
値を用いて未知画素の値を決定する一方、既知画素の個
数が所定の閾値よりも小さいときには、未知画素の値を
決定せず未知画素のまま残すようになっており、処理対
象領域内の各画素について所定の閾値での前記処理がな
された後、値の決定された未知画素を既知画素とし、ま
た、閾値を変更し、残されている未知画素に対して処理
を繰り返し行なう画像処理において、上記閾値の最適な
閾値を、処理対象領域の大きさに関する情報、および/
または、処理対象領域の形状に関する情報に基づいて決
定するようになっている。これにより、処理対象領域の
大きさ,形状に応じた最適な処理を行なうことができ、
画像を高速にかつ高品質に修復,推定等することができ
る。
In order to achieve the above object, the invention according to claim 1 to claim 7 is such that each pixel in the processing target area initially has a completely unknown value or an uncertain value. When an attention is paid to a specific unknown pixel in the processing target area, the number of known pixels having a known value among neighboring pixels of the unknown pixel is larger than a predetermined threshold value. , The value of the unknown pixel is determined using the value of the known pixel among the neighboring pixels, and when the number of the known pixels is smaller than the predetermined threshold, the value of the unknown pixel is not determined and the unknown pixel is left as it is. After each pixel in the processing target area is subjected to the above-mentioned processing with a predetermined threshold value, the unknown pixel whose value has been determined is set as a known pixel, and the threshold value is changed to the remaining unknown pixel. Repeat the process for In the image processing, an optimal threshold of the threshold, information on the size of the processing target area, and /
Alternatively, the determination is made based on information about the shape of the processing target area. As a result, it is possible to perform optimal processing according to the size and shape of the processing target area,
Images can be restored and estimated at high speed and with high quality.

【0007】[0007]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。図1は本発明に係る画像処理装置の構成例を示す
図である。図1を参照すると、この画像処理装置は、図
2に示すように、画像PC中において処理対象(例えば
修復対象)となる領域PCUを特定する領域特定部1
と、領域特定部1によって特定された処理対象領域PC
Uに含まれる画素に対して所定の画像処理を施す画像処
理部2とを備えている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a configuration example of an image processing apparatus according to the present invention. Referring to FIG. 1, as shown in FIG. 2, the image processing apparatus includes an area specifying unit 1 for specifying an area PCU to be processed (for example, a repair target) in an image PC.
And the processing target area PC specified by the area specifying unit 1.
An image processing unit 2 that performs predetermined image processing on pixels included in U is included.

【0008】ここで、画像処理部2は、領域特定部1に
よって特定された処理対象領域PCUに含まれる各画素
が当初、完全に未知の値あるいは完全には未知でないが
不確かな値をもつ画素(以後、これを未知画素と称す)で
あり、この処理対象領域PCU外の画像PCの領域PC
Kの各画素が全て既知の値をもつ既知画素であるとし、
処理対象領域PCU内の未知画素の値を、既知領域PC
Kの既知画素の値を用いて既知の(確かな)ものに定める
ようになっている。すなわち、画像処理部2は、画像P
C中の全ての画素に対して処理を行なうのではなく、画
像PC中の処理対象領域PCU内の画素のみに着目し、
処理対象領域PCU内の画素のみに対して処理を行なう
ようになっている。
Here, the image processing unit 2 is arranged such that each pixel included in the processing target area PCU specified by the area specifying unit 1 initially has a completely unknown value or a pixel which is not completely unknown but has an uncertain value. (Hereinafter, this is referred to as an unknown pixel), and the area PC of the image PC outside the processing target area PCU
If each pixel of K is a known pixel having a known value,
The value of the unknown pixel in the processing target area PCU is set to the known area PC.
The known pixel value of K is used to determine a known (certain) pixel. That is, the image processing unit 2 uses the image P
Instead of performing processing on all the pixels in C, focusing on only the pixels in the processing target area PCU in the image PC,
The processing is performed only on the pixels in the processing target area PCU.

【0009】また、画像処理部2は、処理対象領域PC
U内の特定の未知画素に対する処理を行なうのに、該特
定の未知画素の近傍の画素に着目し、近傍画素のうちで
既知の値をもつ既知画素を用いて、該特定の未知画素の
値を定める(既知のものとする)ようになっている。この
際、画像処理部2は、処理対象領域PCU内の特定の未
知画素の近傍画素のうちで既知の値をもつ画素の個数を
計数し、既知の値をもつ画素の個数が所定の閾値よりも
大きい場合に限り、近傍画素のうちの既知の値をもつ既
知画素の値を用いて未知画素の値を決定する一方、既知
の値をもつ画素の個数が所定の閾値よりも小さいときに
は、未知画素の値を決定せずに未知画素のまま残すよう
にしている。そして、処理対象領域PCU内の各画素に
ついて所定の閾値で上記処理がなされた後、値の決定さ
れた未知画素を既知画素とし、また、閾値を大きい値か
ら小さい値に段階的に変更し、まだ値の定まっていない
残されている未知画素に対して同様の処理を繰り返し行
なうようになっている。
Further, the image processing unit 2 has a processing target area PC
To perform processing on a specific unknown pixel in U, attention is paid to a pixel in the vicinity of the specific unknown pixel, and the value of the specific unknown pixel is determined by using a known pixel having a known value among the neighboring pixels. Is defined (assumed to be known). At this time, the image processing unit 2 counts the number of pixels having a known value among the neighboring pixels of the specific unknown pixel in the processing target area PCU, and the number of pixels having the known value is less than a predetermined threshold value. If the number of pixels having a known value is smaller than a predetermined threshold, the unknown pixel value is determined using the value of the known pixel having a known value among the neighboring pixels. An unknown pixel is left as it is without determining the pixel value. Then, after the above-mentioned processing is performed for each pixel in the processing target area PCU with a predetermined threshold value, the unknown pixel whose value has been determined is a known pixel, and the threshold value is changed stepwise from a large value to a small value, The same process is repeated for unknown pixels whose values have not yet been determined.

【0010】このような処理機能を実現するため、図1
の構成例では、画像処理部2には、処理全体の制御を行
なう制御部3と、近傍画素を定義するための近傍画素定
義部4と、閾値の初期値を設定するための閾値初期設定
部5と、演算の種類を設定するための演算種類設定部6
と、演算種類設定部6に設定された種類の演算を行なう
演算部7とが備わっている。
In order to realize such a processing function, FIG.
In the above configuration example, the image processing unit 2 includes a control unit 3 that controls the entire process, a neighboring pixel definition unit 4 that defines neighboring pixels, and a threshold initial setting unit that sets an initial value of a threshold. 5 and an operation type setting unit 6 for setting the operation type
And a calculation unit 7 that performs a calculation of the type set in the calculation type setting unit 6.

【0011】図3はこの画像処理部2の処理例を示すフ
ローチャートである。なお、以下では、説明を簡単にす
るため、一例として、処理対象領域PCU内の各画素に
対し、1画素単位に処理がなされ、また、演算部7で
は、処理対象領域PCU内の未知画素を完全に未知の値
のものと仮定し(未知画素が不確かな値をもっていても
これを一切考慮せずに)、近傍画素のうちの既知画素の
値だけに基づいて、未知画素の値を決定する処理がなさ
れるものとする。
FIG. 3 is a flow chart showing a processing example of the image processing unit 2. Note that, in the following, for simplification of description, as an example, each pixel in the processing target area PCU is processed in a unit of one pixel, and the arithmetic unit 7 determines unknown pixels in the processing target area PCU. Assuming that the value is completely unknown (even if the unknown pixel has an uncertain value, it is not considered at all), and the value of the unknown pixel is determined based on the value of the known pixel among the neighboring pixels. Processing shall be done.

【0012】画像処理部2が実際の処理を開始する前提
として、画像中において、未知画素からなる処理対象領
域PCUと、処理対象領域PCU以外の既知画素からな
る既知領域PCKとが、領域特定部1により特定されて
おり、各画素の存在する位置(例えばメモリ内位置)がわ
かっている必要がある。なお、このとき、処理対象領域
PCU内の各画素を特定するため、各画素に番号jが付
されているとし、また、処理対象領域PCU内の画素の
総数Nがわかっているとする。
On the premise that the image processing unit 2 starts the actual processing, in the image, a processing target area PCU including unknown pixels and a known area PCK including known pixels other than the processing target area PCU are included in the area specifying unit. The position where each pixel exists (for example, the position in the memory) needs to be known. At this time, in order to identify each pixel in the processing target area PCU, it is assumed that each pixel is numbered j and the total number N of pixels in the processing target area PCU is known.

【0013】また、近傍画素定義部4により、1つの未
知画素に対する近傍画素が予め定義されている必要があ
る(例えば、近傍の形状,大きさなど)。また、演算種類
設定部6により処理演算の種類(例えば近傍画素のうち
の既知画素の値の平均値をとるなどの演算の種類)が設
定されている必要がある。また、閾値初期設定部5によ
り閾値kの初期値が設定されている必要がある。
In addition, it is necessary that the neighboring pixel definition unit 4 defines a neighboring pixel for one unknown pixel in advance (for example, the shape and size of the neighborhood). Further, the type of processing calculation (for example, the type of calculation such as taking the average value of the values of known pixels among the neighboring pixels) needs to be set by the calculation type setting unit 6. Further, the threshold initial setting unit 5 needs to set the initial value of the threshold k.

【0014】すなわち、近傍画素の定義,演算の種類,
閾値の初期値が、処理対象となる画像の種類(例えば、
画像が2値画像であるか多値画像であるか、あるいは、
画像が文書画像であるか、写真画像であるか、絵図画像
であるかなど)に応じて、あるいは、処理対象領域の種
類(処理対象領域の大きさ,形状など)に応じて、適切な
ものに設定されている必要がある。
That is, the definition of neighboring pixels, the kind of calculation,
The initial value of the threshold is the type of image to be processed (for example,
Whether the image is a binary image or a multi-valued image, or
Appropriate depending on whether the image is a document image, a photographic image, a pictorial image, etc., or depending on the type of processing target area (size, shape, etc. of the processing target area) Must be set to.

【0015】このような前提が整った後(ステップS
1)、jを“1”に初期設定する(ステップS2)。次い
で、画像処理部2は、処理対象領域PCUからj番目の
画素を取り込み(ステップS3)、この画素の近傍画素の
うちで既知の値をもつ既知画素の個数を計数する(ステ
ップS4)。そして、その計数値CNTを閾値kと比較
し(ステップS5)、計数値CNTが閾値kと同じか閾値
kよりも大きいときには、演算部7は、j番目の画素の
近傍画素のうちで既知の値をもつ既知画素に基づき、j
番目の画素の値を定める(ステップS6)。演算の種類が
例えば“平均値”であるときには、既知画素の値の平均
値を求め、これをj番目の画素の値として決定する。こ
れに対し、ステップS5において、計数値CNTが閾値
kよりも小さいときには、演算を行なわず、j番目の画
素の値を未知のまま残す(ステップS7)。
After such a premise is established (step S
1) and j are initialized to "1" (step S2). Next, the image processing unit 2 takes in the j-th pixel from the processing target area PCU (step S3), and counts the number of known pixels having a known value among the neighboring pixels of this pixel (step S4). Then, the count value CNT is compared with the threshold value k (step S5), and when the count value CNT is the same as the threshold value k or larger than the threshold value k, the calculation unit 7 knows a known pixel among the pixels adjacent to the j-th pixel. J based on known pixels with values
The value of the th pixel is determined (step S6). When the type of calculation is, for example, “average value”, the average value of the values of the known pixels is calculated, and this is determined as the value of the jth pixel. On the other hand, in step S5, when the count value CNT is smaller than the threshold value k, no calculation is performed and the value of the j-th pixel is left unknown (step S7).

【0016】j番目の画素についてステップS6または
ステップS7の処理を行なった後、jを“1”だけ歩進
して(ステップS8)、再びステップS3に戻り、処理対
象領域PCU内の次の画素について同様の処理を繰り返
し行なう。処理対象領域PCU内の各画素について順次
にこのような処理を繰り返し行ない、処理対象領域PC
U内の最後の画素についての処理を終了すると(ステッ
プS9)、各画素についての処理結果によって、処理対
象領域PCU内の未知画素の値を書き換える(ステップ
S10)。これにより、ステップS6の処理によって値
が決定された未知画素については、決定された値が既知
の値として設定され、この未知画素は、この時点で既知
画素となる。一方、ステップS7の処理によって値の決
定されなかった未知画素については、書き換えがなされ
ず、未知画素のまま残る。
After the processing of step S6 or step S7 is performed on the j-th pixel, j is incremented by "1" (step S8), and the process returns to step S3 again to the next pixel in the processing target area PCU. The same processing is repeatedly performed for. Such processing is sequentially repeated for each pixel in the processing target area PCU to obtain the processing target area PC.
When the processing for the last pixel in U is completed (step S9), the value of the unknown pixel in the processing target area PCU is rewritten according to the processing result for each pixel (step S10). As a result, regarding the unknown pixel whose value is determined by the process of step S6, the determined value is set as a known value, and this unknown pixel becomes the known pixel at this point. On the other hand, unknown pixels whose values have not been determined by the process of step S7 are not rewritten and remain as unknown pixels.

【0017】次いで、ステップS10の書き換え処理に
よって、未知の画素がなくなったか否か(あるいは所定
個数以下となったか否か)、または、閾値kが最小の値
0になったか否かを判断する(ステップS11)。この
結果、閾値kが最小の値k0になっておらず、未知画素
がまだ残っているときには、これら未知画素に対する値
を決定するために、閾値kを小さくし(ステップS1
2)、再びステップS3に戻る。なお、この際、残って
いる未知画素について、新たに番号jを付す。このよう
にして、段階的に、未知画素に対する値を決定し、ステ
ップS11において、未知画素がなくなったか、あるい
は未知画素の個数が所定個以下となったときに、また
は、閾値kが最小の値k0になったときに、処理を終了
する。
Next, in the rewriting process of step S10, it is determined whether or not there are no unknown pixels (or whether or not the number is equal to or less than a predetermined number), or whether or not the threshold value k is the minimum value k 0. (Step S11). As a result, when the threshold value k is not the minimum value k 0 and the unknown pixels still remain, the threshold value k is reduced to determine the values for these unknown pixels (step S1).
2) Then, the process returns to step S3 again. At this time, a number j is newly added to the remaining unknown pixels. In this way, the value for the unknown pixel is determined stepwise, and when the unknown pixel is eliminated or the number of unknown pixels becomes equal to or less than the predetermined number in step S11, or the threshold value k is the minimum value. When k 0 is reached, the process ends.

【0018】図4(a)乃至(d)は、上記画像処理の具体
例を説明するための図である。この具体例では、近傍画
素として、図4(a)に示すような3×3の大きさのマス
クMijが定義されている。すなわち、このマスクMij
中心を未知画素に設定し、これにより、マスクの8個の
部分M11,M12,M13,M21,M23,M31,M32,M33
がマスクの中心M22に設定された未知画素の近傍画素と
なる。また、この場合、演算の種類が例えば“平均値”
に設定され、閾値kの初期値が例えば“7”に設定され
ているとする。いま、処理対象領域PCUが図4(b)の
ように特定されている場合、この処理対象領域PCU内
の各画素#1〜#5は、当初、未知の値のものとなって
いるので、マスクMの中心M22を各画素#1〜#5に順
次に設定し、処理を行なう。例えば、マスクMijの中心
22を画素#1に設定すると、M11,M12,M13
21,M31,M32,M33の7個の画素は、既知領域の画
素であり、既知の値をもっており、また、M23の部分の
画素は未知画素であるので、8個の近傍画素のうち、既
知の値をもっている既知画素は7個である。従って、閾
値k(=7)と同じであり、閾値k(=7)より小さくない
ので、未知画素#1については、7個の既知画素の値に
基づいて値が決定される。例えば、この値は、7個の既
知画素の値の平均値として決定される。
FIGS. 4A to 4D are views for explaining a concrete example of the image processing. In this specific example, a 3 × 3 size mask M ij as shown in FIG. 4A is defined as the neighboring pixels. That is, the center of this mask M ij is set to an unknown pixel, whereby the eight parts M 11 , M 12 , M 13 , M 21 , M 23 , M 31 , M 32 , M 33 of the mask are set.
Is a neighboring pixel of the unknown pixel set at the center M 22 of the mask. Also, in this case, the type of calculation is, for example, “average value”.
And the initial value of the threshold value k is set to, for example, “7”. Now, when the processing target area PCU is specified as shown in FIG. 4B, each pixel # 1 to # 5 in this processing target area PCU has an unknown value at the beginning, The center M 22 of the mask M is sequentially set for each of the pixels # 1 to # 5, and the processing is performed. For example, when the center M 22 of the mask M ij is set to the pixel # 1, M 11 , M 12 , M 13 ,
The seven pixels of M 21 , M 31 , M 32 , and M 33 are pixels in a known area and have a known value, and the pixel of the portion of M 23 is an unknown pixel, so that there are 8 neighborhoods. Among the pixels, there are seven known pixels that have known values. Therefore, since it is the same as the threshold value k (= 7) and not smaller than the threshold value k (= 7), the value of the unknown pixel # 1 is determined based on the values of the seven known pixels. For example, this value is determined as the average value of the values of seven known pixels.

【0019】同様に、マスクの中心M22を画素#5に設
定すると、この場合も、8個の近傍画素のうち、7個が
既知の値をもっているので、未知画素#5の値が決定さ
れる。
Similarly, when the center M 22 of the mask is set to the pixel # 5, the value of the unknown pixel # 5 is determined since 7 of the 8 neighboring pixels also have known values in this case. It

【0020】これに対し、マスクの中心M22を画素#
2,#3,または#4に設定すると、M11,M12
13,M31,M32,M33の部分の画素は、既知の値をも
っており、M21,M23の部分の画素は未知画素であるの
で、8個の近傍画素のうち、既知の値をもっている画素
は6個である。従って、閾値k(=7)よりも小さいの
で、未知画素#2,#3,#4については、この段階で
は値が決定されない。
On the other hand, the center M 22 of the mask is set to the pixel #
When set to 2, # 3 or # 4, M 11 , M 12 ,
The pixels in the portions of M 13 , M 31 , M 32 , and M 33 have known values, and the pixels in the portions of M 21 and M 23 are unknown pixels, so that the known value among the 8 neighboring pixels is known. Has 6 pixels. Therefore, since it is smaller than the threshold value k (= 7), the values of the unknown pixels # 2, # 3, and # 4 are not determined at this stage.

【0021】このようにして、閾値kを“7”として、
全ての未知画素#1〜#5についての処理を行なったと
き、2つの画素#1,#5について値が決定されたの
で、画素#1,#5については、決定された値が既知の
値として設定される。すなわち、このとき、画素#1,
#5は、既知の値をもつ既知画素となり、図4(c)に示
すように3つの画素#2,#3,#4が未知のまま残
る。
In this way, the threshold value k is set to "7",
When the process is performed for all unknown pixels # 1 to # 5, the values are determined for the two pixels # 1 and # 5, and thus the determined values for the pixels # 1 and # 5 are known values. Is set as. That is, at this time, pixel # 1,
# 5 becomes a known pixel having a known value, and the three pixels # 2, # 3, and # 4 remain unknown as shown in FIG. 4 (c).

【0022】次の段階では、閾値kを“7”から“6”
に変更し、マスクMijの中心M22を未知の画素#2,#
3,#4に順次に設定し、処理を行なう。この場合、マ
スクの中心M22を画素#2,または#4に設定すると、
8個の近傍画素のうち、7個が既知の値をもっており、
閾値k(=6)よりも大きいので、画素#2,#4の値
が、7個の既知画素の値に基づいて決定される。同様
に、マスクの中心M22を画素#3に設定すると、8個の
近傍画素のうち、6個が既知の値をもっており、閾値k
(=6)と同じであり、閾値k(=6)よりも小さくないの
で、画素#3の値が、6個の既知画素の値に基づいて決
定される。
At the next stage, the threshold value k is changed from "7" to "6".
And the center M 22 of the mask M ij is changed to the unknown pixel # 2, #
3 and # 4 are sequentially set and processing is performed. In this case, if the center M 22 of the mask is set to pixel # 2 or # 4,
Of the 8 neighboring pixels, 7 have known values,
Since it is larger than the threshold value k (= 6), the values of the pixels # 2 and # 4 are determined based on the values of the seven known pixels. Similarly, when the center M 22 of the mask is set to the pixel # 3, 6 out of 8 neighboring pixels have known values, and the threshold k
Since it is the same as (= 6) and is not smaller than the threshold value k (= 6), the value of the pixel # 3 is determined based on the values of the six known pixels.

【0023】このようにして、閾値kを“6”として、
全ての未知画素#2〜#4についての処理を行なったと
き、全ての画素#2〜#4について、値が決定され、既
知の値として設定される。この例では、この段階で、図
4(d)に示すように、全ての画素が既知の値をもつ既知
画素となり、未知画素が残っていないので、処理を終了
する。
In this way, the threshold value k is set to "6",
When processing is performed for all unknown pixels # 2 to # 4, values are determined for all pixels # 2 to # 4 and set as known values. In this example, at this stage, as shown in FIG. 4D, all the pixels become known pixels having known values, and no unknown pixels remain, so the process ends.

【0024】画像処理部2における上述した処理の第1
の特徴(利点)は、処理対象領域PCU内の画素の値のみ
を決定することにある。すなわち、画像PC中の全ての
画素に対する処理を行なうのではなく、画像PC中の一
部の領域の画素に対してだけ処理を行なうので、画像処
理時間を従来に比べ短縮することができ、また、処理を
行なう必要のない既知領域PCK内の画素については処
理を行なわないので、全体の画像品質を劣化させずに済
む。
First of the above-mentioned processing in the image processing unit 2
The feature (advantage) of is that only the value of the pixel in the processing target area PCU is determined. That is, since the processing is not performed for all the pixels in the image PC but only for the pixels in a part of the image PC, the image processing time can be shortened as compared with the conventional case. Since the pixels in the known area PCK that do not need to be processed are not processed, the overall image quality does not deteriorate.

【0025】また、上述した処理の第2の特徴(利点)
は、未知画素のうち、最も信頼性良く値が決定されうる
画素から順に、値を決定することである。すなわち、図
4(b)の例では、画素#1,#5は、既知の値をもつ近
傍画素数が画素#2〜#4に比べて多く、最も信頼性良
く値が決定されるものであるので、最初に値が決定され
る。
The second characteristic (advantage) of the above-mentioned processing
Is to determine the value in order from the pixel whose value can be determined most reliably among the unknown pixels. That is, in the example of FIG. 4B, the pixels # 1 and # 5 have a larger number of neighboring pixels having known values than the pixels # 2 to # 4, and the values are most reliably determined. So, the value is determined first.

【0026】また、上述した処理の第3の特徴(利点)
は、未知画素の値が決定され、この未知画素が既知の値
をもつ既知画素となるとき、次の段階で、この画素を近
傍画素の既知の値をもつ画素の仲間に加えて、未知のま
ま残っている画素の値を決定することにある。すなわ
ち、図4(c)の例では、例えば、画素#2の値を決定す
るのに、前の段階で既知の値となった画素#1の値を加
味することにある。これにより、各画素の連続性を確保
することができる。
The third characteristic (advantage) of the above-mentioned processing
When the value of an unknown pixel is determined, and this unknown pixel becomes a known pixel having a known value, in the next step, this pixel is added to a group of pixels having a known value of neighboring pixels, and It is to determine the values of the remaining pixels. That is, in the example of FIG. 4C, for example, in determining the value of the pixel # 2, the value of the pixel # 1 that has become the known value in the previous stage is taken into consideration. Thereby, continuity of each pixel can be secured.

【0027】また、上述した処理の第4の特徴(利点)
は、画像の種類に依らず、全ての種類の画像を処理対象
とすることができることにある。すなわち、近傍画素の
定義,閾値の初期値,演算の種類を適宜設定することに
より、画像が文書画像のような2値画像であっても、ま
た、写真画像や絵図画像のような多値画像であっても、
画像の修復や推定を良好に行なうことができることにあ
る。なお、上述の具体例では、画像の種類について何ら
言及していないが、画像が多値画像である場合には、近
傍画像のうち既知の値をもつ画素の値の演算値(例えば
平均値)そのものを、未知画素の値として決定すること
ができる。また画像が2値画像である場合には、近傍画
像のうち既知の値をもつ画素の値の演算値(例えば平均
値)が“0.5”以下のときには“0”を未知画素に対
する値として決定し、また、演算値(例えば平均値)が
“0.5”以上のときには“1”を未知画素に対する値
として決定することができる。
The fourth characteristic (advantage) of the above-mentioned processing
Is that all types of images can be processed regardless of the types of images. That is, even if the image is a binary image such as a document image, a multi-valued image such as a photographic image or a pictorial image can be obtained by appropriately setting the definition of neighboring pixels, the initial value of the threshold value, and the type of calculation. Even
This is to be able to favorably perform image restoration and estimation. In the specific example described above, no reference is made to the type of image, but when the image is a multi-valued image, the calculated value (for example, the average value) of the pixel values having known values in the neighboring images. That can be determined as the value of the unknown pixel. Further, when the image is a binary image, when the calculated value (for example, average value) of the pixels having known values in the neighboring images is “0.5” or less, “0” is set as the value for the unknown pixel. When the calculated value (for example, the average value) is "0.5" or more, "1" can be determined as the value for the unknown pixel.

【0028】ところで、閾値初期設定部5において、設
定される閾値kの初期値としては、例えば、前述のよう
に近傍画素数に応じた最も大きな値に設定することがで
きる。前述の例では、近傍画素数が“8”である場合、
閾値kの初期値を“7”に設定することができる。この
ように、閾値kの初期値を近傍画素数に応じた最も大き
な値に設定し、閾値kの最も大きいところから処理を開
始することで、処理対象領域PCU内の各画素の値を最
も信頼性のあるものから順に決定することができる。
By the way, as the initial value of the threshold value k set in the threshold value initial setting section 5, for example, the maximum value corresponding to the number of neighboring pixels can be set as described above. In the above example, when the number of neighboring pixels is “8”,
The initial value of the threshold value k can be set to "7". In this way, by setting the initial value of the threshold value k to the largest value according to the number of neighboring pixels and starting the processing from the position where the threshold value k is the largest, the value of each pixel in the processing target area PCU is the most reliable. It can be determined in order from the ones with nature.

【0029】しかしながら、処理対象となる領域の大き
さ,形状によっては、閾値kの初期値を最も大きな値に
設定せずとも、画像をある程度信頼性良く良好に処理
(例えば修復)することができる場合もある。例えば、処
理対象領域PCUの大きさが小さいとき、あるいは処理
対象領域PCUの形状が細長いものでないときには、領
域PCUの大きさが大きい場合、あるいは領域PCUの
形状が細長い場合に比べて、閾値kの初期値を低く設定
し、この領域PCUの画素に対する処理が最も信頼性高
くなされなくとも、画像全体の品質に対するこの領域P
CU内の画素の影響は少ないと考えられる。このような
場合にも、閾値kの初期値を常に近傍画素数に応じた最
も大きな値に設定し、閾値kの最も大きな値のところか
ら処理を開始すると、処理量が増加し、処理速度が低下
するという弊害がかえって生ずる。このような弊害を防
止するため、閾値初期設定部5は、処理対象領域PCU
の大きさ(すなわち処理対象領域PCU内の画素数)お
よび/または、処理対象領域PCUの形状に応じて、閾
値kの初期値を最適なものに設定するのが良い。
However, depending on the size and shape of the region to be processed, even if the initial value of the threshold value k is not set to the maximum value, the image is processed to some extent with good reliability.
In some cases (eg repair) can be done. For example, when the size of the processing target area PCU is small, or when the shape of the processing target area PCU is not elongated, the threshold value k is larger than when the size of the area PCU is large or when the shape of the area PCU is elongated. Even if the processing for the pixels of this area PCU is not made most reliable by setting the initial value low, this area P for the quality of the entire image is
It is considered that the influence of pixels in the CU is small. Even in such a case, if the initial value of the threshold value k is always set to the largest value according to the number of neighboring pixels and the processing is started from the largest value of the threshold value k, the processing amount increases and the processing speed increases. On the contrary, the adverse effect of lowering occurs. In order to prevent such an adverse effect, the threshold initial setting unit 5 sets the processing target area PCU
It is preferable to set the initial value of the threshold value k to an optimum value in accordance with the size of (i.e., the number of pixels in the processing target area PCU) and / or the shape of the processing target area PCU.

【0030】図5は閾値初期設定部5の構成例を示す図
である。図5を参照すると、閾値初期設定部5は、閾値
kの初期値を決定するための情報を保持するテーブルT
BLと、処理対象領域PCUの大きさに関する情報およ
び/または処理対象領域PCUの形状に関する情報を領
域情報として検出する領域情報検出部8と、領域情報検
出部8で検出された領域情報に対応する閾値kの初期値
をテーブルTBLを参照して自動的に決定する初期値決
定部9とを有している。
FIG. 5 is a diagram showing a configuration example of the threshold value initial setting unit 5. Referring to FIG. 5, the threshold initial setting unit 5 holds a table T holding information for determining the initial value of the threshold k.
BL, area information detection unit 8 that detects information about the size of the processing target area PCU and / or information about the shape of the processing target area PCU as area information, and corresponds to the area information detected by the area information detection unit 8. It has an initial value determination unit 9 that automatically determines the initial value of the threshold value k with reference to the table TBL.

【0031】ここで、領域情報検出部8は、処理対象領
域PCUの大きさに関する情報として、画像PC全体の
大きさ(すなわち画像PC全体の画素数)に対する領域P
CU内の画素数Nの割合いf(%)を用いることができ
る。なお、処理対象領域PCU内の画素数Nは、前述の
ように領域特定部1によって処理対象領域PCUを特定
する際に得られたものを利用することができる。
Here, the area information detection unit 8 uses the area P for the size of the entire image PC (that is, the number of pixels of the entire image PC) as information regarding the size of the processing target area PCU.
The ratio f (%) of the number N of pixels in the CU can be used. The number N of pixels in the processing target area PCU may be the number obtained when the processing target area PCU is specified by the area specifying unit 1 as described above.

【0032】また処理対象領域PCUの形状について
は、領域特定部1によって例えば図6(a)に示すような
処理対象領域PCUが特定されたとき、図6(b)のよう
にこの領域PCUを切り出し、切り出した矩形RCの例
えば縦方向iと横方向jの長さの比、すなわち縦横比ま
たは横縦比RTij(=dj/diまたはdi/dj)を求
め、この縦横比または横縦比RTijに基づき検出するこ
とができる。すなわち、領域PCUがどの程度の細長さ
の形状のものであるかを検知することができる。
As for the shape of the processing target area PCU, when the area specifying unit 1 specifies the processing target area PCU as shown in FIG. 6A, the area PCU is selected as shown in FIG. 6B. For example, the ratio of the length of the cut-out rectangle RC in the vertical direction i and the horizontal direction j, that is, the aspect ratio or the aspect ratio RT ij (= dj / di or di / dj) is calculated, and the aspect ratio or the aspect ratio is calculated. It can be detected based on RT ij . That is, it is possible to detect how thin the shape of the area PCU is.

【0033】また、テーブルTBLは、図7(a),図7
(b),または図7(c)のように構成することができる。
図7(a)の例では、テーブルTBLには、画像PC全体
の画素数に対する処理対象領域PCU内の画素数の割合
いf(%)と、割合いfに対応する閾値kの初期値とが設
定されている。また、図7(b)の例では、テーブルTB
Lには、領域PCUの縦横比または横縦比RTijと、R
ijに対応する閾値kの初期値とが設定されている。な
お、図7(b)において、RTijは、縦横比(dj/di)
または横縦比(di/dj)のいずれか大きい値のものと
し、従って、RTijは、“1”以上であるとする。ま
た、図7(c)の例では、テーブルTBLには、領域PC
U内の画素数の割合いfと、領域PCUの縦横比または
横縦比RTijと、fとRTijとに対応する閾値kの初期
値とが設定されている。
The table TBL is shown in FIGS.
It can be configured as in (b) or FIG. 7 (c).
In the example of FIG. 7A, in the table TBL, the ratio f (%) of the number of pixels in the processing target area PCU to the number of pixels of the entire image PC and the initial value of the threshold value k corresponding to the ratio f are shown. Is set. Further, in the example of FIG. 7B, the table TB
L is the aspect ratio of the area PCU or the aspect ratio RT ij , and R
The initial value of the threshold value k corresponding to T ij is set. In FIG. 7B, RT ij is the aspect ratio (dj / di).
Alternatively, it is assumed that the aspect ratio (di / dj) has a larger value, and thus RT ij is “1” or more. In the example of FIG. 7C, the table PC has a region PC.
The ratio f of the number of pixels in U, the aspect ratio or aspect ratio RT ij of the area PCU, and the initial value of the threshold value k corresponding to f and RT ij are set.

【0034】次に閾値初期設定部5が上記のような構成
になっているときの処理の具体例を説明する。いま、テ
ーブルTBLが例えば図7(c)に示すようなものとなっ
ている場合、画像PC中の処理対象領域PCUが例えば
図8のように特定されるときには、画像PC全体の画素
数に対する処理対象領域PCU内の画素数の割合いf
(%)がかなり大きいので、初期値決定部9は、閾値kの
初期値を例えば“7”に決定する。これにより、この大
きな領域PCU内の画素の値を極めて信頼性高く決定す
ることができる。
Next, a specific example of the processing when the threshold initial setting unit 5 has the above-mentioned configuration will be described. Now, when the table TBL is as shown in FIG. 7C, for example, when the processing target area PCU in the image PC is specified as shown in FIG. Ratio f of the number of pixels in the target area PCU f
Since (%) is considerably large, the initial value determination unit 9 determines the initial value of the threshold value k to be “7”, for example. As a result, the pixel value in this large area PCU can be determined with extremely high reliability.

【0035】これに対し、画像PC中の処理対象領域P
CUが例えば図9のように特定されるときには、画像P
C全体の画素数に対する処理対象領域PCU内の画素数
の割合いf(%)が小さく、また、縦横比RTijも小さい
ので、初期値決定部9は、閾値kの初期値を例えば
“4”に決定する。これにより、演算部7は、この小さ
な領域PCU内の画素に対する処理を閾値kの小さな値
“4”のところから開始する。なお、閾値kの小さな値
“4”のところから開始する場合には、領域PCU内の
画素の値は差程信頼性良くは決定されないが、処理対象
領域PCUの大きさが小さいものでありまた、その形状
が細長いものではないので、領域PCU内の画素の値が
差程信頼性良くは決定されない場合でも、画像PC全体
の品質に対する影響は少なく、その反面、処理量を減ら
し、処理の高速化を図ることができる。
On the other hand, the processing target area P in the image PC
When the CU is specified as shown in FIG. 9, for example, the image P
Since the ratio f (%) of the number of pixels in the processing target area PCU to the total number of pixels of C is small and the aspect ratio RT ij is also small, the initial value determination unit 9 sets the initial value of the threshold value k to, for example, “4”. "Decide." As a result, the calculation unit 7 starts the process for the pixels in the small area PCU from the small value “4” of the threshold value k. If the threshold value k starts from a small value “4”, the pixel values in the area PCU are not determined so reliably, but the size of the processing target area PCU is small. However, since the shape is not elongated, even if the pixel values in the area PCU cannot be determined with high reliability, the effect on the quality of the entire image PC is small, but the processing amount is reduced and the processing speed is high. Can be realized.

【0036】また、画像PC中の処理対象領域PCUが
例えば図10のように特定されるときには、画像PC全
体の画素数に対する処理対象領域PCU内の画素数の割
合いf(%)は図9と同様に小さいが、縦横比RTijが大
きくなるので、初期値決定部9は、閾値kの初期値を例
えば“5”に決定する。これにより、図10の領域PC
U内に対する処理を、図9の領域PCU内に対する処理
と比べ、閾値kのより大きい値“5”のところから開始
する。この結果、細長い形状の領域PCU内の画素の値
を図9の場合に比べてより信頼性良く決定することがで
きるとともに、図8の場合に比べて、処理量を減らし、
処理の高速化を図ることができる。
Further, when the processing target area PCU in the image PC is specified as shown in FIG. 10, for example, the ratio f (%) of the number of pixels in the processing target area PCU to the number of pixels in the entire image PC is shown in FIG. Similarly, although the aspect ratio RT ij is large, the initial value determination unit 9 determines the initial value of the threshold value k to be “5”, for example. As a result, the area PC of FIG.
The process for U is started from a value "5", which is larger than the threshold k, as compared with the process for the region PCU in FIG. As a result, the pixel values in the elongated area PCU can be determined more reliably than in the case of FIG. 9, and the processing amount is reduced as compared with the case of FIG.
The processing speed can be increased.

【0037】このように、本発明では、閾値kの初期値
を処理対象領域の大きさ,形状に応じた最適なものに自
動的に決定することにより、処理の最適化を図ることが
できる。
As described above, in the present invention, the initial value of the threshold value k is automatically determined to be the optimum value according to the size and shape of the processing target area, so that the processing can be optimized.

【0038】なお、上記の例では、1つの画像PC中に
1つの処理対象領域PCUが存在する場合について説明
したが、図11に示すように、1つの画像PC中に複数
の(例えば2つの)処理対象領域PCU1,PCU2が存
在する場合にも、各領域PCU1,PCU2について、
それぞれ、本発明を同様に適用することができる。この
際、画像PC全体の画素数をN0とし、領域PCU1内
の画素数をN1とし、領域PCU2内の画素数をN2とす
るとき、閾値kの初期値を決定するときに用いられる画
像PC全体の画素数N0に対する割合いf(%)として、
全ての処理対象画素数(N1+N2)の画像PC全体の画素
数N0に対する割合い(N1+N2)/N0を用いることが考
えられる。すなわち、領域PCU1内の各画素に対する
処理を行なうときと、領域PCU2内の各画素に対する
処理を行なうときとのいずれの場合にも、閾値kの初期
値としては、割合いf=(N1+N2)/N0により決定さ
れた同じものを用いることが考えられる。領域PCU1
と領域PCU2とが互いに同程度の大きさのものである
場合には、割合いf=(N1+N2)/N0によって決定さ
れた同じ閾値kの初期値を用いることも可能であるが、
図11の例のように、領域PCU1と領域PCU2とが
互いに異なる大きさである場合には、これらに一律に同
じ閾値kの初期値を用いることは好ましくない。
In the above example, the case where one processing target area PCU exists in one image PC has been described, but as shown in FIG. 11, a plurality of (for example, two ) Even when the processing target areas PCU1 and PCU2 exist, for each area PCU1 and PCU2,
The present invention can be similarly applied to each of them. At this time, when the number of pixels of the entire image PC is N 0 , the number of pixels in the area PCU 1 is N 1, and the number of pixels in the area PCU 2 is N 2 , it is used when determining the initial value of the threshold value k. As a ratio f (%) to the number of pixels N 0 of the entire image PC,
It is conceivable to use the ratio (N 1 + N 2 ) / N 0 of the total number of processing target pixels (N 1 + N 2 ) to the total number of pixels N 0 of the image PC. That is, the ratio f = (N 1 + N) is set as the initial value of the threshold value k regardless of whether each pixel in the area PCU1 is processed or each pixel in the area PCU2 is processed. It is conceivable to use the same determined by 2 ) / N 0 . Area PCU1
And the area PCU2 have the same size, it is possible to use the same initial value of the threshold value k determined by the ratio f = (N 1 + N 2 ) / N 0 . ,
When the area PCU1 and the area PCU2 have different sizes as in the example of FIG. 11, it is not preferable to uniformly use the same initial value of the threshold value k for them.

【0039】従って、1つの画像PC中に複数の(例え
ば2つの)処理対象領域PCU1,PCU2が存在する
場合、各領域PCU1,PCU2ごとに、割合いfを定
めるのが良い。すなわち、領域PCU1に対する閾値k
の初期値k1については、この領域PCU1内の画素数
1の画像PC全体の画素数N0に対する割合いf1=(N
1/N0に基づいて決定し、また、領域PCU2に対する
閾値kの初期値k2については、この領域PCU2内の
画素数N2の画像PC全体の画素数N0に対する割合いf
2=N2/N0に基づいて決定するのが良い。このよう
に、各領域PCU1,PCU2それぞれに最適な閾値k
の初期値k1,k2を決定することで、各領域PCU1,
PCU2の大きさ,形状が互いに異なっていても(より
具体的には、画像PC中において欠陥画素の分布が一様
でない場合にも)、各領域PCU1,PCU2の各画素
に対し最適な処理を行なうことができる。
Therefore, when a plurality of (for example, two) processing target areas PCU1 and PCU2 exist in one image PC, it is preferable to determine the ratio f for each of the areas PCU1 and PCU2. That is, the threshold value k for the area PCU1
The initial value k 1 of the ratio of the number of pixels N 1 in this area PCU 1 to the number of pixels N 0 of the entire image PC f 1 = (N
1 / N 0, and regarding the initial value k 2 of the threshold value k for the area PCU2, the ratio f of the number of pixels N 2 in this area PCU2 to the number of pixels N 0 of the entire image PC f
It is better to make the determination based on 2 = N 2 / N 0 . Thus, the optimum threshold value k for each of the areas PCU1 and PCU2
By determining the initial values k 1 and k 2 of
Even if the size and shape of PCU2 are different from each other (more specifically, even when the distribution of defective pixels is not uniform in the image PC), the optimum processing is performed on each pixel of each area PCU1 and PCU2. Can be done.

【0040】また、上記各例では、領域PCU(あるい
はPCU1,PCU2)の大きさに関する情報として、
画像PC全体の画素数に対する領域PCU(あるいはP
CU1,PCU2)内の画素数の割合いf(%)(あるいは
1(%),f2(%))を用いたが、領域PCU(あるいはP
CU1,PCU2)の大きさに関する情報として、領域
PCU(あるいはPCU1,PCU2)内の画素数そのも
のを用いても良い。すなわち、画像PC全体が非常に大
きいものであって、例えば、領域PCUの大きさ(画素
数)が画像PC全体に比べればかなり小さいがそれ自体
でかなり大きい場合、領域PCU内の画素の値は、信頼
性高く決定されるのが望ましいが、画像PC全体の画素
数に対する領域PCU内の画素数の割合いfにより閾値
kの初期値を決定すると、この初期値は領域PCUが画
像PC全体と比べ小さな大きさのものであると判断され
て低く設定され、従って、領域PCU内の画素の値を信
頼性良く決定することができなくなる。このような場合
には、領域PCUの大きさに関する情報として、領域P
CU内の画素数そのものを用いるのが良い。
In each of the above examples, as the information on the size of the area PCU (or PCU1, PCU2),
Area PCU (or P
CU1, the ratio of the number of pixels in PCU2) intragastrically f (%) (or f 1 (%), was used f 2 a (%)), region PCU (or P
The number of pixels in the area PCU (or PCU1, PCU2) itself may be used as the information regarding the size of CU1, PCU2). That is, if the entire image PC is very large, for example, the size (number of pixels) of the area PCU is considerably smaller than the entire image PC but is itself large, the value of the pixel in the area PCU is However, it is desirable to be determined with high reliability, but when the initial value of the threshold value k is determined by the ratio f of the number of pixels in the area PCU to the number of pixels in the entire image PC, the initial value of the area PCU is the same as that of the entire image PC. The size of the pixel in the area PCU is determined to be small and is set to be low, so that it becomes impossible to reliably determine the value of the pixel in the area PCU. In such a case, as the information regarding the size of the area PCU, the area P
It is better to use the number of pixels in the CU itself.

【0041】また、上述の例では、領域PCUの形状に
関する情報を、領域PCUの切出矩形RCの縦横比また
は縦横比RTijとして検出しており、このような検出の
仕方は、領域PCUが図12(a)または図12(b)のよ
うに、縦方向iに沿ってまたは横方向jに沿って細長い
形状である場合には有効である。しかしながら、領域P
CU例えば図12(c)に示すように斜めに細長いような
場合、上記の検出の仕方では、これが細長い形状である
と検出することができない。従って、この場合には、領
域PCUの形状に関する情報として、矩形RC内の画素
数NRに対する領域PCU内の画素数Nの比RT'を求
め、この比RT'に基づき、領域PCUが細長い形状で
あるか否かを検出することができる。すなわち、図12
(c)の場合に、比RT'が小さい程、領域PCUが細長
い形状であると検出できる。
In the above example, the information about the shape of the area PCU is detected as the aspect ratio or the aspect ratio RT ij of the cutout rectangle RC of the area PCU. As shown in FIG. 12 (a) or FIG. 12 (b), it is effective when the shape is elongated along the vertical direction i or along the horizontal direction j. However, the area P
In the case where the CU has a slender shape as shown in FIG. 12C, it cannot be detected as a slender shape by the above detection method. Therefore, in this case, as the information on the shape of the region PCU, a ratio RT ′ of the number N of pixels in the region PCU to the number N R of pixels in the rectangle RC is obtained, and the region PCU has an elongated shape based on the ratio RT ′. Can be detected. That is, FIG.
In the case of (c), it is possible to detect that the region PCU has an elongated shape as the ratio RT ′ is smaller.

【0042】また、図12(a),(b),(c)のいずれの
場合にも、領域PCUが細長い形状であると検出できる
ために、領域PCUの形状に関する情報として、矩形R
Cの縦横比または横縦比RTijとともに、矩形RC内の
画素数NRに対する領域PCU内の画素数Nの比RT'を
求め、比RTijと、比RT'との両方に基づき、領域P
CUが細長い形状であるか否かを検出するのが良い。こ
れによれば、例えば、図12(a),(b)の場合には、比
RT'は大きいが、比RTijが大きくなるので、細長い
形状と検出でき、また、図12(c)の場合には、比RT
ijは小さいが、比RT'が小さくなるので、領域PCU
が細長い形状であると検出することができる。
In each of FIGS. 12A, 12B, and 12C, since the area PCU can be detected as having an elongated shape, the rectangle R is used as information regarding the shape of the area PCU.
Along with the aspect ratio or aspect ratio RT ij of C, the ratio RT ′ of the number N of pixels in the region PCU to the number N R of pixels in the rectangle RC is obtained, and the region is calculated based on both the ratio RT ij and the ratio RT ′. P
It is better to detect whether the CU has an elongated shape. According to this, for example, in the case of FIGS. 12 (a) and 12 (b), the ratio RT ′ is large, but the ratio RT ij is large, so that it can be detected as an elongated shape. If the ratio RT
ij is small, but the ratio RT 'is small, so the area PCU
Can be detected as having an elongated shape.

【0043】上述したような本発明の画像処理装置は、
処理対象となる領域が特定できるものであれば、種々の
用途に適用可能である。なお、適用される用途が異なる
ごとに、処理対象領域の特定の仕方も異なるので、画像
処理装置の領域特定部1は、適用される用途に適した構
成をとる必要がある。
The image processing apparatus of the present invention as described above is
It can be applied to various purposes as long as the area to be processed can be specified. It should be noted that the area specifying unit 1 of the image processing apparatus needs to have a configuration suitable for the applied application, because the method of specifying the processing target area also differs depending on the applied application.

【0044】本発明の画像処理装置の適用例として、フ
ァクシミリ,複写機あるいはイメージスキャナ等の画像
読取システムで読取った画像を修復する場合が考えられ
る。図13は本発明の画像処理装置が画像修復装置とし
て組み込まれた画像読取システムの構成例を示す図であ
る。図13を参照すると、この画像読取システムは、原
稿10が載置される原稿台11と、コンタクトガラス1
2と、原稿10に光を照射する光源13と、原稿10か
らの反射光を検知し、原稿10の読取画像を得るCCD
素子やラインセンサなどの画像読取デバイス14と、画
像読取デバイス14によって読取られた画像(例えば多
値画像,あるいは2値画像)を記憶する画像メモリ15
と、画像メモリ15に記憶された画像に対し修復処理を
施す画像修復装置16とを備えている。
As an application example of the image processing apparatus of the present invention, it is conceivable to restore an image read by an image reading system such as a facsimile, a copying machine or an image scanner. FIG. 13 is a diagram showing a configuration example of an image reading system in which the image processing apparatus of the present invention is incorporated as an image restoration apparatus. Referring to FIG. 13, this image reading system includes a document table 11 on which a document 10 is placed, and a contact glass 1.
2, a light source 13 that irradiates the original 10 with light, and a CCD that detects reflected light from the original 10 and obtains a read image of the original 10.
An image reading device 14 such as an element or a line sensor, and an image memory 15 for storing an image (for example, a multi-valued image or a binary image) read by the image reading device 14.
And an image restoration device 16 for performing restoration processing on the image stored in the image memory 15.

【0045】このような画像読取システムにおいて、処
理対象,すなわち修復対象となるべき画像の欠陥は、例
えば、コンタクトガラス12(あるいは、図示しないが
フィルタ,レンズなどの光学部品)の一部に汚れや傷な
どがある場合、あるいは、CCD素子やラインセンサな
どの画像読取デバイス14に故障がある場合、あるいは
原稿10の一部に汚れや傷,しわなどがある場合に生ず
る。
In such an image reading system, a defect of an image to be processed, that is, an object to be repaired is, for example, a stain or a part of the contact glass 12 (or an optical component such as a filter or a lens (not shown)). This occurs when there is a scratch, when the image reading device 14 such as a CCD element or a line sensor has a failure, or when a part of the original 10 has stains, scratches, or wrinkles.

【0046】ここで、コンタクトガラス12(あるい
は、フィルタ,レンズなどの光学部品)の一部に汚れや
傷などがある場合、これらの汚れや傷に対応した欠陥
は、これらが取り除かれない限り、画像メモリ15中の
一定領域(同じ領域)に常に現われる。コンタクトガラス
12(あるいは、フィルタ,レンズなどの光学部品)の一
部に存在する汚れや傷などに対応した画像の欠陥を画像
修復装置16により修復する場合、先ず、画像メモリ1
5中で画像の欠陥領域,すなわち修復対象領域(処理対
象領域)を領域特定部1によって特定する必要がある
が、この修復対象領域は、画像読取りを繰返し行なって
も、画像メモリ15中の常に同じ位置となるので、例え
ば、原稿台11に原稿10が載置されていない状態(例
えば白紙が載置されている状態)における画像を読取っ
て画像メモリ15にプリスキャン画像として記憶し、画
像メモリ15に記憶されたプリスキャン画像から欠陥領
域すなわち修復対象領域を特定するよう、領域特定部1
を構成することができる。
Here, when a part of the contact glass 12 (or an optical component such as a filter or a lens) has stains or scratches, the defects corresponding to these stains or scratches must be removed unless they are removed. It always appears in a certain area (same area) in the image memory 15. When the image restoration device 16 restores an image defect corresponding to stains or scratches present on a part of the contact glass 12 (or optical components such as a filter and a lens), first, the image memory 1
In FIG. 5, the defective area of the image, that is, the repair target area (processing target area) needs to be specified by the area specifying unit 1. This repair target area is always stored in the image memory 15 even if image reading is repeated. Since they are at the same position, for example, an image in a state where the original 10 is not placed on the original table 11 (for example, a blank sheet is placed) is read and stored in the image memory 15 as a prescan image, In order to identify a defective area, that is, an area to be repaired, from the prescan image stored in 15, the area specifying unit 1
Can be configured.

【0047】例えば、領域特定部1は、画像メモリ15
中にプリスキャン画像が多値で記憶されるとする場合、
所定濃度値以上の画素からなる領域を修復対象領域とし
て抽出し特定するよう構成することができる。また、画
像メモリ16中にプリスキャン画像が2値で記憶される
とする場合、“1”の値をもつ画素からなる領域を修復
対象領域として抽出し特定するよう構成することができ
る。図14は領域特定部1の具体例を示す図であり、図
14の例では、領域特定部1は、領域を抽出する領域抽
出部17と、抽出した領域内の各画素の位置情報が記憶
される領域メモリ18とを有している。
For example, the area specifying unit 1 uses the image memory 15
If the pre-scan image is stored in multiple values inside,
A region including pixels having a predetermined density value or more can be extracted and specified as a restoration target region. Further, when the prescan image is stored in the image memory 16 in binary, it is possible to extract and specify a region including pixels having a value of “1” as a restoration target region. FIG. 14 is a diagram showing a specific example of the area specifying unit 1. In the example of FIG. 14, the area specifying unit 1 stores the area extracting unit 17 that extracts an area and the position information of each pixel in the extracted area. The area memory 18 is provided.

【0048】いま、プリスキャンを行なうことによっ
て、例えば図15(a)に示すようなプリスキャン画像が
得られる場合、領域特定部1の領域抽出部17は、図1
5(a)のプリスキャン画像から2つの修復対象領域PC
U1,PCU2を抽出し特定し、各領域PCU1,PC
U2内の画素の位置情報を領域メモリ18に格納する。
このとき、画像処理部2の閾値初期設定部5は、領域メ
モリ18に格納された位置情報を参照し、前述したよう
な仕方で、修復対象領域PCU1に対する閾値kの最適
な初期値k1を設定し、また、修復対象領域PCU2に
対する閾値kの最適な初期値k2を決定する。このよう
にしてプリスキャンにより、修復対象領域が抽出し特定
され、また、閾値kの最適な初期値k1,k2が決定され
た後、実際の原稿を読み取り、その画像を画像メモリ1
5に記憶する。図15(b)は実際の原稿画像の一例であ
り、図15(b)と図15(a)とを比べればわかるよう
に、図15(b)においても、図15(a)とほぼ同じ位置
に、コンタクトガラス12(あるいは、フィルタ,レン
ズなどの光学部品)の一部に存在する汚れや傷などに対
応した欠陥が生じている。画像修復装置の画像処理部2
は、領域メモリ18に格納に格納された領域PCU1,
PCU2の位置情報を参照し、図15(b)の原稿画像に
おいて、修復対象領域PCU1,PCU2内の各画素が
値をもっていても、この値を何ら考慮せずに、(すなわ
ちこれら各画素の値が完全に未知のものであると仮定し
た上で)、画像メモリ15に記憶されている原稿画像に
対し、前述したような処理を修復処理として行なうこと
ができる。例えば、最初、原稿画像において修復対象領
域PCU1の各画素に対して、閾値kの最適な初期値k
1のところから修復処理を行い、次いで、修復対象領域
PCU2内の各画素に対して、閾値kの最適な初期値k
2のところから修復処理を行なう。
When a prescan image such as that shown in FIG. 15A is obtained by performing prescan, the area extracting unit 17 of the area specifying unit 1 operates as shown in FIG.
Two restoration target areas PC from the prescan image of 5 (a)
U1 and PCU2 are extracted and specified, and each area PCU1 and PC
The position information of the pixel in U2 is stored in the area memory 18.
At this time, the threshold initial setting unit 5 of the image processing unit 2 refers to the position information stored in the area memory 18 and determines the optimum initial value k 1 of the threshold value k for the repair target area PCU1 in the manner described above. The optimum initial value k 2 of the threshold value k for the repair target area PCU2 is set. In this way, the area to be repaired is extracted and specified by the pre-scan, and after the optimum initial values k 1 and k 2 of the threshold value k are determined, the actual document is read and its image is read in the image memory 1
Store in 5. FIG. 15B is an example of an actual original image. As can be seen by comparing FIG. 15B and FIG. 15A, FIG. 15B is almost the same as FIG. 15A. A defect corresponding to a stain or a scratch existing on a part of the contact glass 12 (or an optical component such as a filter or a lens) is generated at the position. Image processing unit 2 of the image restoration device
Are stored in the area memory 18 and stored in the area PCU1,
Referring to the position information of the PCU2, even if each pixel in the restoration target regions PCU1 and PCU2 has a value in the original image of FIG. 15B, the value is not taken into consideration (that is, the value of each pixel is Is assumed to be completely unknown), the above-described processing can be performed as the restoration processing on the document image stored in the image memory 15. For example, first, in the original image, the optimum initial value k of the threshold value k is set for each pixel of the restoration target area PCU1.
The restoration process is performed from 1 and then the optimum initial value k of the threshold value k is set for each pixel in the restoration target area PCU2.
Perform the repair process from point 2 .

【0049】このようにして、コンタクトガラス12
(あるいは、フィルタ,レンズなどの光学部品)の一部に
存在する汚れや傷などによって、画像の一部の領域に欠
陥が生じた場合にも、この領域に応じた最適の仕方で、
この領域を高品質の状態に迅速に修復することができ
る。
In this way, the contact glass 12
(Or, if there are defects in some areas of the image due to stains or scratches that exist on some parts (or optical parts such as filters and lenses), use the optimum method according to this area.
This area can be quickly restored to a high quality condition.

【0050】また、画像読取デバイス14の一部に故障
がある場合にも、コンタクトガラス12に汚れや傷など
がある場合と同様に、画像読取デバイス14の一部の故
障に対応した欠陥は、図16(a)あるいは図16(b)に
示すように、画像読取デバイス14が交換されない限
り、画像メモリ15中の一定領域(同じ領域)に常に現わ
れる。例えば、図16(a)に示すように白抜けとして現
われたり、図16(b)に示すように黒線として現われた
りする。なお、図16(a),(b)は、画像読取デバイス
14がCCDである場合の画像である。
Further, even when a part of the image reading device 14 has a failure, as in the case where the contact glass 12 has a stain or a scratch, a defect corresponding to a part of the image reading device 14 has a defect. As shown in FIG. 16A or FIG. 16B, it always appears in a certain area (same area) in the image memory 15 unless the image reading device 14 is replaced. For example, it appears as a blank area as shown in FIG. 16 (a), or as a black line as shown in FIG. 16 (b). 16A and 16B are images when the image reading device 14 is a CCD.

【0051】従って、画像修復装置16の領域特定部1
を、コンタクトガラス12上の汚れや傷に対応した欠陥
領域を特定する図14に示したと同様の構成のものにす
ることで、画像読取デバイス14の一部に故障がある場
合の画像中の欠陥領域を特定することができ、特定した
欠陥領域の各画素を画像処理部2により修復することが
できる。換言すれば、画像修復装置16を図14の構成
とすることで、コンタクトガラス12,画像読取デバイ
ス14などを含む画像読取システム全体の欠陥に対応し
た画像の欠陥領域を同時に特定し、これらを1つの画像
修復装置16で修復することができる。
Therefore, the area specifying unit 1 of the image restoration device 16
To have a structure similar to that shown in FIG. 14 for identifying a defective area corresponding to stains or scratches on the contact glass 12, so that a defect in an image when a part of the image reading device 14 has a failure. The area can be specified, and each pixel of the specified defective area can be repaired by the image processing unit 2. In other words, by configuring the image restoration device 16 as shown in FIG. 14, the defective area of the image corresponding to the defect of the entire image reading system including the contact glass 12, the image reading device 14 and the like is simultaneously identified, and these are identified as 1 It can be restored by one image restoration device 16.

【0052】また、画像読取デバイス14の一部に故障
があるときに生ずる画像の欠陥領域だけを特定する場合
には、領域特定部1を図17に示したような構成のもの
にすることができる。すなわち、図17の構成では、領
域特定部1は、CCDやラインセンサなどの画像読取デ
バイス14の個々の素子から出力される信号レベルを検
出し、各素子が正常であるか異常であるかを判定する異
常検出部21と、異常と判定された素子に対応する画像
メモリ15上での画素の位置情報を記憶する領域メモリ
22とを有している。
Further, in the case of specifying only the defective area of the image which occurs when a part of the image reading device 14 is out of order, the area specifying unit 1 may be constructed as shown in FIG. it can. That is, in the configuration of FIG. 17, the area specifying unit 1 detects the signal level output from each element of the image reading device 14 such as the CCD or the line sensor and determines whether each element is normal or abnormal. An abnormality detection unit 21 for determination and an area memory 22 for storing position information of pixels on the image memory 15 corresponding to an element determined to be abnormal are included.

【0053】一般に、画像読取デバイス14の一部の素
子が電気的に壊れると、この素子から出力される信号レ
ベルは、常時異常なレベルとなり、画像中に図16
(a),図16(b)に示したような欠陥が生ずる。従っ
て、領域特定部1が図17の構成となっている場合に
は、異常検出部21により信号レベルが異常であると検
出された素子に対応する画素からなる領域を修復対象領
域として特定し、その位置情報を領域メモリ22に格納
する。そして、画像処理部2は、領域メモリ22に格納
された位置情報を参照し、先ず、閾値kの初期値を最適
なものに決定し、しかる後、最適に決定された閾値kの
初期値のところから画像修復を行い、図16(a),図1
6(b)のような欠陥のある画像を、この欠陥に応じた最
適の仕方で、良好に修復することができる。
Generally, when a part of the elements of the image reading device 14 is electrically broken, the signal level output from this element is always an abnormal level, and the signal level shown in FIG.
The defects shown in (a) and FIG. 16 (b) occur. Therefore, in the case where the area specifying unit 1 has the configuration of FIG. 17, the area including the pixels corresponding to the element whose signal level is detected to be abnormal by the abnormality detecting unit 21 is specified as the repair target area, The position information is stored in the area memory 22. Then, the image processing unit 2 refers to the position information stored in the area memory 22, first determines the optimum initial value of the threshold value k, and then determines the optimum initial value of the threshold value k. Image restoration is performed from that point, and as shown in FIG.
An image having a defect such as 6 (b) can be satisfactorily restored by an optimum method according to this defect.

【0054】なお、画像修復装置16のもつ上記機能を
画像読取デバイス14自体にもたせることもできる。こ
の場合、画像読取デバイス14の一部が破損しても、画
像読取デバイス自体でこの破損した部分に対応する画像
を良好に修復でき、画像読取デバイス14からは、画像
読取デバイス14の一部が破損していないときと同様の
良好な品質の画像が出力されるので、素子の寿命を見か
け上延ばすことができる。
The image reading device 14 itself can be provided with the above-mentioned functions of the image restoration device 16. In this case, even if a part of the image reading device 14 is damaged, the image reading device itself can satisfactorily restore the image corresponding to the damaged part, and from the image reading device 14, a part of the image reading device 14 is lost. Since an image of good quality is output as when it is not damaged, the life of the device can be apparently extended.

【0055】一方、原稿10の一部に汚れや傷,しわな
どがある場合、原稿10は、コンタクトガラス12や画
像読取デバイス13などのように、画像読取システムに
固定されたものでないので、原稿10を読取ったとき
に、原稿10上の汚れや傷,しわなどは、画像メモリ1
5中において常に同じ領域に現われる性質のものではな
い。
On the other hand, when a part of the original 10 is dirty, scratched, wrinkled, or the like, the original 10 is not fixed to the image reading system like the contact glass 12 and the image reading device 13, so the original 10 is not fixed. When the document 10 is read, stains, scratches, wrinkles, etc. on the document 10 are not detected in the image memory 1.
5 does not always appear in the same region.

【0056】従って、原稿10上の汚れや傷,しわなど
による画像の欠陥を画像修復装置16により修復する場
合、画像修復装置16は、例えば図18のように構成さ
れる。すなわち、図18の画像修復装置16では、領域
特定部1は、画像メモリ15に記憶された画像を表示す
る表示部25と、表示部25に表示された画像のうち所
定の領域をオペレータに指示させるためのマウスなどの
ポインティングデバイス26と、ポインティングデバイ
ス26によって指示された領域内の各画素の位置情報が
記憶される領域メモリ27とを有している。
Therefore, when the image restoration device 16 restores an image defect due to stains, scratches, or wrinkles on the original 10, the image restoration device 16 is configured as shown in FIG. 18, for example. That is, in the image restoration apparatus 16 of FIG. 18, the area specifying unit 1 instructs the operator to display the display unit 25 that displays the image stored in the image memory 15 and a predetermined area of the image displayed on the display unit 25. It has a pointing device 26 such as a mouse for moving the mouse, and an area memory 27 for storing position information of each pixel in the area designated by the pointing device 26.

【0057】このような構成では、原稿10を読取った
とき、画像メモリ15に記憶された原稿画像が例えば図
19(a)のように表示部25に表示される。この表示を
見て、オペレータは、原稿10上の汚れや傷,しわなど
による部分を特定し、その部分を図19(b)に符号PC
Uで示すように、マウスなどのポインティングデバイス
26によって指示する(例えば囲む)。これにより、ポイ
ンティングデバイス26によって指示された(囲まれた)
領域PCU内の各画素の位置情報が領域メモリ27に格
納される。そして、画像処理部2は、領域メモリ27に
格納された位置情報を参照し、先ず、閾値kの初期値を
最適なものに決定し、しかる後、最適に決定された閾値
の初期値のところから領域PCU内の各画素に対し、前
述のような仕方で画像修復を行なうことができる。な
お、図18の例では、処理対象となる領域をオペレータ
に指示させるようになっているが、汚れや傷が一定の形
状,大きさのものである場合、処理対象となる領域も一
定の形状,大きさのものとなるので、この場合には、パ
ターン認識技術を用いてオペレータの指示によらずに領
域を特定することも可能である。
With such a configuration, when the document 10 is read, the document image stored in the image memory 15 is displayed on the display unit 25 as shown in FIG. 19A, for example. Looking at this display, the operator identifies the portion of the original 10 due to stains, scratches, wrinkles, etc., and the portion is indicated by PC in FIG.
As indicated by U, it is instructed (for example, enclosed) by a pointing device 26 such as a mouse. As a result, it is instructed (enclosed) by the pointing device 26.
The position information of each pixel in the area PCU is stored in the area memory 27. Then, the image processing unit 2 refers to the position information stored in the area memory 27, first determines the optimal initial value of the threshold value k, and then determines the optimal initial value of the threshold value. Thus, image restoration can be performed on each pixel in the area PCU in the above-described manner. Note that in the example of FIG. 18, the operator is instructed to specify the area to be processed. However, if the stain or scratch has a constant shape and size, the area to be processed also has a constant shape. In this case, the area can be specified without using the operator's instruction by using the pattern recognition technique.

【0058】このように、本発明の画像処理装置は、画
像読取システムにおいて読取画像中に生ずるあらゆる種
類の欠陥に対し、この欠陥の大きさ,形状に応じた最適
の仕方で、これを良好に画像修復することができる。
As described above, the image processing apparatus of the present invention is capable of properly treating defects of any kind occurring in a read image in the image reading system in an optimum manner according to the size and shape of the defect. Images can be restored.

【0059】上記適用例は、原稿の読取画像(2次元画
像)に対して画像の修復を行なう場合であるが、本発明
は、本願と同一の出願人により本願と同日付で出願され
た特許出願(整理番号9303862)に記載されている
と同様に、対象画像として、2次元画像のみならず、C
T画像や核磁気共鳴画像などの3次元画像あるいは動画
像、さらにそれ以上の高次元画像の修復や推定にも適用
可能である。
The above application example is for the case where an image is restored to a read image (two-dimensional image) of a document, but the present invention is a patent filed by the same applicant as the present application on the same date as the present application. As described in the application (reference number 9303862), not only the two-dimensional image but also the C
It can also be applied to restoration and estimation of three-dimensional images such as T images and nuclear magnetic resonance images or moving images, and higher-dimensional images higher than that.

【0060】また、ファクシミリの画像伝送時に、例え
ば、回線等にノイズなどが混入するときに生ずるファク
シミリ受信画像の欠陥の修復などにも適用可能である。
The present invention can also be applied to, for example, repairing a defect in a facsimile received image that occurs when noise or the like is mixed into a line or the like during image transmission of a facsimile.

【0061】また、上記各例では、演算部7において、
処理対象領域PCU内の未知の画素を完全に未知の値の
ものとし(未知画素が不確かな値をもっていても、この
値を何ら考慮せずに)、近傍画素のうちの既知画素の値
だけに基づいて、未知画素の値を決定するようにしてい
るが、未知画素が完全には未知でなく不確かな値をもっ
ている場合、この情報をも考慮した演算処理がなされる
ことによって、より高品質の画像に修復することができ
ることもある。
Further, in each of the above examples, in the arithmetic unit 7,
The unknown pixel in the processing target area PCU is set to a completely unknown value (even if the unknown pixel has an uncertain value, this value is not taken into consideration), and only the value of the known pixel among the neighboring pixels is set. Based on this, the value of the unknown pixel is determined, but when the unknown pixel is not completely unknown and has an uncertain value, the calculation processing that also takes this information into consideration is performed, resulting in higher quality. Sometimes it can be restored to an image.

【0062】従って、演算部7として、未知画素が不確
かな値をもっている場合、前述の処理例のようにこの未
知画素の値が完全に未知であると仮定し近傍画素のうち
の既知画素の値だけによって決定し、しかる後、このよ
うに決定した値に、この未知画素が本来もっている不確
かな値を加味して、この未知画素の値を最終的に決定す
るよう構成することもできる。
Therefore, when the unknown pixel has an uncertain value, the arithmetic unit 7 assumes that the value of this unknown pixel is completely unknown as in the above-described processing example, and the value of the known pixel among the neighboring pixels. Alternatively, the value of the unknown pixel may be finally determined by adding the uncertain value originally possessed by the unknown pixel to the value thus determined.

【0063】すなわち、未知画素が本来もっている不確
かな値をp(x)とし(ここで、xは未知画素の位置を表
わし、pは例えば濃度値を表わしている)、また、この
未知画素が完全に未知であると仮定し近傍画素のうちの
既知画素の値だけによって決定した値をq(x)とすると
き、p(x)とq(x)との算術演算の結果r(x)を、この
未知画素の値として最終的に決定するようにすることも
できる。
That is, the uncertain value that the unknown pixel originally has is defined as p (x) (where x represents the position of the unknown pixel, and p represents the density value, for example), and this unknown pixel is When q (x) is a value determined only by the value of a known pixel among neighboring pixels on the assumption that the pixel is completely unknown, the result r (x) of the arithmetic operation of p (x) and q (x) Can be finally determined as the value of this unknown pixel.

【0064】p(x)とq(x)との算術演算の具体例とし
て、例えば次式のように、p(x)とq(x)の平均値〈p
(x)+q(x)〉をとることもできる。
As a specific example of the arithmetic operation of p (x) and q (x), for example, the average value of p (x) and q (x) <p
(x) + q (x)> can also be taken.

【0065】[0065]

【数1】r(x)=〈p(x)+q(x)〉## EQU1 ## r (x) = <p (x) + q (x)>

【0066】あるいは、次式のように、処理対象領域P
CUの各画素について得られた値p(x)のうちで最小の
ものをp'(x)とするとき、p(x)とq(x)の平均値
〈p(x)+q(x)〉からp'(x)を減算した値{〈p
(x)+q(x)〉−p'(x)}をr(x)とすることもでき
る。
Alternatively, as shown in the following equation, the processing target area P
When the smallest one of the values p (x) obtained for each pixel of the CU is p '(x), the average value of p (x) and q (x) <p (x) + q (x) Value obtained by subtracting p ′ (x) from〉 {〈p
(x) + q (x)>-p '(x)} may be r (x).

【0067】[0067]

【数2】 [Equation 2]

【0068】処理対象領域PCU内の未知画素が不確か
な値をもっている場合として、例えば、前述の第1の適
用例に示したような画像読取システムで読取った画像に
おける欠陥が挙げられる。すなわち、コンタクトガラス
12(あるいはフィルタ,レンズなどの光学部品)の一部
に汚れや傷がある場合、あるいは、画像読取デバイス1
4の一部の素子の感度が低い場合、あるいは、原稿の一
部に汚れや傷,しわなどがある場合のように、欠陥部分
の各画素の値が全く未知ではなく、その信頼性がいくら
か低い場合が挙げられる。このような場合に、未知画素
の値を完全に未知のものと仮定して、この未知画素の値
r(x)をp(x)として決定してしまうと、この未知画素
が本来もっている情報が何ら生かされない。これに対
し、上述のように、未知画素の値r(x)をp(x)とq
(x)との算術演算値とすることによって、より高品質に
画像を修復することができる。
As a case where the unknown pixel in the processing target area PCU has an uncertain value, for example, there is a defect in the image read by the image reading system as shown in the first application example. That is, when a part of the contact glass 12 (or an optical component such as a filter or a lens) is dirty or scratched, or when the image reading device 1 is used.
When the sensitivity of some of the elements of 4 is low, or when a part of the document has stains, scratches, wrinkles, etc., the value of each pixel in the defective portion is not unknown at all, and its reliability is somewhat unknown. It may be low. In such a case, assuming that the value of the unknown pixel is completely unknown and the value r (x) of the unknown pixel is determined as p (x), the information originally possessed by the unknown pixel is obtained. Is not used at all. On the other hand, as described above, the value r (x) of the unknown pixel is set to p (x) and q
By using the arithmetic operation value with (x), the image can be restored with higher quality.

【0069】さらに、上記変形例として、未知画素の本
来の値q(x)が信頼性の高いものか否かを判断し、信頼
性の高いときには、未知画素の値r(x)を数1または数
2のように決定する一方、信頼性の低いときには、未知
画素の本来の値が完全に未知であるとし、未知画素の値
r(x)をp(x)として決定するようにしても良い。
Further, as a modified example, it is judged whether the original value q (x) of the unknown pixel is highly reliable, and when it is highly reliable, the value r (x) of the unknown pixel is given by Alternatively, on the other hand, if the reliability is low, the original value of the unknown pixel is completely unknown, and the unknown pixel value r (x) is determined as p (x). good.

【0070】また、上述の各例では、処理対象領域PC
U内の画素に対して、1画素単位に処理がなされるとし
たが、処理を高速に行なうため、例えば図20に示すよ
うに、複数の画素の組を1つの画素とみなし、この画素
単位に処理を行なうようにすることもできる。なお、図
20の例では、複数の画素の組が2×2の画素からなっ
ているとしており、この場合、近傍画素も複数の画素の
組からなるものとして定義することができる。例えば、
近傍画素の1つの画素を領域PCU内の画素と同様に、
2×2の画素からなるものとして定義することができ
る。
In each of the above examples, the processing target area PC
Although it is assumed that the pixels in U are processed in units of one pixel, in order to perform the processing at high speed, a group of a plurality of pixels is regarded as one pixel as shown in FIG. It is also possible to carry out processing. Note that, in the example of FIG. 20, a set of a plurality of pixels is made up of 2 × 2 pixels, and in this case, neighboring pixels can also be defined as being made up of a set of a plurality of pixels. For example,
Like one pixel in the area PCU, one of the neighboring pixels is
It can be defined as consisting of 2 × 2 pixels.

【0071】このように、複数の画素の組を1つの画素
とみなし、この画素単位に処理がなされる場合には、1
画素単位に処理がなされる場合に比べて、処理対象とな
る画素数を低減することができ、処理を高速に行なうこ
とができる。例えば、2×2の画素を1つの画素とみな
し、この画素単位に処理がなされる場合には、処理速度
を4倍に向上させることができる。但し、このような処
理を行なうことによって、画像の解像度が劣化する。上
記例では、解像度は1/2に劣化する。従って、解像度
が劣化しても良いような用途に適用することができる。
In this way, when a set of a plurality of pixels is regarded as one pixel and processing is performed in this pixel unit, 1 is set.
The number of pixels to be processed can be reduced as compared with the case where processing is performed in pixel units, and the processing can be performed at high speed. For example, when 2 × 2 pixels are regarded as one pixel and processing is performed in pixel units, the processing speed can be increased four times. However, the resolution of the image is deteriorated by performing such processing. In the above example, the resolution deteriorates to 1/2. Therefore, it can be applied to applications where the resolution may be deteriorated.

【0072】その適用例として、例えば、送信側のファ
クシミリ装置が400dpiの解像度で画像信号を送る
能力を有しているのに対し、受信側のファクシミリ装置
が200dpiの解像度の再現能力しか有していない場
合である。この場合、受信側のファクシミリ装置では、
送信側のファクシミリ装置からの400dpiの画像に
対して、前述したような処理を行なう場合、送信側にお
ける400dpiの解像度を維持する必要はなく、20
0dpiの解像度があれば良い。従って、2×2の画素
を1つの画素とみなし、この画素単位に画像修復処理を
行なうことにより、処理速度を4倍に向上させ、かつ、
受信側に必要な解像度を満たすことができる。
As an example of its application, for example, the facsimile machine on the transmission side has the ability to send an image signal at a resolution of 400 dpi, while the facsimile machine on the reception side has only the reproducibility of the resolution of 200 dpi. If not. In this case, the receiving facsimile machine
When the above-described processing is performed on the 400 dpi image from the facsimile apparatus on the transmission side, it is not necessary to maintain the resolution of 400 dpi on the transmission side.
A resolution of 0 dpi is sufficient. Therefore, the 2 × 2 pixels are regarded as one pixel, and the image restoration process is performed for each pixel to increase the processing speed four times, and
The resolution required by the receiving side can be satisfied.

【0073】[0073]

【発明の効果】以上に説明したように、請求項1乃至請
求項7記載の発明によれば、処理対象領域内の各画素が
当初、完全に未知の値あるいは不確かな値をもつ未知画
素であるとし、処理対象領域内の特定の未知画素に着目
するとき、該未知画素の近傍画素のうちで既知の値をも
つ既知画素の個数が所定の閾値よりも大きい場合に限
り、近傍画素のうちの既知画素の値を用いて未知画素の
値を決定する一方、既知画素の個数が所定の閾値よりも
小さいときには、未知画素の値を決定せず未知画素のま
ま残すようになっており、処理対象領域内の各画素につ
いて所定の閾値での前記処理がなされた後、値の決定さ
れた未知画素を既知画素とし、また、閾値を変更し、残
されている未知画素に対して処理を繰り返し行なう画像
処理において、上記閾値の最適な閾値を、処理対象領域
の大きさに関する情報、および/または、処理対象領域
の形状に関する情報に基づいて決定するようになってい
るので、処理対象領域の大きさ,形状に応じた最適な処
理を行なうことができ、画像を高速にかつ高品質に修
復,推定等することができる。
As described above, according to the first to seventh aspects of the invention, each pixel in the processing target area is initially an unknown pixel having a completely unknown value or an uncertain value. Given that, when focusing on a specific unknown pixel in the processing target region, only if the number of known pixels having a known value among the neighboring pixels of the unknown pixel is larger than a predetermined threshold value, among the neighboring pixels, While the value of the unknown pixel is determined using the value of the known pixel, the value of the unknown pixel is not determined and the unknown pixel is left as it is when the number of the known pixels is smaller than a predetermined threshold. After each pixel in the target area has been subjected to the above-described processing with a predetermined threshold value, the unknown pixel whose value has been determined is set as a known pixel, the threshold value is changed, and the processing is repeated for the remaining unknown pixels. In the image processing to be performed, The optimum threshold value is determined based on the information about the size of the processing target area and / or the information about the shape of the processing target area. Optimal processing can be performed, and images can be restored and estimated at high speed and with high quality.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明に係る画像処理装置の構成例を示す図で
ある。
FIG. 1 is a diagram showing a configuration example of an image processing apparatus according to the present invention.

【図2】画像中の処理対象領域と既知領域とを説明する
ための図である。
FIG. 2 is a diagram for explaining a processing target area and a known area in an image.

【図3】図1の画像処理装置の動作を説明するためのフ
ローチャートである。
FIG. 3 is a flowchart for explaining the operation of the image processing apparatus in FIG.

【図4】(a)乃至(d)は図1の画像処理装置の処理の具
体例を示す図である。
4A to 4D are diagrams showing a specific example of processing of the image processing apparatus of FIG.

【図5】閾値初期設定部の構成例を示す図である。FIG. 5 is a diagram showing a configuration example of a threshold initial setting unit.

【図6】(a),(b)は処理対象領域の形状を検出する仕
方を説明するための図である。
6A and 6B are diagrams for explaining a method of detecting the shape of a processing target area.

【図7】(a)乃至(c)はテーブルの構成例を示す図であ
る。
7A to 7C are diagrams showing a configuration example of a table.

【図8】閾値初期設定部の処理の具体例を示す図であ
る。
FIG. 8 is a diagram illustrating a specific example of processing of a threshold initial setting unit.

【図9】閾値初期設定部の処理の具体例を示す図であ
る。
FIG. 9 is a diagram showing a specific example of processing of a threshold initial setting unit.

【図10】閾値初期設定部の処理の具体例を示す図であ
る。
FIG. 10 is a diagram illustrating a specific example of processing of a threshold initial setting unit.

【図11】1つの画像中に複数の処理対象領域が存在す
る場合を示す図である。
FIG. 11 is a diagram showing a case where a plurality of processing target areas exist in one image.

【図12】(a)乃至(c)は領域PCUの形状を説明する
ための図である。
12A to 12C are diagrams for explaining the shape of a region PCU.

【図13】本発明の画像処理装置が画像修復装置として
組み込まれた画像読取システムの構成例を示す図であ
る。
FIG. 13 is a diagram showing a configuration example of an image reading system in which the image processing apparatus of the present invention is incorporated as an image restoration apparatus.

【図14】画像処理装置の具体的な構成例を示す図であ
る。
FIG. 14 is a diagram illustrating a specific configuration example of an image processing apparatus.

【図15】(a)はプリスキャン画像の一例を示す図、
(b)は実際の原稿画像の一例を示す図である。
15A is a diagram showing an example of a prescan image, FIG.
(b) is a diagram showing an example of an actual document image.

【図16】(a),(b)は画像読取デバイスの一部の素子
に欠陥がある場合の画像の一例を示す図である。
16A and 16B are diagrams showing an example of an image when some elements of the image reading device have a defect.

【図17】画像処理装置の具体的な構成例を示す図であ
る。
FIG. 17 is a diagram illustrating a specific configuration example of an image processing apparatus.

【図18】画像処理装置の具体的な構成例を示す図であ
る。
FIG. 18 is a diagram illustrating a specific configuration example of an image processing apparatus.

【図19】(a),(b)は表示部上での処理対象領域の特
定の仕方を説明するための図である。
19 (a) and 19 (b) are diagrams for explaining how to specify a processing target area on the display unit.

【図20】(a),(b)は処理対象領域内の画素に対し
て、複数の画素の組を1つの画素とみなして処理を行な
う場合の一例を示す図である。
20 (a) and 20 (b) are diagrams showing an example of a case where a set of a plurality of pixels is regarded as one pixel and is processed with respect to a pixel in a processing target region.

【符号の説明】[Explanation of symbols]

1 領域特定部 2 画像処理部 3 制御部 4 近傍画素定義部 5 閾値初期設定部 6 演算種類設定部 8 領域情報検出部 9 初期値決定部 10 原稿 11 原稿台 12 コンタクトガラス 13 光源 14 画像読取デバイス 15 画像メモリ 16 画像処理装置 17 領域抽出部 18,22,27 領域メモリ 21 異常検出部 25 表示部 26 ポインティングデバイス PC 画像 PCU 処理対象領域 PCK 既知領域 TBL テーブル 1 area specifying section 2 image processing section 3 control section 4 neighborhood pixel defining section 5 threshold initial setting section 6 calculation type setting section 8 area information detecting section 9 initial value determining section 10 original document 11 original plate 12 contact glass 13 light source 14 image reading device 15 image memory 16 image processing device 17 area extraction unit 18, 22, 27 area memory 21 abnormality detection unit 25 display unit 26 pointing device PC image PCU processing target area PCK known area TBL table

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 画像中の処理対象領域に含まれる画素に
対して所定の画像処理を施す画像処理装置であって、前
記画像処理装置は、前記処理対象領域の大きさに関する
情報、および/または、処理対象領域の形状に関する情
報に基づいて、閾値の最適な初期値を決定する閾値初期
決定手段と、前記処理対象領域内の各画素が当初、完全
に未知の値あるいは不確かな値をもつ未知画素であると
し、処理対象領域内の特定の未知画素に着目するとき、
該未知画素の近傍画素のうちで既知の値をもつ既知画素
の個数が所定の閾値よりも大きい場合に限り、近傍画素
のうちの既知画素の値を用いて未知画素の値を決定する
一方、既知画素の個数が所定の閾値よりも小さいときに
は、未知画素の値を決定せず未知画素のまま残すように
演算処理を行なう演算処理手段と、処理対象領域内の各
画素について、前記閾値初期決定手段によって決定され
た閾値の最適な初期値のところから前記演算処理手段に
よる演算処理を行なわせ、処理対象領域内の各画素につ
いて演算処理がなされた後、値の決定された未知画素を
既知画素とし、また、閾値を変更し、残されている未知
画素に対して前記演算処理を繰り返し行なう制御手段と
を備えていることを特徴とする画像処理装置。
1. An image processing apparatus for performing a predetermined image processing on a pixel included in a processing target area in an image, wherein the image processing apparatus includes information on a size of the processing target area, and / or A threshold initial determination means for determining an optimum threshold initial value based on information about the shape of the processing target area, and each pixel in the processing target area initially has a completely unknown value or an unknown value. Given that it is a pixel, and paying attention to a specific unknown pixel in the processing target area,
Only when the number of known pixels having a known value among the neighboring pixels of the unknown pixel is larger than a predetermined threshold, while determining the value of the unknown pixel using the value of the known pixel of the neighboring pixels, When the number of known pixels is smaller than a predetermined threshold value, an arithmetic processing unit that performs arithmetic processing so as to leave the unknown pixel value as it is without determining the value of the unknown pixel, and the threshold value initial determination for each pixel in the processing target area. The arithmetic processing is performed by the arithmetic processing means from the optimum initial value of the threshold value determined by the means, and after the arithmetic processing is performed on each pixel in the processing target area, the unknown pixel of which the value is determined is a known pixel. In addition, the image processing apparatus further comprises: a control unit that changes the threshold value and repeats the calculation process for the remaining unknown pixels.
【請求項2】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の大きさに
関する情報を、処理対象領域内の画素数として検出する
ようになっていることを特徴とする画像処理装置。
2. The image processing apparatus according to claim 1,
The image processing apparatus, wherein the threshold initial determination unit is configured to detect information regarding the size of the processing target area as the number of pixels in the processing target area.
【請求項3】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の大きさに
関する情報を、画像全体の画素数に対する処理対象領域
内の画素数の割合として検出するようになっていること
を特徴とする画像処理装置。
3. The image processing apparatus according to claim 1,
The image processing apparatus, wherein the threshold initial determination means is configured to detect information regarding the size of the processing target area as a ratio of the number of pixels in the processing target area to the number of pixels of the entire image.
【請求項4】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の形状に関
する情報を、処理対象領域を矩形状に切出し、切出した
矩形の縦方向と横方向の長さの比に基づき、検出するよ
うになっていることを特徴とする画像処理装置。
4. The image processing apparatus according to claim 1,
The threshold initial determination means is configured to detect the information on the shape of the processing target area based on the ratio of the length in the vertical direction and the horizontal direction of the cut-out rectangular area. An image processing device characterized by the above.
【請求項5】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の形状に関
する情報を、処理対象領域を矩形状に切出し、切出した
矩形内の画素数と処理対象領域内の画素数との比に基づ
き、検出するようになっていることを特徴とする画像処
理装置。
5. The image processing apparatus according to claim 1,
The threshold initial determination means detects information regarding the shape of the processing target area based on a ratio of the number of pixels in the cut-out rectangle and the number of pixels in the processing target area, which is obtained by cutting the processing target area into a rectangular shape. An image processing device characterized by:
【請求項6】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の形状に関
する情報を、処理対象領域を矩形状に切出し、切出した
矩形の縦方向と横方向の長さの比と、切出した矩形内の
画素数と処理対象領域内の画素数との比とに基づき、検
出するようになっていることを特徴とする画像処理装
置。
6. The image processing apparatus according to claim 1,
The threshold initial determination means, information regarding the shape of the processing target area, the processing target area is cut out into a rectangular shape, the ratio of the length of the cut-out rectangle in the vertical direction and the horizontal direction, and the number of pixels in the cut-out rectangle. An image processing apparatus, which is configured to detect based on a ratio with the number of pixels in a processing target area.
【請求項7】 請求項1記載の画像処理装置において、
前記閾値初期決定手段は、前記処理対象領域の大きさが
大きい程、閾値の初期値を大きく決定し、また、前記処
理対象領域の形状が細長い程、閾値の初期値を大きく決
定するようになっていることを特徴とする画像処理装
置。
7. The image processing apparatus according to claim 1,
The threshold initial determination means determines a larger initial value of the threshold as the size of the processing target area increases, and determines a larger initial value of the threshold as the shape of the processing target area becomes narrower. An image processing apparatus characterized in that.
JP5281827A 1993-10-15 1993-10-15 Image processor Pending JPH07114638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5281827A JPH07114638A (en) 1993-10-15 1993-10-15 Image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5281827A JPH07114638A (en) 1993-10-15 1993-10-15 Image processor

Publications (1)

Publication Number Publication Date
JPH07114638A true JPH07114638A (en) 1995-05-02

Family

ID=17644558

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5281827A Pending JPH07114638A (en) 1993-10-15 1993-10-15 Image processor

Country Status (1)

Country Link
JP (1) JPH07114638A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7038810B1 (en) 1998-12-14 2006-05-02 Canon Kabushiki Kaisha Image processing method and apparatus, image processing system, and storage medium
JP2010074672A (en) * 2008-09-19 2010-04-02 Canon Inc Image processor, image processing method, and image processing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7038810B1 (en) 1998-12-14 2006-05-02 Canon Kabushiki Kaisha Image processing method and apparatus, image processing system, and storage medium
JP2010074672A (en) * 2008-09-19 2010-04-02 Canon Inc Image processor, image processing method, and image processing program

Similar Documents

Publication Publication Date Title
JP3442466B2 (en) Image processing apparatus and image processing method
US6233364B1 (en) Method and system for detecting and tagging dust and scratches in a digital image
JP3312948B2 (en) Original platen dirt or scratch area compensation method and image reproducing apparatus
US6985180B2 (en) Intelligent blemish control algorithm and apparatus
US8369650B2 (en) Image defect map creation using batches of digital images
JP2702928B2 (en) Image input device
US8285070B2 (en) Methods and apparatus for image restoration
US7310450B2 (en) Method of detecting and correcting dust in digital images based on aura and shadow region analysis
US20070253638A1 (en) Digital Image Acquisition and Processing System
JP2000030052A (en) Picture processor
Taylor et al. Enhancement of document images from cameras
JPH07114638A (en) Image processor
JP2710527B2 (en) Inspection equipment for periodic patterns
US9589331B2 (en) Method and apparatus for determining a detection of a defective object in an image sequence as a misdetection
JPH1164236A (en) Method and device for detecting defect and recording medium recording defect detection control program
JPH07114639A (en) Image processor and image reader
JP2001016446A (en) Image reader
Stanco et al. Removal of semi-transparent blotches in old photographic prints
JP2004128643A (en) Method for compensating tilt of image
CN114095721B (en) Method and device for detecting video dead pixel and computer readable medium
JP2009124332A (en) Image processor, image processing method and program
JPH1195182A (en) Method for inspecting image quality of liquid crystal display panel
JP3436003B2 (en) Image processing device
JPH02254574A (en) Noise removing system
JP2766031B2 (en) Image processing apparatus and image processing method