WO2011065069A1 - 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、及び画像処理装置の制御方法 - Google Patents

画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、及び画像処理装置の制御方法 Download PDF

Info

Publication number
WO2011065069A1
WO2011065069A1 PCT/JP2010/063402 JP2010063402W WO2011065069A1 WO 2011065069 A1 WO2011065069 A1 WO 2011065069A1 JP 2010063402 W JP2010063402 W JP 2010063402W WO 2011065069 A1 WO2011065069 A1 WO 2011065069A1
Authority
WO
WIPO (PCT)
Prior art keywords
matching
pixel
gradient
specified
specifying
Prior art date
Application number
PCT/JP2010/063402
Other languages
English (en)
French (fr)
Inventor
大輔 山下
洋一郎 八幡
良治 吉本
Original Assignee
シャープ株式会社
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 シャープ株式会社 filed Critical シャープ株式会社
Publication of WO2011065069A1 publication Critical patent/WO2011065069A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/042Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means by opto-electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0412Digitisers structurally integrated in a display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person

Definitions

  • the present invention relates to an image processing apparatus having a function of recognizing an object (for example, a finger) in a captured image, a control program for the image processing apparatus, a computer-readable recording medium on which the control program is recorded, And a control method of the image processing apparatus.
  • an apparatus that recognizes an indicated position or the like of a predetermined object in a captured image captured using a camera or the like using an image processing technique and performs processing according to the recognition result.
  • an image processing apparatus that recognizes a part such as a human hand or a finger in a captured image, specifies its position, and performs data input or operation according to the specified position.
  • Patent Document 1 As described above, there is an operation input device disclosed in Patent Document 1 as a technique for recognizing an object in a captured image by using an image processing technique and specifying an indicated position or the like.
  • the operation input device disclosed in Patent Document 1 mainly uses a photographing means for photographing from the back side of a semi-transparent screen, and image data acquired by the photographing means, and a display surface based on the luminance of the image displayed on the semi-transparent screen.
  • Operating position detecting means for detecting the operating position at.
  • the operation position detection means detects a plurality of areas in the image data whose luminance is equal to or greater than a threshold as contact areas where the user is touching the display surface, and controls the operation direction when the user selects and operates the display object.
  • the contact area located at the forefront of the operation direction is detected as the operation position.
  • the operation position detecting means has a value that is greater than or equal to a second threshold value whose luminance is lower than the threshold value and lower than the threshold value in each of the first region and the second region that are the partitioned areas on the translucent screen.
  • the center of gravity of the image is calculated for each of the first operation part image displayed in the first area and the second operation part image displayed in the second area.
  • a tip direction vector that passes through the center of gravity and extends from the center of gravity of the second operation part image to the center of gravity of the first operation part image is calculated as the operation direction.
  • the operation input device specifies the operation position and the operation direction using the image input from the photographing means.
  • Patent Document 1 has the following problems.
  • the detection object is the first object.
  • the operation direction cannot be detected when it does not extend over two areas of the first area and the second area (exists only in one of the two areas).
  • the operation input device recognizes a plurality of regions whose luminance is equal to or higher than a threshold in the image data as the operation part image, and calculates the operation direction based on the center of gravity of the plurality of operation part images.
  • the brightness on the non-tip side (the base side in the case of a finger) of the contacted part is linked to the change in the angle of the hand or finger with respect to the contact surface.
  • it is difficult to stably calculate the operation direction because the area and shape of the operation site image change according to the fluctuation.
  • the present invention has been made in view of the above-described problems, and an object thereof is to provide an image processing apparatus and the like that can stably detect the indication direction of an object to be imaged.
  • the image processing apparatus of the present invention includes a gradient feature amount calculating unit that calculates a pixel value gradient feature amount from image data of a captured image, and the gradient feature amount calculating unit Edge pixel specifying means for specifying an edge pixel having a pixel value gradient feature amount equal to or greater than a predetermined threshold, a matching area of a predetermined size set on the image data, a predetermined model pattern, A matching degree calculation means for calculating a matching degree indicating a degree of matching between the matching area and the model pattern, and a matching area where the matching degree calculated by the matching degree calculation means is maximized. From the distribution of the pixel value gradient feature quantity for each edge pixel included in the matching area specified by the matching area specifying means and the matching area specifying means specified as Characterized in that it comprises a direction specifying means for specifying a pointing direction of the object.
  • the image processing apparatus control method of the present invention has a function of specifying an instruction direction of an object on the captured image using image data of the captured image.
  • a control method for an image processing device comprising: a gradient feature amount calculating step for calculating a pixel value gradient feature amount from the image data; and a magnitude of the pixel value gradient feature amount calculated in the gradient feature amount calculation step is a predetermined value.
  • An edge pixel specifying step for specifying an edge pixel that is equal to or greater than a threshold value, a matching area of a predetermined size set on the image data, and a predetermined model pattern are matched, and the matching area and the model pattern
  • a matching degree calculation step for calculating a matching degree indicating the degree of matching with the matching degree, and the matching region calculated by the matching degree calculation step is determined to be a matching area.
  • the specified direction of the object on the captured image is determined from the matching area specifying step specified by the step and the distribution of the pixel value gradient feature quantity for each edge pixel included in the matching area specified in the matching area specifying step. And a direction specifying step.
  • the gradient feature amount calculating means or the gradient feature amount calculating step calculates the pixel value gradient feature amount from the image data of the captured image.
  • an edge pixel whose pixel value gradient feature quantity is greater than or equal to a predetermined threshold is specified.
  • edge pixels whose pixel value gradient feature value is greater than or equal to a predetermined threshold value are other than edge pixels whose pixel value gradient feature value value is less than the predetermined threshold value. Can be selected from the pixels.
  • a matching area of a predetermined size set on the image data is compared with a predetermined model pattern, and matching between the matching area and the model pattern is performed.
  • the degree of coincidence indicating the degree is calculated.
  • the degree of matching between the matching area and the model pattern can be recognized from the degree of matching calculated by the degree-of-matching calculation means or the degree-of-matching calculation step.
  • the matching area specifying means or the matching area specifying step the matching area where the matching degree calculated by the matching degree calculating means or the matching degree calculation step is maximized is specified as the matching area.
  • the specified direction of the object on the captured image is specified from the distribution of the pixel value gradient feature value for each edge pixel included in the specified matching region.
  • a scalar quantity such as a pixel value (density value or luminance value) is also conceivable as an amount used for collation between the collation area and a predetermined model pattern (hereinafter referred to as “pattern matching”).
  • pattern matching an amount used for collation between the collation area and a predetermined model pattern.
  • quantization means that a quantity within a predetermined range is treated as a constant quantity.
  • the pixel value gradient feature amount has at least a degree of freedom in the direction of the pixel value gradient direction.
  • the gradient of the pixel value is a vector amount obtained by taking a difference in pixel value between a specific pixel and an adjacent pixel and adding these differences for all adjacent pixels. Has a gradient direction.
  • the gradient direction can be limited to an angle of 0 rad or more and less than 2 ⁇ rad, and by dividing an angle range of 0 rad or more and less than 2 ⁇ rad by an appropriate upper limit angle, the gradient direction having an infinite degree of freedom can be obtained. It is possible to quantize in a finite number of directions.
  • the state that can be taken by the gradient direction calculated for one pixel can be discretized into an extremely small number of 8 (9 including no direction).
  • each state can have a feature that allows easy identification of different directions. Therefore, the pixel value gradient feature amount is an amount suitable for the above-described pattern matching.
  • each gradient direction is, for example, when the surface is soft like a finger and the contact surface becomes circular by touching the surface, or from the edge part toward the center of the area surrounded by the edge part, Alternatively, it shows any tendency from the vicinity of the center toward the edge portion.
  • the magnitude of the gradient (density difference) at each pixel is small at the base side of the finger regardless of the change in the angle of the finger with respect to the contact surface, and increases toward the tip of the finger. Show the trend. These tendencies do not change greatly according to fluctuations in the angle of the finger.
  • the indication direction is usually along the direction from the base of the finger toward the tip of the finger.
  • the pixel value gradient feature amount is used, the above-described tendency indicated by the distribution of the pixel value gradient feature amount for each edge pixel among the pixels included in the match region can be used. Therefore, for each edge pixel included in the match region, From the distribution of the pixel value gradient feature amount, the indication direction of the object on the captured image can be specified.
  • the pointing direction can be specified using only a single matching area, the object does not span the two areas of the first area and the second area as in the operation input device disclosed in Patent Document 1. In addition, there is no problem that the operation direction cannot be detected. Therefore, it is possible to specify a stable pointing direction.
  • the pixel value gradient feature amount is the difference between the pixel values as described above, for example, even if the pixel value on the base side of the finger changes in conjunction with the change in the angle of the finger, the pixel value gradient The tendency of the feature amount to be smaller at the base of the finger and larger toward the tip of the finger and the gradient direction thereof do not vary so much, and the operation amount of the finger is different from that of the operation input device disclosed in Patent Document 1. There is no problem that the operation direction cannot be stably calculated due to a change in the pixel value on the base side. Therefore, it is possible to specify a stable pointing direction.
  • the image processing apparatus and the control method thereof of the present invention it is possible to stably detect the indicated direction of the imaging object.
  • image data may be either analog data or digital data.
  • the “pixel value” is a luminance value or a density value.
  • each divided area obtained by dividing image data into a plurality of areas is called a pixel, and an average density value in each divided area is called a pixel value.
  • the “pixel value” is a density value
  • the “pixel value gradient feature value” may be referred to as a “density gradient feature value”.
  • the image processing apparatus of the present invention includes a gradient feature amount calculating unit that calculates a pixel value gradient feature amount from image data of a captured image, and the pixel value gradient calculated by the gradient feature amount calculating unit.
  • Edge pixel specifying means for specifying an edge pixel whose feature amount is equal to or larger than a predetermined threshold, a matching area of a predetermined size set on the image data, and a predetermined model pattern are collated.
  • a matching degree calculating means for calculating a matching degree indicating a degree of matching between the matching area and the model pattern; and specifying the matching area having the maximum matching degree calculated by the matching degree calculating means as a matching area. From the distribution of the pixel value gradient feature value for each edge pixel included in the match area specified by the match area specifying means and the match area specifying means, It is configured to and a direction specifying means for specifying indicate direction.
  • control method of the image processing apparatus of the present invention includes a gradient feature amount calculation step for calculating a pixel value gradient feature amount from the image data, and the pixel value gradient calculated in the gradient feature amount calculation step.
  • An edge pixel specifying step for specifying an edge pixel having a feature amount greater than or equal to a predetermined threshold is compared with a matching area of a predetermined size set on the image data and a predetermined model pattern.
  • a matching degree calculating step for calculating a matching degree indicating a degree of matching between the matching area and the model pattern, and specifying the matching area having the maximum matching degree calculated in the matching degree calculating step as a matching area.
  • a matching area specifying step and a distribution of the pixel value gradient feature value for each edge pixel included in the matching area specified in the matching area specifying step is a method and a direction specifying step of specifying the pointing direction of the object on the captured image.
  • FIG. 4 is a schematic diagram showing the image of the finger pad (finger pad) and the characteristics of the image of the finger pad in relation to the image processing apparatus, and (a) shows the image of the finger pad when the surrounding is dark. (B) shows the characteristics of the captured image of the finger pad when the surroundings are dark, (c) shows how the finger pad is picked up when the surroundings are bright, and (d) shows the case where the surroundings are bright The characteristic of the captured image of the finger pad is shown.
  • FIG. 4 is a schematic diagram showing the image of the finger pad (finger pad) and the characteristics of the image of the finger pad in relation to the image processing apparatus, and (a) shows the image of the finger pad when the surrounding is dark. (B) shows the characteristics of the captured image of the finger pad when the surroundings are dark, (c) shows how the finger pad is picked up when the surroundings are bright, and (d) shows the case where the surroundings are bright The characteristic of the captured image of the finger pad is shown.
  • FIG. 4 is a schematic diagram showing the image of the finger pad (
  • FIG. 10 is a diagram illustrating a reference table referred to quantize a gradient direction in 8 directions, (a) shows an example of a half of the reference table referred to quantize a gradient direction in 8 directions; (B) shows an example of the remaining half of the reference table.
  • It is a flowchart which shows the outline
  • FIG. 7 is a diagram illustrating an example of a correspondence table indicating a correspondence relationship between a matching pixel number pattern (direction matching pattern) and an object instruction direction for each gradient direction with respect to the image processing apparatus, and (a) illustrates the correspondence table. (B) shows another example of the correspondence table.
  • FIG. 4 is a schematic diagram illustrating an example of distribution of gradient directions for each edge pixel, an example of the number of coincident pixels for each gradient direction, and an example of an indication direction of a specified object with respect to the image processing device,
  • An example of the distribution of the gradient direction for each edge pixel is shown,
  • (b) shows an example of the number of matched pixels for each gradient direction,
  • (c) shows an example of the specified direction of the specified object,
  • (d ) Shows another example of the distribution in the gradient direction for each edge pixel,
  • (e) shows another example of the number of matching pixels for each gradient direction, and
  • (f) shows the indicated direction of the specified object. Another example is shown.
  • FIG. 6 is a schematic diagram illustrating another example of the indication direction of the object specified by (a), (a) shows yet another example of the distribution of gradient directions for each edge pixel, and (b) FIG. 4 shows still another example of the number of coincidence pixels, and (c) to (e) show still other directions of the target direction of the object specified by the synthesized vector synthesized from the vector whose length is the number of matched pixels for each gradient direction.
  • An example is shown.
  • an example of distribution in the gradient direction for each first edge pixel and each second edge pixel, an example of the number of matching pixels for each gradient direction in the first edge pixel, and each gradient direction in the second edge pixel It is a schematic diagram which shows the example of the number of coincidence pixels, (a) shows an example of distribution of the gradient direction for every 1st edge pixel and every 2nd edge pixel, (b) is the gradient direction in a 1st edge pixel. An example of the number of matching pixels for each is shown, and (c) shows an example of the number of matching pixels for each gradient direction in the second edge pixel.
  • FIG. 6 is a flowchart illustrating an example of an operation of an object (instruction) position specifying process with respect to the image processing apparatus.
  • FIG. 4 is a schematic diagram showing an example of a state vector obtained in a direction opposite to an instruction direction of an object with respect to the image processing apparatus, and an example of an existence region of an edge pixel having a gradient direction that matches the direction vector; Shows a state in which a direction vector opposite to the indicated direction of the object is obtained, and (b) shows an example of an existence region of an edge pixel having a gradient direction that matches the direction vector.
  • It is a flowchart which shows another example of operation
  • FIGS. 1 to 15 An embodiment of the present invention will be described with reference to FIGS. 1 to 15 as follows. Configurations other than those described in the following specific embodiments may be omitted as necessary, but are the same as the configurations described in the other embodiments. For convenience of explanation, members having the same functions as those shown in each embodiment are given the same reference numerals, and the explanation thereof is omitted as appropriate.
  • the main functions of the image processing apparatus 1 include the following two functions.
  • the first function is an image display function
  • the image processing apparatus 1 includes a liquid crystal display composed of a plurality of pixels (not shown) and a backlight that emits light to the liquid crystal display, and can display an image. It has become.
  • the second function is an image capturing function.
  • Each pixel in the liquid crystal display of the image processing apparatus 1 includes an optical sensor (or an imaging sensor), and the optical sensor approaches the display screen of the liquid crystal display.
  • a captured image obtained by capturing an external object or the like (target object) can be captured as image data.
  • the liquid crystal display may have a built-in photosensor for every predetermined number of pixels among the plurality of pixels. However, from the viewpoint of the resolution of an image captured by the photosensor, It is preferable to be built in every.
  • any optical sensor may be used as long as it can be built in each pixel such as a liquid crystal display, etc., in addition to a photodiode, using the photoelectric effect as an operating principle.
  • the image processing apparatus 1 includes a gradient feature amount calculation unit (gradient feature amount calculation unit) 2, an edge extraction unit (edge pixel identification unit) 3, a calculation / extraction data holding unit 4, a match Pixel number calculation unit (matching degree calculation unit) 5, model pattern storage unit 6, matching region specifying unit (matching region specifying unit) 7, matching region information storage unit 8, object direction specifying unit (direction specifying unit) 9, target An object direction specifying information storage unit 10 and an object coordinate specifying unit (position specifying means) 11 are provided.
  • a gradient feature amount calculation unit gradient feature amount calculation unit
  • an edge extraction unit edge pixel identification unit
  • a match Pixel number calculation unit matching degree calculation unit
  • model pattern storage unit 6
  • matching region specifying unit matching region specifying unit
  • matching region information storage unit matching region information storage unit 8
  • object direction specifying unit direction specifying unit
  • target An object direction specifying information storage unit 10 and an object coordinate specifying unit (position specifying means) 11 are provided.
  • the gradient feature amount calculation unit 2 calculates a gradient (pixel value gradient feature amount) S of the pixel value of the target pixel from the pixel value of the target pixel and the pixel values of a plurality of adjacent pixels for each pixel on the image data. .
  • image data in the present embodiment is assumed to be digital data, but may be analog data.
  • the “pixel value” is a luminance value or a density value.
  • each divided area obtained by dividing image data into a plurality of areas is called a pixel, and an average density value in each divided area is called a pixel value.
  • the “pixel value” is a density value
  • the “pixel value gradient feature value” may be referred to as a “density gradient feature value”.
  • the gradient S is defined by (lateral gradient Sx, vertical gradient Sy), and the gradient S has a magnitude [gradient magnitude (pixel value gradient feature amount) POW (S)] and direction [ Gradient vector (pixel value gradient feature value) ANG (S)].
  • the gradient S is a vector that takes a difference in pixel value between a specific pixel and an adjacent pixel, sets the difference as a magnitude, and sets the direction from the specific pixel to the adjacent pixel as positive. It is calculated by adding all the adjacent pixels.
  • the gradient S may be calculated using an edge extraction operator such as a Sobel operator or a Prewitt operator.
  • the local vertical gradient Sy and the horizontal gradient Sx at the pixel position x (i, j) of each pixel are obtained using the Sobel operator, and then the pixel is calculated using the following equations (1) and (2).
  • the gradient direction ANG (S) and the gradient magnitude POW (S) at the position x (i, j) can be obtained.
  • i represents the position of the pixel along the horizontal direction
  • j represents the position of the pixel along the vertical direction.
  • i and j are positive integers.
  • Gradient direction ANG (S) tan ⁇ 1 (Sy / Sx) (1)
  • the magnitude of the gradient POW (S) ⁇ (Sx ⁇ 2 + Sy ⁇ 2) (2)
  • the edge extraction unit 3 extracts (identifies) edge pixels whose gradient magnitude POW (S) calculated by the gradient feature value calculation unit 2 is equal to or greater than a predetermined threshold.
  • the calculation / extraction data holding unit 4 calculates data regarding the gradient S for each pixel on the image data calculated by the gradient feature amount calculation unit 2 and the position of the edge pixel extracted by the edge extraction unit 3 on the image data. Data related to etc. is retained.
  • edge pixels whose gradient magnitude POW (S) is equal to or greater than a predetermined threshold are other than edge pixels whose gradient magnitude POW (S) is less than the predetermined threshold. Can be selected from the pixels.
  • the coincidence pixel number calculation unit 5 reads data relating to the gradient S for each pixel on the image data from the calculation / extraction data holding unit 4 described above, reads a model pattern from a model pattern storage unit 6 to be described later, Are compared with the model pattern (hereinafter referred to as “pattern matching”), and the number of pixels in which the gradient direction included in the verification region matches the gradient direction included in the model pattern (degree of matching: This is referred to as “the number of matching pixels”).
  • the matching pixel number calculating unit 5 scans the matching area pixel by pixel while matching the target pixel included in the matching area with all the pixels included in the image data.
  • the number of matching pixels calculated for each matching region is calculated for each target pixel corresponding to each matching region, so that the number of matching pixels can be calculated for all pixels included in the image data. It has become.
  • the matching pixel number calculation unit 5 determines whether the gradient direction ANG (S) matches or does not match for each edge pixel included in the matching region, and determines the matching pixel number for each gradient direction ANG (S) included in the matching region. It can be calculated.
  • the gradient direction ANG (S) is a continuous amount that changes in a range of 0 rad or more and less than 2 ⁇ rad.
  • the quantized pixel direction is quantized into eight directions. Used as
  • FIG. 3A shows an example of a half of the reference table referred to quantize the gradient direction into 8 directions
  • FIG. 3B shows an example of the remaining half of the reference table.
  • the lateral gradient Sx obtained by equation (2) is quantized according to the gradient direction ANG (S) according to the reference table shown in FIG. 3A if Sx ⁇ 0. Set the gradient direction.
  • the gradient direction is quantized into eight directions
  • the number of quantized gradient directions is not limited to eight, and accuracy conditions required for pattern matching and hardware In view of the performance and the like, it can be increased or decreased.
  • the image processing apparatus 1 uses at least the gradient direction ANG (S) indicating the gradient direction of the pixel value as the feature amount.
  • the gradient direction ANG (S) of the pixel value is a feature quantity indicating the direction, it can be directly linked to the designated direction and is a feature quantity that makes it easy to specify the designated direction of the object.
  • the number of coincidence pixels calculated over all the pixels in the collation area can be calculated as the degree of coincidence, and the number of coincidence pixels calculated for each gradient direction ANG (S) can also be calculated as the degree of coincidence. Furthermore, the degree of match (match / mismatch) can also be calculated for each pixel included in the collation area.
  • the gradient direction ANG (S) is a feature amount suitable for specifying the designated direction.
  • the matching pixel number calculation unit 5 matches the number of pixels in which the difference between the gradient direction ANG (S) included in the matching region and the corresponding gradient direction ANG (S) included in the model pattern is equal to or smaller than a predetermined angle. It may be calculated as the number of pixels.
  • a pixel whose difference between the gradient direction ANG (S) included in the matching region and the corresponding gradient direction ANG (S) included in the model pattern is equal to or smaller than a predetermined angle is determined as a pixel that matches the model pattern. Then, by determining a pixel whose difference between the gradient direction ANG (S) included in the matching region and the corresponding gradient direction ANG (S) included in the model pattern exceeds a predetermined angle as a pixel that does not match the model pattern, It is possible to calculate the number of matching pixels of all the pixels included in the matching area.
  • a gradient direction having infinite freedom can be finite. It is possible to quantize in the direction of the number.
  • each of the captured image, the collation region, and the model pattern is a rectangle, but each shape is not limited to a rectangle.
  • a single pixel to be noticed is determined in advance from the pixels included in the collation area, and the single pixel is referred to as a noticed pixel.
  • pattern matching starts from a state in which the pixel in the upper left corner of the image data is set to the position of the target pixel in the matching area, and the matching area is set from the upper left corner to the lower right corner of the image data with reference to the target pixel Matching with the model pattern is performed while scanning pixel by pixel.
  • pattern matching may be performed by excluding the pixel in the portion where the pixel in the matching area does not exist. Further, pattern matching may be performed by setting a periodic boundary condition or the like and replacing a pixel in a region where a pixel in the matching region on the matching region does not exist with a model having an appropriate pixel value gradient feature amount.
  • the size and shape of the matching area may be set as appropriate according to the size and shape of the model pattern.
  • the pattern matching as described above, there are a plurality of collation areas scanned for each pixel, and the number of matching pixels is calculated for each collation area scanned for each pixel. That is, the number of matching pixels is calculated for each of all the pixels on the image data.
  • the model pattern storage unit 6 stores the model pattern as described above.
  • a scalar amount such as a pixel value (density value or luminance value) may be considered.
  • quantization means that a quantity within a predetermined range is treated as a constant quantity.
  • the gradient S described above is a feature amount having a degree of freedom in the direction.
  • the gradient S is a vector quantity obtained by taking a difference in pixel values between a specific pixel and an adjacent pixel and adding these differences for all adjacent pixels, and the gradient magnitude POW (S ) And gradient direction ANG (S).
  • the gradient direction ANG (S) is quantized in eight directions as described above, so that the gradient direction ANG (S) calculated for one pixel can take 8 states (9 including no direction).
  • the states can be discretized into a very small number of states, and each state can be provided with a feature that allows easy identification of different directions. Therefore, the gradient S is an amount suitable for the pattern matching described above.
  • the first calculation method is a method of calculating the number of coincident pixels in which the gradient S for each pixel included in the collation area matches the gradient S for each corresponding pixel included in the model pattern as in the present embodiment. At this time, the greater the number of matching pixels, the greater the degree of matching, and the smaller the number of matching pixels, the smaller the degree of matching.
  • the gradient S may be equally divided into an angle range of 0 rad or more and less than 2 ⁇ rad by an appropriate upper limit angle by discarding the gradient magnitude POW (S).
  • the gradient magnitude POW (S) may be discarded from the gradient S and the gradient direction ANG (S) may be quantized in 8 directions or 16 directions.
  • the second calculation method is a method of calculating a difference from the model pattern with respect to the gradient S for each pixel included in the collation area and calculating the sum of these differences.
  • the first calculation method matching / non-matching can be determined for each pixel, and in the second calculation method, a difference can be calculated for each pixel. Therefore, in these methods, it is possible to set the degree of match for each pixel based on the match / mismatch for each pixel or the difference for each pixel.
  • the second calculation method if the difference in the gradient direction ANG (S) for each pixel is equal to or smaller than the predetermined threshold angle, it is determined that the gradient direction ANG (S) of the model pattern matches, If the gradient direction ANG (S) is the gradient direction ANG (S) of the pixel, the number of matching pixels for each gradient direction ANG (S) included in the matching region can be calculated.
  • the matching area specifying unit 7 specifies a matching area in which the number of matching pixels calculated by the matching pixel number calculation unit 5 is maximized as a matching area.
  • the matching area information storage unit 8 includes data relating to the position of the matching area specified by the matching area specifying unit 7 on the image data, data relating to the gradient S for each pixel included in the matching area, and edge pixels extracted by the edge extracting unit 3. The data regarding the position on the matching area and the data regarding the number of matching pixels for each pixel included in the matching area are stored.
  • the object direction specifying unit 9 receives from the matching region information storage unit 8 data on the position of the matching region on the image data, data on the gradient S for each pixel included in the matching region, and on the matching region of the edge pixel. Is read out from the object direction specifying information storage unit 10 to be described later, and a direction matching pattern for each gradient direction ANG (S) and an instruction direction predetermined as indicating the instruction direction of the object.
  • Correspondence relationship table (correspondence information: see FIG. 8A, etc.) or a correspondence relationship table (correspondence relationship between the distribution of the number of matching pixels for each gradient direction ANG (S) and the instruction direction (correspondence) Attached information: see (b) of FIG. 9) is read and the correspondence direction table is referenced to specify the indication direction from the distribution of the gradient direction ANG (S) for each pixel included in the matching region.
  • the designation direction may be specified based on the above-described correspondence table, or only the gradient direction ANG (S) and the number of matching pixels for each pixel included in the matching region may be used without using the correspondence table. May be used.
  • a correspondence table indicating the correspondence between the distribution of the number of coincident pixels and the designated direction is stored.
  • the above-described coincidence pixel number calculation unit 5 performs collation between the region including the edge pixel specified by the edge extraction unit 3 on the collation region and the model pattern. May be.
  • the object coordinate specifying unit 11 receives data regarding the position of the matching region on the image data from the matching region information storage unit 8, data regarding the position of the edge pixel on the matching region, and matching for each pixel included in the matching region. Data related to the number of pixels is read, and the designated position of the object on the captured image is specified from the distribution of the number of matching pixels calculated for each pixel included in the matching region.
  • the designated position of the object on the captured image can be specified from the distribution of the number of matching pixels for each pixel included in the matching area.
  • the position of the pixel having the maximum number of matching pixels among the number of matching pixels for each pixel included in the matching area may be set as the target position of the object, and the number of matching pixels for each pixel included in the matching area is weighted.
  • the position obtained by the weighted average may be used as the target position of the object.
  • the calculation / extraction data holding unit 4, model pattern storage unit 6, matching area information storage unit 8, and object direction specifying information storage unit 10 described above are, for example, a tape system such as a magnetic tape or a cassette tape, a floppy tape, etc. (Registered trademark) disk / hard disk magnetic disk and compact disk-ROM / MO (magneto-optic) / MD (magnetic disk) / digital video disk / compact disk-R and other optical disks, IC cards (memory) A card system such as an optical card) or a semiconductor memory system such as a mask ROM / EPROM (Erasable Programmable ROM) / EEPROM (Electrically Erasable Programmable ROM) / flash ROM.
  • a finger pad (hereinafter referred to as “finger”) as an object to be imaged by a photodiode built in each pixel of the liquid crystal display of the image processing apparatus 1.
  • An example of “belly” will be given and an outline of the characteristics of each captured image (image data) will be described.
  • FIG. 2 shows how the finger pad is imaged when the surrounding is dark
  • FIG. 2 shows the characteristics of the captured image of the finger pad when the surrounding is dark.
  • the captured image (image data) 31 shown in FIG. Is an image obtained by reflecting the backlight to the object to be imaged (finger's belly), so that the white circular shape is blurred.
  • the gradient direction ANG (S) in each pixel shows a tendency from the edge portion on the captured image 31 to the vicinity of the center of the region surrounded by the edge portion.
  • the gradient direction ANG (S) is a direction in which a density difference occurs, and here, the direction from the dark part to the bright part is positive.
  • the gradient POW (S) (density difference) in each pixel is generally small at the base of the finger and tends to increase toward the tip of the finger.
  • (c) of FIG. 2 shows a state of imaging of the finger pad when the surrounding is bright
  • (d) of FIG. 2 shows characteristics of the captured image of the finger pad when the surrounding is bright.
  • the gradient direction ANG (S) in each pixel is the same as the gradient direction ANG (S) in the white circular portion of the captured image 31 shown in FIG. It shows a reverse trend.
  • the magnitude POW (S) of the gradient in each pixel in the captured image 32 tends to be smaller toward the tip of the finger and larger toward the tip of the finger. The same as the trend.
  • the gradient S is used as the feature amount, the above-described tendency indicated by the distribution of the gradient S for each edge pixel among the pixels included in the matching region can be used. Therefore, the gradient S for each edge pixel included in the matching region can be used. From the distribution, the indication direction of the object on the captured image can be specified.
  • the pointing direction can be specified using only a single matching area, the object does not span the two areas of the first area and the second area as in the operation input device disclosed in Patent Document 1. In addition, there is no problem that the operation direction cannot be detected. Therefore, it is possible to specify a stable pointing direction.
  • the gradient S is a difference between pixel values as described above, for example, even if the pixel value on the base side of the finger changes in conjunction with a change in the angle of the finger, the magnitude of the gradient POW ( S) has a tendency that the base side of the finger is small and becomes larger toward the tip of the finger, and the gradient direction ANG (S) does not vary so much, like the operation input device disclosed in Patent Document 1, There is no problem that the operation direction cannot be stably calculated due to the change in the pixel value on the base side of the finger. Therefore, it is possible to specify a stable pointing direction.
  • the image processing apparatus 1 of the present embodiment it is possible to stably detect the indication direction of the imaging target.
  • FIG. 4 is a flowchart showing an outline of the overall operation of the image processing apparatus 1.
  • step S101 the gradient feature value calculation unit 2 calculates a gradient S for each pixel on the image data, and proceeds to S102 (gradient feature value calculation process: Gradient feature calculation step).
  • the edge extraction unit 3 identifies a pixel having a gradient magnitude POW (S) equal to or greater than a predetermined threshold as an edge pixel, and the gradient direction is “no direction” for pixels that are not identified as edge pixels.
  • the magnitude of the gradient is reset to “0” (edge pixel specifying process: edge pixel specifying step).
  • the matching region specifying unit 7 calculates the matching pixel calculated by the matching pixel number calculation unit 5.
  • the matching area having the maximum number is specified and the process proceeds to S104 (pattern matching process: matching degree calculating step / matching area specifying step).
  • the object direction specifying unit 9 specifies the indication direction of the object from the distribution of the gradient S for each edge pixel included in the matching region, and the object coordinate specifying unit 11 is calculated by the coincident pixel number calculating unit 5.
  • the designated position of the target object is specified from the coincident pixel number distribution for each pixel and becomes “end” (target position / direction specifying process: position specifying step / direction specifying step).
  • the center of gravity position of the distribution of the number of matching pixels (the position obtained by weighted average using the number of matching pixels for each pixel included in the matching area as a weight) is used as the target position of the target object.
  • the method to identify can be considered, it is not limited to this method.
  • the position where the number of matching pixels is the maximum may be specified as the target position of the object.
  • the matching area may be specified as it is as the existence range (position and size) of the object.
  • a range corresponding to the size of the model pattern centering on the center of gravity of the distribution of the number of matched pixels or the position where the number of matched pixels is the maximum may be set as the existence range of the object.
  • a method of specifying the gradient direction ANG (S) specified at the position (pixel) where the number of matching pixels is the maximum in S103 as the target direction of the target can be considered.
  • the gradient direction ANG (S) specified in each pixel is set as the vector direction
  • the direction vector (the first number) is the length of either the number of matching pixels or the product of the gradient size POW (S) and the number of matching pixels.
  • 1 direction vector or second direction vector may be defined, and the direction indicated by the combined vector obtained by combining the direction vectors for each edge pixel may be specified as the target direction of the object.
  • an average value of gradient magnitudes POW (S) may be calculated, and a vector (third direction vector) having the average value as a length may be defined.
  • a median (median value) of gradient magnitudes POW (S) may be calculated, and a vector (third direction vector) having the median as a length may be defined.
  • the gradient direction ANG (S) having a large number of matching pixels has a strong relationship with the indication direction of the object
  • the distribution of the first direction vector having the length of the number of matching pixels in each gradient direction ANG (S) is represented. If used, the edge pixels can be selected according to the strength of the relationship with the pointing direction, so that the pointing direction can be specified with high accuracy.
  • the specified direction was specified by discarding the degree of freedom of the gradient magnitude POW (S).
  • the gradient S has a degree of freedom of the gradient magnitude POW (S)
  • it is indicated from the distribution of the second direction vector including the degree of freedom of the gradient magnitude POW (S). If the direction is specified, it is possible to specify the pointing direction with higher accuracy.
  • the gradient magnitude POW (S) tends to increase from the base of the finger toward the vicinity of the tip of the finger, so the second direction vector described above is finally calculated. Since such a tendency can be included in the combined vector of the two-way vectors, the pointing direction can be specified with higher accuracy.
  • the third direction vector described above is the final calculated third direction vector. Since such a tendency can be included in the composite vector, the pointing direction can be specified with high accuracy.
  • FIG. 5 shows an example of a finger pad model pattern when the surrounding is dark.
  • FIG. 5B shows an example of a shadow model pattern that surrounds the periphery of the finger pad when the surrounding is bright.
  • the gradient direction of each pixel is reversed. Orientation (direction different by 180 degrees).
  • FIG. 5 (a) assumes image data captured based on a state in which the reflected light of the backlight hits the finger pad, and shows a state where the brightness increases toward the center. ing. On the other hand, (b) of FIG. 5 assumes image data in which a shadow of a finger is captured, and shows a state in which the image becomes brighter toward the edge portion of the image.
  • FIG. 6A shows another example of a model pattern that is collated with image data when the surrounding is dark.
  • the difference from the model pattern of FIG. 5A is that two degrees of freedom in the gradient direction are given for each pixel.
  • two degrees of freedom in the gradient direction are given for each pixel.
  • FIG. 7 is a flowchart showing the operation of the pattern matching process among the operations of the image processing apparatus 1 shown in FIG.
  • the coincidence pixel number calculation unit 5 initializes all coincidence pixel numbers in each gradient direction ANG (S) to “0”, and proceeds to S202.
  • the matching pixel number calculation unit 5 performs a matching process using a model pattern for each pixel, and proceeds to S203.
  • the matching pixel number calculation unit 5 determines whether or not the model pattern and the gradient direction ANG (S) are matched by the matching process in S202. If the gradient directions ANG (S) match (Yes), the process proceeds to S204, and if they do not match (No), the process proceeds to S205.
  • the coincidence pixel number calculation unit 5 updates the coincidence pixel number in each gradient direction ANG (S) by adding the number of pixels in which the model pattern coincides with the gradient direction ANG (S) in S202, and proceeds to S205. .
  • the coincidence pixel number calculation unit 5 determines whether or not collation has been completed for all elements (pixels) of the model pattern. If the collation is completed (Yes), the process proceeds to S206, and if not completed (No), the process proceeds to S202, and the collation process is performed on the next element (pixel) of the model pattern.
  • the coincidence pixel number calculation unit 5 outputs a value obtained by adding the coincidence pixel numbers for each gradient direction ANG (S), and proceeds to S207.
  • the total value output in S206 is used in the object position / direction specifying process in S104 of FIG.
  • the target object direction specifying unit 9 specifies and outputs the target direction of the target object based on the number of matching pixels for each gradient direction ANG (S), and ends the pattern matching process.
  • the method for specifying the target direction of the object in this embodiment will be described in detail below.
  • FIG. 8A and FIG. 8B are patterns of coincidence pixel numbers (or direction coincidence patterns) calculated by the coincidence pixel number calculation unit 5 and indicating whether or not there is a coincidence direction for each gradient direction ANG (S).
  • the direction matching pattern is data having a value of “Yes” or “No” for each gradient direction ANG (S), and “Yes” indicates the number of matching pixels in the gradient direction ANG (S). 1 or more and “None” indicates that the number of matching pixels in the gradient direction ANG (S) is zero.
  • the number of matched pixels for each gradient direction ANG (S) calculated by the matched pixel number calculating unit 5 is exemplified in FIGS. 8A and 8B. It is determined which pattern corresponds to the number of matching pixels in the correspondence table, and the indication direction of the object is specified.
  • FIG. 8A shows an example of a correspondence table when the surrounding is dark
  • FIG. 8B shows an example of the correspondence table when the surrounding is bright
  • the correspondence shown in FIG. Compared with the relationship table, the indication direction of the object is reverse (180 degrees different).
  • (A) of FIG. 8 assumes the image data imaged based on the state where the reflected light of the backlight hits the belly of the finger, and the captured image tends to become brighter toward the center. For this reason, the indication direction of the object is associated as the opposite direction (direction different by 180 degrees) from the gradient direction ANG (S) in the image.
  • (b) of FIG. 8 assumes image data in which the shadow of the finger is captured, and the captured image tends to become brighter toward the edge portion of the image.
  • the gradient direction ANG (S) in the image are associated with the same direction as the gradient direction ANG (S) in the image.
  • the correspondence table may be defined for all possible matching combinations, or only some of the matching combinations are defined as shown in FIGS. 8A and 8B. You can keep it.
  • the object direction specifying unit 9 specifies the same direction as other matching states when a matching state of the undefined gradient direction ANG (S) appears.
  • the direction may be undefined (no direction).
  • FIG. 9 shows an example of the distribution of the gradient direction ANG (S) for each pixel calculated by the gradient feature amount calculation unit 2
  • (b) of FIG. 9 shows the coincidence pixel number calculation unit.
  • 5 shows an example (association information) of the distribution of the number of matching pixels for each gradient direction ANG (S) calculated by 5.
  • the pixel (pixel which is not an edge pixel) identified as “non-directional” by the gradient feature amount calculation unit 2 is shown as an empty box in FIG. 9A.
  • FIG. 9A shows an example of image data obtained by imaging a state where the reflected light of the backlight hits the belly of the finger when the surrounding is dark.
  • FIG. 9 shows another example of the distribution of the gradient direction ANG (S) for each pixel calculated by the gradient feature value calculation unit 2, and (e) of FIG.
  • the other example (association information) of distribution of the number of coincident pixels for each gradient direction ANG (S) calculated by the unit 5 is shown.
  • a pixel a pixel that is not an edge pixel identified as “non-directional” by the gradient feature amount calculation unit 2 is shown as an empty box in FIG. 9D.
  • FIG. 9D shows another example of image data obtained by imaging the state where the reflected light of the backlight hits the belly of the finger when the surrounding is dark.
  • the distribution of the number of coincident pixels shown in FIGS. 9A and 9B is suitable when the deviation in the gradient direction matched with the model pattern is small.
  • the distribution of the number of matching pixels is set such that the gradient direction ANG (S) having a large number of matching pixels has a strong relationship with the instruction direction.
  • edge pixels are concentrated on the upper part of the image, and the edge pixels matched by the matching process are indicated by shaded portions.
  • the number of matching pixels for each gradient direction ANG (S) in FIG. 9B three gradient directions ANG (S) in the lower right direction, the lower direction, and the lower left direction are matched.
  • the object direction specifying unit 9 uses the correspondence table shown in (a) in FIG. 8 as the correspondence table. .
  • the pointing direction of the object associated with the pattern in which the three gradient directions ANG (S) in the lower right direction, the lower direction, and the lower left direction are matched is defined as the upward direction.
  • the object direction specifying unit 9 specifies that the designated direction of the object is the upward direction (FIG. 9C).
  • edge pixels are concentrated on the upper left part of the image, and the edge pixels matched by the matching process are indicated by shaded portions.
  • the number of matching pixels for each gradient direction ANG (S) in FIG. 9E three gradient directions ANG (S) in the right direction, the lower right direction, and the lower direction are matched.
  • the indication direction of the object associated with the pattern is defined as the upper left direction. Therefore, in the captured image shown in FIG. 9D, the object direction specifying unit 9 specifies the instruction direction of the object as the upper left direction ((f) in FIG. 9).
  • the object direction specifying unit 9 specifies the indicated direction of the object by referring to the correspondence table in FIG.
  • pixels having a gradient magnitude POW (S) equal to or greater than a predetermined threshold are identified as edge pixels from the image data of the captured image. Since the pointing direction and pointing position of the object to be imaged are specified using the pattern matching technique above, it is possible to prevent the position of noise or the like in the picked-up image from being erroneously specified as the pointing position of the object.
  • the pointing direction and pointing position of an object can be specified with high accuracy.
  • the object direction specifying unit 9 determines the pattern of the number of matching pixels for each gradient direction ANG (S) and the object as shown in (a) and (b) of FIG.
  • the present invention is not limited to such a configuration. That is, it is good also as a structure which specifies the instruction
  • FIG. 10A shows still another example of the distribution of the gradient direction ANG (S) for each pixel calculated by the gradient feature value calculation unit 2
  • FIG. 10B shows the coincidence pixel number calculation unit.
  • 5 shows still another example of the distribution of the number of matched pixels for each gradient direction ANG (S) calculated by 5. Note that pixels (non-edge pixels) identified as “non-directional” by the gradient feature quantity calculation unit 2 are shown as empty boxes, as in (a) and (d) of FIG.
  • FIG. 10 (a) is similar to FIG. 9 (a) and FIG. 9 (b), in which the reflected light of the backlight hits the belly of the finger when the surroundings are dark. Another example of image data is shown.
  • edge pixels matched by the matching process are shown as shaded portions, and three gradient directions ANG (S) in the lower right direction, the lower direction, and the lower left direction are matched.
  • first direction vector whose length is the number of coincident pixels
  • three first direction vectors such as a vector 51 shown in FIG. can get.
  • (a) of FIG. 10 is an example of image data captured based on a state in which the reflected light of the backlight hits the belly of the finger, and the captured image tends to become brighter toward the center.
  • the indication direction of the target object is opposite to the gradient direction ANG (S) in the image (direction different by 180 degrees).
  • the object direction specifying unit 9 specifies the direction obtained by converting the vector 52 shown in (d) of FIG. 10 into the reverse direction (direction different by 180 degrees), that is, the upward direction as the instruction direction of the object. ((E) of FIG. 10).
  • the object direction specifying unit 9 defines the first direction vector described above for each gradient direction ANG (S), and obtains a result of combining all the first direction vectors.
  • the direction indicated by the combined vector thus specified is directly specified as the target direction of the object.
  • the first direction vector whose length is the number of matching pixels is defined for each gradient direction ANG (S).
  • the matching pixel is not the number of matching pixels itself but the gradient direction ANG (S).
  • a vector (second direction vector) whose length is the product of the number and the gradient magnitude POW (S) may be defined.
  • an average value of gradient magnitudes POW (S) may be calculated, and a vector (third direction vector) having the average value as a length may be defined.
  • a median (median value) of gradient magnitudes POW (S) may be calculated, and a vector (third direction vector) having the median as a length may be defined.
  • the object coordinate specifying unit 11 specifies the target position of the object using all the edge pixels for which the number of matching pixels can be obtained by the pattern matching process. It is not limited to a specific method.
  • a threshold value for the lower limit of the number of matching pixels is prepared in advance, and the total value of the number of matching pixels obtained by the pattern matching process is lower than the threshold value, for the edge pixel from which the number of matching pixels is obtained, It may not be used for specifying the designated position of the object (the number of matching pixels is 0).
  • FIG. 1 The image processing apparatus 1 (electronic device 20) according to the second embodiment of the present invention will be described below with reference to FIGS. 1, 8, 11, and 12.
  • FIG. 1 The image processing apparatus 1 (electronic device 20) according to the second embodiment of the present invention will be described below with reference to FIGS. 1, 8, 11, and 12.
  • the edge extraction unit 3 can set two thresholds for specifying edge pixels. The point which did is different from 1st Embodiment, and the structure of other than that is the same as that of 1st Embodiment. Note that the configuration of the image processing apparatus 1 in the second embodiment is the same as the configuration of the image processing apparatus 1 in the first embodiment and only part of the operation is different, so description of each configuration is omitted. Here, an outline of the operation of the image processing apparatus 1 of the present embodiment will be described.
  • the outline of the overall operation is almost the same as the outline of the overall operation in the image processing apparatus 1 of the first embodiment shown in FIG.
  • the first point is that the edge extraction unit 3 shown in FIG. 1 specifies the first edge pixel using the first threshold and specifies the second edge pixel using the second threshold. Different from the embodiment.
  • FIG. 11 is a flowchart showing the operation of the pattern matching process in the image processing apparatus 1 of the present embodiment.
  • the coincidence pixel number calculation unit 5 initializes all the coincidence pixel numbers in the respective gradient directions ANG (S) for the first edge pixels to “0”, and proceeds to S302.
  • the coincidence pixel number calculation unit 5 initializes all the coincidence pixel numbers in each gradient direction ANG (S) for the second edge pixel to “0”, and the process proceeds to S303.
  • the coincidence pixel number calculation unit 5 performs a matching process using the model pattern on the first edge pixel for each pixel, and the process proceeds to S304.
  • the matching pixel number calculation unit 5 determines whether or not the model pattern and the gradient direction ANG (S) are matched by the matching processing in S303. If the gradient directions ANG (S) match (Yes), the process proceeds to S305, and if they do not match (No), the process proceeds to S307.
  • the coincidence pixel number calculation unit 5 performs a matching process using the model pattern on the second edge pixel, and the process proceeds to S306.
  • the second threshold value for specifying the second edge pixel is set larger than the first threshold value for specifying the first edge pixel. Therefore, the second edge pixel has a larger gradient magnitude POW (S) than the first edge pixel. In addition, the first edge pixel always exists at the position of the second edge pixel due to the magnitude relationship between the two threshold values of the first threshold value and the second threshold value.
  • the matching result at the second edge pixel is always obtained by the collation processing in S305.
  • a result in which the gradient directions ANG (S) coincide is always obtained.
  • the coincidence pixel number calculation unit 5 determines whether or not collation has been completed for all elements (pixels) of the model pattern. If the collation is completed (Yes), the process proceeds to S308, and if not completed (No), the process proceeds to S303 and the collation process is performed on the next element of the model pattern.
  • the coincidence pixel number calculation unit 5 adds the coincidence pixel number for each gradient direction ANG (S) of the first edge pixel and the coincidence pixel number for each gradient direction ANG (S) of the second edge pixel. Is added, and the process proceeds to S309.
  • the combined value output in S308 is used in the object position / direction specifying process in S104 of FIG.
  • the object direction specifying unit 9 specifies and outputs the instruction direction of the object based on the distribution of the number of coincident pixels for each gradient direction ANG (S) of the second edge pixels, and the pattern matching process ends. .
  • FIG. 12A shows the distribution of the gradient direction ANG (S) for each edge pixel calculated by the gradient feature value calculation unit 2.
  • FIG. 12 shows an example of the distribution of the number of matching pixels for each gradient direction ANG (S) of the first edge pixel calculated by the matching pixel number calculation unit 5, and (c) of FIG. An example of distribution of the number of coincident pixels for each gradient direction ANG (S) of the second edge pixel is shown.
  • FIG. 12A shows still another example of image data obtained by imaging the state in which the reflected light of the backlight hits the belly of the finger when the surrounding is dark.
  • the edge pixels matched by the matching process are indicated by a dark shaded portion and a thin shaded portion.
  • the thin shaded portion is a pixel specified as the first edge pixel and the second edge pixel, and the dark shaded portion is a pixel specified only as the first edge pixel.
  • the vicinity of the tip of the object is not significantly affected by the contact angle of the object to the display surface, and has a relatively stable gradient magnitude POW (S).
  • the second threshold is set so that only the edge near the tip of the object is specified as the two-edge pixel.
  • the object is determined based on the number of matching pixels for each gradient direction ANG (S) of the second edge pixel.
  • S gradient direction ANG
  • FIG. 12A is an example of image data obtained by imaging a state in which the reflected light of the backlight hits the belly of the finger. Therefore, the distribution of matching pixels and the target for each gradient direction ANG (S) Referring to the correspondence relationship table shown in FIG. 8A as the association information of the instruction direction of the object, it is associated with the pattern in which the three gradient directions ANG (S) of the right direction, the lower right direction, and the lower direction are matched. The indicated direction of the target object is defined as the upper left direction.
  • the object direction specifying unit 9 can specify that the specified direction of the object is the upper left direction ((c) of FIG. 12).
  • the object direction specifying unit 9 specifies the indicated direction of the object by referring to the correspondence table in FIG.
  • the target position of the target object can be determined while preventing the position where noise or the like appears from being erroneously specified as the target position of the target object.
  • the pointing direction of the object can be identified more accurately.
  • the object direction specifying unit 9 corresponds to the correspondence relationship between the direction matching pattern and the instruction direction of the object as shown in FIGS. 8 (a) and 8 (b).
  • the configuration using the relationship table is used, the configuration is not limited to such a configuration.
  • a configuration may be adopted in which the target direction of an object is specified without using a correspondence table. That is, the object direction specifying unit 9 defines, for each gradient direction ANG (S), a first direction vector whose length is the number of coincident pixels, and a combined vector obtained as a result of combining all the first direction vectors is It is good also as a structure which specifies the instruction
  • the object coordinate specifying unit 11 is configured to specify the target position of the object using all the edge pixels for which the number of matching pixels can be obtained by the pattern matching process. It is not limited to such a configuration.
  • a lower limit threshold value for the number of matching pixels is prepared in advance, and the total value of the matching pixel number obtained by the pattern matching process is lower than the lower limit threshold value.
  • the edge pixels for which the number of matching pixels is obtained may be configured not to be used for specifying the target position of the object (the number of matching pixels is set to 0).
  • the predetermined threshold may include at least a predetermined first threshold and a second threshold larger than the first threshold.
  • the coincidence pixel number calculation unit 5 of the image processing apparatus 1 determines, for each gradient direction ANG (S) related to the first edge pixel, from the result of matching the matching region with the model pattern for the first edge pixel.
  • the matching pixel count (second matching score) for each gradient direction ANG (S) related to the second edge pixel is calculated from the result of collation for the matching pixel count (first matching score) and the second edge pixel.
  • the gradient magnitude POW (S) near the tip of the finger is relatively large, and the gradient magnitude POW (S) on the base side of the finger tends to be small. .
  • the threshold value for detecting the gradient S near the tip of the finger is the second threshold value and at least the threshold value for detecting the gradient S on the base side of the finger is the first threshold value, it is equal to or greater than the first threshold value.
  • An edge of the entire finger can be detected by the pixel, and an edge (second edge pixel) in the vicinity of the tip of the finger can be detected by a pixel having a second threshold value or more.
  • the first matching degree is the number of matching pixels related to the edge of the entire finger
  • the second matching degree is the number of matching pixels related to the edge near the tip of the finger.
  • the object coordinate specifying unit 11 of the image processing apparatus 1 of the present embodiment calculates the number of coincident pixels for each gradient direction ANG (S) related to the first edge pixel and the second edge calculated for each first edge pixel.
  • the indicated position is specified from the distribution on the matching area of the number of matching pixels for each gradient direction ANG (S) related to the second edge pixel calculated for each pixel.
  • the threshold value for detecting the gradient S near the tip of the finger is the second threshold value
  • the threshold value for detecting at least the gradient S on the base side of the finger is the first threshold value
  • a first edge pixel having a large number of matching pixels tends to be close to the center of the finger belly
  • a second edge pixel having a large number of matching pixels tends to be close to a position near the tip of the finger (hereinafter referred to as a tip position).
  • the indication position specified from the distribution of the number of coincident pixels for each gradient direction ANG (S) related to the first edge pixel is close to the center of the belly of the finger, and the coincidence for each gradient direction ANG (S) related to the second edge pixel.
  • the indicated position specified from the distribution of the number of pixels is close to the tip position.
  • the indicated position specified from the distribution of the number of matching pixels for each gradient direction ANG (S) regarding the first edge pixel and the number of matching pixels for each gradient direction ANG (S) regarding the second edge pixel is the center of the belly of the finger. , It is close to the middle position of the tip position.
  • the designated position is specified from the distribution on the matched region of at least one of the first match degree and the second match degree, a position close to the center of the finger, the tip position, or the middle position is set as the designated position. It becomes possible to specify.
  • the number of matching pixels for each gradient direction ANG (S) regarding the first edge pixel, the number of matching pixels for each gradient direction ANG (S) regarding the second edge pixel, or a combination of these matching pixel numbers is selected.
  • any one of the center of the finger, the tip position, or a position close to the middle position can be specified as the designated position of the object.
  • the method for specifying the target position of the object the method for specifying the center of gravity of the distribution of the number of matched pixels for each pixel, the position for which the number of matched pixels is the maximum is specified.
  • a method for specifying the size range as the existence range (position and size) of the object has been described as an example.
  • the entire contact surface of the object is specified as an edge pixel, and pattern matching is performed. It is desirable to check the shape of an object relatively closely. Therefore, the threshold value for specifying the edge pixel in the first embodiment and the first threshold value for specifying the first edge pixel in the second embodiment cannot be set too large.
  • the luminance of the side that is not the tip (the base side in the case of a finger) out of the parts in contact with each other due to fluctuations in the angle of the hand or finger with respect to the display surface. It fluctuates, and the area and shape of the base side edge change accordingly.
  • the threshold value (first threshold value) is too small, the area on the non-tip side of the contacted part becomes large, and the number of matching pixels of the edge pixels specified using the threshold value (first threshold value) If the position is specified using, stability is lacking. Therefore, unless the threshold value (first threshold value) is adjusted very carefully, there arises a problem that the indicated position of the object cannot be obtained stably.
  • an instruction direction of an object is first specified, and then an instruction direction of the specified object is specified.
  • tip position) of a target object using is different from embodiment mentioned above.
  • the data near the front end of the object that provides a relatively stable gradient magnitude POW (S) with respect to fluctuations in the angle of the object with respect to the contact surface is used.
  • the indication direction of the object can be specified with high accuracy.
  • the tip position of the object can be specified with high accuracy. Therefore, if the tip position of the target is specified as the target position of the target, a stable position can be specified.
  • the image processing apparatus 1 according to the third embodiment of the present invention will be described below with reference to FIGS. Note that the configuration of the image processing apparatus 1 in the third embodiment is the same as the configuration of the image processing apparatus 1 in the first and second embodiments, and a description thereof will be omitted.
  • the outline of the overall operation is the same as the outline of the overall operation in the image processing apparatus 1 of the first embodiment shown in FIG.
  • FIG. 13 is a flowchart showing the operation of the object position specifying process in the image processing apparatus 1 of the present embodiment. Here, it is assumed that when the surroundings are dark, the operation is performed on image data obtained by imaging the state in which the reflected light of the backlight hits the belly of the finger.
  • the object coordinate specifying unit 11 specifies the gradient direction ANG (S) obtained by rotating the indication direction of the object specified by the object direction specifying unit 9 by 180 degrees, and then the gradient direction ANG.
  • the edge pixel in the matching area having (S) is specified, and the process proceeds to S402.
  • the direction in which the target object is rotated 180 degrees assumes image data when the surrounding is dark, and the captured image tends to become brighter toward the center. This is because the designated direction and the gradient direction of the pixel at the tip position of the object are opposite to each other (the two directions form an angle of 180 degrees).
  • the object coordinate specifying unit 11 checks the gradient magnitude POW (S) of each edge pixel specified in S401, and selects the pixel having the largest gradient magnitude POW (S) as the target position of the object. And the object position specifying process is terminated.
  • FIG. 14A and 14B show the gradient direction ANG (S) for each edge pixel calculated by the gradient feature amount calculation unit 2 and the target direction specified by the object direction specifying unit 9. It is a schematic diagram which shows an example. In addition, the pixel (pixel which is not an edge pixel) specified as “no direction” by the gradient feature amount calculation unit 2 is shown as an empty box in FIG. 14B.
  • FIG. 14B shows an example of image data obtained by imaging a state in which the reflected light of the backlight hits the belly of the finger when the surrounding is dark.
  • the target object coordinate specifying unit 11 specifies the position of the pixel in the dark shaded portion as the target position of the target object.
  • an area where there are many pixels having a gradient direction that is the same as or opposite to the indicated direction specified by the object direction specifying unit 9 is considered to be an area close to the tip position of the object among the matching areas. It is done.
  • the object coordinate specifying unit 11 determines the tip position of the object from the region where pixels having gradient directions that are the same as or opposite to the indicated direction specified by the object direction specifying unit 9 exist. If specified, the tip position can be specified with high accuracy regardless of whether the shape of the entire contact surface of the object, particularly the area and shape of the image at the base of the finger, has changed.
  • the target position of the target object is prevented from being erroneously specified as the target position of the target object, where noise or the like appears. It becomes possible to acquire (tip position) more stably.
  • the object coordinate specifying unit 11 determines the distribution of the gradient direction ANG (S) for each edge pixel included in the matching area, the indication direction specified by the object direction specifying unit 9, and the gradient magnitude POW (S).
  • the tip position of the object on the captured image may be specified.
  • the gradient POW (S) tends to increase as it goes from the base of the finger to the vicinity of the tip of the finger. Therefore, among the regions where there are many pixels having the gradient direction ANG (S) close to the same or opposite direction as the indication direction specified by the object direction specifying unit 9, the pixel having the large image gradient size POW (S) is selected. The position is considered to be a position close to the tip position of the object.
  • the object coordinate specifying unit 11 determines, for example, an area near the tip of the finger from the distribution of the gradient direction ANG (S) for each edge pixel included in the matching area and the indication direction specified by the object direction specifying unit 9. Further, since the position of the pixel having a large gradient POW (S) from the region near the tip of the finger can be set as the tip position, the tip position of the target can be specified with higher accuracy.
  • the object coordinate specifying unit 11 calculates a gradient direction in the same direction as the designated direction specified by the object direction specifying unit 9 among the gradient directions ANG (S) for each edge pixel included in the matching region.
  • the tip position of the object on the captured image may be specified from the distribution of edge pixels.
  • the image sensor detects the superposed light of the reflected light reflected by the object and the light emitted from the backlight and the outside light.
  • the gradient direction ANG (S) of the edge portion tends to be opposite to each other when the surrounding is bright and when the surrounding is dark.
  • the object coordinate specifying unit 11 assumes that the surrounding is bright, and the edge in which the gradient direction ANG (S) in the same direction as the indicated direction is calculated among the gradient directions ANG (S) for each edge pixel.
  • the tip position is specified from the pixel distribution.
  • the object coordinate specifying unit 11 has a gradient direction ANG (S) opposite to the indicated direction specified by the object direction specifying unit 9 among the gradient directions ANG (S) for each edge pixel included in the matching region.
  • the tip position of the object on the captured image may be specified from the calculated distribution of edge pixels.
  • the object coordinate specifying unit 11 assumes that the surrounding is dark, and among the gradient directions ANG (S) for each edge pixel, the object coordinate specifying unit 11 calculates the gradient direction ANG (S) opposite to the indicated direction.
  • the tip position is specified from the distribution.
  • the object coordinate specifying unit 11 determines the position of the pixel having the largest gradient magnitude POW (S) among the edge pixels in the gradient direction ANG (S) corresponding to the instruction direction of the object.
  • the configuration is such that it is specified as the indicated position of the object, it is not limited to this configuration.
  • it is good also as a structure which specifies the gravity center of each edge pixel which has the gradient direction ANG (S) corresponding to the instruction
  • the position moved by a predetermined amount may be specified as the designated position of the object.
  • the specified position of the target object is specified near the center of the contact portion of the target object.
  • the indication position of the object is not adjusted unless the threshold value (first threshold value) is adjusted very carefully. The problem that can not be obtained stably.
  • the tip position of the object is specified at a position close to the vicinity of the tip of the contact portion of the object.
  • the vicinity of the center of the contact portion of the object it is difficult to stably acquire which position is near the center with the third embodiment alone. The problem remains.
  • the object coordinate specifying unit 11 performs the first embodiment or the second operation in the previous operation.
  • the current operation is performed from the tip position specified in the previous operation. It differs from the above-described embodiment in that the position where the designated position identified in the previous operation is displaced by the amount of displacement up to the identified tip position is set as the designated position of the current object. .
  • the specified position is specified in the previous operation, but even if the specified position cannot be specified in the current operation for some reason, the tip position in which the tip position was specified in the previous and current operations is used. Since the designated position is specified, it is possible to specify the designated position of the target object with high accuracy while preventing the position of noise or the like in the captured image from being erroneously specified as the designated position of the target object.
  • the configuration of the image processing apparatus 1 in the fourth embodiment is the same as the configuration of the image processing apparatus 1 in the first to third embodiments, and a description thereof will be omitted.
  • the outline of the overall operation of the image processing apparatus 1 is also the same as the outline of the overall operation of the image processing apparatus 1 according to the first embodiment shown in FIG.
  • FIG. 15 is a flowchart showing the operation of the object position specifying process in the image processing apparatus 1 of the present embodiment.
  • a first position (instructed position) of the object and a second position (tip position) different from the first position are stored.
  • the object coordinate specifying unit 11 uses the specified method of specifying the target position of the object as in the first embodiment or the second embodiment as the first position from the captured image data. The position near the center of the contact portion of the object is specified.
  • the target object coordinate specifying unit 11 uses the method for specifying the front end position of the target object as in the third embodiment as the second position from the captured image data, to the front end of the target object. Identify close locations.
  • the object coordinate specifying unit 11 tries to read out the stored first position.
  • the object coordinate specifying unit 11 reads the stored second position, and the captured image data
  • the coordinate difference between the second position identified from the above and the second position already stored is calculated, and the calculated first difference is added to the stored first position to obtain a new first position.
  • the position of is calculated.
  • the first position specified from the captured image data is used as it is as the new first position.
  • the object coordinate specifying unit 11 specifies the new first position as the designated position of the object, and sets the new first position and the second position newly specified from the captured image data. Store and store the object position identification process. If the first position is not specified, the stored first position is deleted.
  • FIG. 15 is a flowchart showing the operation of the object position specifying process in the fourth embodiment described above.
  • the image processing apparatus 1 repeatedly executes the operation shown in this flowchart every predetermined unit time.
  • the object coordinate specifying unit 11 checks whether or not the first position of the object is stored. If stored (Yes), the process proceeds to S504. If not stored (No), the process proceeds to S502.
  • the object coordinate specifying unit 11 uses the method for specifying the target position of the object in the first or second embodiment as the first position from the captured image data. After trying to specify the position near the center of the contact part, the process proceeds to S503.
  • the object coordinate specifying unit 11 checks whether the position near the center has been specified in S502. If it can be identified (Yes), the process proceeds to S505, and if it cannot be identified (No), the process proceeds to S512.
  • the object coordinate specifying unit 11 reads the stored first position, and proceeds to S505.
  • the object coordinate specifying unit 11 uses the method for specifying the tip position of the target object according to the third embodiment as a second position from the captured image data. After the identification is attempted, the process proceeds to S506.
  • step S506 the object coordinate specifying unit 11 checks whether the position near the tip has been specified in step S505. If it can be identified (Yes), the process proceeds to S507, and if it cannot be identified (No), the process proceeds to S512.
  • the object coordinate specifying unit 11 checks whether or not the second position of the object is stored. If stored (Yes), the process proceeds to S508, and if not stored (No), the process proceeds to S509.
  • the object coordinate specifying unit 11 calculates a coordinate difference between the new second position specified in S505 and the already stored second position, and the calculated difference is already stored.
  • the new first position is calculated by adding the first position, and the process proceeds to S509.
  • the object coordinate specifying unit 11 stores the new second position specified in S505, and proceeds to S510.
  • the target object coordinate specifying unit 11 specifies the first position as the target position of the target object, and the process proceeds to S511.
  • the position specified as the target position of the target object is the newly calculated first position if the process of S508 is performed, and is stored if the process of S508 is not performed.
  • the first position or the first position specified in S502 (not yet stored).
  • the object coordinate specifying unit 11 stores the (new) first position, and ends the object position specifying process.
  • the object coordinate specifying unit 11 deletes the stored first position and second position, and ends the object position specifying process without specifying the indicated position of the object. . In this case, the designated position of the object cannot be specified.
  • the image processing apparatus 1 in the fourth embodiment it is possible to continue to acquire the position near the center of the contact portion of the target object accurately and stably.
  • each block of the image processing apparatus 1 (electronic device 20), in particular, the gradient feature amount calculation unit 2, the edge extraction unit 3, the matching pixel number calculation unit 5, the matching region specification unit 7, the object direction specification unit (direction specification)
  • the means) 9 and the object coordinate specifying unit (position specifying means) 11 may be configured by hardware logic, or may be realized by software using a CPU as follows.
  • the image processing apparatus 1 includes a CPU (central processing unit) that executes instructions of a control program that realizes each function, a ROM (read only memory) that stores the program, and a RAM that expands the program (Random access memory), a storage device (recording medium) such as a memory for storing the program and various data.
  • An object of the present invention is to enable a computer to read the program code (execution format program, intermediate code program, source program) of the control program of the image processing apparatus 1 (electronic device 20), which is software that implements the functions described above. It is also achieved by supplying the recorded recording medium to the image processing apparatus 1 (electronic device 20), and the computer (or CPU or MPU: micro processing unit) reads and executes the program code recorded on the recording medium. Is possible.
  • Examples of the recording medium include a tape system such as a magnetic tape and a cassette tape, a magnetic disk such as a floppy (registered trademark) disk / hard disk, and a compact disk-ROM / MO / MD / digital video disk / compact disk-R.
  • the recording medium is preferably a recording medium that fluidly carries the program so as to download the program from the communication network.
  • the download program is stored in the main device in advance or installed from another recording medium.
  • the image processing apparatus 1 may be configured to be connectable to a communication network, and the program code may be supplied via the communication network.
  • the communication network is not particularly limited.
  • the Internet intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network, telephone line network, mobile communication network, satellite communication. A net or the like is available.
  • the transmission medium constituting the communication network is not particularly limited.
  • the present invention is a computer program encoded in a computer-readable medium, and the image processing apparatus includes the readable medium, and when executed by a computer, each of the image processing apparatuses It can also be realized as a computer program for realizing the function of the means.
  • the image processing apparatus includes a feature amount calculation unit that calculates a feature amount according to a pixel value difference with an adjacent pixel for each pixel on image data of a captured image, and the feature amount calculation.
  • An edge specifying means for specifying an edge pixel whose feature amount calculated by the means is equal to or greater than a threshold; a collation area included in a partial area on the image data based on a result of specifying the edge pixel;
  • a matching degree calculation means for calculating a matching degree indicating a matching degree between the matching area and the model pattern, and a distribution for each pixel of the matching degree calculated by the matching degree calculation means.
  • the distribution of each pixel may comprise a direction specifying means for specifying a direction in which the object on the captured image is indicated.
  • the threshold value includes at least two threshold values: a first threshold value and a second threshold value that is larger than the first threshold value
  • the edge specifying means includes the feature value calculating means. At least two types of edge pixels, a first edge pixel whose calculated feature value is equal to or greater than the first threshold value and a second edge pixel whose feature value calculated by the feature value calculation means is equal to or greater than the second threshold value.
  • the degree-of-match calculation means includes at least two types of matches: a first degree of matching based on the result of specifying the first edge pixel and a second degree of matching based on the result of specifying the second edge pixel.
  • the position specifying means specifies the position of the object using one or both of the first match degree and the second match degree calculated by the match degree calculation means, and the direction specifying means
  • the degree-of-match calculation means calculates A second matching degree was may identify the orientation of the object.
  • the feature amount may include at least a gradient direction indicating a gradient direction of luminance of the pixel.
  • the degree-of-match calculation unit calculates the number of coincident pixels in which the gradient direction included in the matching region matches the gradient direction included in the model pattern for each gradient direction. You may do it.
  • association information in which the number of matching pixels for each gradient direction is associated with the direction indicated by the object is determined in advance, and the direction specifying unit The direction indicated by the object on the captured image may be specified from the information and the distribution of the matching degree for each pixel.
  • the direction specifying unit is configured to detect a target object on the captured image from a vector amount having the length of the number of coincident pixels for each gradient direction and a distribution of the degree of coincidence for each pixel.
  • the direction indicated by may be specified.
  • the feature amount includes at least a vector amount having a gradient direction indicating a magnitude of a pixel luminance gradient and a direction of the pixel luminance gradient
  • the direction specifying unit includes: The direction indicated by the object on the captured image is specified from the vector amount obtained by multiplying the number of matching pixels for each gradient direction by the magnitude of the previous gradient and the distribution of the matching degree for each pixel. May be.
  • the position specifying unit specifies the distribution of the edge pixels for each pixel specified by the edge specifying unit, the direction specified by the target specified by the direction specifying unit,
  • the position of the object on the captured image may be specified from the distribution of the degree of coincidence calculated by the degree of coincidence calculating means for each pixel.
  • the feature amount includes at least a magnitude of a luminance gradient of a pixel
  • the position specifying unit specifies the luminance gradient of the edge pixel specified by the edge specifying unit.
  • the position specifying unit has a pixel-by-pixel distribution of the edge pixels having the same gradient direction as the direction indicated by the object specified by the direction specifying unit, and the matching degree calculating unit.
  • the position of the object may be determined from the distribution of the degree of match calculated for each pixel.
  • the position specifying unit has a gradient direction obtained by rotating the direction indicated by the target specified by the direction specifying unit by 180 degrees and the edge pixel distribution for each pixel, and the match The fingertip position may be determined from the distribution of the degree of match calculated by the degree calculation means for each pixel.
  • the image processing apparatus of the present invention is characterized in that an image is captured every predetermined unit time, and the position of the object on the captured image and the pointing direction are identified from the captured image.
  • An image processing apparatus comprising: a position storage unit that stores at least a first position of an object and a second position different from the first position for each predetermined unit time;
  • the position specifying means specifies, as a first position, a position of an object on the captured image specified from a distribution for each pixel of the degree of match calculated by the match degree calculating means, and the edge specifying means Specified by the distribution of the edge pixels for each pixel, the direction specified by the direction specifying unit, the direction indicated by the object, and the distribution for each pixel of the matching degree calculated by the matching degree calculating unit, Pair on the captured image
  • the position of the object is specified as the second position and the first position is stored in the position storage means
  • the specified first position is stored in the position storage means. Recalculating from the first position, the second position stored in the position storage means,
  • the degree of coincidence calculation means may set the degree of coincidence to 0 when the calculated degree of coincidence is less than a predetermined threshold.
  • a pixel having a feature amount equal to or greater than a predetermined threshold is specified as an edge pixel from image data of a captured image that has been mainly captured, and then the pointing direction of the imaging target is determined using a pattern matching technique. And the specified position. Therefore, it is possible to specify the target position and the pointing direction with high accuracy while preventing the position of noise or the like in the captured image from being erroneously specified as the target position of the target object.
  • error pixel when there is noise or a pixel defect that occurs during imaging (hereinafter, such a pixel in which such a problem has occurred is referred to as an “error pixel”), the error pixel affects the pixel value gradient feature amount and indicates The direction identification accuracy may be reduced.
  • the degree-of-match calculation unit may collate the region including the edge pixel specified by the edge pixel identification unit on the comparison region with the model pattern.
  • the matching degree calculation unit may scan the matching area pixel by pixel while matching the target pixel included in the matching area with all the pixels included in the image data.
  • a plurality of matching areas, and the degree of matching calculated for each matching area is calculated for each pixel of interest corresponding to each matching area, whereby the matching degree is calculated for all pixels included in the image data.
  • a position specifying means for specifying the target position of the object on the captured image from the distribution of the matching degree for each pixel included in the matching area.
  • the matching degree calculation unit sets a plurality of matching areas by scanning the matching area pixel by pixel while matching the target pixel included in the matching area with all the pixels included in the image data. At the same time, the degree of coincidence calculated for each matching area is calculated for each pixel of interest corresponding to each matching area, thereby calculating the degree of matching for all pixels included in the image data.
  • each of the captured image, the collation region, and the model pattern is a rectangle, but each shape is not limited to a rectangle.
  • a single pixel to be noticed is determined in advance from the pixels included in the collation area, and the single pixel is referred to as a noticed pixel.
  • pattern matching starts from a state in which the pixel in the upper left corner of the image data is set to the position of the target pixel in the matching area, and the matching area is scanned pixel by pixel from the upper left corner to the lower right corner of the image data.
  • matching with the model pattern is performed.
  • pattern matching may be performed by excluding the pixel in the portion where the pixel in the matching area does not exist. Further, pattern matching may be performed by setting a periodic boundary condition or the like and replacing a pixel in a region where a pixel in the matching region on the matching region does not exist with a model having an appropriate pixel value gradient feature amount.
  • the size and shape of the matching area may be set as appropriate according to the size and shape of the model pattern.
  • the matching degree is calculated for each matching area scanned for each pixel in the matching degree calculation means or the matching degree calculation step. become. That is, the degree of match is calculated for each of all the pixels on the image data.
  • the position specifying means specifies the designated position of the object on the captured image from the distribution of the degree of coincidence calculated for each pixel included in the matching area.
  • the designated position of the object on the captured image can be specified from the distribution of the degree of coincidence for each pixel included in the coincidence area.
  • the position of the pixel having the highest matching degree among the matching degrees for each pixel included in the matching area may be set as the target position of the object, or weighting with the matching degree for each pixel included in the matching area as a weight.
  • the position obtained by averaging may be used as the designated position of the object.
  • the predetermined threshold includes at least a predetermined first threshold and a second threshold larger than the first threshold
  • the edge pixel specifying unit includes: The first edge pixel whose magnitude of the pixel value gradient feature amount calculated by the gradient feature amount calculating means is equal to or greater than the first threshold value and the second edge pixel that is equal to or greater than the second threshold value are identified as the edge pixels. Then, the degree-of-match calculation means obtains the first degree of match from the result of matching the matching area and the model pattern for the first edge pixel, and the result of the matching for the second edge pixel.
  • the direction specifying means specifies the indicated direction from the distribution of the pixel value gradient feature quantity for each of the second edge pixels included in the match area, and specifies the position Stage, the first match degree for each pixel included in the matching area, and one of the second matching degree may identify the indicated position from at least one of the distribution.
  • the predetermined threshold value includes at least a predetermined first threshold value and a second threshold value larger than the first threshold value.
  • the matching degree calculation means calculates the first matching degree (matching degree) from the result of matching between the matching region and the model pattern for the first edge pixel, and the second matching from the result of matching for the second edge pixel.
  • the degree (degree of match) is calculated.
  • the magnitude of the gradient near the tip of the finger is relatively large, and the magnitude of the gradient on the base side of the finger tends to be small.
  • the threshold value for detecting the pixel value gradient feature value near the tip of the finger is set as the second threshold value
  • the threshold value for detecting the pixel value gradient feature value at least at the base of the finger is set as the first threshold value.
  • the edge of the entire finger can be detected by a pixel equal to or higher than the first threshold
  • the edge (second edge pixel) near the tip of the finger can be detected by a pixel equal to or higher than the second threshold.
  • the first match level is a match level related to the edge of the entire finger
  • the second match level is a match level related to the edge near the tip of the finger.
  • the position specifying means specifies the designated position from the distribution of at least one of the first match degree and the second match degree calculated for each pixel included in the match area.
  • the threshold value for detecting the pixel value gradient feature value near the tip of the finger is set as the second threshold value
  • the threshold value for detecting at least the pixel value gradient feature value at the base side of the finger is set as the second threshold value.
  • the distribution of the first matching degree on the matching area is a guideline for calculating the center of the portion surrounded by the edge, that is, the vicinity of the center of the belly of the finger.
  • the distribution is a guide for calculating a position near the tip of the finger (hereinafter simply referred to as “tip position”).
  • the indicated position specified from the distribution of the first degree of matching is close to the center of the belly of the finger, and the specified position specified from the distribution of the second degree of match is close to the tip position.
  • the indicated position specified from the distribution of the first match degree and the second match degree is close to the middle position between the center of the finger belly and the tip position.
  • the specified position is specified from the distribution of at least one of the first match degree and the second match degree on the match area, a position close to any of the center of the finger, the tip position, or the intermediate position is indicated. It can be specified as a position.
  • the pixel value gradient feature amount may be a feature amount indicating at least a gradient direction of the pixel value.
  • the gradient direction of the pixel value is a feature quantity indicating the direction, it can be directly linked to the designated direction, and the designated quantity of the target object can be easily specified.
  • a scalar quantity such as the magnitude of the gradient is a feature quantity that is difficult to be directly linked to the indicated direction because it is not a feature quantity indicating the direction.
  • the degree-of-match calculation unit may determine, for each gradient direction, the number of pixels in which the gradient direction included in the matching region matches the gradient direction included in the model pattern. May be calculated as the degree of coincidence.
  • the pattern matching using the gradient direction it can be determined whether or not the gradient direction matches for each pixel included in the matching region.
  • the number of matching pixels calculated over all the pixels in the matching area can be calculated as the degree of matching, and the number of matching pixels calculated for each gradient direction can also be calculated as the degree of matching. Furthermore, the degree of match (match / mismatch) can also be calculated for each pixel included in the collation area.
  • the specified direction can be easily identified using this bias.
  • the gradient direction is a pixel value gradient feature amount suitable for specifying the designated direction.
  • association information indicating a correspondence relationship between the distribution of the number of matching pixels for each gradient direction and the designated direction is determined in advance, and the direction specifying unit includes the association information With reference to the information, the indicated direction may be specified from the distribution of the number of matched pixels for each gradient direction calculated by the matching degree calculating means.
  • association information when the deviation in the gradient direction matched with the model pattern is large, only the presence / absence of the matched pixel is indicated for each gradient direction (the number of matching pixels is discarded).
  • the pattern and the instruction direction may be associated with each other.
  • the distribution of the number of matched pixels for each gradient direction may be associated with the designated direction.
  • the association information is set on the assumption that the gradient direction having a large number of matching pixels has a strong relationship with the instruction direction.
  • the direction specifying unit may specify the indicated direction from a distribution of first direction vectors having a length corresponding to the number of matching pixels for each gradient direction.
  • the edge pixels can be selected according to the strength of the relationship with the indication direction. As a result, the pointing direction can be specified with high accuracy.
  • the direction specifying unit may determine the instruction from a distribution of a second direction vector having a length as a product of the number of matched pixels for each gradient direction and the magnitude of the pixel value gradient feature amount.
  • the direction may be specified.
  • the designated direction is identified by regarding the number of matching pixels as the magnitude of the gradient.
  • the pixel value gradient feature quantity has a degree of freedom of the magnitude of the gradient, so that the indicated direction is specified from the distribution of the second direction vector including the degree of freedom of the magnitude of the gradient. By doing so, it is possible to specify the pointing direction with higher accuracy.
  • the magnitude of the gradient tends to increase from the base of the finger toward the vicinity of the tip of the finger. Therefore, in the second direction vector, the resultant vector of the second direction vector finally calculated On the other hand, since such a tendency can be included, the pointing direction can be specified with higher accuracy.
  • the direction specifying unit specifies the indicated direction from a distribution of third direction vectors whose length is the magnitude of the pixel value gradient feature amount for each gradient direction. Also good.
  • the gradient tends to increase from the base of the finger toward the vicinity of the tip of the finger. Therefore, in the third direction vector, the finally calculated third direction vector is compared with the resultant vector. Since such a tendency can be included, the pointing direction can be specified with high accuracy.
  • the entire contact surface of the target object may not be specified as the target position of the target object by mistake.
  • the luminance of the finger base side of the contacted part varies depending on the angle of the hand or finger with respect to the display surface, and accordingly, the finger base side changes accordingly.
  • the area and shape of the image changes. Therefore, if the predetermined threshold value is too small, the area on the base side of the finger that is not the tip among the parts that are in contact with each other will increase, and the degree of match for the edge pixel specified using the predetermined threshold value will be determined. This makes it difficult to stably specify the indicated position. Therefore, there is a problem that the designated position of the object cannot be stably acquired unless the predetermined threshold value is adjusted very carefully.
  • the position specifying unit includes the gradient direction distribution for each edge pixel included in the matching region, and the indication direction specified by the direction specifying unit. From this, the tip position of the object on the captured image may be specified.
  • an area where there are many pixels having a gradient direction that is the same as or opposite to the indicated direction specified by the direction specifying means is considered to be an area close to the tip position of the object on the matching area.
  • the tip position of the object is specified from an area where pixels having gradient directions that are the same as or opposite to the indicated direction specified by the direction specifying means exist, the shape of the entire contact surface of the object In particular, the tip position can be accurately identified regardless of whether the area or shape of the image on the base side of the finger has changed.
  • the tip position of the target can be specified with high accuracy while preventing the position of noise or the like in the captured image from being erroneously specified as the target position of the target.
  • the position specifying unit includes a distribution of the gradient direction for each of the edge pixels included in the matching region, the indication direction specified by the direction specifying unit, and the pixel value gradient feature. You may specify the front-end
  • the gradient tends to increase as it goes from the base of the finger to the vicinity of the tip of the finger. Therefore, in the region where there are many pixels having a gradient direction that is the same or opposite to the indicated direction specified by the direction specifying means, the position of the pixel having a large gradient is close to the tip position of the object. It is believed that there is.
  • the region near the tip of the finger is specified from the distribution of the gradient direction for each edge pixel included in the matching region, the indication direction specified by the direction specifying unit, and the region near the tip of the finger. Since the position of a pixel having a large gradient from the region can be set as the tip position, the tip position of the object can be specified with higher accuracy.
  • the position specifying unit may include the gradient direction in the same direction as the indication direction specified by the direction specifying unit, of the gradient directions for each of the edge pixels included in the matching region.
  • the tip position of the object on the captured image may be specified from the calculated distribution of the edge pixels.
  • the image sensor detects the superposed light of the reflected light reflected by the object and the light emitted from the backlight and the outside light.
  • the gradient directions of the edge portions tend to be opposite to each other when the surrounding is bright and when the surrounding is dark.
  • the tip position is specified from the distribution of edge pixels in which the gradient direction in the same direction as the indicated direction is calculated among the gradient directions for each edge pixel, assuming that the surrounding is bright. Yes.
  • the position specifying unit may include the gradient direction opposite to the indicated direction specified by the direction specifying unit among the gradient directions for each of the edge pixels included in the matching region.
  • the tip position of the object on the captured image may be specified from the calculated distribution of the edge pixels.
  • the tip position is specified from the distribution of edge pixels for which the gradient direction opposite to the indicated direction is calculated among the gradient directions for each edge pixel.
  • the position specifying means specifies the previous operation when the indicated position is specified by the previous operation and the tip position is specified by the previous operation and the current operation.
  • a position obtained by displacing the indicated position specified in the previous operation by the amount of displacement from the specified tip position to the tip position specified in the current operation may be used as the current target position of the object.
  • the specification of the tip position is performed.
  • the shape of the entire contact surface of the object particularly the area or shape of the image at the base of the finger, can be identified stably.
  • the position specifying means specifies the pointing position in the previous operation, and when the tip position is specified in the previous and current operations, from the tip position specified in the previous operation.
  • the position where the indicated position specified in the previous operation is displaced by the amount of displacement up to the tip position specified in the current operation is set as the indicated position of the target object.
  • the specified position is specified using the tip position specified in the previous and current actions even if the specified position is specified in the previous action, even if the specified position cannot be specified in the current action for some reason. Therefore, the target position of the target can be specified with high accuracy while preventing the position of noise or the like in the captured image from being erroneously specified as the target position of the target.
  • the matching degree calculation means may set the matching degree to 0 when the calculated matching degree is less than a predetermined threshold value.
  • the degree of matching calculated by the degree-of-match calculation means tends to be relatively low.
  • the upper limit value (threshold value) of the matching degree it is possible to delete from the processing data the matching degree that is affected by an invalid error pixel caused by noise or the like in the image data. It is possible to eliminate the influence of an unreasonable error pixel and specify the target position of the object stably.
  • Each means, each function, each process, and each step and each process in the image processing apparatus and its control method may be realized by a computer.
  • the computer is used as each means.
  • a computer-readable recording medium on which is recorded also falls within the scope of the present invention.
  • the image processing apparatus of the present invention can be applied to an apparatus that performs operations and instructions by touching a display of a display device such as a liquid crystal with an object such as a finger, such as a mobile phone or a PDA. it can.
  • a display device for example, it can be used for an active matrix liquid crystal display device, and an electrophoretic display, a twist ball display, a reflective display using a fine prism film, a digital mirror device, etc.
  • organic EL light-emitting elements, inorganic EL light-emitting elements displays using light-emitting luminance variable elements such as LEDs (Light Emitting Diodes), field emission displays (FED) It can also be used for plasma displays.
  • LEDs Light Emitting Diodes
  • FED field emission displays

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)
  • Position Input By Displaying (AREA)

Abstract

 撮像された撮像画像の画像データから勾配Sを算出する勾配特徴量算出部(2)と、勾配特徴量算出部(2)が算出した勾配の大きさPOW(S)が所定の閾値以上であるエッジ画素を特定するエッジ抽出部(3)と、画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、照合領域に含まれる勾配方向ANG(S)とモデルパターンに含まれる勾配方向ANG(S)が一致する画素の数を示す一致画素数を算出する一致画素数算出部(5)と、一致画素数算出部(5)が算出した一致画素数が最大となる照合領域を合致領域として特定する合致領域特定部(7)と、合致領域特定部(7)が特定した合致領域に含まれるエッジ画素毎の勾配Sの分布から、撮像画像上の対象物の指示方向を特定する対象物方向特定部(9)とを備える。これにより、撮像対象物の指示方向を安定して検出する。

Description

画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、及び画像処理装置の制御方法
 本発明は、撮像された撮像画像中の対象物(例えば、指)を認識する機能を備えた画像処理装置、該画像処理装置の制御プログラム、該制御プログラムを記録したコンピュータ読み取り可能な記録媒体、及び前記画像処理装置の制御方法に関するものである。
 一般に、カメラ等を用いて撮像された撮像画像中にある所定の対象物の指示位置等を、画像処理技術を用いて認識し、その認識結果に応じた処理を行う装置が知られている。例えば、撮像画像中の人間の手や指などの部位を認識し、その位置を特定した上で、特定された位置に応じてデータ入力や操作を行う画像処理装置が知られている。
 このように、撮像された撮像画像中の対象物を、画像処理技術を用いて認識し、その指示位置等を特定する技術として特許文献1に開示された操作入力装置がある。
 特許文献1に開示された操作入力装置は、主として、半透明スクリーンの背面側から撮影する撮影手段と、撮影手段が取得した画像データを用い、半透明スクリーンに映る画像の輝度を基に表示面における操作位置を検出する操作位置検出手段とを備えている。
 操作位置検出手段は、画像データの中で輝度が閾値以上となる複数の領域を、ユーザが表示面に触れている接触領域として検出し、ユーザが表示物を選択操作する際の操作方向に対し、当該操作方向の最先端に位置する接触領域を操作位置として検出している。
 さらに、操作位置検出手段は、半透明スクリーン上の区画域である第1領域及び第2領域の各々において、輝度が閾値よりも低い値の第2閾値以上で、かつ前記閾値よりも低い値となる領域を操作部位の画像として認識し、第1領域に表示される第1操作部位画像と、第2領域に表示される第2操作部位画像との各々で画像の重心を算出し、これら2つの重心を通るとともに第2操作部位画像の重心から第1操作部位画像の重心に向かう先端方向ベクトルを操作方向として算出している。
 以上のように、操作入力装置は、撮影手段から入力した画像を用いて操作位置や操作方向を特定するようになっている。
日本国公開特許公報「特開2007-80187号公報(公開日:2007年3月29日)」
 しかしながら、前記従来の特許文献1に開示された操作入力装置には、以下のような問題点がある。
 まず、この操作入力装置では、半透明スクリーン上の区画域である第1領域及び第2領域の各々において認識した操作部位の画像を用いて操作方向を算出しているため、検出対象物が第1領域及び第2領域の2つの領域にまたがらない(いずれか一方のみに存在する)場合は、操作方向を検出できないという問題点がある。
 また、この操作入力装置は、画像データ中で輝度が閾値以上となる複数の領域を操作部位の画像として認識し、これら複数の操作部位画像の重心をもとに操作方向を算出しているので、例えば、人間の手や指の場合は、接触面に対する手や指の角度の変動に連動して、接触している部位のうち先端では無い側(指であれば、付け根側)の輝度が変動し、それに従い操作部位画像の面積や形状が変化することから、操作方向を安定して算出することが難しいという問題点もある。
 本発明は、前記問題点に鑑みなされたものであって、撮像対象物の指示方向を安定して検出することができる画像処理装置などを提供することを目的とする。
 本発明の画像処理装置は、前記課題を解決するために、撮像された撮像画像の画像データから画素値勾配特徴量を算出する勾配特徴量算出手段と、前記勾配特徴量算出手段が算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定手段と、前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、前記合致度算出手段が算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定手段と、前記合致領域特定手段が特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定手段とを備えていることを特徴とする。
 また、本発明の画像処理装置の制御方法は、前記課題を解決するために、撮像された撮像画像の画像データを用いて、前記撮像画像上の対象物の指示方向を特定する機能を備えた画像処理装置の制御方法であって、前記画像データから画素値勾配特徴量を算出する勾配特徴量算出ステップと、前記勾配特徴量算出ステップで算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定ステップと、前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出ステップと、前記合致度算出ステップで算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定ステップと、前記合致領域特定ステップで特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定ステップとを含んでいることを特徴とする。
 前記構成又は方法によれば、勾配特徴量算出手段又は勾配特徴量算出ステップでは、撮像された撮像画像の画像データから画素値勾配特徴量を算出する。
 次に、エッジ画素特定手段又はエッジ画素特定ステップでは、画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定する。
 これにより、画像データ上の全画素の中から、画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を、画素値勾配特徴量の大きさが所定の閾値未満であるエッジ画素以外の画素から選り分けることができる。
 次に、合致度算出手段又は合致度算出ステップでは、画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、照合領域とモデルパターンとのマッチングの度合いを示す合致度を算出する。
 これにより、合致度算出手段又は合致度算出ステップで算出した合致度から照合領域とモデルパターンとのマッチングの度合いを認識することができる。
 次に、合致領域特定手段又は合致領域特定ステップでは、合致度算出手段又は合致度算出ステップで算出した合致度が最大となる照合領域を合致領域として特定する。
 これにより、画像データにおける対象物の存在領域を示す合致領域を特定することができる。
 次に、方向特定手段又は方向特定ステップでは、特定した合致領域に含まれるエッジ画素毎の画素値勾配特徴量の分布から、撮像画像上の対象物の指示方向を特定する。
 ここで、照合領域と、予め定められたモデルパターンとの照合(以下「パターンマッチング」と言う。)に使用される量としては、画素値(濃度値又は輝度値)などのスカラー量も考えられる。しかしながら、このようなスカラー量は量子化したとしても、対象物の状況等に応じて、常に変わり得るため、あらかじめモデルパターンを設定しておくことは困難である。なお、量子化とは、所定の範囲内の量を一律にある一定の量と看做して扱うことである。
 一方、画素値勾配特徴量は、少なくとも画素値の勾配方向という方向の自由度を持っている。なお、画素値の勾配は、特定の画素と隣接画素との間で画素値の差分をとり、これらの差分を全ての隣接画素について加算することによって得られるベクトル量であり、勾配の大きさ及び勾配方向を持つ。
 ここで、例えば、勾配方向は、0rad以上2πrad未満の角度に限定することができ、0rad以上2πrad未満の角度範囲を適当な上限角度で等分割することにより、無限の自由度を持つ勾配方向を有限の数の方向に量子化することが可能である。
 また、勾配方向は、例えば、8方向に量子化することによって、1つの画素について算出される勾配方向が取り得る状態を8(無方向を含めると9)という極めて少ない状態に離散化することでき、さらにそれぞれの状態には、方向が異なるという識別が容易な特徴を持たせることができる。したがって、画素値勾配特徴量は、上述したパターンマッチングに適した量である。
 さらに、各勾配方向の分布は、例えば、指のように表面が柔らかく、面に接触することにより接触面が円形になる場合、エッジ部分からエッジ部分に囲まれた領域の中心付近に向かうか、或いは、該中心付近から放射状にエッジ部分に向かうかのいずれかの傾向を示す。また、対象物が指の場合、各画素における、勾配の大きさ(濃度差)は、接触面に対する指の角度の変動に関わらず、凡そ指の付け根側は小さく、指の先端に向かうほど大きくなる傾向を示す。これらの傾向は、指の角度の変動等に応じて、大きく変わることは無い。なお、対象物が指の場合、指示方向は、通常、指の付け根側から指の先端に向かう向きに沿っている。
 したがって、画素値勾配特徴量を用いれば、合致領域に含まれる画素のうち、エッジ画素毎の画素値勾配特徴量の分布が示す上述した傾向を利用できるので、合致領域に含まれるエッジ画素毎の画素値勾配特徴量の分布から、撮像画像上の対象物の指示方向を特定することができる。
 よって、単一の合致領域のみを用いて指示方向を特定できるので、特許文献1に開示された操作入力装置のように対象物が第1領域及び第2領域の2つの領域にまたがらない場合に、操作方向を検出できないという問題点は生じない。よって、安定した指示方向の特定が可能である。
 また、画素値勾配特徴量は、上述したように画素値の差分であるから、例えば、指の角度の変動等に連動して、指の付け根側の画素値が変動したとしても、画素値勾配特徴量の大きさが、指の付け根側は小さく、指の先端に向かうほど大きくなるという傾向及びその勾配方向はあまり変動せず、特許文献1に開示された操作入力装置のように、指の付け根側の画素値の変動により操作方向を安定して算出できなくなるという問題点は生じない。よって、安定した指示方向の特定が可能である。
 以上のように、本発明の画像処理装置及びその制御方法によれば、撮像対象物の指示方向を安定して検出することができる。
 ここで、「画像データ」は、アナログデータ及びデジタルデータの何れであっても良い。また、「画素値」は、輝度値や濃度値のことである。なお、アナログデータの場合、画像データを複数の領域に分割した各分割領域のことを画素、各分割領域における平均濃度値を画素値と呼ぶ。また、「画素値」が濃度値の場合、「画素値勾配特徴量」は「濃度勾配特徴量」と称しても良い。
 本発明の画像処理装置は、以上のように、撮像された撮像画像の画像データから画素値勾配特徴量を算出する勾配特徴量算出手段と、前記勾配特徴量算出手段が算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定手段と、前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、前記合致度算出手段が算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定手段と、前記合致領域特定手段が特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定手段とを備えている構成である。
 また、本発明の画像処理装置の制御方法は、以上のように、前記画像データから画素値勾配特徴量を算出する勾配特徴量算出ステップと、前記勾配特徴量算出ステップで算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定ステップと、前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出ステップと、前記合致度算出ステップで算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定ステップと、前記合致領域特定ステップで特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定ステップとを含んでいる方法である。
 それゆえ、撮像対象物の指示方向を安定して検出することができる。
 本発明の他の目的、特徴、および優れた点は、以下に示す記載によって十分分かるであろう。また、本発明の利点は、添付図面を参照した次の説明で明白になるであろう。
本発明における画像処理装置(電子機器)の実施の一形態を示すブロック図である。 前記画像処理装置に関し、指の腹(指腹)の撮像の様子、及び指腹の撮像画像の特徴を示す概要図であり、(a)は、周囲が暗い場合における指腹の撮像の様子を示し、(b)は、周囲が暗い場合における指腹の撮像画像の特徴を示し、(c)は、周囲が明るい場合における指腹の撮像の様子を示し、(d)は、周囲が明るい場合における指腹の撮像画像の特徴を示す。 勾配方向を8方向に量子化するために参照される参照テーブルを示す図であり、(a)は、勾配方向を8方向に量子化するために参照される参照テーブルの半分の例を示し、(b)は、前記参照テーブルの残りの半分の例を示す。 前記画像処理装置の全体的な動作の概要を示すフローチャートである。 勾配方向の分布の例を示す概要図であり、(a)は、周囲が暗い場合における勾配方向の分布の一例を示し、(b)は、周囲が明るい場合における勾配方向の分布の一例を示す。 勾配方向の分布の他の例を示す概要図であり、(a)は、周囲が暗い場合における勾配方向の分布の他の一例を示し、(b)は、周囲が明るい場合における勾配方向の分布の他の一例を示す。 前記画像処理装置の動作のうち、パターンマッチング過程の動作の一例を示すフローチャートである。 前記画像処理装置に関し、勾配方向毎の一致画素数パターン(方向一致パターン)と対象物指示方向との対応関係を示す対応関係デーブルの例を示す図であり、(a)は、前記対応関係デーブルの一例を示し、(b)は、前記対応関係デーブルの他の一例を示す。 前記画像処理装置に関し、エッジ画素毎の勾配方向の分布の例、勾配方向毎の一致画素数の例、及び特定された対象物の指示方向の一例を示す概要図であり、(a)は、エッジ画素毎の勾配方向の分布の一例を示し、(b)は、勾配方向毎の一致画素数の一例を示し、(c)は、特定された対象物の指示方向の一例を示し、(d)は、エッジ画素毎の勾配方向の分布の他の一例を示し、(e)は、勾配方向毎の一致画素数の他の一例を示し、(f)は、特定された対象物の指示方向の他の一例を示す。 前記画像処理装置に関し、エッジ画素毎の勾配方向の分布の他の例、勾配方向毎の一致画素数の他の例、及び勾配方向毎の一致画素数を長さとするベクトルから合成された合成ベクトルによって特定された対象物の指示方向の他の例を示す概要図であり、(a)は、エッジ画素毎の勾配方向の分布のさらに他の一例を示し、(b)は、勾配方向毎の一致画素数のさらに他の一例を示し、(c)~(e)は、勾配方向毎の一致画素数を長さとするベクトルから合成された合成ベクトルによって特定された対象物の指示方向のさらに他の一例を示す。 前記画像処理装置の動作のうち、パターンマッチング過程の動作の他の一例を示すフローチャートである。 前記画像処理装置に関し、第1エッジ画素毎及び第2エッジ画素毎の勾配方向の分布の例、第1エッジ画素における勾配方向毎の一致画素数の例、及び第2エッジ画素における勾配方向毎の一致画素数の例を示す概要図であり、(a)は、第1エッジ画素毎及び第2エッジ画素毎の勾配方向の分布の一例を示し、(b)は、第1エッジ画素における勾配方向毎の一致画素数の一例を示し、(c)は、第2エッジ画素における勾配方向毎の一致画素数の一例を示す。 前記画像処理装置に関し、対象物(指示)位置特定過程の動作の一例を示すフローチャートである。 前記画像処理装置に関し、対象物の指示方向と逆向きの方向ベクトルを求めた様子、及び前記方向ベクトルと一致する勾配方向を持つエッジ画素の存在領域の一例を示す概要図であり、(a)は、対象物の指示方向と逆向きの方向ベクトルを求めた様子を示し、(b)は、前記方向ベクトルと一致する勾配方向を持つエッジ画素の存在領域の一例を示す。 前記画像処理装置に関し、対象物(指示)位置特定過程の動作の他の一例を示すフローチャートである。
 本発明の一実施形態について図1~図15に基づいて説明すれば、次の通りである。以下の特定の実施形態で説明すること以外の構成は、必要に応じて説明を省略する場合があるが、他の実施形態で説明する構成と同じである。また、説明の便宜上、各実施形態に示した部材と同一の機能を有する部材については、同一の符号を付し、適宜その説明を省略する。
 また、以下の各実施の形態では、画像表示部の例として液晶ディスプレイを採用した場合について説明するが、液晶ディスプレイ以外の画像表示部を採用する場合も本発明の適用範囲に含まれる。
  〔第1の実施形態〕
 本発明の第1の実施形態である画像処理装置1(電子機器20)について図1~図10に基づいて説明すれば、以下の通りである。
 まず、画像処理装置1の主要な機能について説明し、次に図1に基づき、本実施形態の画像処理装置1の構成について説明する。
 画像処理装置1の主要な機能のとしては、以下の2つの機能がある。
 第1の機能は、画像表示機能であり、画像処理装置1は、図示しない複数の画素から構成される液晶ディスプレイ及び該液晶ディスプレイに光を照射するバックライトを備え、画像を表示することが可能となっている。
 また、第2の機能は、画像撮像機能であり、画像処理装置1の液晶ディスプレイにおける各画素内には、光センサ(又は撮像センサ)が内蔵され、光センサによって液晶ディスプレイの表示画面に近接してきた外部の物体など(対象物)を撮像した撮像画像を画像データとして取り込むことが可能となっている。
 なお、液晶ディスプレイは、複数の画素のうち所定数の画素毎に光センサが内蔵されているものであっても良いが、光センサによる撮像画像の解像度の観点から、光センサは、全ての画素毎に内蔵されていることが好ましい。
 また、光センサとしては、フォトダイオードの他、光電効果を動作原理とし、液晶ディスプレイなどの各画素に内蔵できるものであれば、どのような光センサを用いても良い。
 次に、図1に示すように、画像処理装置1は、勾配特徴量算出部(勾配特徴量算出手段)2、エッジ抽出部(エッジ画素特定手段)3、算出/抽出データ保持部4、一致画素数算出部(合致度算出手段)5、モデルパターン格納部6、合致領域特定部(合致領域特定手段)7、合致領域情報格納部8、対象物方向特定部(方向特定手段)9、対象物方向特定用情報格納部10、及び対象物座標特定部(位置特定手段)11を備える。
 勾配特徴量算出部2は、画像データ上の画素毎に、注目画素の画素値と複数の隣接画素の画素値とから、注目画素の画素値の勾配(画素値勾配特徴量)Sを算出する。
 ここで、本実施形態の「画像データ」は、デジタルデータを想定しているが、アナログデータであっても良い。
 また、「画素値」は、輝度値や濃度値のことである。なお、アナログデータの場合、画像データを複数の領域に分割した各分割領域のことを画素と呼び、各分割領域における平均濃度値を画素値と呼ぶ。また、「画素値」が濃度値の場合、「画素値勾配特徴量」は「濃度勾配特徴量」と称しても良い。
 本実施形態では、勾配Sは、(横方向勾配Sx,縦方向勾配Sy)で定義され、勾配Sは、大きさ〔勾配の大きさ(画素値勾配特徴量)POW(S)〕と向き〔勾配方向(画素値勾配特徴量)ANG(S)〕とを持つベクトル量である。
 なお、勾配Sは、数学的には、特定の画素と隣接画素との間で画素値の差分をとり、これらの差分を大きさとし、特定の画素から隣接画素に向かう向きを正とするベクトルを全ての隣接画素について加算することによって算出される。
 より具体的には、勾配Sは、Sobel(ソーベル)オペレータ、Prewitt(プリウイット)オペレータなどのエッジ抽出オペレータを用いて算出すれば良い。
 例えば、Sobelオペレータを用いて、各画素の画素位置x(i,j)における局所的な縦方向勾配Sy及び横方向勾配Sxを求めた後、次式(1)及び(2)を用いて画素位置x(i,j)における勾配方向ANG(S)及び勾配の大きさPOW(S)を求めることができる。ここで、iは水平方向に沿った画素の位置を、jは垂直方向に沿った画素の位置をそれぞれ表す。i及びjは正の整数である。
 勾配方向ANG(S)=tan-1(Sy/Sx)   ・・・(1)
 勾配の大きさPOW(S)=√(Sx^2+Sy^2)  ・・・(2)
 次に、エッジ抽出部3は、勾配特徴量算出部2が算出した勾配の大きさPOW(S)が所定の閾値以上であるエッジ画素を抽出(特定)する。
 次に、算出/抽出データ保持部4は、勾配特徴量算出部2が算出した、画像データ上の画素毎の勾配Sに関するデータや、エッジ抽出部3が抽出したエッジ画素の画像データ上の位置等に関するデータを保持する。
 これにより、画像データ上の全画素の中から、勾配の大きさPOW(S)が所定の閾値以上であるエッジ画素を、勾配の大きさPOW(S)が所定の閾値未満であるエッジ画素以外の画素から選り分けることができる。
 次に、一致画素数算出部5は、上述した算出/抽出データ保持部4から画像データ上の画素毎の勾配Sに関するデータを読出し、後述するモデルパターン格納部6からモデルパターンを読出し、照合領域と、モデルパターンとの照合(以下「パターンマッチング」と言う。)を行って、照合領域に含まれる勾配方向と、モデルパターンに含まれる勾配方向とが一致する画素数(合致度:以下、「一致画素数」と呼ぶ。)を算出する。
 より具体的には、一致画素数算出部5は、照合領域に含まれる注目画素を、画像データに含まれる全ての画素に合わせながら、照合領域を一画素づつ走査することによって複数の照合領域を設定するとともに、各照合領域について算出される一致画素数を、各照合領域に対応する各注目画素について算出することで、画像データに含まれる全ての画素について一致画素数を算出することができるようになっている。
 また、一致画素数算出部5は、合致領域に含まれるエッジ画素毎に勾配方向ANG(S)の一致・不一致を判定し、合致領域に含まれる勾配方向ANG(S)毎の一致画素数を算出できるようになっている。
 ここで、勾配方向ANG(S)は、0rad以上2πrad未満の範囲で変化する連続量であるが、本実施形態の一致画素数算出部5では、これを8方向に量子化したものを勾配方向として用いる。
 次に、図3の(a)及び図3の(b)に基づき、勾配方向ANG(S)の8方向への量子化方法について説明する。
 図3の(a)は、勾配方向を8方向に量子化するために参照される参照テーブルの半分の例を示し、図3の(b)は、参照テーブルの残りの半分の例を示す。
 まず、各画素について、(2)式で求めた横方向勾配Sxについて、Sx≧0ならば、図3の(a)に示す参照テーブルにしたがい、勾配方向ANG(S)に応じて量子化された勾配方向を設定する。
 一方、Sx<0ならば、図3の(b)に示す参照テーブルにしたがって、勾配方向ANG(S)に応じて量子化された勾配方向を設定する。
 なお、ここでは、勾配方向を8方向に量子化した場合について説明するが、量子化された勾配方向の数は8に限定されるものではなく、パターンマッチングに要求される精度条件や、ハードウェアの性能等を鑑みて、増減させることもできる。
 上述したように、画像処理装置1では、少なくとも画素値の勾配方向を示す勾配方向ANG(S)を特徴量として用いる。
 画素値の勾配方向ANG(S)は、方向を示す特徴量なので直接指示方向と結びつけることができ、対象物の指示方向の特定が簡単な特徴量である。
 一方、勾配の大きさPOW(S)などのスカラー量は、方向を示す特徴量でないので直接指示方向と結びつけることが困難な特徴量である。
 従って、特徴量として画素値の勾配方向ANG(S)を用いることによって、対象物の指示方向の特定をより簡単に実現することができる。
 以上説明した勾配方向ANG(S)を利用したパターンマッチングでは、照合領域に含まれる画素毎に、勾配方向ANG(S)が一致したか否かが判定できる。
 よって、照合領域の全画素に亘って計算した一致画素数を合致度として算出することもできるし、勾配方向ANG(S)毎に計算した一致画素数を合致度として算出することもできる。さらに、照合領域に含まれる画素毎に合致度(一致・不一致)を算出することもできる。
 ここで、勾配方向ANG(S)毎に、一致画素数を算出した場合、勾配方向ANG(S)毎の一致画素数が特定の勾配方向ANG(S)に偏っていれば、この偏りを利用して簡単に指示方向を特定することができる。よって、勾配方向ANG(S)は、指示方向の特定に適した特徴量と言える。
 次に、勾配Sを量子化する他の形態について説明する。まず、一致画素数算出部5は、照合領域に含まれる勾配方向ANG(S)と、モデルパターンに含まれる対応する勾配方向ANG(S)との差分が所定角度以下である画素の数を一致画素数として算出しても良い。
 これにより、例えば、照合領域に含まれる勾配方向ANG(S)と、モデルパターンに含まれる対応する勾配方向ANG(S)との差分が所定角度以下である画素をモデルパターンと一致した画素と判定し、照合領域に含まれる勾配方向ANG(S)と、モデルパターンに含まれる対応する勾配方向ANG(S)との差分が所定角度を超える画素をモデルパターンと一致しない画素と判定することで、照合領域に含まれる全画素の一致画素数を算出することができる。
 なお、勾配方向を量子化する方法としては、上述した例の他、例えば、0rad以上2πrad未満の角度範囲を適当な上限角度で等分割することにより、無限の自由度を持つ勾配方向を有限の数の方向に量子化することが可能である。
 本実施形態では、簡単のため、撮像画像、照合領域、及びモデルパターンのそれぞれの形状がいずれも矩形であるものとするが、それぞれの形状は、矩形に限られない。また、照合領域に含まれる画素の中から注目する単一の画素を予め決めておき、その単一の画素のことを注目画素と称することとする。
 ここで、パターンマッチングは、例えば、画像データの左上角の画素を、照合領域の注目画素の位置とした状態からスタートし、照合領域を、注目画素を基準として画像データの左上角から右下角まで一画素づつ走査させながら、モデルパターンとのマッチングが行われる。
 なお、画像データの端(最外周)の画素を、照合領域の注目画素の位置とした状態のとき、照合領域の一部に画素が存在していない場合が生じ得る。しかしながら、このような境界問題が生じる場合は、照合領域の画素が存在していない部分の画素を除外してパターンマッチングを行っても良い。また、周期的境界条件などを設定し、照合領域上の照合領域の画素が存在していない部分の画素を適当な画素値勾配特徴量を持つモデルで置き換えてパターンマッチングを行っても良い。
 また、照合領域の大きさや形状は、モデルパターンの大きさや形状に合わせて適宜設定すれば良い。
 以上のようなパターンマッチングにより、一画素づつ走査される照合領域は、複数存在し、一画素づつ走査させた照合領域毎に一致画素数が算出されることになる。すなわち、画像データ上の全ての画素のそれぞれについて一致画素数が算出される。
 次に、モデルパターン格納部6は、上述したようにモデルパターンを格納しておくものである。
 以上より、一致画素数算出部5が算出した一致画素数から照合領域とモデルパターンとのマッチングの度合いを認識することができる。
 ここで、パターンマッチングに使用される量としては、画素値(濃度値又は輝度値)などのスカラー量も考えられる。しかしながら、このようなスカラー量は量子化したとしても、対象物の状況等に応じて、常に変わり得るため、あらかじめモデルパターンを設定しておくことは困難である。なお、量子化とは、所定の範囲内の量を一律にある一定の量と看做して扱うことである。
 一方、上述した勾配Sは、方向の自由度を持つ特徴量である。また、勾配Sは、特定の画素と隣接画素との間で画素値の差分をとり、これらの差分を全ての隣接画素について加算することによって得られるベクトル量であり、勾配の大きさPOW(S)及び勾配方向ANG(S)を持つ。
 また、勾配方向ANG(S)は、上述のように8方向に量子化することによって、1つの画素について算出される勾配方向ANG(S)が取り得る状態を8(無方向を含めると9)という極めて少ない状態に離散化することでき、さらにそれぞれの状態には、方向が異なるという識別が容易な特徴を持たせることができる。したがって、勾配Sは、上述したパターンマッチングに適した量である。
 次に、本実施形態では、パターンマッチングで算出される「合致度」の例として一致画素数を算出する場合について説明した。
 しかしながら、「合致度」の計算方法は、大きくわけて2つの計算方法が例示できる。
 第1の計算方法は、本実施形態のように照合領域に含まれる画素毎の勾配Sとモデルパターンに含まれる対応する画素毎の勾配Sとが一致する一致画素数を計算する方法である。このとき、一致画素数が大きいほど、合致度は大きくなり、一致画素数が小さいほど合致度は小さくなる。
 但し、勾配の大きさPOW(S)及び勾配方向ANG(S)には無限の自由度があるので、一致画素数を求めるには、工夫が必要である。例えば、上述したように、勾配Sを、勾配の大きさPOW(S)を捨象して、0rad以上2πrad未満の角度範囲を適当な上限角度で等分割すれば良い。また、勾配Sから勾配の大きさPOW(S)を捨象し、勾配方向ANG(S)を8方向や16方向に量子化したものを用いても良い。
 次に、第2の計算方法は、照合領域に含まれる画素毎の勾配Sについてモデルパターンとの差分を計算し、これらの差分の総和を計算して求める方法である。このとき、差分の総和が大きいほど、合致度は小さくなり、差分の総和が小さいほど合致度は大きくなる。
 なお、第1の計算方法では、画素毎に一致・不一致を判定し、第2の計算方法では、画素毎に差分を計算することができる。よって、これらの方法では、画素毎の一致・不一致又は画素毎の差分に基づいて画素毎に合致度を設定することも可能である。
 また、第2の計算方法では、画素毎の勾配方向ANG(S)の差分が、所定の閾値角度以下であれば、モデルパターンの勾配方向ANG(S)と一致したと判断し、モデルパターンの勾配方向ANG(S)を、その画素の勾配方向ANG(S)とすれば、合致領域に含まれる勾配方向ANG(S)毎の一致画素数を算出することも可能である。
 次に、合致領域特定部7は、一致画素数算出部5が算出した一致画素数が最大となる照合領域を合致領域として特定する。
 これにより、画像データにおける対象物の存在領域を示す合致領域を特定することができる。
 合致領域情報格納部8には、合致領域特定部7が特定した合致領域の画像データ上の位置に関するデータ、合致領域に含まれる画素毎の勾配Sに関するデータ、エッジ抽出部3が抽出したエッジ画素の合致領域上の位置に関するデータ及び合致領域に含まれる画素毎の一致画素数に関するデータなどが格納される。
 次に、対象物方向特定部9は、合致領域情報格納部8から、合致領域の画像データ上の位置に関するデータ、合致領域に含まれる画素毎の勾配Sに関するデータ、及びエッジ画素の合致領域上の位置に関するデータなどを読出し、後述する対象物方向特定用情報格納部10から、勾配方向ANG(S)毎の方向一致パターンと対象物の指示方向を示すものとして予め定められた指示方向との対応関係を示す対応関係テーブル(対応付け情報:図8の(a)など参照)又は、勾配方向ANG(S)毎の一致画素数の分布と指示方向との対応関係を示す対応関係テーブル(対応付け情報:図9の(b)など参照)を読出し、対応関係テーブルを参照して、合致領域に含まれる画素毎の勾配方向ANG(S)の分布から、指示方向を特定する。
 なお、指示方向の特定は、上述した対応関係テーブルに基づいて行ってもよいし、対応関係テーブルを用いずに、合致領域に含まれる画素毎の勾配方向ANG(S)と一致画素数のみを用いて行ってもよい。
 対象物方向特定用情報格納部10には、上述したように、勾配方向ANG(S)毎の方向一致パターンと指示方向との対応関係を示す対応関係テーブル又は、勾配方向ANG(S)毎の一致画素数の分布と指示方向との対応関係を示す対応関係テーブルなどが格納される。
 ところで、撮像時に生じたノイズ又は画素の欠陥等によるエラー画素が、勾配Sに影響を及ぼし、指示方向の特定精度が低下してしまう可能性がある。
 そこで、このような問題点を解決するために、上述した一致画素数算出部5は、照合領域上のエッジ抽出部3によって特定されたエッジ画素を含む領域とモデルパターンとの照合を行うようにしても良い。
 これにより、あまり重要でないエッジ画素以外の画素を除外し、エッジ画素についてのみパターンマッチングを行うようにしているので、上述したエラー画素などの大部分を除外することができる。これにより指示方向の特定精度を向上させることができるので、指示方向を安定して検出することができる。
 次に、対象物座標特定部11は、合致領域情報格納部8から合致領域の画像データ上の位置に関するデータ、エッジ画素の合致領域上の位置に関するデータ、及び合致領域に含まれる画素毎の一致画素数に関するデータなどを読出し、合致領域に含まれる画素毎に算出された一致画素数の分布から、撮像画像上の対象物の指示位置を特定する。
 よって、合致領域に含まれる画素毎の一致画素数の分布から撮像画像上の対象物の指示位置を特定することができる。
 例えば、合致領域に含まれる画素毎の一致画素数のうち、最大の一致画素数をもつ画素の位置を対象物の指示位置としても良いし、合致領域に含まれる画素毎の一致画素数を重みとした重み付け平均によって求めた位置を対象物の指示位置としても良い。
 なお、上述した算出/抽出データ保持部4、モデルパターン格納部6、合致領域情報格納部8、及び対象物方向特定用情報格納部10は、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやコンパクトディスク-ROM/MO(magneto-optic)/MD(magnetic disk)/デジタルビデオデイスク/コンパクトディスク-R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM(Erasable Programmable ROM)/EEPROM(Electrically Erasable Programmable ROM)/フラッシュROM等の半導体メモリ系などを用いることができる。
 次に、図2の(a)~図2の(d)に基づき、画像処理装置1の液晶ディスプレイの各画素に内蔵されたフォトダイオードによって撮像される対象物として、指の腹(以下「指腹」という)の例を挙げ、それぞれの撮像画像(画像データ)の特徴の概要について説明する。
 図2の(a)は、周囲が暗い場合における指腹の撮像の様子を示し、図2の(b)は、周囲が暗い場合における指腹の撮像画像の特徴を示す。
 まず、周囲が暗い状況で、図2の(a)に示すように、ユーザが液晶ディスプレイの表示画面に人差し指の腹を接触させると、図2の(b)の示す撮像画像(画像データ)31は、バックライトが撮像対象(指の腹)に反射して得られる画像となるため、白い円形状がぼやけたような画像となる。
 また、各画素における勾配方向ANG(S)は、凡そ撮像画像31上のエッジ部分からエッジ部分に囲まれた領域の中心付近に向かう傾向を示している。なお、勾配方向ANG(S)は、濃度差が発生する方向であって、ここでは、暗い部分から明るい部分に向かう向きを正としている。また、各画素における勾配の大きさPOW(S)(濃度差)は、おおよそ、指の付け根側は小さく、指の先端に向かうほど大きくなる傾向を示している。
 次に、図2の(c)は、周囲が明るい場合の指腹の撮像の様子を示し、図2の(d)は、周囲が明るい場合の指腹の撮像画像の特徴を示す。
 周囲が暗い状況で、図2の(c)に示すように、ユーザが液晶ディスプレイの表示画面に人差し指の腹を接触させると、図2の(d)に示す撮像画像(画像データ)32は、外光が液晶ディスプレイの表示画面に入射することによって得られる画像(接触した場合は、バックライトによる反射光も混じる)となるため、人差し指で外光が遮られることによって生じた指の影と、液晶ディスプレイの表示画面に接触した指腹にバックライトの光が反射した成分が混ざり合い、黒に近い灰色の円形状となる。
 撮像画像32の場合、周囲が外光で明るいので、各画素における勾配方向ANG(S)は、図2の(b)に示す撮像画像31の白い円形状の部分における勾配方向ANG(S)と逆向きの傾向を示している。
 一方、撮像画像32における、各画素における勾配の大きさPOW(S)は、凡そ指の付け根側は小さく、指の先端に向かうほど大きくなる傾向を示しており、この傾向は、撮像画像31の傾向と同じである。
 したがって、勾配Sを特徴量として用いれば、合致領域に含まれる画素のうち、エッジ画素毎の勾配Sの分布が示す上述した傾向を利用できるので、合致領域に含まれるエッジ画素毎の勾配Sの分布から、撮像画像上の対象物の指示方向を特定することができる。
 よって、単一の合致領域のみを用いて指示方向を特定できるので、特許文献1に開示された操作入力装置のように対象物が第1領域及び第2領域の2つの領域にまたがらない場合に、操作方向を検出できないという問題点は生じない。よって、安定した指示方向の特定が可能である。
 また、勾配Sは、上述したように画素値の差分であるから、例えば、指の角度の変動等に連動して、指の付け根側の画素値が変動したとしても、勾配の大きさPOW(S)が、指の付け根側は小さく、指の先端に向かうほど大きくなるという傾向、及びその勾配方向ANG(S)はあまり変動せず、特許文献1に開示された操作入力装置のように、指の付け根側の画素値の変動により操作方向を安定して算出できなくなるという問題点は生じない。よって、安定した指示方向の特定が可能である。
 以上のように、本実施形態の画像処理装置1によれば、撮像対象物の指示方向を安定して検出することができる。
  (全体的な動作の概要)
 次に、図1及び図4に基づいて、画像処理装置1(電子機器20)の動作の概要について説明する。図4は、画像処理装置1の全体的な動作の概要を示すフローチャートである。
 まず、ステップS101(以下「S101」のように記載する。)では、勾配特徴量算出部2が、画像データ上の画素毎に、勾配Sを算出し、S102に進む(勾配特徴量算出過程:勾配特徴量算出ステップ)。
 S102では、エッジ抽出部3が、所定の閾値以上の勾配の大きさPOW(S)を持つ画素をエッジ画素として特定し、エッジ画素として特定されなかった画素については、勾配方向は「無方向」、勾配の大きさは「0」に設定し直す(エッジ画素特定過程:エッジ画素特定ステップ)。
 このように、あまり重要でない画素や、撮像時のエラー画素などにおける勾配方向ANG(S)を一律無方向及び/又は勾配の大きさPOW(S)を0とみなすことで、後述する指示位置特定や指示方向特定の精度をさらに向上させることができる。
 S103では、一致画素数算出部5が、照合領域と、モデルパターンとの照合を行って、一致画素数を算出した後に、合致領域特定部7が、一致画素数算出部5が算出した一致画素数が最大となる合致領域を特定してS104に進む(パターンマッチング過程:合致度算出ステップ/合致領域特定ステップ)。
 S104では、対象物方向特定部9が、合致領域に含まれるエッジ画素毎の勾配Sの分布から対象物の指示方向を特定し、対象物座標特定部11が、一致画素数算出部5が算出した、画素毎の一致画素数分布から、対象物の指示位置を特定し、「エンド」となる(対象物位置・方向特定過程:位置特定ステップ/方向特定ステップ)。
 なお、対象物の指示位置の特定においては、一致画素数の分布の重心位置(合致領域に含まれる画素毎の一致画素数を重み付けとする重み付け平均で求めた位置)を対象物の指示位置として特定する方法が考えられるが、この方法に限定されるものではない。
 例えば、一致画素数が最大である位置を対象物の指示位置として特定してもよい。また、合致領域をそのまま対象物の存在範囲(位置及び大きさ)として特定してもよい。さらに、一致画素数の分布の重心又は一致画素数が最大である位置を中心として、モデルパターンの大きさ分の範囲を、対象物の存在範囲としてもよい。
 また、対象物の指示方向の特定においては、S103において、一致画素数が最大である位置(画素)において特定された勾配方向ANG(S)を、対象物の指示方向として特定する方法が考えられるが、この方法に限定されるものではない。例えば、各画素において特定された勾配方向ANG(S)をベクトルの方向とし、一致画素数又は勾配の大きさPOW(S)と一致画素数との積のいずれかを長さとした方向ベクトル(第1方向ベクトル又は第2方向ベクトル)を定義し、エッジ画素毎の方向ベクトルを合成して得られた合成ベクトルが示す方向を、対象物の指示方向として特定してもよい。
 また、各勾配方向ANG(S)について、勾配の大きさPOW(S)の平均値を算出し、該平均値を長さとするベクトル(第3方向ベクトル)を定義してもよい。
 さらに、各勾配方向ANG(S)について、勾配の大きさPOW(S)のメディアン(中央値)を算出し、該メディアンを長さとするベクトル(第3方向ベクトル)を定義してもよい。
 ここで、一致画素数が大きい勾配方向ANG(S)は、対象物の指示方向との関係が強いので、勾配方向ANG(S)毎の一致画素数を長さとする第1方向ベクトルの分布を用いれば、指示方向との関係の強弱によってエッジ画素を選り分けることができるので、精度よく指示方向を特定することができる。
 なお、上述した第1方向ベクトルでは、勾配の大きさPOW(S)の自由度は捨象して指示方向の特定を行った。しかしながら、勾配Sは、厳密には、勾配の大きさPOW(S)という自由度を持っているので、勾配の大きさPOW(S)の自由度を含めた第2方向ベクトルの分布から、指示方向を特定するようにすれば、より精度の高い指示方向の特定が可能となる。
 また、上述したように勾配の大きさPOW(S)は、指の付け根側から指の先端付近に向けて大きくなる傾向があるので、上述した第2方向ベクトルでは、最終的に算出される第2方向ベクトルの合成ベクトルに対して、このような傾向を含めることができるので、より精度よく指示方向を特定することができる。
 さらに、上述したように勾配の大きさは、指の付け根側から指の先端付近に向けて大きくなる傾向があるので、上述した第3方向ベクトルでは、最終的に算出される第3方向ベクトルの合成ベクトルに対して、このような傾向を含めることができるので、精度よく指示方向を特定することができる。
 以上が、画像処理装置1の全体の動作の概要である。次に、図1及び図5の(a)~図9の(d)に基づき、パターンマッチング過程における画像処理装置1の各動作の詳細について説明する。
 まず、図5の(a)及び図5の(b)、並びに図6の(a)及び図6の(b)に基づき、照合領域と照合されるモデルパターンの具体例について説明する。
 図5の(a)は、周囲が暗い場合における指腹のモデルパターンの一例を示す。また、図5の(b)は、周囲が明るい場合における指腹の周囲を囲む影のモデルパターンの一例を示し、図5の(a)のモデルパターンと比較すると、各画素の勾配方向が逆向き(180度異なる向き)になっている。
 また、図5の(a)は、バックライトの光の反射光が指腹に当たった状態を基礎として撮像された画像データを想定したものであり、中央に向かうほど明るくなっている様子を示している。一方、図5の(b)は、指の影が撮像された画像データを想定したものであり、画像のエッジ部分に向けて明るくなっている様子を示している。
 図6の(a)は、周囲が暗い場合における画像データと照合されるモデルパターンの他の例を示す。図5の(a)のモデルパターンとの違いは、1つの画素ごとに、2つの勾配方向の自由度が与えられている点である。このようなモデルパターンを工夫することにより、照合の効率化を図りつつ、照合精度を高めることができる。一方、図6の(b)は、指の影が撮像された画像データを想定したものであり、図6の(a)と同様に、1つの画素ごとに、2つの勾配方向の自由度が与えられている。
 次に、図7は、図1に示す画像処理装置1の動作のうち、パターンマッチング過程の動作を示すフローチャートである。
 まず、S201では、一致画素数算出部5が、各勾配方向ANG(S)の一致画素数を全て「0」に初期化して、S202に進む。
 S202では、一致画素数算出部5が、1画素ごとに、モデルパターンによる照合処理を行って、S203に進む。
 S203では、一致画素数算出部5が、S202での照合処理によって、モデルパターンと勾配方向ANG(S)が一致したかどうかを判定する。勾配方向ANG(S)が一致すれば(Yes)、S204に進み、一致しなければ(No)、S205に進む。
 S204では、一致画素数算出部5が、各勾配方向ANG(S)の一致画素数について、S202でモデルパターンと勾配方向ANG(S)が一致した画素数を加算して更新し、S205に進む。
 S205では、一致画素数算出部5が、モデルパターンの全要素(画素)について照合を完了したかどうかを判定する。照合が完了していれば(Yes)、S206に進み、完了していなければ(No)、S202に進み、モデルパターンの次の要素(画素)について照合処理を行う。
 S206では、一致画素数算出部5が、勾配方向ANG(S)毎の一致画素数を合算した値を出力し、S207へ進む。S206で出力された合算値は、図4のS104での対象物位置・方向特定過程で使用される。
 S207では、対象物方向特定部9が、勾配方向ANG(S)毎の一致画素数に基づき、対象物の指示方向を特定して出力し、パターンマッチング過程を終了する。本実施形態における、対象物の指示方向の特定方法については、以下で詳しく述べる。
 次に、図8の(a)~図9の(f)に基づき、対象物方向特定部9による対象物の指示方向特定処理の具体例について説明する。
 図8の(a)及び図8の(b)は、一致画素数算出部5が算出した、勾配方向ANG(S)毎の一致方向の存否を示す一致画素数のパターン(又は方向一致パターン)と、対象物の指示方向との対応関係を示す対応関係テーブルの一例を示す。ここで、方向一致パターンとは、勾配方向ANG(S)毎で「有」「無」のいずれかの値を取るデータであり、「有」は、勾配方向ANG(S)の一致画素数が1以上であり、「無」は、勾配方向ANG(S)の一致画素数が0であることを示している。
 なお、図8の(a)及び図8の(b)に示す対応関係テーブルは、モデルパターンとマッチした勾配方向の偏りが大きい場合に好適である。
 対象物方向特定部9は、一致画素数算出部5で算出された勾配方向ANG(S)毎の一致画素数が、図8の(a)及び図8の(b)に例示されるような対応関係テーブルの一致画素数のどのパターンに該当するかを判定し、対象物の指示方向を特定する。
 次に、対応関係テーブルを用いた指示方向の特定処理について、さらに詳しく述べる。
 図8の(a)は、周囲が暗い場合における対応関係テーブルの一例を示し、図8の(b)は、周囲が明るい場合における対応関係テーブルの一例を示し、図8の(a)の対応関係テーブルと比較すると、対象物の指示方向が逆向き(180度異なる向き)になっている。
 図8の(a)は、バックライトの光の反射光が指の腹に当たった状態を基礎として撮像された画像データを想定したものであり、撮像画像は中央に向かうほど明るくなる傾向を示すことから、対象物の指示方向は、画像中の勾配方向ANG(S)とは逆向き(180度異なる向き)として対応付けられている。
 一方、図8の(b)は、指の影が撮像された画像データを想定したものであり、撮像画像は、画像のエッジ部分に向けて明るくなる傾向を示すことから、対象物の指示方向は、画像中の勾配方向ANG(S)と同じ向きとして対応付けられている。
 なお、図8の(a)及び図8の(b)においては、照合処理によって3種類の勾配方向ANG(S)がマッチングした場合のみを図示しているが、4種類以上の勾配方向ANG(S)がマッチングした場合においても同様の対応関係テーブルが定義できる。
 また、対応関係テーブルは、可能性のある全てのマッチングの組合せにおいて定義しても良いし、図8の(a)及び図8の(b)に示すように一部のマッチングの組合せのみを定義しておいても良い。一部の組合せのみを定義している場合、対象物方向特定部9は、定義されていない勾配方向ANG(S)のマッチング状態が出現したときは、他のマッチング状態と同じ方向を特定してもよいし、方向が未定義(無方向)であるとしてもよい。
 次に、図9の(a)は、勾配特徴量算出部2が算出した、画素毎の勾配方向ANG(S)の分布の一例を示し、図9の(b)は、一致画素数算出部5が算出した、勾配方向ANG(S)毎の一致画素数の分布の一例(対応付け情報)を示す。なお、勾配特徴量算出部2によって「無方向」と特定された画素(エッジ画素ではない画素)は、図9の(a)においては、空箱として示してある。また、図9の(a)は、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データの一例を示す。
 一方、図9の(d)は、勾配特徴量算出部2が算出した、画素毎の勾配方向ANG(S)の分布の他の一例を示し、図9の(e)は、一致画素数算出部5が算出した、勾配方向ANG(S)毎の一致画素数の分布の他の一例(対応付け情報)を示す。なお、勾配特徴量算出部2によって「無方向」と特定された画素(エッジ画素ではない画素)は、図9の(d)においては、空箱として示してある。また、図9の(d)は、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データの他の一例を示す。
 なお、図9の(a)及び図9の(b)に示す一致画素数の分布は、モデルパターンとマッチした勾配方向の偏りが小さい場合に好適である。なお、一致画素数の分布は、一致画素数が大きな勾配方向ANG(S)が、指示方向との関係が強いものとして設定される。
 まず、図9の(a)では、画像の上部にエッジ画素が集中して存在しており、照合処理によってマッチングしたエッジ画素は、網掛け部分で示されている。図9の(b)の勾配方向ANG(S)毎の一致画素数を参照すると、右下方向、下方向、左下方向の3つの勾配方向ANG(S)がマッチングしている。
 また、図9の(a)は、周囲が暗い場合の画像データであるから、対象物方向特定部9は、対応関係テーブルとして、図8の(a)に示す対応関係テーブルを用いることになる。図8の(a)を参照すると、右下方向、下方向、左下方向の3つの勾配方向ANG(S)がマッチングしたパターンに対応付けられた対象物の指示方向は、上方向であると定義されている。したがって、図9の(a)に示す撮像画像では、対象物方向特定部9は、対象物の指示方向を、上方向であると特定することになる(図9の(c))。
 一方、図9の(d)では、画像の左上部にエッジ画素が集中して存在しており、照合処理によってマッチングしたエッジ画素は、網掛け部分で示されている。図9の(e)の勾配方向ANG(S)毎の一致画素数を参照すると、右方向、右下方向、下方向の3つの勾配方向ANG(S)がマッチングしている。図9の(a)に示す例と同じように、図8の(a)に示す対応関係テーブルを参照すると、右方向、右下方向、下方向の3つの勾配方向ANG(S)がマッチングしたパターンに対応付けられた対象物の指示方向は、左上方向であると定義されている。したがって、図9の(d)に示す撮像画像では、対象物方向特定部9は、対象物の指示方向を、左上方向であると特定することになる(図9の(f))。
 なお、周囲が明るい場合の画像データについては、対象物方向特定部9は、図8の(b)の対応関係テーブルを参照することによって、対象物の指示方向を特定することになる。
 以上説明したように、本実施形態における画像処理装置1によれば、撮像された撮像画像の画像データから、所定の閾値以上の勾配の大きさPOW(S)を持つ画素をエッジ画素として特定した上で、パターンマッチングの技術を用いて、撮像対象物の指示方向及び指示位置を特定するので、撮像画像中のノイズ等の位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の指示方向及び指示位置を高精度に特定することができる。
 なお、以上の説明では、対象物方向特定部9は、図8の(a)及び図8の(b)に示すような、勾配方向ANG(S)毎の一致画素数のパターンと、対象物の指示方向との対応関係テーブルを用いる構成としたが、このような構成に限定されるものではない。すなわち、対応関係テーブルを用いずに対象物の指示方向を特定する構成としてもよい。
 次に、対応関係テーブルを用いない場合について、図10の(a)~図10の(e)に基づき、具体例を説明する。
 図10の(a)は、勾配特徴量算出部2が算出した、画素毎の勾配方向ANG(S)の分布のさらに他の一例を示し、図10の(b)は、一致画素数算出部5が算出した、勾配方向ANG(S)毎の一致画素数の分布のさらに他の一例を示す。なお、図9の(a)及び図9の(d)と同様、勾配特徴量算出部2によって「無方向」と特定された画素(エッジ画素ではない画素)は、空箱として示してある。
 また、図10の(a)は、図9の(a)及び図9の(b)と同様、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データのさらに他の一例を示す。
 図10の(a)では、照合処理によってマッチングしたエッジ画素が、網掛け部分として示されており、右下方向、下方向、左下方向の3つの勾配方向ANG(S)がマッチングしている。
 ここで、各勾配方向ANG(S)について、一致画素数を長さとするベクトル(第1方向ベクトル)を定義すると、図10の(c)に示すベクトル51のような3つの第1方向ベクトルが得られる。
 次に、図10の(c)に示すベクトル51に示された3つの第1方向ベクトルを合成すると、図10の(d)に示すベクトル52のような合成ベクトルが得られる。
 ここで、図10の(a)は、バックライトの光の反射光が指の腹に当たった状態を基礎として撮像された画像データの例であり、撮像画像は中央に向かうほど明るくなる傾向を示すことから、対象物の指示方向は、画像中の勾配方向ANG(S)とは逆向き(180度異なる向き)となると考えられる。
 したがって、対象物方向特定部9は、図10の(d)に示すベクトル52を逆向き(180度異なる向き)に変換した方向、すなわち、上方向を、対象物の指示方向として特定することになる(図10の(e))。
 なお、周囲が明るい場合の画像データについては、対象物方向特定部9は、各勾配方向ANG(S)について、上述した第1方向ベクトルを定義し、その第1方向ベクトルを全て合成した結果得られた合成ベクトルが示す方向を、そのまま、対象物の指示方向として特定することになる。
 なお、以上の説明では、各勾配方向ANG(S)について、一致画素数を長さとする第1方向ベクトルを定義したが、一致画素数そのものではなく、各勾配方向ANG(S)について、一致画素数と、勾配の大きさPOW(S)との積を長さとするベクトル(第2方向ベクトル)を定義してもよい。
 また、各勾配方向ANG(S)について、勾配の大きさPOW(S)の平均値を算出し、該平均値を長さとするベクトル(第3方向ベクトル)を定義してもよい。
 さらに、各勾配方向ANG(S)について、勾配の大きさPOW(S)のメディアン(中央値)を算出し、該メディアンを長さとするベクトル(第3方向ベクトル)を定義してもよい。
 また、以上の説明では、対象物座標特定部11は、パターンマッチング過程により、一致画素数を得ることができたエッジ画素の全てを用いて、対象物の指示位置を特定したが、このような特定方法に限定されるものではない。
 例えば、予め一致画素数の下限の閾値を準備しておき、パターンマッチング過程によって得られた一致画素数の合算値が、当該閾値を下回る場合は、一致画素数が得られたエッジ画素については、対象物の指示位置の特定に用いない(一致画素数を0とする)ようにしても良い。このような構成とすることで、画像データ中のノイズ等により生じた不当なエラー画素の影響を排除し、安定して対象物の指示位置を特定することが可能となる。
  〔第2の実施形態〕
 本発明の第2の実施形態である画像処理装置1(電子機器20)について図1、図8、図11及び図12に基づいて説明すれば、以下の通りである。
 第1の実施形態では、エッジ抽出部3がエッジ画素を特定する際の所定の閾値は、1つだけであった。
 しかしながら、対象物の指示方向をより高い精度で求めたい場合、対象物の置かれる角度等の変動に対して比較的安定した勾配の大きさPOW(S)が得られる対象物の先端付近のみが、エッジ画素として特定されるよう、前記所定の閾値を大きめに設定する必要がある。
 一方、ノイズ等の出現している位置を誤って対象物の指示位置として特定しないようにするには、対象物の先端付近のみならず、対象物の接触面全体が、エッジ画素として特定されるよう、前記所定の閾値をあまり大きく設定できないという問題が生じる。
 第2の実施形態の画像処理装置1(電子機器20)では、以上のような問題点を解決するために、エッジ抽出部3が、エッジ画素を特定する際の閾値を2つ設定できるようにした点が、第1の実施形態と異なっており、それ以外の構成は、第1の実施形態と同様である。なお、第2の実施形態における画像処理装置1の構成は、第1の実施形態における画像処理装置1の構成と同一で動作の一部が異なっているだけなので各構成についての説明は省略し、ここでは、本実施形態の画像処理装置1の動作の概要について説明する。
 なお、全体的な動作の概要については、図4に示す第1の実施形態の画像処理装置1における全体的な動作の概要とほぼ同一であるので、説明を省略する。但し、エッジ画素特定過程においては、図1に示すエッジ抽出部3が、第1閾値を用いて第1エッジ画素を特定し、第2閾値を用いて第2エッジ画素を特定する点が第1の実施形態と異なる。
 次に、第1の実施形態とは異なる動作を行う本実施形態の画像処理装置1のパターンマッチング過程について、図8、図11及び図12に基づいて説明する。
 図11は、本実施形態の画像処理装置1におけるパターンマッチング過程の動作を示すフローチャートである。
 まず、S301では、一致画素数算出部5が、第1エッジ画素についての各勾配方向ANG(S)の一致画素数を全て「0」に初期化して、S302に進む。
 S302では、一致画素数算出部5が、第2エッジ画素についての各勾配方向ANG(S)の一致画素数を全て「0」に初期化して、S303に進む。
 S303では、一致画素数算出部5が、1画素ごとに、第1エッジ画素に対してモデルパターンによる照合処理を行って、S304に進む。
 S304では、一致画素数算出部5が、S303での照合処理によって、モデルパターンと勾配方向ANG(S)が一致したかどうかを判定する。勾配方向ANG(S)が一致すれば(Yes)、S305に進み、一致しなければ(No)、S307に進む。
 S305では、一致画素数算出部5が、第2エッジ画素に対してモデルパターンによる照合処理を行って、S306に進む。
 本実施形態においては、第1エッジ画素を特定するための第1閾値よりも、第2エッジ画素を特定するための第2閾値のほうを、大きく設定する。従って、第2エッジ画素は、第1エッジ画素よりも、勾配の大きさPOW(S)が大きくなる。また、第1閾値及び第2閾値の2つの閾値の大小関係より、第2エッジ画素の位置には、必ず、第1エッジ画素が存在することになる。
 よって、S305での照合処理によって、第2エッジ画素でのマッチング結果が必ず得られることになる。換言すれば、第2エッジ画素とモデルパターンの照合を行うと、必ず、勾配方向ANG(S)が一致する結果が得られることになる。
 S306では、第1エッジ画素の勾配方向ANG(S)毎の一致画素数、及び第2エッジ画素の勾配方向ANG(S)毎の一致画素数について、S303及びS305でモデルパターンと勾配方向ANG(S)が一致した画素数を新たに加算して更新し、S307に進む。
 S307では、一致画素数算出部5が、モデルパターンの全要素(画素)について照合を完了したかどうかを判定する。照合が完了していれば(Yes)、S308に進み、完了していなければ(No)、S303に進み、モデルパターンの次の要素について照合処理を行う。
 S308では、一致画素数算出部5が、第1エッジ画素の勾配方向ANG(S)毎の一致画素数を合算した値、及び、第2エッジ画素の勾配方向ANG(S)毎の一致画素数を合算した値を出力し、S309へ進む。S308で出力された合算値は、図4のS104での対象物位置・方向特定過程で使用される。
 S309では、対象物方向特定部9が、第2エッジ画素の勾配方向ANG(S)毎の一致画素数の分布に基づき、対象物の指示方向を特定して出力し、パターンマッチング過程を終了する。
 次に、図8の(a)及び図8の(b)、並びに図12の(a)~図12の(c)に基づき、対象物方向特定部9による対象物の指示方向特定処理の具体例について説明する。本実施形態における、対象物の指示方向の特定方法については、以下で詳しく述べる。
 図12の(a)は、勾配特徴量算出部2が算出したエッジ画素毎の勾配方向ANG(S)の分布の様子を示す。
 また、図12の(b)は、一致画素数算出部5が算出した第1エッジ画素の勾配方向ANG(S)毎の一致画素数の分布の一例を示し、図12の(c)は、第2エッジ画素の勾配方向ANG(S)毎の一致画素数の分布の一例を示す。
 なお、図12の(a)では、勾配特徴量算出部2によって「無方向」と特定された画素(エッジ画素ではない画素)は、空箱として示してある。また、図12の(a)は、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データのさらに他の一例を示す。
 図12の(a)では、照合処理によってマッチングしたエッジ画素は、濃い網掛け部分と薄い網掛け部分で示されている。なお、薄い網掛け部分が、第1エッジ画素かつ第2エッジ画素として特定された画素であり、濃い網掛け部分が、第1エッジ画素としてのみ特定された画素である。
 ここで、上述したように、対象物の先端付近は、対象物の表示面への接触角度等にあまり影響を受けず、比較的安定した勾配の大きさPOW(S)を持つことから、第2エッジ画素として、対象物の先端付近のエッジのみが特定されるように、第2閾値を設定している。
 次に、図12の(b)に示す第1エッジ画素の勾配方向ANG(S)毎の一致画素数の分布を参照すると、8方向全ての勾配方向ANG(S)がマッチングしている。従って、対象物の接触部分の形状は、丸に近いものであると考えられ、パターンマッチング過程により、ノイズ等ではなく、正しく対象物を検知できていると考えられる。しかしながら、8方向全ての勾配方向ANG(S)がマッチングしていることから、このままでは対象物の指示方向を正しく特定できないおそれがある。
 一方、図12の(c)に示す第2エッジ画素の勾配方向ANG(S)毎の一致画素数の分布を参照すると、右方向、右下方向、下方向の3つの勾配方向ANG(S)がマッチングしている。
 ここで、第2エッジ画素として、対象物の先端付近のエッジのみが特定されるようにしているから、第2エッジ画素の勾配方向ANG(S)毎の一致画素数をもとに、対象物の指示方向を特定することで、精度よく指示方向を特定することができる。
 図12の(a)は、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データの例であることから、勾配方向ANG(S)毎の一致画素数の分布と対象物の指示方向の対応付け情報として、図8の(a)に示す対応関係テーブルを参照すると、右方向、右下方向、下方向の3つの勾配方向ANG(S)がマッチングしたパターンに対応付けられた対象物の指示方向は、左上方向であると定義されている。
 したがって、図12の(a)の例では、対象物方向特定部9は、対象物の指示方向を、左上方向であると特定できることになる(図12の(c))。
 なお、周囲が明るい場合の画像データについては、対象物方向特定部9は、図8の(b)の対応関係テーブルを参照することによって、対象物の指示方向を特定することになる。
 以上説明したように、第2の実施形態における画像処理装置1によれば、ノイズ等の出現している位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の指示位置を特定できるとともに、対象物の指示方向をより精度よく特定することができる。
 なお、以上の説明では、対象物方向特定部9は、図8の(a)及び図8の(b)に示すような、方向一致パターンと、対象物の指示方向との対応関係を示す対応関係テーブルを用いる構成としたが、このような構成に限定されるものではない。例えば、第1の実施形態で説明したのと同様に、対応関係テーブルを用いずに対象物の指示方向を特定する構成としてもよい。すなわち、対象物方向特定部9を、各勾配方向ANG(S)について、一致画素数を長さとした第1方向ベクトルを定義し、その第1方向ベクトルを全て合成した結果得られた合成ベクトルが示す方向から、対象物の指示方向を特定する構成としてもよい。
 また、以上の説明では、対象物座標特定部11は、パターンマッチング過程により、一致画素数を得ることができたエッジ画素全てを用いて、対象物の指示位置を特定する構成としていたが、このような構成に限定されるものではない。たとえば、第1の実施形態で説明したのと同様に、あらかじめ一致画素数の下限の閾値を準備しておき、パターンマッチング過程によって得られた一致画素数の合算値が、下限の閾値を下回る場合は、一致画素数が得られたエッジ画素については、対象物の指示位置の特定に使用しない(一致画素数を0とする)構成としてもよい。このような構成とすることで、画像データ中のノイズ等により生じた不当なエラー画素の影響を排除し、安定して対象物の指示位置を特定することが可能となる。
 以上のように、所定の閾値は、予め定められた第1閾値と、該第1閾値よりも大きい第2閾値とを、少なくとも含んでいても良い。
 また、本実施形態の画像処理装置1の一致画素数算出部5は、第1エッジ画素について照合領域とモデルパターンとの照合を行った結果から、第1エッジ画素に関する勾配方向ANG(S)毎の一致画素数(第1合致度)及び第2エッジ画素について照合を行った結果から、第2エッジ画素に関する勾配方向ANG(S)毎の一致画素数(第2合致度)を算出する。
 ここで、上述したように、例えば、指の先端付近の勾配の大きさPOW(S)は比較的大きく、指の付け根側の勾配の大きさPOW(S)の大きさは小さくなる傾向がある。
 そこで、例えば、指の先端付近の勾配Sを検出するための閾値を第2閾値とし、少なくとも指の付け根側の勾配Sを検出するための閾値を第1閾値とすれば、第1閾値以上の画素によって、指全体のエッジ(第1エッジ画素)を検出することができ、第2閾値以上の画素によって、指の先端付近のエッジ(第2エッジ画素)を検出することができる。
 なお、第1合致度は、指全体のエッジに関係する一致画素数であり、第2合致度は、指の先端付近のエッジに関係する一致画素数となる。
 一方、本実施形態の画像処理装置1の対象物座標特定部11は、第1エッジ画素毎に算出された、第1エッジ画素に関する勾配方向ANG(S)毎の一致画素数、及び第2エッジ画素毎に算出された、第2エッジ画素に関する勾配方向ANG(S)毎の一致画素数の、合致領域上の分布から指示位置を特定する。
 ここで、上述したように例えば、指の先端付近の勾配Sを検出するための閾値を第2閾値とし、少なくとも指の付け根側の勾配Sを検出するための閾値を第1閾値とすれば、一致画素数が大きい第1エッジ画素は、指の腹の中心に近く、一致画素数が大きい第2エッジ画素は、指の先端付近の位置(以下、先端位置という)に近くなる傾向を示す。
 よって、第1エッジ画素に関する勾配方向ANG(S)毎の一致画素数の分布から特定した指示位置は、指の腹の中心に近くなり、第2エッジ画素に関する勾配方向ANG(S)毎の一致画素数の分布から特定した指示位置は、先端位置に近くなる。
 また、第1エッジ画素に関する勾配方向ANG(S)毎の一致画素数及び第2エッジ画素に関する勾配方向ANG(S)毎の一致画素数の分布から特定した指示位置は、指の腹の中心と、先端位置との中間の位置に近くなる。
 よって、第1合致度及び第2合致度のうち少なくとも一方の、合致領域上の分布から指示位置を特定すれば、指の腹の中心、先端位置、又は中間の位置に近い位置を指示位置として特定することが可能となる。
 また、第1エッジ画素に関する勾配方向ANG(S)毎の一致画素数、第2エッジ画素に関する勾配方向ANG(S)毎の一致画素数又はこれらの一致画素数の組合せのいずれかを選択することにより、指の腹の中心、先端位置、又は中間の位置に近い位置のいずれかを対象物の指示位置として特定することも可能となる。
  〔実施の形態3〕
 第1の実施形態や第2の実施形態においては、対象物の指示位置の特定方法として、画素毎の一致画素数の分布の重心位置として特定する方法、一致画素数が最大である位置として特定する方法、合致領域を、そのまま、対象物の存在範囲(位置及び大きさ)として特定する方法、一致画素数の分布の重心又は一致画素数の分布が最大である位置を中心として、モデルパターンの大きさ分の範囲を、対象物の存在範囲(位置及び大きさ)として特定する方法などを例示して説明した。
 ところで、ノイズ等の出現している位置を誤って対象物の指示位置として特定しないようにするには、対象物の接触面全体が、エッジ画素として特定されるようにして、パターンマッチングによって、対象物の形状を比較的厳密に照合することが望ましい。したがって、第1の実施形態における、エッジ画素を特定するための閾値や、第2の実施形態における、第1エッジ画素を特定するための第1閾値は、あまり大きく設定することができない。
 しかしながら、例えば、人間の手や指を検出する場合、表示面に対する手や指の角度の変動によって、接触している部位のうち、先端では無い側(指であれば、付け根側)の輝度が変動し、それに従い付け根側のエッジの面積や形状が変化する。
 よって、あまり閾値(第1閾値)を小さくしすぎると、接触している部位のうち、先端では無い側の面積が大きくなり、閾値(第1閾値)を用いて特定したエッジ画素の一致画素数を用いて位置を特定した場合、安定性に欠けることになる。したがって、閾値(第1閾値)の調整を非常に慎重に行わないと、対象物の指示位置を安定して取得できないという問題点が生じる。
 言い換えれば、上述した対象物の指示位置は、ノイズ等の影響や、対象物の接触面全体の形状の変化による影響を受けやすいと言える。
 第3の実施形態の画像処理装置1(電子機器20)では、以上のような問題点を解決するために、まず対象物の指示方向を特定し、その後に、特定された対象物の指示方向を用いて、対象物の指示位置(又は先端位置)を特定する方法を採用している点が、上述した実施形態と異なっている。
 第2の実施形態の説明で述べたように、対象物の接触面に対する角度等の変動に対して比較的安定した勾配の大きさPOW(S)が得られる対象物の先端付近のデータを用いて、対象物の指示方向を特定することにより、精度よく指示方向を特定することができる。
 また、精度のよい指示方向が特定できれば、対象物の先端位置も精度よく特定できることになる。したがって、対象物の先端位置を対象物の指示位置として特定すれば、安定した位置を特定できることになる。
 本発明の第3の実施形態の画像処理装置1について図1、図13及び図14に基づいて説明すれば、以下の通りである。なお、第3の実施形態における画像処理装置1の構成は、第1の実施形態及び第2の実施形態における画像処理装置1の構成と同一であるため、説明を省略する。
 まず、本発明の第3の実施形態である画像処理装置1の動作の概要について説明する。
 全体的な動作の概要については、図4に示す第1の実施形態の画像処理装置1における全体的な動作の概要と同一であるので、説明を省略する。
 次に、第3の実施形態の画像処理装置1の動作として、第1の実施形態及び第2の実施形態とは異なる動作を行う対象物位置特定過程について、図13及び図14に基づいて説明する。
 図13は、本実施形態の画像処理装置1における対象物位置特定過程の動作を示すフローチャートである。なお、ここでは、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データに対して動作することを想定している。
 まず、S401では、対象物座標特定部11が、対象物方向特定部9によって特定された対象物の指示方向を、180度回転させた勾配方向ANG(S)を特定した後に、その勾配方向ANG(S)を有する合致領域内のエッジ画素を特定して、S402へ進む。
 なお、S401で、対象物の指示方向を180度回転させているのは、周囲が暗い場合の画像データを想定しており、撮像画像は中央に向かうほど明るくなる傾向を示すことから、対象物の指示方向と、対象物の先端位置の画素の勾配方向は、互いに反対である(2つの方向は180度の角度をなす)ためである。
 一方、周囲が明るい場合の画像データに対しては、S401において、対象物方向特定部9によって特定された対象物の指示方向と同一の勾配方向ANG(S)であるエッジ画素を特定するようにすればよい。
 S402では、対象物座標特定部11が、S401で特定された各エッジ画素の勾配の大きさPOW(S)を調べ、最も勾配の大きさPOW(S)の大きい画素を、対象物の指示位置として特定し、対象物位置特定過程を終了する。
 次に、図14の(a)及び図14の(b)に基づき、対象物座標特定部11による対象物の対象物位置特定処理の具体例について説明する。
 図14の(a)及び図14の(b)は、勾配特徴量算出部2が算出したエッジ画素毎の勾配方向ANG(S)と、対象物方向特定部9が特定した対象物の指示方向の一例を示す概要図である。なお、勾配特徴量算出部2によって「無方向」と特定された画素(エッジ画素ではない画素)は、図14の(b)では空箱として示してある。
 また、図14の(b)は、周囲が暗い場合に、バックライトの光の反射光が指の腹に当たった状態を撮像した画像データの一例を示す。
 図14の(a)に示すように、対象物の指示方向は左上方向と特定されているため、対象物の指示方向を180度回転させた勾配方向ANG(S)は右下方向となる。また、勾配方向ANG(S)が右下方向であるエッジ画素を特定すると、図14の(b)の薄い網掛け部分及び濃い網掛け部分となる。そして、最も勾配の大きさPOW(S)の大きい画素は、図示していない勾配の大きさPOW(S)を参照することにより、濃い網掛け部分の画素であると特定される。したがって、対象物座標特定部11は、対象物の指示位置として、濃い網掛け部分の画素の位置を特定することになる。
 ここで、例えば、対象物方向特定部9が特定した指示方向と同一又は逆方向に近い勾配方向を持つ画素が多い領域は、合致領域のうち、対象物の先端位置に近い領域であると考えられる。
 また、対象物の接触面全体の形状、特に指の付け根側の画像の面積や形状が変化したとしても、合致領域上の先端位置に近い領域の位置や、先端位置に近い領域に含まれる画素の勾配方向はあまり変化しないと考えられる。
 よって、以上説明したように、対象物座標特定部11が、対象物方向特定部9が特定した指示方向と同一又は逆方向に近い勾配方向を持つ画素が存在する領域から対象物の先端位置を特定するようにすれば、対象物の接触面全体の形状、特に指の付け根側の画像の面積や形状が変化したか否かに関わらず、精度よく先端位置を特定することができる。
 以上説明したように、第3の実施形態における画像処理装置1によれば、ノイズ等の出現している位置を誤って対象物の指示位置として特定されることを防ぎつつ、対象物の指示位置(先端位置)をより安定して取得することが可能となる。
 また、対象物座標特定部11は、合致領域に含まれるエッジ画素毎の勾配方向ANG(S)の分布、対象物方向特定部9が特定した指示方向、及び勾配の大きさPOW(S)から、撮像画像上の対象物の先端位置を特定しても良い。
 ところで、上述したように、指の付け根側から指の先端付近に向かう程、勾配の大きさPOW(S)は大きくなる傾向がある。よって、対象物方向特定部9が特定した指示方向と同一又は逆方向に近い勾配方向ANG(S)を持つ画素が多く存在する領域のうち、画勾配の大きさPOW(S)が大きい画素の位置は、対象物の先端位置に近い位置であると考えられる。
 よって、対象物座標特定部11は、例えば、合致領域に含まれるエッジ画素毎の勾配方向ANG(S)の分布、対象物方向特定部9が特定した指示方向から、指の先端付近の領域を特定し、さらに指の先端付近の領域から勾配の大きさPOW(S)が大きい画素の位置を先端位置とすることができるので、より高精度に対象物の先端位置を特定することができる。
 また、対象物座標特定部11は、合致領域に含まれるエッジ画素毎の勾配方向ANG(S)のうち、対象物方向特定部9が特定した指示方向と同方向の勾配方向が算出されているエッジ画素の分布から、撮像画像上の対象物の先端位置を特定しても良い。
 ところで、例えば、撮像センサ内蔵型液晶ディスプレイの場合、バックライトから出射した出射光が対象物で反射した反射光と、外光との重ね合わせ光が、撮像センサによって検出される。
 このような重ね合わせ光を撮像センサによって撮像した撮像画像では、周囲が明るい場合と、周囲が暗い場合とで、エッジ部分の勾配方向ANG(S)は、互いに逆向きになる傾向がある。
 そこで、対象物座標特定部11は、周囲が明るい場合を想定して、エッジ画素毎の勾配方向ANG(S)のうち、指示方向と同方向の勾配方向ANG(S)が算出されているエッジ画素の分布から先端位置を特定している。
 これにより、周囲が明るい場合でも精度良く先端位置を特定することができる。
 また、対象物座標特定部11は、合致領域に含まれるエッジ画素毎の勾配方向ANG(S)のうち、対象物方向特定部9が特定した指示方向と逆方向の勾配方向ANG(S)が算出されているエッジ画素の分布から、撮像画像上の対象物の先端位置を特定しても良い。
 対象物座標特定部11は、周囲が暗い場合を想定して、エッジ画素毎の勾配方向ANG(S)のうち、指示方向と逆方向の勾配方向ANG(S)が算出されているエッジ画素の分布から先端位置を特定している。
 これにより、周囲が暗い場合でも精度良く先端位置を特定することができる。
 なお、以上の説明では、対象物座標特定部11は、対象物の指示方向に対応する勾配方向ANG(S)のエッジ画素のうち、勾配の大きさPOW(S)が最も大きい画素の位置を、対象物の指示位置として特定する構成としているが、この構成に限定されるものではない。例えば、対象物の指示方向に対応する勾配方向ANG(S)を有する各エッジ画素の重心を、対象物の指示位置として特定する構成としてもよい。
 また、対象物の指示方向に対応する勾配方向ANG(S)を有するエッジ画素のうち、勾配の大きさPOW(S)が最も大きい画素の位置から、指示方向又は指示方向と180度異なる方向に、所定の量だけ移動した位置を、対象物の指示位置として特定する構成としてもよい。
  〔第4の実施形態〕
 ところで、第1の実施形態や第2の実施形態で説明した指示位置の特定方法では、対象物の指示位置は、対象物の接触部分の中心付近に特定されることになる。
 しかしながら、第3の実施形態の説明した通り、第1の実施形態や第2の実施形態の特定方法では、閾値(第1閾値)の調整を非常に慎重に行わないと、対象物の指示位置を安定して取得できないという問題が生じた。
 一方、第3の実施形態においては、対象物の先端位置は、対象物の接触部分の先端付近に近い位置に特定されることになる。しかしながら、対象物の指示位置として、対象物の接触部分の中心付近を特定したい場合、第3の実施形態だけでは、どの位置が中心付近であるかを、安定して取得し続けることは難しいという問題点が残存している。
 第4の実施形態の画像処理装置1(電子機器20)では、以上のような問題点を解決するために、対象物座標特定部11は、前回の動作で第1の実施形態又は第2の実施形態の手法により指示位置が特定されており、前回及び今回の動作で第3の実施形態の手法により先端位置が特定された場合に、前回の動作で特定された先端位置から今回の動作で特定された先端位置までの変位量だけ、前回の動作で特定された指示位置を変位させた位置を今回の対象物の指示位置とするようにしている点が、上述した実施形態と異なっている。
 これにより、前回の動作で指示位置が特定されたが、何らかの原因により、今回の動作で指示位置が特定できなかったとしても、前回及び今回の動作で先端位置が特定された先端位置を用いて指示位置を特定するようにしているので、撮像画像中のノイズ等の位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の指示位置を高精度に特定することができる。
 次に、第1の実施形態~第3の実施形態とは異なる動作を行う本実施形態の画像処理装置1の対象物位置特定過程について、図1及び図15に基づいて説明する。
 なお、第4の実施形態における画像処理装置1の構成は、第1の実施形態~第3の実施形態における画像処理装置1の構成と同一であるため、説明を省略する。また、画像処理装置1の全体的な動作の概要についても、図4に示す第1の実施形態の画像処理装置1における全体的な動作の概要と同一であるので、説明を省略する。
 図15は、本実施形態の画像処理装置1における対象物位置特定過程の動作を示すフローチャートである。
 以下では、本実施形態の画像処理装置1における全体的な動作のうち、第1の実施形態~第3の実施形態とは異なる動作を行う対象物位置特定過程について説明する。
 まず、所定の単位時間ごとに、対象物の第1の位置(指示位置)と、第1の位置とは異なる第2の位置(先端位置)とを記憶しておく。
 ここで、対象物座標特定部11は、撮像された画像データから、第1の位置として、第1の実施形態や第2の実施形態にあるような対象物の指示位置の特定方法を用いて、対象物の接触部分の中心付近の位置を特定する。
 次に、対象物座標特定部11は、撮像された画像データから、第2の位置として、第3の実施形態にあるような対象物の先端位置の特定方法を用いて、対象物の先端に近い位置を特定する。
 次に、対象物座標特定部11は、記憶されている第1の位置の読み出しを試みる。第1の位置の読み出しに成功した場合、すなわち、第1の位置が既に記憶されていた場合は、対象物座標特定部11は、記憶されていた第2の位置を読み出し、撮像された画像データから特定された第2の位置と、既に記憶されていた第2の位置の、座標の差分を算出し、算出された差分を、記憶されていた第1の位置と足し合わせて、新しい第1の位置を算出する。
 一方、第1の位置の読み出しに失敗した場合、すなわち、第1の位置がまだ記憶されていない場合は、撮像された画像データから特定された第1の位置を、そのまま、新しい第1の位置とする。
 そして、対象物座標特定部11は、新しい第1の位置を、対象物の指示位置として特定し、新しい第1の位置と、撮像された画像データから新たに特定された第2の位置とを記憶して、対象物位置特定過程を終了する。なお、第1の位置が特定されなかった場合は、記憶されている第1の位置を消去する。
 次に、図15は、以上で説明した第4の実施形態における対象物位置特定過程の動作を示すフローチャートである。なお、第4の実施形態においては、画像処理装置1は、所定の単位時間ごとに、本フローチャートに示す動作を繰り返し実行するものとする。
 まず、S501では、対象物座標特定部11が、対象物の第1の位置が記憶されているかどうかを調べる。記憶されていれば(Yes)、S504に進み、記憶されていなければ(No)、S502へ進む。
 S502では、対象物座標特定部11が、撮像された画像データから、第1の位置として、第1の実施形態や第2の実施形態における対象物の指示位置の特定方法を用いて、対象物の接触部分の中心付近の位置の特定を試みた後に、S503へ進む。
 S503では、対象物座標特定部11が、S502で中心付近の位置が特定できたかどうかを調べる。特定できていれば(Yes)、S505へ進み、特定できていなければ(No)、S512へ進む。
 S504では、対象物座標特定部11が、記憶されている第1の位置を読み出し、S505へ進む。
 S505では、対象物座標特定部11が、撮像された画像データから、第2の位置として、第3の実施形態における対象物の先端位置の特定方法を用いて、対象物の先端に近い位置の特定を試みた後に、S506へ進む。
 S506では、対象物座標特定部11が、S505で先端付近の位置が特定できたかどうかを調べる。特定できていれば(Yes)、S507へ進み、特定できていなければ(No)、S512へ進む。
 S507では、対象物座標特定部11が、対象物の第2の位置が記憶されているかどうかを調べる。記憶されていれば(Yes)、S508へ進み、記憶されていなければ(No)、S509へ進む。
 S508では、対象物座標特定部11が、S505で特定された新しい第2の位置と、既に記憶されている第2の位置の、座標の差分を算出し、算出された差分を、既に記憶されている第1の位置と足し合わせて、新しい第1の位置を算出し、S509へ進む。
 S509では、対象物座標特定部11が、S505で特定された新しい第2の位置を記憶し、S510へ進む。
 S510では、対象物座標特定部11が、第1の位置を、対象物の指示位置として特定し、S511へ進む。ここで、対象物の指示位置として特定される位置は、S508の処理が行われていれば、新しく算出された第1の位置であり、S508の処理が行われていなければ、記憶されていた第1の位置、あるいは、S502で特定された(まだ記憶されていない)第1の位置となる。
 S511では、対象物座標特定部11が、(新しい)第1の位置を記憶し、対象物位置特定過程を終了する。
 S512では、対象物座標特定部11が、記憶されている第1の位置、及び第2の位置を消去したうえで、対象物の指示位置を特定せずに、対象物位置特定過程を終了する。この場合、対象物の指示位置は特定できなかったことになる。
 以上説明したように、第4の実施形態における画像処理装置1によれば、対象物の接触部分の中心付近の位置を、精度よく、安定して取得し続けることが可能になる。
 最後に、画像処理装置1(電子機器20)の各ブロック、特に勾配特徴量算出部2、エッジ抽出部3、一致画素数算出部5、合致領域特定部7、対象物方向特定部(方向特定手段)9及び対象物座標特定部(位置特定手段)11は、ハードウェアロジックによって構成してもよいし、次のようにCPUを用いてソフトウェアによって実現してもよい。
 すなわち、画像処理装置1(電子機器20)は、各機能を実現する制御プログラムの命令を実行するCPU(central processing unit)、前記プログラムを格納したROM(read only memory)、前記プログラムを展開するRAM(random access memory)、前記プログラム及び各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである画像処理装置1(電子機器20)の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、画像処理装置1(電子機器20)に供給し、そのコンピュータ(又はCPUやMPU:micro processing unit)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。
 前記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやコンパクトディスク-ROM/MO/MD/デジタルビデオデイスク/コンパクトディスク-R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ系などを用いることができる。
 また、インターネットを含む通信ネットワークを接続可能なシステム構成であれば、通信ネットワークからプログラムをダウンロードするように流動的にプログラムを担持する記録媒体であることが好ましい。
 さらに、このように通信ネットワークからプログラムをダウンロードする場合には、そのダウンロード用のプログラムは予め本体装置に格納しておくか、あるいは別な記録媒体からインストールされるものであることが好ましい。
 また、画像処理装置1(電子機器20)を通信ネットワークと接続可能に構成し、前記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークとしては、特に限定されず、例えば、インターネット、イントラネット、エキストラネット、LAN、ISDN、VAN、CATV通信網、仮想専用網(virtual private network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、通信ネットワークを構成する伝送媒体としては、特に限定されず、例えば、IEEE1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL回線等の有線でも、IrDAやリモコンのような赤外線、Bluetooth(登録商標)、802.11無線、HDR、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。なお、本発明は、コンピュータ読取可能媒体内に符号化されたコンピュータプログラムであって、前記画像処理装置が、前記読取可能媒体を備え、コンピュータによって実行されるときに、前記画像処理装置における前記各手段の機能を実現するコンピュータプログラムとして実現することもできる。
 また、本発明は、以下のように表現することもできる。
 すなわち、本発明の画像処理装置は、撮像された撮像画像の画像データ上の画素ごとに、隣接する画素との画素値差に応じた特徴量を算出する特徴量算出手段と、前記特徴量算出手段により算出された特徴量が閾値以上であるエッジ画素を特定するエッジ特定手段と、前記エッジ画素の特定結果に基づいて、前記画像データ上の一部の領域に含まれる照合領域と、あらかじめ定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、前記合致度算出手段が算出した合致度の、画素ごとの分布から、前記撮像画像上の対象物の位置を特定する位置特定手段と、前記エッジ特定手段が特定したエッジ画素の、画素ごとの分布、及び、前記合致度算出手段が算出した合致度の、画素ごとの分布から、前記撮像画像上の対象物が指し示す方向を特定する方向特定手段とを備えていても良い。
 また、本発明の画像処理装置は、前記閾値は、第1閾値と、第1閾値よりも大きい第2閾値との、少なくとも2つの閾値を含み、前記エッジ特定手段は、前記特徴量算出手段により算出された特徴量が前記第1閾値以上である第1エッジ画素と、前記特徴量算出手段により算出された特徴量が前記第2閾値以上である第2エッジ画素の、少なくとも2種類のエッジ画素を特定し、前記合致度算出手段は、前記第1エッジ画素の特定結果に基づいた第1合致度と、前記第2エッジ画素の特定結果に基づいた第2合致度の、少なくとも2種類の合致度を算出し、前記位置特定手段は、前記合致度算出手段が算出した第1合致度と第2合致度のいずれか又は両方を用いて、対象物の位置を特定し、前記方向特定手段は、前記合致度算出手段が算出した第2合致度から、対象物の方向を特定しても良い。
 また、本発明の画像処理装置は、前記特徴量は、少なくとも、画素の輝度の勾配の方向を示す勾配方向を含んでも良い。
 また、本発明の画像処理装置は、前記合致度算出手段は、前記勾配方向ごとに、前記照合領域に含まれる勾配方向と、前記モデルパターンに含まれる勾配方向とが一致する一致画素数を算出しても良い。
 また、本発明の画像処理装置は、あらかじめ、前記勾配方向ごとの一致画素数と、対象物が指し示す方向とを対応付けた対応付け情報が定められており、前記方向特定手段は、前記対応付け情報と、前記合致度の画素ごとの分布から、前記撮像画像上の対象物が指し示す方向を特定しても良い。
 また、本発明の画像処理装置は、前記方向特定手段は、前記勾配方向ごとの前記一致画素数を長さとしたベクトル量と、前記合致度の画素ごとの分布から、前記撮像画像上の対象物が指し示す方向を特定しても良い。
 また、本発明の画像処理装置は、前記特徴量は、少なくとも、画素の輝度の勾配の大きさと、画素の輝度の勾配の方向を示す勾配方向を持つベクトル量を含み、前記方向特定手段は、前記勾配方向ごとの前記一致画素数に前期勾配の大きさを乗じた量を長さとしたベクトル量と、前記合致度の画素ごとの分布から、前記撮像画像上の対象物が指し示す方向を特定しても良い。
 また、本発明の画像処理装置は、前記位置特定手段は、前記エッジ特定手段が特定した、前記エッジ画素の画素ごとの分布と、前記方向特定手段が特定した、対象物が指し示す方向と、前記合致度算出手段が算出した合致度の画素ごとの分布から、前記撮像画像上の対象物の位置を特定しても良い。
 また、本発明の画像処理装置は、前記特徴量は、少なくとも、画素の輝度の勾配の大きさを含み、前記位置特定手段は、前記エッジ特定手段が特定した、前記エッジ画素の輝度の勾配の大きさ及び画素ごとの分布と、前記方向特定手段が特定した、対象物が指し示す方向と、前記合致度算出手段が算出した合致度の画素ごとの分布から、前記撮像画像上の対象物の位置を特定しても良い。
 また、本発明の画像処理装置は、前記位置特定手段は、前記方向特定手段が特定した対象物が指し示す方向と同じ勾配方向を持つ、前記エッジ画素の画素ごとの分布と、前記合致度算出手段が算出した合致度の画素ごとの分布から、対象物の位置を決定しても良い。
 また、本発明の画像処理装置は、前記位置特定手段は、前記方向特定手段が特定した対象物が指し示す方向を180度回転した勾配方向を持つ、前記エッジ画素の画素ごとの分布と、前記合致度算出手段が算出した合致度の画素ごとの分布から、指先位置を決定しても良い。
 また、本発明の画像処理装置は、所定の単位時間ごとに、画像を撮像し、撮像された撮像画像から、前記撮像画像上の対象物の位置及び指し示す方向を特定することを繰り返すことを特徴とする画像処理装置であって、前記所定の単位時間ごとに、少なくとも、対象物の第1の位置と、第1の位置とは異なる第2の位置とを記憶する、位置記憶手段を備え、前記位置特定手段は、前記合致度算出手段が算出した合致度の、画素ごとの分布から特定された、前記撮像画像上の対象物の位置を、第1の位置として特定し、前記エッジ特定手段が特定した、前記エッジ画素の画素ごとの分布と、前記方向特定手段が特定した、対象物が指し示す方向と、前記合致度算出手段が算出した合致度の画素ごとの分布から特定された、前記撮像画像上の対象物の位置を、第2の位置として特定し、前記位置記憶手段に前記第1の位置が記憶されている場合は、前記特定された第1の位置を、前記位置記憶手段に記憶されている前記第1の位置と、前記位置記憶手段に記憶されている前記第2の位置と、前記特定された第2の位置から算出し直し、前記第1の位置を、対象物の位置として特定しても良い。
 また、本発明の画像処理装置は、前記合致度算出手段は、算出した前記合致度が所定の閾値未満である場合には、前記合致度を0に設定しても良い。
 以上の各構成では、主として撮像された撮像画像の画像データから、所定の閾値以上の特徴量を持つ画素をエッジ画素として特定した上で、パターンマッチングの技術を用いて、撮像対象物の指示方向及び指示位置を特定している。それゆえ、撮像画像中のノイズ等の位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の指示位置及び指示方向を高精度に特定することができる。
 ところで、撮像時に生じたノイズ又は画素の欠陥等があった場合(以下、このような問題が生じた画素を「エラー画素」という)、エラー画素が、画素値勾配特徴量に影響を及ぼし、指示方向の特定精度が低下してしまう可能性がある。
 そこで、本発明の画像処理装置は、前記合致度算出手段は、前記照合領域上の前記エッジ画素特定手段によって特定された前記エッジ画素を含む領域と前記モデルパターンとの照合を行っても良い。
 これにより、あまり重要でないエッジ画素以外の画素を除外し、エッジ画素についてのみパターンマッチングを行うようにしているので、上述したエラー画素などの大部分を除外することができる。これにより指示方向の特定精度を向上させることができるので、指示方向を安定して検出することができる。
 また、本発明の画像処理装置は、前記合致度算出手段は、前記照合領域に含まれる注目画素を、前記画像データに含まれる全ての画素に合わせながら、前記照合領域を一画素づつ走査することによって複数の照合領域を設定するとともに、各照合領域について算出される合致度を、前記各照合領域に対応する各注目画素について算出することで、前記画像データに含まれる全ての画素について前記合致度を算出し、前記合致領域に含まれる画素毎の前記合致度の分布から、前記撮像画像上の対象物の指示位置を特定する位置特定手段を備えていても良い。
 前記構成によれば、合致度算出手段は、照合領域に含まれる注目画素を、画像データに含まれる全ての画素に合わせながら、照合領域を一画素づつ走査することによって複数の照合領域を設定するとともに、各照合領域について算出される合致度を、各照合領域に対応する各注目画素について算出することで、画像データに含まれる全ての画素について合致度を算出する。
 ここで、簡単のため、撮像画像、照合領域、及びモデルパターンのそれぞれの形状がいずれも矩形であるものとするが、それぞれの形状は、矩形に限られない。また、照合領域に含まれる画素の中から注目する単一の画素を予め決めておき、その単一の画素のことを注目画素と称することとする。
 ここで、パターンマッチングは、例えば、画像データの左上角の画素を、照合領域の注目画素の位置とした状態からスタートし、照合領域を、画像データの左上角から右下角まで一画素づつ走査させながら、モデルパターンとのマッチングが行われる。
 なお、画像データの端(最外周)の画素を、照合領域の注目画素の位置とした状態のとき、照合領域の一部に画素が存在していない場合が生じ得る。しかしながら、このような境界問題が生じる場合は、照合領域の画素が存在していない部分の画素を除外してパターンマッチングを行っても良い。また、周期的境界条件などを設定し、照合領域上の照合領域の画素が存在していない部分の画素を適当な画素値勾配特徴量を持つモデルで置き換えてパターンマッチングを行っても良い。
 また、照合領域の大きさや形状は、モデルパターンの大きさや形状に合わせて適宜設定すれば良い。
 以上のようなパターンマッチングにより、一画素づつ走査される照合領域は、複数存在し、合致度算出手段又は合致度算出ステップでは、一画素づつ走査させた照合領域毎に合致度が算出されることになる。すなわち、画像データ上の全ての画素のそれぞれについて合致度が算出される。
 次に、位置特定手段は、合致領域に含まれる画素毎に算出された合致度の分布から、撮像画像上の対象物の指示位置を特定する。
 よって、合致領域に含まれる画素毎の合致度の分布から撮像画像上の対象物の指示位置を特定することができる。
 例えば、合致領域に含まれる画素毎の合致度のうち、最大の合致度をもつ画素の位置を対象物の指示位置としても良いし、合致領域に含まれる画素毎の合致度を重みとした重み付け平均によって求めた位置を対象物の指示位置としても良い。
 また、本発明の画像処理装置は、前記所定の閾値は、予め定められた第1閾値と、該第1閾値よりも大きい第2閾値とを、少なくとも含んでおり、前記エッジ画素特定手段は、前記勾配特徴量算出手段が算出した前記画素値勾配特徴量の大きさが前記第1閾値以上である第1エッジ画素と、前記第2閾値以上である第2エッジ画素とを前記エッジ画素として特定し、前記合致度算出手段は、前記第1エッジ画素について前記照合領域と前記モデルパターンとの照合を行った結果から第1合致度、及び前記第2エッジ画素について前記照合を行った結果から第2合致度を、前記合致度として算出し、前記方向特定手段は、前記合致領域に含まれる前記第2エッジ画素毎の前記画素値勾配特徴量の分布から前記指示方向を特定し、前記位置特定手段は、前記合致領域に含まれる画素毎の前記第1合致度、及び前記第2合致度のうち少なくとも一方の分布から前記指示位置を特定しても良い。
 前記構成によれば、所定の閾値は、予め定められた第1閾値と、該第1閾値よりも大きい第2閾値とを、少なくとも含んでいる。
 また、合致度算出手段は、第1エッジ画素について照合領域とモデルパターンとの照合を行った結果から第1合致度(合致度)、及び第2エッジ画素について照合を行った結果から第2合致度(合致度)を算出する。
 ここで、上述したように、指の先端付近の勾配の大きさは比較的大きく、指の付け根側の勾配の大きさは小さくなる傾向がある。
 そこで、例えば、指の先端付近の画素値勾配特徴量を検出するための閾値を第2閾値とし、少なくとも指の付け根側の画素値勾配特徴量を検出するための閾値を第1閾値とすれば、第1閾値以上の画素によって、指全体のエッジ(第1エッジ画素)を検出することができ、第2閾値以上の画素によって、指の先端付近のエッジ(第2エッジ画素)を検出することができる。
 なお、第1合致度は、指全体のエッジに関係する合致度であり、第2合致度は、指の先端付近のエッジに関係する合致度となる。
 一方、位置特定手段は、合致領域に含まれる画素毎に算出された第1合致度、及び第2合致度のうち少なくとも一方の分布から指示位置を特定する。
 ここで、上述したように例えば、指の先端付近の画素値勾配特徴量を検出するための閾値を第2閾値とし、少なくとも指の付け根側の画素値勾配特徴量を検出するための閾値を第1閾値とすれば、合致領域上の第1合致度の分布は、エッジで囲まれた部分の中心、すなわち、指の腹の中心付近を算出する目安となり、合致領域上の第2合致度の分布は、指の先端付近の位置(以下、単に「先端位置」という)を算出する目安となる。
 よって、第1合致度の分布から特定した指示位置は、指の腹の中心に近くなり、第2合致度の分布から特定した指示位置は、先端位置に近くなる。
 また、第1合致度、及び第2合致度の分布から特定した指示位置は、指の腹の中心と、先端位置との中間の位置に近くなる。
 よって、合致領域上の第1合致度及び第2合致度のうち少なくとも一方の分布から指示位置を特定すれば、指の腹の中心、先端位置、又は中間の位置のいずれかに近い位置を指示位置として特定することが可能となる。
 また、第1合致度、第2合致度又はこれらの合致度の組合せのいずれかを選択することにより、ユーザの嗜好に合わせて、指の腹の中心、先端位置、又は中間の位置に近い位置のいずれかを選択して対象物の指示位置として特定することが可能となる。
 また、本発明の画像処理装置は、前記画素値勾配特徴量は、少なくとも画素値の勾配方向を示す特徴量であっても良い。
 上述したように、画素値の勾配方向は、方向を示す特徴量なので直接指示方向と結びつけることができ、対象物の指示方向の特定が簡単な特徴量である。
 一方、勾配の大きさなどのスカラー量は、方向を示す特徴量でないので直接指示方向と結びつけることが困難な特徴量である。
 従って、特徴量として画素値の勾配方向を用いることによって、対象物の指示方向の特定をより簡単に実現することができる。
 また、本発明の画像処理装置は、前記合致度算出手段は、前記勾配方向毎に、前記照合領域に含まれる前記勾配方向と、前記モデルパターンに含まれる前記勾配方向とが一致する画素の数を示す一致画素数を、前記合致度として算出しても良い。
 ここで、勾配方向を利用したパターンマッチングでは、照合領域に含まれる画素毎に、勾配方向が一致したか否かが判定できる。
 よって、照合領域の全画素に亘って計算した一致画素数を合致度として算出することもできるし、勾配方向毎に計算した一致画素数を合致度として算出することもできる。さらに、照合領域に含まれる画素毎に合致度(一致・不一致)を算出することもできる。
 ここで、勾配方向毎に、一致画素数を算出した場合、勾配方向毎の一致画素数が特定の勾配方向に偏っていれば、この偏りを利用して簡単に指示方向を特定することができる。
 よって、勾配方向は、指示方向の特定に適した画素値勾配特徴量と言える。
 また、本発明の画像処理装置は、前記勾配方向毎の一致画素数の分布と、前記指示方向との対応関係を示す対応付け情報が予め定められており、前記方向特定手段は、前記対応付け情報を参照して、前記合致度算出手段が算出した前記勾配方向毎の一致画素数の分布から前記指示方向を特定しても良い。
 ここで、対応付け情報の例としては、モデルパターンとマッチした勾配方向の偏りが大きい場合は、単に、勾配方向毎に、一致した画素の存否のみを示す(一致画素数は捨象する)方向一致パターンと、指示方向とを対応付けておけば良い。
 また、モデルパターンとマッチした勾配方向の偏りが小さい場合は、勾配方向毎の一致画素数の分布と、指示方向とを対応付けておけば良い。このとき、一致画素数が大きな勾配方向が、指示方向との関係が強いものとして対応付け情報を設定する。
 また、本発明の画像処理装置は、前記方向特定手段は、前記勾配方向毎の一致画素数を長さとする第1方向ベクトルの分布から、前記指示方向を特定しても良い。
 ここで、一致画素数が大きい勾配方向は、対象物の指示方向との関係が強いので、勾配方向毎の一致画素数を用いれば、指示方向との関係の強弱によってエッジ画素を選り分けることができるので、精度よく指示方向を特定することができる。
 また、本発明の画像処理装置は、前記方向特定手段は、前記勾配方向毎の一致画素数と前記画素値勾配特徴量の大きさとの積を長さとする第2方向ベクトルの分布から、前記指示方向を特定しても良い。
 上述した第1方向ベクトルでは、一致画素数を勾配の大きさと看做して指示方向の特定を行った。しかしながら、画素値勾配特徴量は、厳密には、勾配の大きさという自由度を持っているので、勾配の大きさの自由度を含めた第2方向ベクトルの分布から、指示方向を特定するようにすれば、より精度の高い指示方向の特定が可能となる。
 また、上述したように勾配の大きさは、指の付け根側から指の先端付近に向けて大きくなる傾向があるので、第2方向ベクトルでは、最終的に算出される第2方向ベクトルの合成ベクトルに対して、このような傾向を含めることができるので、より精度よく指示方向を特定することができる。
 また、本発明の画像処理装置は、前記方向特定手段は、前記勾配方向毎の、前記画素値勾配特徴量の大きさを長さとする第3方向ベクトルの分布から、前記指示方向を特定しても良い。
 上述したように勾配の大きさは、指の付け根側から指の先端付近に向けて大きくなる傾向があるので、第3方向ベクトルでは、最終的に算出される第3方向ベクトルの合成ベクトルに対して、このような傾向を含めることができるので、精度よく指示方向を特定することができる。
 ところで、指の腹などの中心位置を対象物の指示位置とする場合、ノイズ等の出現している位置を誤って対象物の指示位置として特定しないようにするには、対象物の接触面全体が、エッジ画素として特定されるように、パターンマッチングによって、対象物の形状を比較的厳密に照合することが望ましい。したがって、エッジ画素を特定するための所定の閾値は、あまり大きく設定することができない。
 一方、例えば、人間の手や指を検出する場合、表示面に対する手や指の角度の変動によって、接触している部位のうち指の付け根側の輝度が変動し、それに従い、指の付け根側の画像の面積や形状が変化する。よって、あまり所定の閾値を小さくしすぎると、接触している部位のうち、先端では無い、指の付け根側の面積が大きくなり、所定の閾値を用いて特定したエッジ画素について照合した合致度を用いて指示位置を安定して特定することが困難となる。したがって、所定の閾値の調整を非常に慎重に行わないと、対象物の指示位置を安定して取得できないという問題点がある。
 言い換えれば、上述した対象物の指示位置は、ノイズ等の影響や、対象物の接触面全体の形状の変化による影響を受けやすいと言える。
 そこで、本発明の画像処理装置は、前記構成に加えて、前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向の分布、及び前記方向特定手段が特定した前記指示方向から、前記撮像画像上の対象物の先端位置を特定しても良い。
 ここで、例えば、方向特定手段が特定した指示方向と同一又は逆方向に近い勾配方向を持つ画素が多い領域は、合致領域上で対象物の先端位置に近い領域であると考えられる。
 また、対象物の接触面全体の形状、特に指の付け根側の画像の面積や形状が変化したとしても、合致領域上の先端位置に近い領域の位置や、先端位置に近い領域に含まれる画素の勾配方向はあまり変化しないと考えられる。
 よって、例えば、方向特定手段が特定した指示方向と同一又は逆方向に近い勾配方向を持つ画素が存在する領域から対象物の先端位置を特定するようにすれば、対象物の接触面全体の形状、特に指の付け根側の画像の面積や形状が変化したか否かに関わらず、精度よく先端位置を特定することができる。
 以上より、撮像画像中のノイズ等の位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の先端位置を高精度に特定することができる。
 また、本発明の画像処理装置は、前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向の分布、前記方向特定手段が特定した前記指示方向、及び該画素値勾配特徴量の大きさから、前記撮像画像上の対象物の先端位置を特定しても良い。
 ところで、上述したように、指の付け根側から指の先端付近に向かう程、勾配の大きさは大きくなる傾向がある。よって、方向特定手段が特定した指示方向と同一又は逆方向に近い勾配方向を持つ画素が多く存在する領域のうち、勾配の大きさが大きい画素の位置は、対象物の先端位置に近い位置であると考えられる。
 よって、前記構成によれば、例えば、合致領域に含まれるエッジ画素毎の勾配方向の分布、方向特定手段が特定した指示方向から、指の先端付近の領域を特定し、さらに指の先端付近の領域から勾配の大きさが大きい画素の位置を先端位置とすることができるので、より高精度に対象物の先端位置を特定することができる。
 また、本発明の画像処理装置は、前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向のうち、前記方向特定手段が特定した指示方向と同方向の前記勾配方向が算出されている前記エッジ画素の分布から、前記撮像画像上の対象物の先端位置を特定しても良い。
 ところで、例えば、撮像センサ内蔵型液晶ディスプレイの場合、バックライトから出射した出射光が対象物で反射した反射光と、外光との重ね合わせ光が、撮像センサによって検出される。
 このような重ね合わせ光を撮像センサによって撮像した撮像画像では、周囲が明るい場合と、周囲が暗い場合とで、エッジ部分の勾配方向は、互いに逆向きになる傾向がある。
 そこで、前記構成によれば、周囲が明るい場合を想定して、エッジ画素毎の勾配方向のうち、指示方向と同方向の勾配方向が算出されているエッジ画素の分布から先端位置を特定している。
 これにより、周囲が明るい場合でも精度良く先端位置を特定することができる。
 また、本発明の画像処理装置は、前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向のうち、前記方向特定手段が特定した指示方向と逆方向の前記勾配方向が算出されている前記エッジ画素の分布から、前記撮像画像上の対象物の先端位置を特定しても良い。
 前記構成によれば、周囲が暗い場合を想定して、エッジ画素毎の勾配方向のうち、指示方向と逆方向の勾配方向が算出されているエッジ画素の分布から先端位置を特定している。
 これにより、周囲が暗い場合でも精度良く先端位置を特定することができる。
 また、本発明の画像処理装置は、前記位置特定手段は、前回の動作で前記指示位置が特定されており、前回及び今回の動作で前記先端位置が特定された場合に、前回の動作で特定された前記先端位置から今回の動作で特定された前記先端位置までの変位量だけ、前回の動作で特定された前記指示位置を変位させた位置を今回の前記対象物の指示位置としても良い。
 上述したように、指の腹の中心位置を指示位置として特定するためには、厳密なパターンマッチングが必要であるため、対象物の接触面全体の形状、特に、指の付け根側の画像の面積や形状が変化した場合、指示位置の特定は困難となる。
 一方、上述したように、合致領域に含まれるエッジ画素毎の勾配方向の分布、方向特定手段が特定した指示方向から、指の先端付近の領域を特定するようにすれば、先端位置の特定は、対象物の接触面全体の形状、特に指の付け根側の画像の面積や形状が変化したか否かに関わらず安定して特定することができる。
 そこで、前記構成によれば、位置特定手段は、前回の動作で指示位置が特定されており、前回及び今回の動作で先端位置が特定された場合に、前回の動作で特定された先端位置から今回の動作で特定された先端位置までの変位量だけ、前回の動作で特定された指示位置を変位させた位置を今回の前記対象物の指示位置とする。
 よって、前回の動作で指示位置が特定されたが、何らかの原因により、今回の動作で指示位置が特定できなかったとしても、前回及び今回の動作で特定された先端位置を用いて指示位置を特定するようにしているので、撮像画像中のノイズ等の位置を誤って対象物の指示位置として特定することを防ぎつつ、対象物の指示位置を高精度に特定することができる。
 また、本発明の画像処理装置は、前記合致度算出手段は、算出された合致度が予め定められた閾値未満である場合には、前記合致度を0に設定しても良い。
 ところで、画像データ中のノイズ等により生じた不当なエラー画素が生じると、合致度算出手段が算出する合致度は、比較的低くなってしまう傾向がある。
 そこで、前記構成によれば、合致度の上限値(閾値)を設定することで、画像データ中のノイズ等により生じた不当なエラー画素の影響を受けた合致度を処理データから削除できるので、不当なエラー画素の影響を排除し、安定して対象物の指示位置を特定することが可能となる。
 なお、前記画像処理装置及びその制御方法における各手段、各機能、各処理、並びに、各ステップ及び各工程のそれぞれは、コンピュータによって実現してもよく、この場合には、コンピュータを前記各手段として動作させ、コンピュータに前記各機能を実現させ、若しくはコンピュータに前記各処理、前記各ステップ又は前記各工程を実行させることにより前記画像処理装置及びその制御方法を、コンピュータにて実現させる制御プログラム及びそれを記録したコンピュータ読み取り可能な記録媒体も、本発明の範疇に入る。
 また、本発明は、上述した画像処理装置(電子機器)の例に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、また、〔実施の形態1〕~〔実施の形態4〕の各項目にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
 本発明の画像処理装置は、例えば携帯電話やPDAなどのように、液晶などの表示装置のディスプレイに、指等の物体でタッチすることにより、操作や指示を行うような装置に適用することができる。具体的には、表示装置として、例えば、アクティブマトリクス型の液晶表示装置に用いることができると共に、電気泳動型ディスプレイ、ツイストボール型ディスプレイ、微細なプリズムフィルムを用いた反射型ディスプレイ、デジタルミラーデバイス等の光変調素子を用いたディスプレイの他、発光素子として、有機EL発光素子、無機EL発光素子、LED(Light Emitting Diode)等の発光輝度が可変の素子を用いたディスプレイ、フィールドエミッションディスプレイ(FED)、プラズマディスプレイにも利用することができる。
  1 画像処理装置
  2 勾配特徴量算出部(勾配特徴量算出手段)
  3 エッジ抽出部(エッジ画素特定手段)
  5 一致画素数算出部(合致度算出手段)
  7 合致領域特定部(合致領域特定手段)
  9 対象物方向特定部(方向特定手段)
 11 対象物座標特定部(位置特定手段)
 31,32 撮像画像
 S  勾配(画素値勾配特徴量)
 Sx 横方向勾配(画素値勾配特徴量)
 Sy 縦方向勾配(画素値勾配特徴量)
POW(S) 勾配の大きさ(画素値勾配特徴量)
ANG(S) 勾配方向(画素値勾配特徴量)

Claims (19)

  1.  撮像された撮像画像の画像データから画素値勾配特徴量を算出する勾配特徴量算出手段と、
     前記勾配特徴量算出手段が算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定手段と、
     前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、
     前記合致度算出手段が算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定手段と、
     前記合致領域特定手段が特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定手段とを備えていることを特徴とする画像処理装置。
  2.  前記合致度算出手段は、前記照合領域上の前記エッジ画素特定手段によって特定された前記エッジ画素を含む領域と前記モデルパターンとの照合を行うことを特徴とする請求項1に記載の画像処理装置。
  3.  前記合致度算出手段は、前記照合領域に含まれる注目画素を、前記画像データに含まれる全ての画素に合わせながら、前記照合領域を一画素づつ走査することによって複数の照合領域を設定するとともに、各照合領域について算出される合致度を、前記各照合領域に対応する各注目画素について算出することで、前記画像データに含まれる全ての画素について前記合致度を算出し、
     前記合致領域に含まれる画素毎の前記合致度の分布から、前記撮像画像上の対象物の指示位置を特定する位置特定手段を備えていることを特徴とする請求項1又は2に記載の画像処理装置。
  4.  前記所定の閾値は、予め定められた第1閾値と、該第1閾値よりも大きい第2閾値とを、少なくとも含んでおり、
     前記エッジ画素特定手段は、前記勾配特徴量算出手段が算出した前記画素値勾配特徴量の大きさが前記第1閾値以上である第1エッジ画素と、前記第2閾値以上である第2エッジ画素とを前記エッジ画素として特定し、
     前記合致度算出手段は、前記第1エッジ画素について前記照合領域と前記モデルパターンとの照合を行った結果から第1合致度、及び前記第2エッジ画素について前記照合を行った結果から第2合致度を、前記合致度として算出し、
     前記方向特定手段は、前記合致領域に含まれる前記第2エッジ画素毎の前記画素値勾配特徴量の分布から前記指示方向を特定し、
     前記位置特定手段は、前記合致領域に含まれる画素毎の前記第1合致度及び前記第2合致度のうち少なくとも一方の分布から、前記指示位置を特定することを特徴とする請求項3に記載の画像処理装置。
  5.  前記画素値勾配特徴量は、少なくとも画素値の勾配方向を示す特徴量であることを特徴とする請求項3又は4に記載の画像処理装置。
  6.  前記合致度算出手段は、前記勾配方向毎に、前記照合領域に含まれる前記勾配方向と、前記モデルパターンに含まれる前記勾配方向とが一致する画素の数を示す一致画素数を、前記合致度として算出することを特徴とする請求項5に記載の画像処理装置。
  7.  前記勾配方向毎の一致画素数の分布と、前記指示方向との対応関係を示す対応付け情報が予め定められており、
     前記方向特定手段は、前記対応付け情報を参照して、前記合致度算出手段が算出した前記勾配方向毎の一致画素数の分布から前記指示方向を特定することを特徴とする請求項6に記載の画像処理装置。
  8.  前記方向特定手段は、前記勾配方向毎の一致画素数を長さとする第1方向ベクトルの分布から、前記指示方向を特定することを特徴とする請求項6又は7に記載の画像処理装置。
  9.  前記方向特定手段は、前記勾配方向毎の一致画素数と前記画素値勾配特徴量の大きさとの積を長さとする第2方向ベクトルの分布から、前記指示方向を特定することを特徴とする請求項6又は7に記載の画像処理装置。
  10.  前記方向特定手段は、前記勾配方向毎の、前記画素値勾配特徴量の大きさを長さとする第3方向ベクトルの分布から、前記指示方向を特定することを特徴とする請求項6又は7に記載の画像処理装置。
  11.  前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向の分布、及び前記方向特定手段が特定した前記指示方向から、前記撮像画像上の対象物の先端位置を特定することを特徴とする請求項6に記載の画像処理装置。
  12.  前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向の分布、前記方向特定手段が特定した前記指示方向、及び該画素値勾配特徴量の大きさから、前記撮像画像上の対象物の先端位置を特定することを特徴とする請求項6に記載の画像処理装置。
  13.  前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向のうち、前記方向特定手段が特定した指示方向と同方向の前記勾配方向が算出されている前記エッジ画素の分布から、前記撮像画像上の対象物の先端位置を特定することを特徴とする請求項6に記載の画像処理装置。
  14.  前記位置特定手段は、前記合致領域に含まれる前記エッジ画素毎の前記勾配方向のうち、前記方向特定手段が特定した指示方向と逆方向の前記勾配方向が算出されている前記エッジ画素の分布から、前記撮像画像上の対象物の先端位置を特定することを特徴とする請求項6に記載の画像処理装置。
  15.  前記位置特定手段は、前回の動作で前記指示位置が特定されており、前回及び今回の動作で前記先端位置が特定された場合に、前回の動作で特定された前記先端位置から今回の動作で特定された前記先端位置までの変位量だけ、前回の動作で特定された前記指示位置を変位させた位置を今回の前記対象物の指示位置とすることを特徴とする請求項11から14までのいずれか1項に記載の画像処理装置。
  16.  前記合致度算出手段は、算出された合致度が予め定められた閾値未満である場合には、前記合致度を0に設定することを特徴とする請求項1から15までのいずれか1項に記載の画像処理装置。
  17.  請求項1から16までのいずれか1項に記載の画像処理装置における各手段としてコンピュータを動作させるための画像処理装置の制御プログラム。
  18.  請求項17に記載の制御プログラムを記録したコンピュータ読み取り可能な記録媒体。
  19.  撮像された撮像画像の画像データを用いて、前記撮像画像上の対象物の指示方向を特定する機能を備えた画像処理装置の制御方法であって、
     前記画像データから画素値勾配特徴量を算出する勾配特徴量算出ステップと、
     前記勾配特徴量算出ステップで算出した前記画素値勾配特徴量の大きさが所定の閾値以上であるエッジ画素を特定するエッジ画素特定ステップと、
     前記画像データ上に設定される所定の大きさの照合領域と、予め定められたモデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出ステップと、
     前記合致度算出ステップで算出した前記合致度が最大となる前記照合領域を合致領域として特定する合致領域特定ステップと、
     前記合致領域特定ステップで特定した前記合致領域に含まれる前記エッジ画素毎の前記画素値勾配特徴量の分布から、前記撮像画像上の対象物の指示方向を特定する方向特定ステップとを含んでいることを特徴とする画像処理装置の制御方法。
PCT/JP2010/063402 2009-11-24 2010-08-06 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、及び画像処理装置の制御方法 WO2011065069A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009-266548 2009-11-24
JP2009266548A JP4659900B1 (ja) 2009-11-24 2009-11-24 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体及び画像処理装置の制御方法

Publications (1)

Publication Number Publication Date
WO2011065069A1 true WO2011065069A1 (ja) 2011-06-03

Family

ID=43952796

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/063402 WO2011065069A1 (ja) 2009-11-24 2010-08-06 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、及び画像処理装置の制御方法

Country Status (2)

Country Link
JP (1) JP4659900B1 (ja)
WO (1) WO2011065069A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6028589B2 (ja) * 2013-01-23 2016-11-16 富士通株式会社 入力プログラム、入力装置および入力方法
JP2020181360A (ja) * 2019-04-25 2020-11-05 日本放送協会 注視領域推定装置およびそのプログラム

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09229646A (ja) * 1996-02-26 1997-09-05 Matsushita Electric Works Ltd 物体認識方法
WO2008123466A1 (ja) * 2007-03-30 2008-10-16 Sharp Kabushiki Kaisha 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理装置の制御方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09229646A (ja) * 1996-02-26 1997-09-05 Matsushita Electric Works Ltd 物体認識方法
WO2008123466A1 (ja) * 2007-03-30 2008-10-16 Sharp Kabushiki Kaisha 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理装置の制御方法

Also Published As

Publication number Publication date
JP4659900B1 (ja) 2011-03-30
JP2011113133A (ja) 2011-06-09

Similar Documents

Publication Publication Date Title
JP4727614B2 (ja) 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理装置の制御方法
JP4790653B2 (ja) 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理装置の制御方法
JP4727615B2 (ja) 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理装置の制御方法
JP2008250949A5 (ja)
US8824792B2 (en) Image element brightness adjustment
US8401305B2 (en) Contour-information extracting method by use of image processing, pattern model creating method in image processing, pattern model positioning method in image processing, image processing apparatus, image processing program, and computer readable recording medium
JP2008250950A5 (ja)
US8406527B2 (en) Pattern model positioning method in image processing, image processing apparatus, image processing program, and computer readable recording medium
US8155473B2 (en) Method for deciding image data reduction ratio in image processing, pattern model positioning method in image processing, pattern model creating method in image processing, image processing apparatus, image processing program, and computer readable recording medium
JP2008250951A5 (ja)
US9020210B2 (en) Image processing system, image processing apparatus, image processing method, and program
US9100576B2 (en) Camera positioning tool for symbology reading
US20100290673A1 (en) Image processing device, electronic instrument, and information storage medium
US9058655B2 (en) Region of interest based image registration
JP2004023158A (ja) 画像撮像装置
JP5015097B2 (ja) 画像処理装置、画像処理プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理方法
JP4659900B1 (ja) 画像処理装置、制御プログラム、コンピュータ読み取り可能な記録媒体及び画像処理装置の制御方法
JP2011118466A (ja) 差分ノイズ置換装置、差分ノイズ置換方法、差分ノイズ置換プログラム、コンピュータ読み取り可能な記録媒体、および、差分ノイズ置換装置を備えた電子機器
US10002291B2 (en) Method and system of identifying fillable fields of an electronic form
KR101413587B1 (ko) 화상처리장치, 화상처리방법, 제어 프로그램 및 기록매체
JP4966080B2 (ja) 対象物検出装置
Robert et al. Does super-resolution improve ocr performance in the real world? A case study on images of receipts
JP2010055578A (ja) 画像解析装置、画像解析方法、撮像装置、画像解析プログラムおよび記録媒体
JP2006350642A (ja) 画像処理装置、及びプログラム
JP4964849B2 (ja) 画像処理装置、画像処理プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10832916

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10832916

Country of ref document: EP

Kind code of ref document: A1