JP5674535B2 - Image processing apparatus, method, and program - Google Patents

Image processing apparatus, method, and program Download PDF

Info

Publication number
JP5674535B2
JP5674535B2 JP2011084561A JP2011084561A JP5674535B2 JP 5674535 B2 JP5674535 B2 JP 5674535B2 JP 2011084561 A JP2011084561 A JP 2011084561A JP 2011084561 A JP2011084561 A JP 2011084561A JP 5674535 B2 JP5674535 B2 JP 5674535B2
Authority
JP
Japan
Prior art keywords
sub
region
value
image
integrated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2011084561A
Other languages
Japanese (ja)
Other versions
JP2012221102A (en
Inventor
森 稔
稔 森
柏野 邦夫
邦夫 柏野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2011084561A priority Critical patent/JP5674535B2/en
Publication of JP2012221102A publication Critical patent/JP2012221102A/en
Application granted granted Critical
Publication of JP5674535B2 publication Critical patent/JP5674535B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、画像処理装置、方法、及びプログラムに係り、特に、処理対象画像について特徴値のヒストグラムを生成する画像処理装置、方法、及びプログラムに関する。   The present invention relates to an image processing apparatus, method, and program, and more particularly, to an image processing apparatus, method, and program for generating a histogram of feature values for a processing target image.

従来より、検索対象画像内でテンプレート画像と類似している画像領域を検索する画像処理技術において、類似性を測る為に用いる情報として、テンプレート画像及び検索対象画像内の検索対象領域(サブウィンドウ)から抽出される色や輝度値やエッジなどの特徴値の数をカウントすることによりヒストグラムを作成して用いる手法が知られている。このヒストグラムを作成して用いる手法において、ヒストグラムの作成方法として、検索位置毎にサブウィンドウの各画素から特徴値を逐次カウントする全探索法が最も基本的な処理として使用されている。全探索法では、検索対象画像内の指定された検索位置に所定の大きさのサブウィンドウを設定し、サブウィンドウ内若しくはサブウィンドウを分割して得られる部分領域である各サブ領域内の各画素から抽出される特徴値を逐次カウントして、ヒストグラムを作成する。全探索法では、上記処理を検索対象画像内の各検索位置で実施する。検索位置、サブウィンドウ、及びサブ領域の関係を図1に示す。   2. Description of the Related Art Conventionally, in an image processing technique for searching an image area similar to a template image in a search target image, information used for measuring similarity is obtained from a template image and a search target area (subwindow) in the search target image. There is known a method of creating and using a histogram by counting the number of feature values such as extracted colors, luminance values, and edges. In the method of creating and using the histogram, as a method of creating the histogram, a full search method that sequentially counts feature values from each pixel of the subwindow for each search position is used as the most basic processing. In the full search method, a subwindow of a predetermined size is set at a specified search position in the search target image, and extracted from each pixel in each subregion which is a subregion obtained by dividing the subwindow or subwindow. A histogram is created by sequentially counting feature values. In the full search method, the above processing is performed at each search position in the search target image. The relationship between the search position, subwindow, and subregion is shown in FIG.

ヒストグラムの作成処理時間を削減する手法の一つとして、積分画像(非特許文献1参照)を利用したIntegral histogram法(非特許文献2参照)が提案されている。Integral histogram法では、ヒストグラムを構成するビン別に積分画像を作成する。検索対象画像内の各検索位置のサブウィンドウ及びサブ領域において特徴値のヒストグラムを作成する際は、各ビンの積分画像に基づいて、サブウィンドウ若しくはサブ領域等の指定範囲のヒストグラムを算出する。全てのビンの積分画像からヒストグラムを算出することで、サブウィンドウ及びサブ領域のヒストグラムを作成することが可能となる。   As one of the methods for reducing the histogram creation processing time, an Integrated histogram method (see Non-Patent Document 2) using an integral image (see Non-Patent Document 1) has been proposed. In the integral histogram method, an integral image is created for each bin constituting the histogram. When creating a histogram of feature values in the subwindow and subregion at each search position in the search target image, a histogram of a specified range such as a subwindow or subregion is calculated based on the integrated image of each bin. By calculating the histogram from the integrated images of all bins, it is possible to create a histogram of the subwindow and subregion.

P. Viola and M. Jones, 「Robust Real-Time Face Detection」, International Journal of Computer Vision, vol.57, no.2, pp.137-154, 2004.P. Viola and M. Jones, `` Robust Real-Time Face Detection '', International Journal of Computer Vision, vol.57, no.2, pp.137-154, 2004. F. Porikli, 「Integral Histogram: A Fast Way to Extract Histograms in Cartesian Spaces」, International Conference on Computer Vision and Pattern Recognition, Vol. 1, pp. 829-836, June 2005.F. Porikli, `` Integral Histogram: A Fast Way to Extract Histograms in Cartesian Spaces '', International Conference on Computer Vision and Pattern Recognition, Vol. 1, pp. 829-836, June 2005.

全探索法では、ヒストグラムを作成する際に、検索箇所毎に抽出範囲であるサブウィンドウ及びサブ領域内の全画素から特徴値を逐次読み込む必要があり、処理時間が掛かる、という問題がある。また、Integral histogram法では、各積分画像において任意の大きさの領域の4隅の座標値を設定して特徴を抽出することで、サブウィンドウおよび各サブ領域のヒストグラムの作成は高速に実施可能である。しかし、サブウィンドウが複数のサブ領域から構成される場合、同じ位置から複数回に渡りサブ領域のヒストグラムを作成する為、積分画像を用いても複数回の算出をする必要があり、余計な処理時間が掛かる、という問題がある。   The full search method has a problem in that when creating a histogram, it is necessary to sequentially read feature values from all pixels in the subwindow and subregion, which are extraction ranges, for each search location, and processing time is required. Also, in the integral histogram method, the feature can be extracted by setting the coordinate values of the four corners of the region of any size in each integral image, so that the sub-window and the histogram of each sub-region can be created at high speed. . However, if the sub-window is composed of multiple sub-regions, a histogram of the sub-region is created multiple times from the same position. There is a problem that it takes.

また、検索処理時の類似性を測る尺度として、特徴の積算値以外が必要な尺度、例えば正規化相関を用いた場合、サブ領域のヒストグラムの値の2乗値を全サブ領域において算出し積算する必要があるが、Integral histogram法を用いた場合、検索位置が1画素移るたびに、各サブ領域のヒストグラムを算出すると共に、左記値の2乗値の計算を全サブ領域に渡って実行し、且つ左記2乗値を加算する処理が必要となり、非常に処理時間が掛かる、という問題がある。特徴値の積算値以外を用いる他の類似尺度においても、同様である。   Further, when a measure other than the feature integrated value is used as a measure for measuring the similarity during the search processing, for example, normalized correlation is used, the square value of the histogram value of the sub-region is calculated in all the sub-regions and integrated. However, when using the integral histogram method, every time the search position moves one pixel, the histogram of each sub-region is calculated and the square value of the left value is calculated over all sub-regions. In addition, there is a problem that processing for adding the square value shown on the left is necessary, and it takes a very long processing time. The same applies to other similar scales using other than the integrated value of feature values.

本発明は、上記の事情を鑑みてなされたもので、サブウィンドウが複数のサブ領域からなる場合に、サブ領域毎に特徴値のヒストグラムを高速に算出すると共に、サブ領域における特徴値の積算値に算術演算を施した値を複数のサブ領域に渡って総和した値を高速に算出することができる画像処理装置、方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances. When a sub-window is composed of a plurality of sub-regions, a feature value histogram is calculated at a high speed for each sub-region, and an integrated value of feature values in the sub-region is calculated. An object of the present invention is to provide an image processing apparatus, method, and program capable of calculating at high speed a value obtained by summing values subjected to arithmetic operations over a plurality of sub-regions.

上記の目的を達成するために本発明に係る画像処理装置は、処理対象画像の各画素について特徴値を算出する特徴値算出手段と、座標(x、y)が最小となる画素を原点としたとき、原点からx方向に1画素ずつ順に移動した各x座標について更にy方向に1画素ずつ順に移動することにより設定される、各座標(x、y)を着目位置とするサブ領域を設定し、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、該着目位置の前記サブ領域内における前記範囲に属する特徴値の頻度値を、前記サブ領域内の予め定めた位置の画素値として付与したサブ領域積算値画像を各々生成するサブ領域積算値画像生成手段と、前記特徴値の各範囲に対して、前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々と、を総和した総和値、又は前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値に対して所定の算術演算を施した値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、前記サブ領域内の特定座標(x、y)における積算値として付与したサブ領域積算値積分画像を各々生成するサブ領域積算値積分画像生成手段と、を含んで構成されている。 In order to achieve the above object, an image processing apparatus according to the present invention uses a feature value calculation unit that calculates a feature value for each pixel of a processing target image, and a pixel having a minimum coordinate (x, y) as an origin. when is set by moving sequentially from the origin pixel by pixel further the y direction for each x coordinate has moved one by one pixel in the x direction and set sub-regions to each coordinate (x, y) of the interested position Based on the feature value of each pixel calculated by the feature value calculation means, for each range of the feature value, the frequency value of the feature value belonging to the range in the sub-region of the position of interest is Sub-region integrated value image generating means for generating sub-region integrated value images provided as pixel values at predetermined positions in the sub-region, and specific coordinates in the sub region (for each range of the feature values) x, y) And the pixel values of the serial subregion integrated value image, the specific coordinates (x, y) each x wherein (n is a natural number) n times in the x-direction size of the sub-regions spaced in the direction in which x becomes smaller only for Each of the pixel values of the sub-region integrated value image at each position indicated by the y-coordinates separated by n times (n is a natural number) of the coordinates and the size of the sub-region in the y-direction . Or a value obtained by performing a predetermined arithmetic operation on the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub-region, and the specific coordinates (x, y) Each x coordinate separated in the direction in which x is reduced by n times the size of the subregion in the x direction (n is a natural number) and n times the size of the subregion in the y direction (n is a natural number) before at each position indicated by the y coordinate y is separated in the direction of smaller only A total value obtained by summing the values obtained by performing a predetermined arithmetic operation on each pixel value of the sub-region integrated value image is added as an integrated value at a specific coordinate (x, y) in the sub-region. Sub-region integrated value integrated image generating means for generating sub-region integrated value integrated images, respectively.

本発明に係る画像処理方法は、特徴値算出手段と、サブ領域積算値画像生成手段と、サブ領域積算値積分画像生成手段と、を含む画像処理装置における画像処理方法であって、前記特徴値算出手段が、処理対象画像の各画素について特徴値を算出するステップと、前記サブ領域積算値画像生成手段が、座標(x、y)が最小となる画素を原点としたとき、原点からx方向に1画素ずつ順に移動した各x座標について更にy方向に1画素ずつ順に移動することにより設定される、各座標(x、y)を着目位置とするサブ領域を設定し、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、該着目位置の前記サブ領域内における前記範囲に属する特徴値の頻度値を、前記サブ領域内の予め定めた位置の画素値として付与したサブ領域積算値画像を各々生成するステップと、前記サブ領域積算値積分画像生成手段が、前記特徴値の各範囲に対して、前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々と、を総和した総和値、又は前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値に対して所定の算術演算を施した値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、前記サブ領域内の特定座標(x、y)における積算値として付与したサブ領域積算値積分画像を各々生成するステップと、を含むことを特徴とする。 An image processing method according to the present invention is an image processing method in an image processing apparatus including a feature value calculating unit, a sub-region integrated value image generating unit, and a sub-region integrated value integrated image generating unit, wherein the feature value calculating means, calculating a feature value for each pixel of the processing target image, the sub-area integrated value image generating means, the coordinates (x, y) when the origin pixel is minimum, x-direction from the origin A sub-region that sets each coordinate (x, y) as a target position , which is set by sequentially moving one pixel at a time in the y direction for each x coordinate that has moved one pixel at a time , and the feature value calculating means Based on the feature value of each pixel calculated by the above, for each range of the feature value, a frequency value of the feature value belonging to the range in the sub-region of the target position is determined in advance in the sub-region. Position And generating each sub-area integrated value image given as a pixel value, the sub-region integrated value integrating the image generating means, for each range of the characteristic value, the specific coordinates of the sub-region (x, y) Each of the pixel values of the sub-region integrated value image in FIG. 5 and the specific coordinates (x, y) separated from each other in the direction of decreasing x by n times the size of the sub-region in the x direction (n is a natural number). Each of the pixel values of the sub-region integrated value image at each position indicated by each of the x-coordinate and each y-coordinate separated in the direction of decreasing y by n times the size of the sub-region in the y direction (n is a natural number) , Or a value obtained by performing a predetermined arithmetic operation on the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub-region, and the specific coordinates (x, y the size of the x-direction of the sub-regions with respect to) n times (n is a natural number) each y coordinate spaced by x each x and n times the y-direction size of the sub-areas away in the direction of smaller (n is a natural number) by y decreases direction The total value obtained by summing the values obtained by performing a predetermined arithmetic operation on each pixel value of the sub-region integrated value image at each position shown is specified coordinates (x, y) in the sub-region. Generating each sub-region integrated value integrated image given as an integrated value.

本発明によれば、処理対象画像の各画素について特徴値を算出する。そして、座標が最小となる画素を原点としたとき、原点から座標が大きくなる方向に1画素ずつずらしながら、各座標を着目位置とするサブ領域を設定し、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、該着目位置の前記サブ領域内における前記範囲に属する特徴値の頻度値を、前記サブ領域内の予め定めた位置の画素値として付与したサブ領域積算値画像を各々生成する。   According to the present invention, the feature value is calculated for each pixel of the processing target image. Then, when the pixel having the smallest coordinate is used as the origin, sub-regions with the coordinates as the target position are set while shifting one pixel at a time from the origin in the direction in which the coordinate becomes larger, and are calculated by the feature value calculation unit. Based on the feature value of each pixel, for each range of the feature value, the frequency value of the feature value belonging to the range in the sub-region of the position of interest is determined as a pixel at a predetermined position in the sub-region. Each sub-region integrated value image given as a value is generated.

そして、前記特徴値の各範囲に対して、前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値と、前記特定座標(x、y)に対して前記サブ領域の大きさのn倍(nは自然数)だけ離れ、かつ、当該座標より小さい座標における前記サブ領域積算値画像の画素値の各々と、を総和した総和値、又は前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値に対して所定の算術演算を施した値と、前記特定座標(x、y)に対して前記サブ領域の大きさのn倍(nは自然数)だけ離れ、かつ、当該座標より小さい座標における前記サブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、前記サブ領域内の特定座標(x、y)における積算値として付与したサブ領域積算値積分画像を各々生成する。   For each range of the feature values, the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub-region and the sub-region with respect to the specific coordinates (x, y) The total value obtained by summing the pixel values of the sub-region integrated value image at a coordinate smaller than the coordinate and separated by n times (n is a natural number), or specific coordinates in the sub-region ( a value obtained by performing a predetermined arithmetic operation on the pixel value of the sub-region integrated value image at x, y) and n times the size of the sub-region with respect to the specific coordinates (x, y) (n is A total value obtained by summing each of the values obtained by performing a predetermined arithmetic operation on each pixel value of the sub-region integrated value image at a coordinate smaller than the natural number) As an integrated value at specific coordinates (x, y) Generating respectively given to sub-area integrated value integrated image.

このように、特徴値の各範囲に対して、サブ領域内の画素の特徴値の頻度値を付与したサブ領域積算値画像と、サブ領域内の特定座標(x、y)におけるサブ領域積算値画像の画素値と、特定座標(x、y)に対してサブ領域の大きさのn倍だけ離れ、かつ、当該座標より小さい座標におけるサブ領域積算値画像の画素値の各々と、を総和した総和値、又はサブ領域内の特定座標(x、y)におけるサブ領域積算値画像の画素値に対して所定の算術演算を施した値と、特定座標(x、y)に対してサブ領域の大きさのn倍だけ離れ、かつ、当該座標より小さい座標におけるサブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、積算値として付与したサブ領域積算値積分画像と生成することにより、サブウィンドウが複数のサブ領域からなる場合に、サブ領域毎に特徴値のヒストグラムを高速に算出すると共に、サブ領域における特徴値の積算値に算術演算を施した値を複数のサブ領域に渡って総和した値を高速に算出することができる。   As described above, the sub-region integrated value image in which the frequency value of the feature value of the pixel in the sub-region is given to each range of the feature value, and the sub-region integrated value at the specific coordinates (x, y) in the sub-region. The sum of the pixel value of the image and each pixel value of the sub-region integrated value image at a coordinate smaller than the specific coordinate (x, y) by n times the size of the sub-region and smaller than the coordinate. The total value or a value obtained by performing a predetermined arithmetic operation on the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub-region and the sub-region of the sub-region with respect to the specific coordinates (x, y) The total value obtained by summing the values obtained by performing a predetermined arithmetic operation on each pixel value of the sub-region integrated value image at a coordinate smaller than the size n times and smaller than the coordinate is obtained as an integrated value. The sub-region integrated value integrated image given as Thus, when the sub-window is composed of a plurality of sub-regions, a feature value histogram is calculated at a high speed for each sub-region, and a value obtained by performing an arithmetic operation on the integrated feature value in each sub-region is transferred to the plurality of sub-regions. The total value can be calculated at high speed.

本発明に係る画像処理装置は、入力されたテンプレート画像に相当する大きさのサブウィンドウを前記サブ領域積算値画像上と前記サブ領域積算値積分画像上に設定し、サブウィンドウを分割して得られる部分領域であるサブ領域を前記サブ領域積算値画像上に設定するサブウィンドウ設定手段と、前記サブ領域積算値画像内に設定された前記サブウィンドウのサブ領域毎に、前記特徴値の各範囲に対する前記サブ領域積算値画像の画素値を要素とするヒストグラムを各々生成するヒストグラム生成手段と、前記サブ領域積算値積分画像内に設定された前記サブウィンドウの4隅の座標の画素値に基づいて、前記特徴値の各範囲に対して、前記サブウィンドウ内の各サブ領域における前記総和値を算出する総和値算出手段と、を更に含むようにすることができる。   The image processing apparatus according to the present invention sets a sub-window having a size corresponding to an input template image on the sub-region integrated value image and the sub-region integrated value integrated image, and a portion obtained by dividing the sub window Sub-window setting means for setting a sub-region as a region on the sub-region integrated value image; and for each sub-region of the sub-window set in the sub-region integrated value image, the sub-region for each range of the feature values Histogram generation means for generating histograms each having a pixel value of an integrated value image as an element, and based on pixel values of coordinates of four corners of the sub-window set in the sub-region integrated value integrated image, A total value calculating means for calculating the total value in each sub-region in the sub-window for each range. It can be.

本発明に係るサブ領域積算値積分画像生成手段は、前記処理対象画像内の各位置に前記サブ領域を設定した場合について、前記サブ領域に隣接するサブ領域について既に算出された前記総和値を用いて、前記サブ領域に対する前記総和値を算出して、前記サブ領域内の特定座標(x、y)における積算値として付与した前記サブ領域積算値積分画像を生成するようにすることができる。これによって、サブ領域積算値積分画像を生成するのにかかる計算時間を短縮することができる。   The sub-region integrated value integrated image generating means according to the present invention uses the total value already calculated for the sub-region adjacent to the sub-region when the sub-region is set at each position in the processing target image. Then, the total value for the sub-region can be calculated, and the sub-region integrated value integrated image given as the integrated value at the specific coordinates (x, y) in the sub-region can be generated. As a result, the calculation time required to generate the sub-region integrated value integrated image can be shortened.

本発明に係る画像処理装置は、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、前記原点と座標(x、y)を対角とする矩形領域内の前記範囲に属する特徴値の頻度値を、座標(x、y)における頻度値として、各座標について算出し、各画素の前記頻度値を表わす積分画像を各々生成する積分画像生成手段を更に含み、前記サブ領域積算値画像生成手段は、前記積分画像生成手段によって生成された前記特徴値の各範囲に対する前記積分画像に基づいて、前記特徴値の各範囲に対する前記サブ領域積算値画像を生成するようにすることができる。これによって、サブ領域積算値積分画像及びサブ領域積算値積分画像を生成するのにかかる計算時間を短縮することができる。 The image processing apparatus according to the present invention uses the origin and coordinates (x, y) as a diagonal for each range of the feature value based on the feature value of each pixel calculated by the feature value calculation unit. The integrated image generation for calculating the frequency value of the feature value belonging to the range in the rectangular area to be calculated for each coordinate as the frequency value at the coordinates (x, y), and generating each integrated image representing the frequency value of each pixel And the sub-region integrated value image generating means includes the sub-region integrated value for each range of the feature values based on the integrated image for each range of the feature values generated by the integrated image generating unit. the image can be made so that forming raw. As a result, the calculation time required to generate the sub-region integrated value integrated image and the sub-region integrated value integrated image can be shortened.

上記の積分画像生成手段は、各画素について、前記画素に隣接する画素について既に算出された前記積算値を用いて、前記画素に対する前記積算値を算出して、前記積分画像を生成するようにすることができる。これによって、積分値画像を生成するのにかかる計算時間を短縮することができる。   The integrated image generation means generates the integrated image by calculating the integrated value for the pixel using the integrated value already calculated for the pixel adjacent to the pixel for each pixel. be able to. As a result, the calculation time required to generate the integral value image can be shortened.

本発明に係る画像処理方法は、サブウィンドウ設定手段が、入力されたテンプレート画像に相当する大きさのサブウィンドウを前記サブ領域積算値画像上と前記サブ領域積算値積分画像上に設定し、サブウィンドウを分割して得られる部分領域であるサブ領域を前記サブ領域積算値画像上に設定するステップと、ヒストグラム生成手段が、前記サブ領域積算値画像内に設定された前記サブウィンドウのサブ領域毎に、前記特徴値の各範囲に対する前記サブ領域積算値画像の画素値を要素とするヒストグラムを各々生成するステップと、総和値算出手段が、前記サブ領域積算値積分画像内に設定された前記サブウィンドウの4隅の座標の画素値に基づいて、前記特徴値の各範囲に対して、前記サブウィンドウ内の各サブ領域における前記総和値を算出するステップと、を更に含むようにすることができる。 In the image processing method according to the present invention, the sub-window setting means sets a sub-window having a size corresponding to the input template image on the sub-region integrated value image and the sub-region integrated value integrated image, and divides the sub window. A step of setting a sub-region, which is a partial region obtained on the sub-region integrated value image, and a histogram generating means for each sub-region of the sub-window set in the sub-region integrated value image A step of generating histograms each including a pixel value of the sub-region integrated value image for each range of values, and a sum total value calculating means at four corners of the sub-window set in the sub-region integrated value integrated image Based on the pixel value of the coordinates, for each range of the feature value, the total value in each sub-region in the sub-window Calculating, may further include a.

本発明に係る前記サブ領域積算値積分画像生成手段が前記サブ領域積算値積分画像を生成するステップは、前記処理対象画像内の各位置に前記サブ領域を設定した場合について、前記サブ領域に隣接するサブ領域について既に算出された前記総和値を用いて、前記サブ領域に対する前記総和値を算出して、前記サブ領域内の特定座標(x、y)における積算値として付与した前記サブ領域積算値積分画像を生成するようにすることができる。これによって、サブ領域積算値積分画像を生成するのにかかる計算時間を短縮することができる。 The step of generating the sub-region integrated value integrated image by the sub-region integrated value integrated image generating unit according to the present invention is adjacent to the sub-region when the sub-region is set at each position in the processing target image. The sub-region integrated value given as an integrated value at the specific coordinates (x, y) in the sub-region by calculating the sum value for the sub-region using the total value already calculated for the sub-region An integral image can be generated. As a result, the calculation time required to generate the sub-region integrated value integrated image can be shortened.

本発明に係る画像処理方法は、積分画像生成手段が、前記算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、前記原点と座標(x、y)を対角とする矩形領域内の前記範囲に属する特徴値の頻度値を、座標(x、y)における頻度値として、各座標について算出し、各画素の前記頻度値を表わす積分画像を各々生成するステップを更に含み、前記サブ領域積算値画像生成手段が前記サブ領域積算値画像を生成するステップは、前記生成された前記特徴値の各範囲に対する前記積分画像に基づいて、前記特徴値の各範囲に対する前記サブ領域積算値画像を生成することができる。これによって、サブ領域積算値積分画像及びサブ領域積算値積分画像を生成するのにかかる計算時間を短縮することができる。 In the image processing method according to the present invention, the integral image generation unit diagonally sets the origin and the coordinates (x, y) for each range of the feature value based on the calculated feature value of each pixel. Calculating a frequency value of feature values belonging to the range in the rectangular area as a frequency value at coordinates (x, y) for each coordinate, and generating an integral image representing the frequency value of each pixel, respectively. Further, the step of generating the sub-region integrated value image generation means by the sub-region integrated value image generating means , based on the integrated image for each of the generated feature value ranges, for each range of the feature values the subregion integrated value image can Rukoto forming raw. As a result, the calculation time required to generate the sub-region integrated value integrated image and the sub-region integrated value integrated image can be shortened.

本発明に係るプログラムは、コンピュータを、上記の画像処理装置の各手段として機能させるためのプログラムである。   The program according to the present invention is a program for causing a computer to function as each unit of the image processing apparatus.

以上説明したように、本発明の画像処理装置、方法、及びプログラムによれば、特徴値の各範囲に対して、サブ領域内の画素の特徴値の頻度値を付与したサブ領域積算値画像と、サブ領域内の特定座標(x、y)におけるサブ領域積算値画像の画素値と、特定座標(x、y)に対してサブ領域の大きさのn倍だけ離れ、かつ、当該座標より小さい座標におけるサブ領域積算値画像の画素値の各々と、を総和した総和値、又はサブ領域内の特定座標(x、y)におけるサブ領域積算値画像の画素値に対して所定の算術演算を施した値と、特定座標(x、y)に対してサブ領域の大きさのn倍だけ離れ、かつ、当該座標より小さい座標におけるサブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、積算値として付与したサブ領域積算値積分画像と生成することにより、サブウィンドウが複数のサブ領域からなる場合に、サブ領域毎に特徴値のヒストグラムを高速に算出すると共に、サブ領域における特徴値の積算値に算術演算を施した値を複数のサブ領域に渡って総和した値を高速に算出することができる、という効果が得られる。   As described above, according to the image processing apparatus, method, and program of the present invention, the sub-region integrated value image in which the frequency value of the feature value of the pixel in the sub-region is assigned to each feature value range, The pixel value of the sub-region integrated value image at specific coordinates (x, y) in the sub-region is separated from the specific coordinates (x, y) by n times the size of the sub-region and smaller than the coordinates. A predetermined arithmetic operation is performed on the sum value obtained by summing the pixel values of the sub-region integrated value image at the coordinates or the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub region. And a predetermined arithmetic operation for each pixel value of the sub-region integrated value image at a coordinate smaller than the coordinate and smaller than the specific region (x, y) by n times the size of the sub-region. The total value obtained by summing each of the values subjected to By generating a sub-region integrated value integrated image given as an integrated value, when the sub-window is composed of a plurality of sub-regions, a feature value histogram is calculated at a high speed for each sub-region, and the feature values in the sub-region are integrated. An effect is obtained that a value obtained by performing arithmetic operation on the value over a plurality of sub-regions can be calculated at high speed.

サブウィンドウ及びサブ領域を説明するための図である。It is a figure for demonstrating a subwindow and a sub area | region. 本発明の実施の形態に係る画像処理装置の構成を示す概略図である。1 is a schematic diagram illustrating a configuration of an image processing apparatus according to an embodiment of the present invention. 本発明の実施の形態に係る画像処理装置におけるヒストグラム算出処理ルーチンの内容を示すフローチャートである。It is a flowchart which shows the content of the histogram calculation process routine in the image processing apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理装置におけるサブ領域積算値画像及びサブ領域積算値成分画像の作成処理ルーチンの内容を示すフローチャートである。It is a flowchart which shows the content of the creation process routine of a sub area | region integrated value image and a sub area | region integrated value component image in the image processing apparatus which concerns on embodiment of this invention. 各ビン別のサブ領域積算値画像及びサブ領域積算値を作成する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which produces the sub area | region integrated value image and sub area | region integrated value for every bin. 積分画像上のサブ領域を示す図である。It is a figure which shows the sub area | region on an integral image. サブ領域内の特徴値の積算値及び特徴値の積算値の2乗和を付与する位置を説明するための図である。It is a figure for demonstrating the position which provides the square sum of the integrated value of the feature value in a sub-region, and the integrated value of a feature value. 特徴値の積算値の2乗和を算出する方法を説明するための図である。It is a figure for demonstrating the method of calculating the square sum of the integrated value of a feature value. 本発明の実施の形態に係る画像処理装置におけるヒストグラム作成処理ルーチンの内容を示すフローチャートである。It is a flowchart which shows the content of the histogram creation process routine in the image processing apparatus which concerns on embodiment of this invention. サブ領域積算値積分画像からサブ領域の積算値の2乗和を算出する方法を説明するための図である。It is a figure for demonstrating the method of calculating the square sum of the integrated value of a sub area | region from a sub area | region integrated value integrated image. 検索対象画像及びテンプレート画像の例を示す図である。It is a figure which shows the example of a search object image and a template image. 特徴量を抽出したい領域を設定する例を示す図である。It is a figure which shows the example which sets the area | region which wants to extract a feature-value.

以下、図面を参照して本発明の実施の形態を詳細に説明する。なお、サブウィンドウが複数のサブ領域からなり、検索処理時に用いる類似尺度として正規化相関を用いるために、左記正規化相関の計算に必要な、サブ領域毎のヒストグラムの構成要素となる特徴値の積算値を付与したサブ領域積算値画像を作成すると共に、特徴値の積算値の2乗値の総和値を付与したサブ領域積算値積分画像を作成する画像処理装置に本発明を適用した場合を例に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Since the sub-window is composed of a plurality of sub-regions and the normalized correlation is used as the similarity measure used in the search process, the integration of the feature values that are components of the histogram for each sub-region required for the calculation of the normalized correlation shown on the left An example in which the present invention is applied to an image processing apparatus that creates a sub-region integrated value image to which a value is added and a sub-region integrated value integrated image to which a sum of square values of feature values is added Explained.

<システム構成>
図2に示すように、本発明の実施の形態に係る画像処理装置100は、検索対象画像内のサブウィンドウからヒストグラムを算出する。この画像処理装置100は、CPUと、RAMと、後述するヒストグラム算出処理ルーチンを実行するためのプログラムを記憶したROMとを備えたコンピュータで構成され、機能的には次に示すように構成されている。画像処理装置100は、入力部10と、特徴抽出部20と、ヒストグラム作成部30と、出力部40とを備えている。なお、特徴抽出部20は、特徴値算出手段の一例であり、ヒストグラム作成部30は、サブ領域積算値画像生成手段、サブ領域積算値積分画像生成手段、ヒストグラム作成手段、総和値算出手段、及び積算値画像生成手段の一例である。
<System configuration>
As shown in FIG. 2, the image processing apparatus 100 according to the embodiment of the present invention calculates a histogram from the subwindow in the search target image. The image processing apparatus 100 is configured by a computer including a CPU, a RAM, and a ROM that stores a program for executing a histogram calculation processing routine, which will be described later, and is functionally configured as follows. Yes. The image processing apparatus 100 includes an input unit 10, a feature extraction unit 20, a histogram creation unit 30, and an output unit 40. The feature extracting unit 20 is an example of a feature value calculating unit, and the histogram creating unit 30 is a sub region integrated value image generating unit, a sub region integrated value integrated image generating unit, a histogram generating unit, a total value calculating unit, and It is an example of an integrated value image generation means.

入力部10には、入力された検索対象画像を受け付ける。   The input unit 10 receives the input search target image.

特徴抽出部20は、画像の類似性を測る為に用いる特徴として、検索対象画像から各画素について色情報や輝度値やエッジ等の特徴値を抽出する。例えば、色情報の場合、特徴値として、RGB別に、画素値(0−255)を適当な間隔でサンプリングした値を用いる。輝度値の場合も、特徴値として、画素の値(0−255)を適当な間隔でサンプリングした値を用いる。エッジの場合、特徴値として、フィルタ処理等で得られたエッジの角度を適当な間隔でサンプリングした角度別にエッジ強度を表わす値を用いる。抽出された特徴値は、ヒストグラム作成部30に出力される。   The feature extraction unit 20 extracts feature values such as color information, luminance values, and edges for each pixel from the search target image as features used to measure the similarity of images. For example, in the case of color information, a value obtained by sampling pixel values (0 to 255) at appropriate intervals for each RGB is used as the feature value. Also in the case of the luminance value, a value obtained by sampling the pixel value (0-255) at an appropriate interval is used as the feature value. In the case of an edge, a value representing edge strength is used as a feature value for each angle obtained by sampling the edge angle obtained by filtering or the like at an appropriate interval. The extracted feature value is output to the histogram creation unit 30.

ヒストグラム作成部30は、本発明の主要部であり、検索対象画像上で位置を1画素ずつ移動させながら、特徴抽出部20から出力された特徴値から、各位置のサブ領域内の画素値(特徴値)のヒストグラム、及び左記ヒストグラムに算術演算を施した値を複数のサブ領域について総和した値を算出し、各位置に格納したサブ領域積算値画像及びサブ領域積算値積分画像を生成する。次に、ヒストグラム作成部30は、検索のリクエストに応じてサブウィンドウが指定された場合、各ビン別に、上記サブ領域積算値画像及びサブ領域積算値積分画像上に設定したサブウィンドウ及び当該サブウィンドウを複数の領域に分割したサブ領域から、必要なヒストグラムの値、及びヒストグラムの値に算術演算を施した値を総和した値を算出し、出力部40へ出力する。なお、サブウィンドウをサブ領域に分割したときの分割数は、予め設定されているものとする。   The histogram creation unit 30 is a main part of the present invention. While moving the position one pixel at a time on the search target image, the histogram creation unit 30 calculates the pixel values (in the sub-regions at each position) from the feature values output from the feature extraction unit 20. (Feature value) histogram and values obtained by performing arithmetic operations on the left histogram are summed for a plurality of sub-regions, and a sub-region integrated value image and a sub-region integrated value integrated image stored at each position are generated. Next, when a sub-window is designated in response to a search request, the histogram creation unit 30 sets a plurality of sub-windows set on the sub-region integrated value image and the sub-region integrated value integrated image for each bin, and a plurality of the sub-windows. From the sub-region divided into regions, a necessary histogram value and a sum of values obtained by performing arithmetic operations on the histogram value are calculated and output to the output unit 40. Note that the number of divisions when the subwindow is divided into subregions is set in advance.

出力部40は、ヒストグラム作成部30により作成されたヒストグラム等を出力する。すなわち、出力部40は、サブウィンドウから抽出されたビン毎のヒストグラムの値、及びヒストグラムの値に算術演算を施した値をビン別に総和した値を出力する。   The output unit 40 outputs the histogram and the like created by the histogram creation unit 30. That is, the output unit 40 outputs a histogram value for each bin extracted from the sub-window and a value obtained by summing the values obtained by performing arithmetic operations on the histogram values for each bin.

<画像処理装置の作用>
次に、本実施の形態に係る画像処理装置100の作用について説明する。まず、検索対象画像が画像処理装置100に入力された後、画像処理装置100によって、図3に示すヒストグラム算出処理ルーチンが実行される。
<Operation of image processing apparatus>
Next, the operation of the image processing apparatus 100 according to the present embodiment will be described. First, after the search target image is input to the image processing apparatus 100, the image processing apparatus 100 executes a histogram calculation processing routine shown in FIG.

まず、ステップS1において、入力され検索対象画像を取得し、ステップS2において、検索等の類似性の評価に用いる情報となる特徴値を、検索対象画像の各画素について抽出する。   First, in step S1, an input search target image is acquired, and in step S2, feature values serving as information used for similarity evaluation such as search are extracted for each pixel of the search target image.

そして、ステップS3において、上記ステップS2で得られた各画素の特徴値から、各ビン別に積分画像を生成する。またビン別の積分画像を用いて、サブ領域内の当該ビンにおけるヒストグラムの値(当該ビンに属する特徴の頻度値)を算出し、左記ヒストグラムの値を各サブ領域の位置に付与したサブ領域積算値画像を作成する。また、当該サブ領域とそのn倍だけ離れた画素における左記ヒストグラムの値の2乗値を総和した値を算出し、左記算出値を各サブ領域の位置に付与したサブ領域積算値積分画像を作成する。   In step S3, an integrated image is generated for each bin from the feature value of each pixel obtained in step S2. Also, using the integrated image for each bin, the histogram value (frequency value of the feature belonging to the bin) in the bin in the sub-region is calculated, and the sub-region integration in which the left-hand histogram value is assigned to the position of each sub-region Create a value image. Also, the sum of the square values of the left histogram values at the pixel separated from the sub area by n times is calculated, and a sub area integrated value integrated image is created by assigning the calculated values to the position of each sub area. To do.

そして、検索のリクエストに応じてテンプレート画像が入力されると、ステップS4において、各検索位置においてテンプレート画像に相当する大きさのサブウィンドウをサブ領域積算値積分画像上に設定し、サブウィンドウを分割して得られる部分領域であるサブ領域をサブ領域積算値画像上に設定する。   When a template image is input in response to a search request, in step S4, a sub-window having a size corresponding to the template image is set on the sub-region integrated value integrated image at each search position, and the sub-window is divided. A sub-region which is a partial region to be obtained is set on the sub-region integrated value image.

次のステップS5では、設定されたサブウィンドウ及びサブ領域から、ヒストグラムを作成すると共に、ヒストグラムの値に算術演算を施した値の総和値を算出する。そして、ステップS6において、上記ステップS5で作成されたサブ領域毎のヒストグラム、及びサブウィンドウに対する上記の総和値を出力する。   In the next step S5, a histogram is created from the set subwindow and subregion, and a total value of values obtained by performing arithmetic operations on the values of the histogram is calculated. In step S6, the histogram for each sub-region created in step S5 and the total value for the sub-window are output.

次のステップS7において、サブウィンドウが全ての検索位置に走査されたか否かを判定し、全ての検索位置に走査されていない場合には、上記ステップS4へ戻り、サブウィンドウを次の検索位置に設定する。一方、サブウィンドウが全ての検索位置に走査された場合には、ヒストグラム算出処理ルーチンを終了する。   In the next step S7, it is determined whether or not the sub-window has been scanned to all the search positions. If all the search positions have not been scanned, the process returns to step S4 to set the sub-window to the next search position. . On the other hand, if the sub-window has been scanned to all search positions, the histogram calculation processing routine is terminated.

上記ステップS3は、図4に示すサブ領域積算値画像及びサブ領域積算値積分画像の作成処理ルーチンによって実現される。   Step S3 is realized by the processing routine for creating the sub-region integrated value image and the sub-region integrated value integrated image shown in FIG.

ステップS3−1において、検索対象画像から抽出された特徴値から、ビン別に、当該ビンに属する特徴値を各画素について読み込む。そして、ステップS3−2において、各ビン別に読み込んだ特徴値から、各ビン別の積分画像を作成する。   In step S3-1, feature values belonging to the bin are read for each pixel from the feature values extracted from the search target image for each bin. In step S3-2, an integrated image for each bin is created from the feature values read for each bin.

ここで、積分画像を作成する方法について説明する。座標(x,y)においてあるビンに属する特徴値の有無を示す値をi(x,y)、当該ビンに対する積分画像の座標(x,y)の値をii(x,y)とすると、ii(x,y)は、x‘≦x及びy’≦yの各画素(原点と(x、y)で形成される矩形領域内の各画素)から抽出される、当該ビンに属する特徴の頻度値(当該ビンに属する特徴値がいくつあるかを示す値)であり、以下の(1)式で定義される値となる。   Here, a method for creating an integral image will be described. Assuming that a value indicating the presence or absence of a feature value belonging to a certain bin at coordinates (x, y) is i (x, y) and a value of the coordinate (x, y) of the integral image for the bin is ii (x, y), ii (x, y) is extracted from each pixel of x ′ ≦ x and y ′ ≦ y (each pixel in a rectangular area formed by the origin and (x, y)), and is a feature belonging to the bin It is a frequency value (a value indicating how many characteristic values belong to the bin), and is a value defined by the following equation (1).

上記(1)式で表される値は、画像の原点と処理対象の座標(x、y)とを対角とする矩形領域内における、当該ビンに属する特徴値の頻度値(当該ビンにおけるヒストグラムの値)となる。   The value represented by the above equation (1) is the frequency value of the characteristic value belonging to the bin (histogram in the bin) in a rectangular area whose diagonal is the origin of the image and the coordinates (x, y) of the processing target. Value).

上記(1)式で表されるii(x,y)を、以下の(2)式を用いることにより、高速に算出する事が可能である。   By using the following equation (2), ii (x, y) represented by the above equation (1) can be calculated at high speed.

上記(2)式では、対象の画素に隣接する画素について既に算出された、当該ビンに属する特徴値の頻度値を用いて、再帰的にii(x,y)を算出している。   In the above equation (2), ii (x, y) is recursively calculated using the frequency value of the feature value belonging to the bin already calculated for the pixel adjacent to the target pixel.

上記算出を全ての座標(x,y)において実施して、画素(x,y)に付与することで、積分画像を作成する。また上記処理を全てのビンにおいて実施する。ここで、検索対象画像内で積分画像を求める座標(x,y)は、x,yの値が共に最小となる位置(原点)から開始して、1画素ずつ順に移動(xが増加する方向に移動させた後、yが増加する方向に移動)させることを前提としている。   The above calculation is performed at all coordinates (x, y) and given to the pixel (x, y), thereby creating an integral image. The above processing is performed in all bins. Here, the coordinates (x, y) for obtaining the integral image within the search target image start from a position (origin) where both the values of x and y are minimum (in the direction in which x increases). It is assumed that y is moved in the direction in which y increases).

次のステップS3−3において、上記ステップS3−2により作成された各ビン別の積分画像を用いて、各ビン別に、サブ領域積算値画像及びサブ領域積算値積分画像を作成する。   In the next step S3-3, a sub-region integrated value image and a sub-region integrated value integrated image are generated for each bin using the integrated image for each bin generated in step S3-2.

これにより、画像処理装置100は、検索対象画像内の任意のサブ領域から、ビン別の特徴値のヒストグラムの値及びそのヒストグラムの値の2乗和を算出することができる。また、画像処理装置100は、テンプレート画像が入力されたときに、検索対象画像内に設定されたテンプレート画像と同じ大きさのサブウィンドウとテンプレート画像のそれぞれについて、算出されたビン別の特徴値のヒストグラムの値及びそのヒストグラムの値の2乗和を用いて、正規化相関を算出する。   Thereby, the image processing apparatus 100 can calculate the histogram value of the bin-specific feature value and the square sum of the histogram value from an arbitrary sub-region in the search target image. Further, when a template image is input, the image processing apparatus 100 calculates a histogram of feature values for each bin calculated for each of the sub window and the template image having the same size as the template image set in the search target image. The normalized correlation is calculated using the square sum of the values of and the histogram.

例えば、検索対象画像の座標(c,d)における正規化相関NCC(c,d)は、以下の式で表わされる。   For example, the normalized correlation NCC (c, d) at the coordinates (c, d) of the search target image is expressed by the following equation.

ここで、a(u,v)はテンプレート画像におけるu番目のサブ領域のヒストグラムのv番目のビンの値である。ここでのサブ領域は、テンプレート画像を分割して得られる各部分領域を指す。b(u,v)は、検索対象画像に設定されたサブウィンドウにおけるu番目のサブ領域のヒストグラムのv番目のビンの値である。Uは、サブ領域の数であり、Vは、各サブ領域毎に作成されるヒストグラムのビンの数である。なお、以下の説明では検索対象画像についてのヒストグラム及びヒストグラムの2乗和の計算を例に説明を行うが、テンプレート画像についてのヒストグラム及びヒストグラムの2乗和も同じ要領で計算することができる。   Here, a (u, v) is the value of the vth bin of the histogram of the uth sub-region in the template image. The sub-area here refers to each partial area obtained by dividing the template image. b (u, v) is the value of the vth bin in the histogram of the uth sub-region in the subwindow set in the search target image. U is the number of sub-regions, and V is the number of histogram bins created for each sub-region. In the following description, the calculation of the histogram and the square sum of the histogram for the search target image will be described as an example. However, the histogram and the square sum of the histogram for the template image can be calculated in the same manner.

上記ステップS3−3は、図5に示す処理ルーチンによって実現される。   The step S3-3 is realized by the processing routine shown in FIG.

ステップS3−3−1において、処理対象のビンを設定し、ステップS3−3−2において、処理対象のビンに対する積分画像を読み込む。そして、ステップS3−3−3において、上記ステップS3−3−2で読み込んだ積分画像上のある位置に、サブ領域の大きさを持つ4隅を設定し、処理対象のサブ領域とする。処理対象のサブ領域の初期位置としては、例えば、サブ領域の1つの隅が、積分画像の原点となるように設定する。   In step S3-3-1, a processing target bin is set, and in step S3-3-2, an integral image for the processing target bin is read. In step S3-3-3, four corners having the size of the sub-region are set at a certain position on the integrated image read in step S3-3-2, and set as a sub-region to be processed. As the initial position of the sub-region to be processed, for example, one corner of the sub-region is set to be the origin of the integrated image.

次のステップS3−3−4では、処理対象のビンに対する積分画像上の、処理対象のサブ領域から、処理対象のビンに属する特徴値の頻度値(ヒストグラムの値)を算出する。   In the next step S3-3-4, the frequency value (histogram value) of the feature values belonging to the processing target bin is calculated from the processing target sub-region on the integral image for the processing target bin.

ここで、積分画像から、処理対象のサブ領域方形内の当該ビンに属するヒストグラムの値を算出する方法について図6を用いて説明する。サブ領域(x’,y’)の4隅がA(x,y)、B(x,y)、C(x,y)、D(x,y)の4点で定義されているとする。ここで、A(x)<x’≦B(x)、A(y)<y’≦C(y)、A(x)=C(x)、A(y)=B(y)、B(x)=D(x)、及びC(y)=D(y)である。処理対象のサブ領域内のあるビンに属するヒストグラムの値Σi(x‘,y’)は、以下の(3)式から算出される。   Here, a method for calculating the value of the histogram belonging to the bin in the sub-region square to be processed from the integral image will be described with reference to FIG. Assume that the four corners of the sub-region (x ′, y ′) are defined by four points of A (x, y), B (x, y), C (x, y), and D (x, y). . Here, A (x) <x ′ ≦ B (x), A (y) <y ′ ≦ C (y), A (x) = C (x), A (y) = B (y), B (x) = D (x) and C (y) = D (y). The histogram value Σi (x ′, y ′) belonging to a certain bin in the sub-region to be processed is calculated from the following equation (3).

上記ステップS3−3−4で積分画像から算出されたサブ領域内の処理対象のビンに属するヒストグラムの値をs(x,y)とすると、ステップS3−3−5において、算出されたヒストグラムの値s(x,y)を、処理対象のビンに対するサブ領域積算値画像におけるサブ領域の位置を指す座標に付与する。例えば、図7で示すようにサブ領域の左上隅の座標に付与する。   Assuming that the value of the histogram belonging to the bin to be processed in the sub-region calculated from the integral image in step S3-3-4 is s (x, y), in step S3-3-5 The value s (x, y) is assigned to the coordinates indicating the position of the sub area in the sub area integrated value image for the bin to be processed. For example, it is given to the coordinates of the upper left corner of the sub-region as shown in FIG.

次のステップS3−3−6では、積分画像から算出されたサブ領域内のヒストグラムの値s(x,y)を用いて、サブ領域内の各画素のヒストグラムの値の2乗値s2(x,y)を、以下の(4)式で算出する。   In the next step S3-3-6, using the histogram value s (x, y) in the sub-region calculated from the integral image, the square value s2 (x2) of the histogram value of each pixel in the sub-region. , y) is calculated by the following equation (4).

そして、ステップS3−3−7において、着目している座標(x,y)からサブ領域の大きさの自然数倍に相当する距離だけ離れた座標(x−n*w, y−m*h)(ただし、サブ領域の大きさをw×hとし、n及びmは自然数とする)で算出された当該座標(x−n*w, y−m*h)におけるサブ領域内のヒストグラムの値の2乗値であるs2(x−n*w,y−n*h)を更に積算して、サブ領域間のヒストグラムの値の2乗値の総和値を算出する。具体的には、座標(x,y)において算出されたサブ領域内のヒストグラムの値の2乗値s2(x,y)に対し、x’≦x及びy’≦yで且つサブ領域の大きさ(w×h)の倍数に相当する距離が離れた座標で算出されたサブ領域のヒストグラム値の2乗和から構成される、サブ領域積算値積分画像における座標(x,y)の値を、ss2(x,y)とすると、ss2(x,y)は以下の(5)式で定義される値となる。   In step S3-3-7, coordinates (xn * w, ym * h) separated from the coordinate (x, y) of interest by a distance corresponding to a natural number multiple of the size of the sub-region. ) (Where the size of the sub-region is w × h, and n and m are natural numbers), the value of the histogram in the sub-region at the coordinates (xn * w, ym * h) S2 (x−n * w, yn * h) that is the square value of is further integrated to calculate the sum of the square values of the histogram values between the sub-regions. Specifically, with respect to the square value s2 (x, y) of the histogram value in the sub area calculated at the coordinates (x, y), x ′ ≦ x and y ′ ≦ y and the size of the sub area The value of the coordinate (x, y) in the sub-region integrated value integrated image, which is composed of the sum of squares of the histogram values of the sub-region calculated with the coordinates corresponding to multiples of (w × h) apart, is , Ss2 (x, y), ss2 (x, y) is a value defined by the following equation (5).

上記(5)式で表される値は、図8において黒色で示す画素におけるヒストグラムの値の2乗値を足し合わせた値となる。ここで、図8の例では、w=3,h=3である。   The value represented by the above equation (5) is a value obtained by adding the square values of the histogram values in the pixels shown in black in FIG. Here, in the example of FIG. 8, w = 3 and h = 3.

サブ領域積算値の2乗和ss2(x,y)を、以下の(6)式を用いることにより、高速に算出することが可能である。   The square sum ss2 (x, y) of the sub-region integrated values can be calculated at high speed by using the following equation (6).

上記(6)式では、処理対象のサブ領域に隣接するサブ領域について既に算出された、当該ビンに属するヒストグラムの値の2乗値の総和値(2乗和)を用いて、再帰的にss2(x,y)を算出している。   In the above equation (6), ss2 is recursively using the total value (square sum) of the square values of the histogram values belonging to the bin already calculated for the sub region adjacent to the sub region to be processed. (x, y) is calculated.

ステップS3−3−8では、上記ステップS3−3−7で算出された値ss2(x、y)を、処理対象のビンに対するサブ領域積算値積分画像における着目座標(サブ領域の位置)に付与する。処理対象のサブ領域を設定する位置は、x,yの値が共に最小となる位置(原点)から開始して、1画素ずつ順に移動(xが増加する方向に移動させた後、yが増加する方向に移動)させていくことを前提としている。   In step S3-3-8, the value ss2 (x, y) calculated in step S3-3-7 is assigned to the target coordinate (sub-region position) in the sub-region integrated value integrated image for the bin to be processed. To do. The position where the sub-region to be processed is set starts from the position (origin) where the values of x and y are both minimum (moving in the direction in which x increases after moving one pixel at a time) It is assumed that it will be moved in the direction of

そして、ステップS3−3−9では、処理対象のサブ領域を、積分画像上の全ての位置に走査したか否かを判定し、全ての位置に走査していない場合には、上記ステップS3−3−3に戻り、次の位置に、処理対象のサブ領域を設定する。一方、処理対象のサブ領域を積分画像上の全ての位置に走査した場合には、ステップS3−3−10に移行する。   In step S3-3-9, it is determined whether or not the sub-region to be processed has been scanned at all positions on the integral image. Returning to 3-3, the sub-region to be processed is set at the next position. On the other hand, when the processing target sub-region has been scanned at all positions on the integral image, the process proceeds to step S3-3-10.

ステップS3−3−10では、全てのビンについて、上記ステップS3−3−1〜S3−3−9の処理を実行したか否かを判定し、全てのビンについて上記処理を実行していない場合には、上記ステップS3−3−1に戻り、処理を実行していないビンを、処理対象のビンに設定する。一方、全てのビンについて、上記ステップS3−3−1〜S3−3−9の処理を実行した場合には、本処理ルーチンを終了する。   In step S3-3-10, it is determined whether or not the processing in steps S3-3-1 to S3-3-9 has been executed for all bins, and the above processing has not been executed for all bins. In step S3-3-1, the bin that has not been processed is set as a bin to be processed. On the other hand, when the processes of steps S3-3-1 to S3-3-9 have been executed for all bins, this process routine is terminated.

上記の処理ルーチンが実行されると、各ビン別に、全ての(x,y)において、サブ領域のヒストグラムの値が算出されて、ビン別のサブ領域積算値画像が作成される。また、各ビン別に、全ての(x,y)において、サブ領域間のヒストグラムの値の2乗和が算出されて、ビン別のサブ領域積算値積分画像が作成される。   When the above processing routine is executed, the value of the histogram of the sub-region is calculated for each (x, y) for each bin, and a sub-region integrated value image for each bin is created. For each (x, y) for each bin, the sum of squares of the histogram values between sub-regions is calculated, and a sub-region integrated value integrated image for each bin is created.

また、ステップS5は、図9に示すヒストグラム作成処理ルーチンによって実現される。上記ステップS4で設定された検索位置(画素位置)のサブウィンドウ及びサブ領域についてヒストグラムが作成される。例えば、サブウィンドウの左上隅を検索位置とした場合、上記図1に示すように、サブウィンドウ及びサブ領域が設定される。   Step S5 is realized by the histogram creation processing routine shown in FIG. A histogram is created for the subwindow and subregion of the search position (pixel position) set in step S4. For example, when the upper left corner of the sub window is set as the search position, the sub window and the sub area are set as shown in FIG.

ステップS5−1では、各ビン別に、当該ビンに対するサブ領域積算値画像から、設定されたサブ領域の位置に付与された積算値を読み込み、当該サブ領域のヒストグラムの、当該ビンに対する値とする。そして、ステップS5−2において、各ビン別に、サブウィンドウの4隅の座標を用いて、当該ビンに対するサブ領域積算値積分画像から、サブウィンドウ内に含まれる複数のサブ領域のヒストグラムの値の2乗和を読み込むことにより、各ビン別に、サブ領域のヒストグラムの値の2乗和を算出する。   In step S5-1, for each bin, the integrated value assigned to the position of the set sub-region is read from the sub-region integrated value image for that bin, and is set as the value for that bin in the histogram of the sub-region. In step S5-2, for each bin, using the coordinates of the four corners of the sub-window, the sum of squares of the histogram values of the plurality of sub-regions included in the sub-window from the sub-region integrated value integration image for that bin. , The square sum of the values of the histogram of the sub-region is calculated for each bin.

ここで、図10を用いて、サブ領域積算値積分画像から、各ビン別にサブ領域のヒストグラムの値の2乗和を算出する方法を説明する。サブウィンドウ4隅がP(x,y)、Q(x,y)、R(x,y)、S(x,y)の4点で定義されているとする。ここで、P(x)<x”≦Q(x)、P(y)<y”≦R(y)、P(x)=R(x)、P(y)=Q(y)、Q(x)=S(x)、及びR(y)=S(y)、x”はサブウィンドウ内の画素のx軸の座標値、y”はサブウィンドウ内の画素のy軸の座標値である。検索位置(x”,y”)での各ビン別のサブ領域の積算値の2乗和Σs(x”,y”)は、以下の(7)式から算出される。   Here, a method of calculating the sum of squares of the histogram values of the sub-regions for each bin from the sub-region integrated value integrated image will be described with reference to FIG. Assume that the four corners of the subwindow are defined by four points of P (x, y), Q (x, y), R (x, y), and S (x, y). Here, P (x) <x ″ ≦ Q (x), P (y) <y ″ ≦ R (y), P (x) = R (x), P (y) = Q (y), Q (x) = S (x) and R (y) = S (y), x ″ is the x-axis coordinate value of the pixel in the subwindow, and y ″ is the y-axis coordinate value of the pixel in the subwindow. The sum of squares Σs (x ″, y ″) of the integrated values of the sub-regions for each bin at the search position (x ″, y ″) is calculated from the following equation (7).

そして、ステップS5−3に基づいて、上記ステップS5−1で読み込んだ各ビン別のサブ領域のヒストグラムの値に基づいて、サブ領域毎のヒストグラムを作成する。また、上記ステップS5−2で算出した各ビン別のサブ領域のヒストグラムの値の2乗和を、各ビン別のヒストグラムの値の2乗和とし、ヒストグラム作成処理ルーチンを終了する。   Based on step S5-3, a histogram for each sub-region is created based on the histogram value of the sub-region for each bin read in step S5-1. Further, the sum of squares of the histogram values of each bin sub-region calculated in step S5-2 is set as the sum of squares of the histogram values of each bin, and the histogram creation processing routine is terminated.

上記に説明したように本発明の実施の形態に係る画像処理装置100は、検索対象画像から特徴抽出部20で抽出された各画素の特徴値に基づいて、ヒストグラム作成部30によって、各ビン別にサブ領域積算値画像及びサブ領域積算積分画像を作成する。そして、検索処理が実行される場合、各検索位置において、各ビン別にサブ領域積算画像を用いてサブ領域のヒストグラムの構成要素(ヒストグラムのビン別の値)を取得し、検索位置における全ビンのヒストグラムを作成する。また各ビン別にサブ領域積算積分画像を用いてサブウィンドウ内の全サブ領域のヒストグラムの値の2乗和を算出することで、検索位置におけるヒストグラムの2乗和を求める。   As described above, the image processing apparatus 100 according to the embodiment of the present invention uses the histogram creation unit 30 to classify each bin based on the feature value of each pixel extracted from the search target image by the feature extraction unit 20. A sub-region integrated value image and a sub-region integrated image are created. When the search process is executed, at each search position, the sub-region histogram components (values for each bin of the histogram) are obtained using the sub-region integrated image for each bin, and all bins at the search position are obtained. Create a histogram. In addition, the sum of squares of histograms at the search position is obtained by calculating the sum of squares of histogram values of all sub-regions in the sub-window using the sub-region integrated integral image for each bin.

これにより、本発明の実施の形態に係る画像処理装置100は、検索位置毎にサブ領域の積算値の算出及び2乗値の計算及び積算を繰り返すことなく、検索位置において設定されたサブウィンドウから高速にヒストグラムやヒストグラムの値の2乗和を求めることが可能となる。   As a result, the image processing apparatus 100 according to the embodiment of the present invention does not repeat the calculation of the integrated value of the sub-region and the calculation and integration of the square value for each search position, and the high-speed operation from the sub-window set at the search position. It is possible to obtain the histogram and the square sum of the histogram values.

次に、上記の実施の形態に係る手法を適用して実験を行った結果について説明する。ここでは、上記の実施の形態に係る手法を適用して、類似性を判定する尺度として正規化相関を用いると共に、図11の検索対象画像及びその中の一部を抜き出して作成したテンプレート画像を用いて、検索を実行した。比較手法として、全探索法及びIntegral histogram法を適用して、同様に検索を実行した。また、特徴には各RGB値を4個、8個、16個、32個、43個、64個に量子化した値を用いた。従って、ヒストグラムのビン数は各々12、24、48、96、129、192となる。サブウィンドウ内のサブ領域の数は8×8=64とした。実験結果を以下の表1に示す。各数値は検索の実行時間[ms]を表す。   Next, the results of experiments performed by applying the method according to the above embodiment will be described. Here, the method according to the above embodiment is applied, normalized correlation is used as a scale for determining similarity, and the search target image in FIG. 11 and a template image created by extracting a part thereof are extracted. Used to perform the search. As a comparison method, a full search method and an Integral histogram method were applied, and the search was performed in the same manner. Further, as the features, values obtained by quantizing each RGB value into 4, 8, 16, 32, 43, and 64 are used. Accordingly, the bin numbers of the histogram are 12, 24, 48, 96, 129, and 192, respectively. The number of sub-regions in the sub-window is 8 × 8 = 64. The experimental results are shown in Table 1 below. Each numerical value represents the search execution time [ms].

上記の表1により、全探索法及びIntegral histogram法に対して、上記の実施の形態にかかる手法を用いた検索では、非常に高速な検索が実現出来ており、上記の実施の形態にかかる手法の有効性が分かった。   According to Table 1 above, the search using the technique according to the above embodiment for the full search method and the integral histogram method can realize a very high-speed search, and the technique according to the above embodiment. The effectiveness of was understood.

以上説明したように、本実施の形態に係る画像処理装置によれば、各ビンに対して、サブ領域内の画素の特徴値の積算値を付与したサブ領域積算値画像と、原点とサブ領域とを対角とする矩形領域を分割して得られるサブ領域の各々における、サブ領域の特徴値の積算値の2乗和を、積算値として付与したサブ領域積算値積分画像と生成することにより、サブウィンドウが複数のサブ領域からなる場合に、サブ領域毎に特徴値のヒストグラムを高速に算出すると共に、各サブ領域におけるヒスグラムの値の2乗和を高速に算出することができる。   As described above, according to the image processing apparatus of the present embodiment, the sub-region integrated value image in which the integrated value of the feature value of the pixel in the sub-region is assigned to each bin, the origin, and the sub-region. By generating a square sum of the integrated values of the feature values of the sub-regions in each of the sub-regions obtained by dividing the rectangular region with the diagonal as a sub-region integrated value integrated image provided as an integrated value When the sub-window is composed of a plurality of sub-regions, a histogram of feature values can be calculated at high speed for each sub-region, and the square sum of the histogram values in each sub-region can be calculated at high speed.

なお、本発明は、上述した実施形態に限定されるものではなく、この発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。   Note that the present invention is not limited to the above-described embodiment, and various modifications and applications are possible without departing from the gist of the present invention.

例えば、特徴として色情報、輝度値、エッジ情報を用いたが、当然ながら他の特徴も使用可能であり、本発明による手法は特徴の種別に依存せずに利用可能である。   For example, although color information, luminance values, and edge information are used as features, other features can naturally be used, and the method according to the present invention can be used without depending on the type of feature.

また、上記の実施の形態では、検索位置としてサブウィンドウの左上隅の座標を設定したが、検索処理を通して全サブウィンドウに共通した設定であれば、付与する座標はサブウィンドウ内の任意の位置に設定可能である。   In the above embodiment, the coordinates of the upper left corner of the sub-window are set as the search position. However, if the setting is common to all the sub-windows through the search process, the given coordinates can be set at any position in the sub-window. is there.

また、上記の実施の形態では、サブ領域の積算値をサブ領域の左上隅の座標に付与したが、全サブ領域に共通した設定であれば、付与する座標はサブ領域内の任意の位置に設定可能である。   In the above embodiment, the integrated value of the sub-region is given to the coordinates of the upper left corner of the sub-region. However, if the setting is common to all the sub-regions, the given coordinate is set at an arbitrary position in the sub-region. It can be set.

また、上記の実施の形態では、画素値の積算値を算出する際に積分画像を用いたが、当然ながら処理時間は増えるものの、都度画素値の加算処理を実行する手法も使用可能である。   In the above embodiment, the integral image is used when calculating the integrated value of the pixel values. However, although the processing time naturally increases, a method of executing the addition processing of the pixel values each time can be used.

また、上記の実施の形態では、類似尺度として正規化相関を用いた場合に必要な、サブ領域のヒストグラムの積算値を2乗した値を各画素に付与して、サブ領域積算値積分画像を作成したが、当然ながら別の類似尺度等に応じた2乗値以外の値を付与した積算画像の作成も可能である。   Further, in the above embodiment, a value obtained by squaring the integrated value of the histogram of the sub-region, which is necessary when using normalized correlation as a similarity measure, is assigned to each pixel, and the sub-region integrated value integrated image is obtained. Although created, of course, it is possible to create an integrated image to which a value other than the square value according to another similarity scale or the like is given.

また、上記の実施の形態では、サブ領域の積算値を各サブ領域の座標値に付与したが、当然ながら2乗値を用いたサブ領域積算画像と同様に、サブ領域の積算値を更に複数のサブ領域間で総和した値を付与して、サブ領域積算画像を作成し、利用する事も可能である。   Further, in the above embodiment, the integrated value of the sub-region is given to the coordinate value of each sub-region. Of course, similarly to the sub-region integrated image using the square value, a plurality of integrated values of the sub-region are further added. It is also possible to create and use a sub-region integrated image by assigning a total value between the sub-regions.

また、上記の実施の形態では、サブ領域のヒストグラムの積算値を2乗した値を積算したサブ領域積算値積分画像から、サブウィンドウ内の2乗和を算出したが、当然ながら左記サブ領域積算値積分画像を用いて、任意の個数のサブ領域からなる領域から、左記領域に含まれる2乗和を高速に算出する事も可能である。   In the above embodiment, the sum of squares in the subwindow is calculated from the subregion integrated value integrated image obtained by integrating the values obtained by squaring the integrated values of the histograms of the subregions. It is also possible to calculate the sum of squares included in the left area at high speed from an area composed of an arbitrary number of sub-areas using the integral image.

また、上記の実施の形態では、検索処理に用いるヒストグラムの作成方法について説明したが、当然ながら本発明による手法は検索処理に関わらず、処理対象領域のヒストグラムの作成が必要な処理に利用可能である。例えば、図12に示すように、複数のサブ領域からなる領域を、ヒストグラムを抽出したい領域として設定し、当該領域に関するヒストグラムやヒストグラムの値の2乗和などが必要な処理に利用可能である。   In the above embodiment, a method for creating a histogram used for search processing has been described. Naturally, the technique according to the present invention can be used for processing that requires creation of a histogram of a processing target region regardless of search processing. is there. For example, as shown in FIG. 12, a region composed of a plurality of sub-regions can be set as a region from which a histogram is desired to be extracted, and can be used for a process that requires a histogram related to the region or a square sum of histogram values.

また、上記図2における画像処理装置100が備えている入力部10、特徴抽出部20、ヒストグラム作成部30、及び出力部40という各構成は、専用のハードウェアにより実現されるものであってもよく、また、メモリおよびマイクロプロセッサにより実現させるものであってもよい。   Further, the configuration of the input unit 10, the feature extraction unit 20, the histogram creation unit 30, and the output unit 40 included in the image processing apparatus 100 in FIG. 2 may be realized by dedicated hardware. Alternatively, it may be realized by a memory and a microprocessor.

また、この各構成は、メモリおよびCPU(中央演算装置)により構成され、各構成の機能を実現するためのプログラムをメモリにロードして実行することによりその機能を実現させるものであってもよい。   In addition, each configuration may be configured by a memory and a CPU (central processing unit), and the function may be realized by loading a program for realizing the function of each configuration into the memory and executing the program. .

また、この各構成の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより、各構成による処理が実行されてもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。   In addition, a program for realizing the function of each configuration is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read and executed by a computer system, so that the processing according to each configuration is performed. May be executed. Here, the “computer system” includes an OS and hardware such as peripheral devices.

また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間の間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含むものとする。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。   Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used. The “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM and a CD-ROM, and a hard disk incorporated in a computer system. Furthermore, the “computer-readable recording medium” dynamically holds a program for a short time like a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line. In this case, a volatile memory in a computer system serving as a server or a client in that case, and a program that holds a program for a certain period of time are also included. The program may be a program for realizing a part of the functions described above, and may be a program capable of realizing the functions described above in combination with a program already recorded in a computer system.

以上、この発明の実施形態を図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes design and the like within a scope not departing from the gist of the present invention.

10 入力部
20 特徴抽出部
30 ヒストグラム作成部
40 出力部
100 画像処理装置
DESCRIPTION OF SYMBOLS 10 Input part 20 Feature extraction part 30 Histogram creation part 40 Output part 100 Image processing apparatus

Claims (10)

処理対象画像の各画素について特徴値を算出する特徴値算出手段と、
座標(x、y)が最小となる画素を原点としたとき、原点からx方向に1画素ずつ順に移動した各x座標について更にy方向に1画素ずつ順に移動することにより設定される、各座標(x、y)を着目位置とするサブ領域を設定し、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、該着目位置の前記サブ領域内における前記範囲に属する特徴値の頻度値を、前記サブ領域内の予め定めた位置の画素値として付与したサブ領域積算値画像を各々生成するサブ領域積算値画像生成手段と、
前記特徴値の各範囲に対して、前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々と、を総和した総和値、又は前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値に対して所定の算術演算を施した値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、前記サブ領域内の特定座標(x、y)における積算値として付与したサブ領域積算値積分画像を各々生成するサブ領域積算値積分画像生成手段と、
を含む画像処理装置。
Feature value calculating means for calculating a feature value for each pixel of the processing target image;
When the pixel having the smallest coordinate (x, y) is defined as the origin, each coordinate set by sequentially moving one pixel at a time in the y direction with respect to each x coordinate sequentially moved from the origin by one pixel in the x direction. A sub-region having (x, y) as the target position is set, and the sub-region of the target position is set for each range of the feature values based on the feature value of each pixel calculated by the feature value calculating unit. Sub-region integrated value image generating means for generating sub-region integrated value images each having a frequency value of a feature value belonging to the range in the region as a pixel value at a predetermined position in the sub region;
For each range of feature values, the pixel value of the sub-region integrated value image at specific coordinates (x, y) in the sub-region, and x of the sub-region with respect to the specific coordinates (x, y) direction size of n times (n is a natural number) n times the y-direction size of each x-coordinate and the sub areas away in the direction in which x becomes smaller by (n is a natural number) spaced in a direction by y decreases In addition, the sum of the pixel values of the sub-region integrated value image at each position indicated by each y-coordinate , or the total value of the sub-region integrated value image at the specific coordinates (x, y) in the sub-region. A value obtained by performing a predetermined arithmetic operation on the pixel value and a direction in which x decreases by n times (n is a natural number) the size of the sub-region in the x direction with respect to the specific coordinates (x, y). n times the respective x-coordinate and y-direction dimensions of the sub-region away (n is self Sum the total and each value obtained by performing a predetermined arithmetic operation for each of the pixel values of the sub-area integrated value image at each position y by the number) is represented by the y coordinate spaced in the direction of smaller, the Sub-region integrated value integrated image generating means for generating sub-region integrated value integrated images, each of which is assigned a value as an integrated value at specific coordinates (x, y) in the sub-region,
An image processing apparatus.
入力されたテンプレート画像に相当する大きさのサブウィンドウを前記サブ領域積算値画像上と前記サブ領域積算値積分画像上に設定し、サブウィンドウを分割して得られる部分領域であるサブ領域を前記サブ領域積算値画像上に設定するサブウィンドウ設定手段と、
前記サブ領域積算値画像内に設定された前記サブウィンドウのサブ領域毎に、前記特徴値の各範囲に対する前記サブ領域積算値画像の画素値を要素とするヒストグラムを各々生成するヒストグラム生成手段と、
前記サブ領域積算値積分画像内に設定された前記サブウィンドウの4隅の座標の画素値に基づいて、前記特徴値の各範囲に対して、前記サブウィンドウ内の各サブ領域における前記総和値を算出する総和値算出手段と、
を更に含む請求項1記載の画像処理装置。
A sub-window having a size corresponding to the inputted template image is set on the sub-region integrated value image and the sub-region integrated value integrated image, and a sub-region which is a partial region obtained by dividing the sub-window is the sub-region. Sub-window setting means for setting on the integrated value image;
Histogram generating means for generating, for each sub-region of the sub-window set in the sub-region integrated value image, a histogram whose elements are pixel values of the sub-region integrated value image for each range of the feature values;
Based on the pixel values of the coordinates of the four corners of the sub-window set in the sub-region integrated value integrated image, the total value in each sub-region in the sub-window is calculated for each range of the feature values. A total value calculation means;
The image processing apparatus according to claim 1, further comprising:
前記サブ領域積算値積分画像生成手段は、前記処理対象画像内の各位置に前記サブ領域を設定した場合について、前記サブ領域に隣接するサブ領域について既に算出された前記総和値を用いて、前記サブ領域に対する前記総和値を算出して、前記サブ領域内の特定座標(x、y)における積算値として付与した前記サブ領域積算値積分画像を生成する請求項1又は2記載の画像処理装置。   The sub-region integrated value integrated image generation means uses the total value already calculated for the sub-region adjacent to the sub-region when the sub-region is set at each position in the processing target image. The image processing apparatus according to claim 1, wherein the total value for the sub-region is calculated, and the sub-region integrated value integrated image provided as an integrated value at a specific coordinate (x, y) in the sub-region is generated. 前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、前記原点と座標(x、y)を対角とする矩形領域内の前記範囲に属する特徴値の頻度値を、座標(x、y)における頻度値として、各座標について算出し、各画素の前記頻度値を表わす積分画像を各々生成する積分画像生成手段を更に含み、
前記サブ領域積算値画像生成手段は、前記積分画像生成手段によって生成された前記特徴値の各範囲に対する前記積分画像に基づいて、前記特徴値の各範囲に対する前記サブ領域積算値画像を生成する請求項1〜請求項3の何れか1項記載の画像処理装置。
Based on the feature value of each pixel calculated by the feature value calculation means, for each range of the feature value, it belongs to the range in a rectangular area whose diagonal is the origin and coordinates (x, y) An integrated image generating unit that calculates the frequency value of the feature value as a frequency value at the coordinates (x, y) for each coordinate and generates an integrated image representing the frequency value of each pixel;
The subregion integrated value image generation means, on the basis of the integral image for each range of the characteristic value generated by the integral image generating means, that constitute raw said subregion integrated value image for each range of the characteristic value The image processing apparatus according to claim 1.
前記積分画像生成手段は、各画素について、前記画素に隣接する画素について既に算出された前記積算値を用いて、前記画素に対する前記積算値を算出して、前記積分画像を生成する請求項4記載の画像処理装置。   The integrated image generation means calculates the integrated value for the pixel by using the integrated value already calculated for a pixel adjacent to the pixel, and generates the integrated image for each pixel. Image processing apparatus. 特徴値算出手段と、サブ領域積算値画像生成手段と、サブ領域積算値積分画像生成手段と、を含む画像処理装置における画像処理方法であって、
前記特徴値算出手段が、処理対象画像の各画素について特徴値を算出するステップと、
前記サブ領域積算値画像生成手段が、座標(x、y)が最小となる画素を原点としたとき、原点からx方向に1画素ずつ順に移動した各x座標について更にy方向に1画素ずつ順に移動することにより設定される、各座標(x、y)を着目位置とするサブ領域を設定し、前記特徴値算出手段によって算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、該着目位置の前記サブ領域内における前記範囲に属する特徴値の頻度値を、前記サブ領域内の予め定めた位置の画素値として付与したサブ領域積算値画像を各々生成するステップと、
前記サブ領域積算値積分画像生成手段が、前記特徴値の各範囲に対して、前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々と、を総和した総和値、又は前記サブ領域内の特定座標(x、y)における前記サブ領域積算値画像の画素値に対して所定の算術演算を施した値と、前記特定座標(x、y)に対して前記サブ領域のx方向の大きさのn倍(nは自然数)だけxが小さくなる方向に離れた各x座標及び前記サブ領域のy方向の大きさのn倍(nは自然数)だけyが小さくなる方向に離れた各y座標で示される各位置における前記サブ領域積算値画像の画素値の各々に対して所定の算術演算を施した値の各々と、を総和した総和値を、前記サブ領域内の特定座標(x、y)における積算値として付与したサブ領域積算値積分画像を各々生成するステップと、
を含むことを特徴とする画像処理方法。
An image processing method in an image processing apparatus including a feature value calculating unit, a sub-region integrated value image generating unit, and a sub-region integrated value integrated image generating unit,
The feature value calculating means calculating a feature value for each pixel of the processing target image;
When the sub-region integrated value image generating means uses the pixel having the minimum coordinate (x, y) as the origin, each x coordinate sequentially moved one pixel at a time from the origin in the x direction is further sequentially pixel by pixel in the y direction. A sub-region that is set by moving and has each coordinate (x, y) as a target position is set, and each range of the feature value is based on the feature value of each pixel calculated by the feature value calculation means Generating a sub-region integrated value image in which frequency values of feature values belonging to the range in the sub-region of the target position are given as pixel values at predetermined positions in the sub-region, ,
The sub-region integrated value integrated image generation means, for each range of the feature values, the pixel value of the sub-region integrated value image at the specific coordinates (x, y) in the sub region and the specific coordinates (x , Y) n times the size of the sub-region in the x-direction (n is a natural number) and each x-coordinate separated in the direction of decreasing x and the size of the sub-region in the y-direction (n Is a natural number) and the sum value of the pixel values of the sub-region integrated value image at each position indicated by each y-coordinate separated in the direction in which y decreases , or specific coordinates (x in the sub-region) , Y) a value obtained by performing a predetermined arithmetic operation on the pixel value of the sub-region integrated value image, and n times the size of the sub-region in the x direction with respect to the specific coordinates (x, y) ( n each x-coordinate and the remote in the direction in which x becomes smaller by a natural number) N times in the y-direction size of the probe region (n is a natural number) by y is predetermined for each of the pixel values of the sub-area integrated value image at each position indicated by the y coordinate spaced in the direction of smaller Each of the values subjected to the arithmetic operation, and generating a sub-region integrated value integrated image in which the total sum value is added as an integrated value at the specific coordinates (x, y) in the sub-region,
An image processing method comprising:
サブウィンドウ設定手段が、入力されたテンプレート画像に相当する大きさのサブウィンドウを前記サブ領域積算値画像上と前記サブ領域積算値積分画像上に設定し、サブウィンドウを分割して得られる部分領域であるサブ領域を前記サブ領域積算値画像上に設定するステップと、
ヒストグラム生成手段が、前記サブ領域積算値画像内に設定された前記サブウィンドウのサブ領域毎に、前記特徴値の各範囲に対する前記サブ領域積算値画像の画素値を要素とするヒストグラムを各々生成するステップと、
総和値算出手段が、前記サブ領域積算値積分画像内に設定された前記サブウィンドウの4隅の座標の画素値に基づいて、前記特徴値の各範囲に対して、前記サブウィンドウ内の各サブ領域における前記総和値を算出するステップと、
を更に含む請求項6記載の画像処理方法。
Sub-window setting means sets a sub-window having a size corresponding to the input template image on the sub-region integrated value image and the sub-region integrated value integrated image, and is a sub-region which is a partial region obtained by dividing the sub-window. Setting an area on the sub-area integrated value image;
The step of the histogram generating means, wherein the sub-area integrated value for each sub-region of the sub-window set in the image to generate respective histograms as elements the pixel value of the sub-area integrated value image for each range of the characteristic value When,
Based on the pixel values of the coordinates of the four corners of the sub-window set in the sub-region integrated value integration image , the sum total value calculation means, for each range of the feature value, in each sub-region in the sub-window Calculating the sum value;
The image processing method according to claim 6, further comprising:
前記サブ領域積算値積分画像生成手段が前記サブ領域積算値積分画像を生成するステップは、前記処理対象画像内の各位置に前記サブ領域を設定した場合について、前記サブ領域に隣接するサブ領域について既に算出された前記総和値を用いて、前記サブ領域に対する前記総和値を算出して、前記サブ領域内の特定座標(x、y)における積算値として付与した前記サブ領域積算値積分画像を生成する請求項6又は7記載の画像処理方法。 The step of the sub-region integrated value integrated image generating means generating the sub-region integrated value integrated image is performed for a sub-region adjacent to the sub-region when the sub-region is set at each position in the processing target image. Using the already calculated total value, the total value for the sub-region is calculated, and the sub-region integrated value integrated image provided as an integrated value at specific coordinates (x, y) in the sub-region is generated. The image processing method according to claim 6 or 7. 積分画像生成手段が、前記算出された各画素の特徴値に基づいて、前記特徴値の各範囲に対して、前記原点と座標(x、y)を対角とする矩形領域内の前記範囲に属する特徴値の頻度値を、座標(x、y)における頻度値として、各座標について算出し、各画素の前記頻度値を表わす積分画像を各々生成するステップを更に含み、
前記サブ領域積算値画像生成手段が前記サブ領域積算値画像を生成するステップは、前記生成された前記特徴値の各範囲に対する前記積分画像に基づいて、前記特徴値の各範囲に対する前記サブ領域積算値画像を生成する請求項6〜請求項8の何れか1項記載の画像処理方法。
Based on the calculated feature value of each pixel , the integral image generation means sets the range within the rectangular region diagonally with the origin and coordinates (x, y) for each range of the feature value. Calculating the frequency value of the feature value to belong to each coordinate as the frequency value at the coordinates (x, y), and generating each integrated image representing the frequency value of each pixel;
The step of generating the sub-region integrated value image by the sub-region integrated value image generating means is based on the integrated image for each range of the generated feature values, and the sub-region integrated value for each range of the feature values. the image processing method according to any one of claims 6 to claim 8 that forms a value images live.
コンピュータを、請求項1〜請求項5の何れか1項記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1-5.
JP2011084561A 2011-04-06 2011-04-06 Image processing apparatus, method, and program Active JP5674535B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011084561A JP5674535B2 (en) 2011-04-06 2011-04-06 Image processing apparatus, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011084561A JP5674535B2 (en) 2011-04-06 2011-04-06 Image processing apparatus, method, and program

Publications (2)

Publication Number Publication Date
JP2012221102A JP2012221102A (en) 2012-11-12
JP5674535B2 true JP5674535B2 (en) 2015-02-25

Family

ID=47272572

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011084561A Active JP5674535B2 (en) 2011-04-06 2011-04-06 Image processing apparatus, method, and program

Country Status (1)

Country Link
JP (1) JP5674535B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111583159B (en) * 2020-05-29 2024-01-05 北京金山云网络技术有限公司 Image complement method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7454058B2 (en) * 2005-02-07 2008-11-18 Mitsubishi Electric Research Lab, Inc. Method of extracting and searching integral histograms of data samples
US20070237387A1 (en) * 2006-04-11 2007-10-11 Shmuel Avidan Method for detecting humans in images
JP4582079B2 (en) * 2006-10-19 2010-11-17 トヨタ自動車株式会社 Image identification apparatus and image identification method

Also Published As

Publication number Publication date
JP2012221102A (en) 2012-11-12

Similar Documents

Publication Publication Date Title
CN108960229B (en) Multidirectional character detection method and device
CN108875723B (en) Object detection method, device and system and storage medium
CN108986152B (en) Foreign matter detection method and device based on difference image
JP6089886B2 (en) Region dividing method and inspection apparatus
JP6432162B2 (en) Image collation method, image collation apparatus, model template generation method, model template generation apparatus, and program
JP6393230B2 (en) Object detection method and image search system
US8548237B2 (en) Ordinal and spatial local feature vector based image representation
CN110781877B (en) Image recognition method, device and storage medium
US10922535B2 (en) Method and device for identifying wrist, method for identifying gesture, electronic equipment and computer-readable storage medium
CN111814905A (en) Target detection method, target detection device, computer equipment and storage medium
JPWO2014136327A1 (en) Image processing system, image processing method, and image processing program
CN112101386B (en) Text detection method, device, computer equipment and storage medium
JP2013037539A (en) Image feature amount extraction device and program thereof
Widiarti Comparing Hilditch, Rosenfeld, Zhang-Suen, and Nagendraprasad-Wang-Gupta Thinning
JP6229554B2 (en) Detection apparatus and detection method
JP6694638B2 (en) Program, information storage medium, and recognition device
JP5674535B2 (en) Image processing apparatus, method, and program
US10002291B2 (en) Method and system of identifying fillable fields of an electronic form
JP6082312B2 (en) Template image candidate area determination device, template image candidate area determination method, and program
Saif et al. Performance comparison of min-max normalisation on frontal face detection using haar classifiers
CN109635798A (en) A kind of information extracting method and device
JP2022185872A (en) Image processing device, image processing method and imaging apparatus
US10134163B2 (en) Dynamic detection of an object framework in a mobile device captured image
JP6609181B2 (en) Character attribute estimation apparatus and character attribute estimation program
US20150142784A1 (en) Retrieval device and method and computer program product

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130826

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140430

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140513

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140710

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141125

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141222

R150 Certificate of patent or registration of utility model

Ref document number: 5674535

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150