WO2013094154A1 - 画像処理装置および画像処理方法 - Google Patents

画像処理装置および画像処理方法 Download PDF

Info

Publication number
WO2013094154A1
WO2013094154A1 PCT/JP2012/007932 JP2012007932W WO2013094154A1 WO 2013094154 A1 WO2013094154 A1 WO 2013094154A1 JP 2012007932 W JP2012007932 W JP 2012007932W WO 2013094154 A1 WO2013094154 A1 WO 2013094154A1
Authority
WO
WIPO (PCT)
Prior art keywords
angle
edge
angles
depth
image
Prior art date
Application number
PCT/JP2012/007932
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 パナソニック株式会社
Priority to JP2013550102A priority Critical patent/JP6021078B2/ja
Priority to CN201280017586.1A priority patent/CN103460249B/zh
Priority to US14/009,958 priority patent/US9183633B2/en
Publication of WO2013094154A1 publication Critical patent/WO2013094154A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/536Depth or shape recovery from perspective effects, e.g. by using vanishing points
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2628Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation
    • 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/30244Camera pose

Definitions

  • the present invention relates to an image processing apparatus for deriving an inclination angle of an image.
  • Patent Document 1 There is a technique described in Patent Document 1 as a technique related to an image processing apparatus for deriving an inclination angle of an image.
  • the tilt angle of the image may not be derived properly. In this case, it is difficult to correct the inclination of the image.
  • the present invention provides an image processing apparatus that can appropriately derive the tilt angle of an image.
  • the image processing apparatus of the present invention can appropriately derive the tilt angle of an image.
  • FIG. 1 is a diagram illustrating an image having line segments in the depth direction.
  • FIG. 2 is a configuration diagram of the image processing apparatus according to the first embodiment.
  • FIG. 3 is a flowchart showing the operation of the image processing apparatus according to the first embodiment.
  • FIG. 4A is a diagram showing an input image according to the first embodiment.
  • FIG. 4B is a diagram showing edges according to Embodiment 1.
  • FIG. 5 is a diagram showing edge strength and edge angle according to the first embodiment.
  • FIG. 6 is a histogram of all edge angles corresponding to all pixels according to the first embodiment.
  • FIG. 7A is a histogram of a plurality of edge angles at the first depth level according to the first embodiment.
  • FIG. 7B is a histogram of a plurality of edge angles at the second depth level according to the first embodiment.
  • FIG. 7C is a histogram of a plurality of edge angles at the third depth level according to the first embodiment.
  • FIG. 7D is a histogram of a plurality of edge angles at the fourth depth level according to the first embodiment.
  • FIG. 8 shows a depth map and edges according to the first embodiment.
  • FIG. 9 is a configuration diagram of an image processing apparatus according to a modification of the first embodiment.
  • FIG. 10 is a configuration diagram of an image processing apparatus according to the second embodiment.
  • FIG. 11 is a flowchart showing the operation of the image processing apparatus according to the second embodiment.
  • FIG. 12 is a histogram of all edge angles corresponding to all pixels according to the second embodiment.
  • FIG. 13 is a diagram showing depth variance values according to the second embodiment.
  • FIG. 14 is a configuration diagram of an image processing apparatus according to the third embodiment.
  • FIG. 15 is a
  • the tilted image is difficult for the user to see. Therefore, it may be effective to correct the tilt of the image by rotating the image.
  • wearable cameras have recently appeared in addition to conventional digital still cameras and digital movies.
  • a wearable camera is always worn on the user's body and images the periphery of the user.
  • events that the user experiences are always recorded. Therefore, the user can always confirm safety and security.
  • the wearable camera when the wearable camera is tilted by mistake, or when the wearable camera is tilted, for example, when the user moves while the wearable camera is mounted, the image obtained by imaging also tilts. As described above, a tilted image is difficult for the user to see, and in this case as well, tilt correction is effective.
  • the inclination angle of the image is estimated from the angle of the line segment included in the image. This method is particularly effective when a structure is shown in the image.
  • information obtained from sensors may be used. Thereby, a more accurate inclination angle is derived.
  • the sensor provided in the imaging device can obtain the range of the tilt angle of the imaging device during imaging. The size of the range is based on the accuracy of the sensor. Within the obtained range, a more accurate tilt angle is derived by deriving the tilt angle from the angle of the line segment included in the image.
  • an image processing apparatus for deriving the tilt angle of an image first calculates a vertical edge strength and a horizontal edge strength for each pixel in the image using a Sobel filter. Then, the image processing apparatus calculates an edge angle for each pixel from the vertical edge strength and the horizontal edge strength.
  • the image processing apparatus creates a histogram representing the distribution of all edge angles corresponding to all pixels in the image.
  • the image processing apparatus derives an inclination angle using an edge angle having an appearance frequency (frequency, number of pixels) equal to or higher than a threshold in the histogram.
  • the image processing apparatus limits the range of edge angles using information obtained from the sensor. Then, the image processing apparatus derives the edge angle having the maximum appearance frequency within the limited range as the tilt angle.
  • FIG. 1 is a diagram showing an image having line segments in the depth direction.
  • the line segment in the depth direction is also called a perspective.
  • the structure exists from the near side to the far side. Therefore, a line segment 1300 appears obliquely in the image 1310.
  • An oblique line segment 1300 does not represent the inclination of the imaging device or the inclination of the image 1310. If the oblique line segment 1300 is dominant in the image 1310, the inclination angle of the image 1310 is not derived properly.
  • the sensor may not be able to properly detect the tilt angle of the wearable camera due to an impact during walking or the like. That is, the error of the tilt angle detected by the sensor is large. Therefore, it is difficult to limit the range of the tilt angle of the image to a small size using the tilt angle detected by the sensor. Therefore, the angle of the line segment in the depth direction may be included in the range limited by the sensor. In this case, the tilt angle of the image cannot be derived properly.
  • the tilt angle of the image may not be derived properly.
  • an image processing apparatus that derives an inclination angle of an image, and each of a plurality of pixels in the image has an edge angle.
  • An edge angle calculation unit that calculates a plurality of edge angles corresponding to the plurality of pixels by calculating a certain edge angle, and a plurality of values corresponding to the plurality of pixels, each indicating a depth of the pixel
  • An inclination angle deriving unit for deriving the inclination angle from the above use angle.
  • the image processing apparatus can appropriately specify a tilt angle candidate (utilization angle) from a plurality of edge angles corresponding to a plurality of pixels, using a plurality of depth values corresponding to the plurality of pixels. . Therefore, the image processing apparatus can derive an appropriate tilt angle.
  • the use angle specifying unit has an appearance frequency equal to or higher than a predetermined appearance frequency at a plurality of edge angles corresponding to a plurality of pixels having a depth distribution indicating a degree of dispersion of a plurality of depth values that is equal to or less than a predetermined depth distribution.
  • One or more edge angles may be specified as the one or more use angles.
  • the image processing apparatus can specify an edge angle having a high appearance frequency as a candidate for an inclination angle at a plurality of edge angles corresponding to a plurality of pixels having a low depth dispersion.
  • the use angle specifying unit generates a plurality of histograms by generating a histogram of the plurality of edge angles calculated by the edge angle calculation unit for each depth level indicating the degree of the depth value.
  • a use angle specifying processing unit that specifies one or more edge angles satisfying a predetermined condition in the plurality of histograms as the one or more use angles.
  • the image processing apparatus can specify the tilt angle candidate using the histogram generated for each depth level.
  • the use angle specifying processing unit may specify one or more edge angles having an appearance frequency equal to or higher than a predetermined appearance frequency in any of the plurality of histograms as the one or more use angles.
  • the image processing apparatus identifies an edge angle having a high appearance frequency in one depth level as a tilt angle candidate. There is a high possibility that an edge angle having a high appearance frequency at one depth level is different from the angle of the line segment in the depth direction. Therefore, the image processing apparatus can appropriately specify the tilt angle candidates.
  • the use angle specifying processing unit may specify one or more edge angles having the highest appearance frequency in the plurality of histograms as the one or more use angles.
  • the image processing apparatus identifies an edge angle having a high appearance frequency as a candidate of an inclination angle in the histogram generated for each depth level.
  • the appearance frequency of the edge angle corresponding to the depth direction is reduced because it is distributed to a plurality of histograms. Therefore, the image processing apparatus can appropriately specify the tilt angle candidates.
  • the use angle specifying processing unit may specify one or more edge angles having a maximum appearance frequency in any of the plurality of histograms as the one or more use angles.
  • the image processing apparatus identifies an edge angle having a maximum appearance frequency as a candidate for an inclination angle in the histogram generated for each depth level.
  • the appearance frequency corresponding to the depth direction decreases, and there is a possibility that the maximum value is not formed. Therefore, the image processing apparatus can appropriately specify the tilt angle candidates.
  • the use angle specifying unit is a histogram generation unit that generates a histogram of a plurality of edge angles calculated by the edge angle calculation unit, and a plurality of edge angles that satisfy a predetermined condition in the histogram, By obtaining, for each use angle candidate, a use angle candidate specifying processing unit that specifies a plurality of use angle candidates that are a plurality of use angle candidates, and for each use angle candidate, a depth distribution indicating a degree of dispersion of the plurality of depth values.
  • a use angle specifying processing unit that acquires a plurality of depth dispersions corresponding to the plurality of use angle candidates and specifies the one or more use angles from the plurality of use angle candidates based on the plurality of depth dispersions; May be provided.
  • the image processing apparatus can appropriately specify the tilt angle candidate based on the depth dispersion.
  • the use angle specifying processing unit may specify one or more use angle candidates whose depth dispersion is equal to or less than a predetermined depth dispersion as the one or more use angles.
  • the image processing apparatus can appropriately specify the tilt angle candidates from the plurality of edge angles corresponding to the plurality of pixels having a small depth dispersion.
  • the use angle candidate specification processing unit may specify a plurality of edge angles having an appearance frequency equal to or higher than a predetermined appearance frequency in the histogram as the plurality of use angle candidates.
  • the image processing apparatus can appropriately specify a tilt angle candidate using an edge angle having a high appearance frequency.
  • the image processing apparatus may further include an inclination correction unit that corrects the inclination of the image using the inclination angle derived by the inclination angle deriving unit.
  • the image processing apparatus can appropriately correct the inclination of the image using an appropriate inclination angle.
  • the tilt angle deriving unit may derive either the average value of the one or more use angles or the one or more use angles as the tilt angle.
  • the image processing apparatus can derive the tilt angle from the plurality of candidates even when there are a plurality of candidates for the tilt angle.
  • FIG. 2 is a diagram illustrating a configuration of the image processing apparatus 100 according to the present embodiment.
  • the image processing apparatus 100 includes an edge detection unit 101, an edge angle calculation unit 102, a use angle identification unit 109, and an inclination angle derivation unit 105.
  • the use angle identification unit 109 includes a histogram generation unit 103 and a use angle identification processing unit 104.
  • FIG. 3 shows a procedure by which the image processing apparatus 100 derives the tilt angle.
  • the flow of deriving the tilt angle will be described with reference to FIGS.
  • the edge detection unit 101 detects an edge of the input image (S101).
  • the edge detection unit 101 inputs edge information to the edge angle calculation unit 102.
  • the edge angle calculation unit 102 calculates an edge angle that is an edge angle for each pixel from the edge information (S102).
  • the histogram generation unit 103 generates a plurality of histograms by generating edge angle histograms for each depth level (S103).
  • the depth level is a depth value level and corresponds to the magnitude of the depth value. Levels may be replaced with expressions such as degree, degree, classification, class, or range.
  • the depth value is classified into a plurality of depth levels according to the depth resolution which is the resolution of the depth value.
  • the depth level may be the same as the depth value. For example, when the depth value is limited to any one of 0, 1, 2, and 3, the depth level may be treated as the same as the depth value.
  • the histogram generation unit 103 inputs a histogram for each depth level to the use angle identification processing unit 104.
  • the use angle specification processing unit 104 specifies a use angle (use edge angle) for each histogram (S104).
  • the use angle is an edge angle used as a tilt angle candidate.
  • the use angle specification processing unit 104 specifies, as the use angle, an edge angle in which the number of pixels corresponding to the frequency (appearance frequency) of the histogram is equal to or greater than a threshold in any of the plurality of histograms.
  • the use angle specification processing unit 104 may specify the peak edge angle as the use angle in any of the plurality of histograms.
  • the use angle specification processing unit 104 may specify the use angle based on these combinations.
  • the use angle identification processing unit 104 inputs information on the use angle to the tilt angle deriving unit 105.
  • the tilt angle deriving unit 105 derives the tilt angle from the use angle (S105).
  • an image generated when an imaging device or the like images a subject is input to the edge detection unit 101.
  • This input image may be an original image generated by imaging, or may be a converted image such as a gray scale image subjected to a color system conversion process.
  • the edge detection unit 101 detects an edge in the input image (S101). Specifically, for example, the edge detection unit 101 calculates the edge strength in the vertical direction of the input image and the edge strength in the horizontal direction of the input image using a Sobel filter for each pixel in the input image.
  • the vertical edge strength of a pixel is proportional to the magnitude of the difference between the value of the pixel and the values of the pixels above and below it.
  • the lateral edge strength of a pixel is proportional to the magnitude of the difference between the value of the pixel and the values of the left and right pixels.
  • FIG. 4A shows an input image according to the present embodiment.
  • FIG. 4A shows an image 300 that is an input image.
  • FIG. 4B is a diagram showing edges according to the present embodiment.
  • representative edges 301 to 304 obtained by performing edge detection on the image 300 are displayed so as to overlap the image 300.
  • the edge 301 corresponds to a line segment in the horizontal direction and is composed of pixels having an edge angle that should be used for deriving the tilt angle.
  • the edge 302 corresponds to a vertical line segment and is composed of pixels having an edge angle that should be used for deriving the tilt angle.
  • the edge 303 and the edge 304 are composed of pixels having edge angles that should not be used for deriving the tilt angle.
  • the edge 303 and the edge 304 are edges corresponding to a line segment called a perspective, and correspond to the depth direction of the structure.
  • the edge angle calculation unit 102 calculates an edge angle for each pixel from the edges detected by the edge detection unit 101 (S102).
  • FIG. 5 shows the edge angle ⁇ corresponding to the pixel.
  • the edge detected by the edge detection unit 101 has a vertical edge strength and a horizontal edge strength in each pixel.
  • the edge angle calculation unit 102 can calculate the edge angle ⁇ for each pixel by combining the edge strength in the vertical direction and the edge strength in the horizontal direction.
  • the edge direction obtained by the synthesis corresponds to the normal direction of the line segment appearing in the image.
  • the edge angle ⁇ is an angle between the vertical direction of the image and the edge direction.
  • the edge direction may be a direction along a line segment appearing in the image, and the edge angle ⁇ may be an angle between the horizontal direction of the image and the edge direction.
  • the edge angle calculation unit 102 does not have to calculate the edge angle ⁇ in all pixels, and only when the edge strength in the vertical direction or the horizontal direction corresponding to the pixel is larger than a preset threshold value, The corresponding edge angle ⁇ may be calculated. This is due to the following reasons.
  • the edge representing the structure corresponds to the horizontal direction or the vertical direction, and is suitable for deriving the tilt angle.
  • a background such as the sky or an edge representing a low texture does not correspond to the horizontal direction or the vertical direction, and is inappropriate for deriving the tilt angle. That is, in the derivation of the tilt angle, the edge representing the background or the low texture is noise. Therefore, the image processing apparatus 100 should exclude as much as possible unnecessary edge information that is noise before deriving the tilt angle. Edge strength is useful for removing this noise.
  • the edge angle calculation unit 102 does not have to calculate the edge angle corresponding to the pixel when the edge strength corresponding to the pixel is small.
  • the histogram generation unit 103 presets a histogram indicating the relationship between the edge angle and the number of pixels based on the edge angle calculated for each pixel by the edge angle calculation unit 102 and the depth value for each pixel. It is created for each depth level that has been set (S103).
  • a normal image processing apparatus creates a histogram representing the distribution of all edge angles corresponding to all pixels, and derives an inclination angle using an edge angle having an appearance frequency equal to or higher than a threshold in the histogram.
  • the histogram shown in FIG. 6 is a histogram created based on the image 300 by a normal image processing apparatus, and shows statistics of all edge angles corresponding to all pixels of the image 300.
  • the frequency indicated by the vertical axis of the histogram is the number of pixels, and the class indicated by the horizontal axis of the histogram is the edge angle.
  • a normal image processing apparatus uses the edge angles corresponding to the peak 502 and the peak 504 having the number of pixels equal to or greater than the threshold value 510 shown in the histogram to derive the tilt angle.
  • the edge angle corresponding to the peak 504 is the angle of the edge 304 corresponding to the perspective. Therefore, the edge angle corresponding to peak 504 should not be used to derive the tilt angle.
  • the histogram generation unit 103 of the image processing apparatus 100 generates a histogram based on the depth value.
  • the depth value is specifically a depth value corresponding to the pixel, and indicates a distance from the imaging position to the subject corresponding to the pixel.
  • the depth value is represented by a value from 0 to 255. The smaller the depth value, the longer the distance from the imaging position to the subject, and the larger the depth value, the shorter the distance from the imaging position to the subject. That is, when the depth value is 0, the distance from the imaging position to the subject is the longest. When the depth value is 255, the distance from the imaging position to the subject is the shortest.
  • the depth value may be represented by a value other than 0 to 255.
  • the smaller the depth value the shorter the distance from the imaging position to the subject, and the larger the depth value, the longer the distance from the imaging position to the subject.
  • a method for acquiring the depth value there are an active distance measurement method such as TOF (Time Of Flight) and a passive distance measurement method such as DFF (Depth From Focus) using contrast in a plurality of images.
  • the method for acquiring the depth value is not limited, and various methods can be adopted.
  • FIGS. 7A to 7D show histograms generated by classifying the depth values of 0 to 255 into four depth levels and generating each depth level.
  • FIG. 7A shows a histogram of a plurality of edge angles corresponding to a plurality of pixels having depth values of 192 to 255 in the image 300.
  • FIG. 7B corresponds to depth values from 128 to 191
  • FIG. 7C corresponds to depth values from 64 to 127
  • FIG. 7D corresponds to depth values from 0 to 63.
  • the horizontal axis bin width (class interval) is 1 degree. Usually, a bin width of 1 degree is sufficient. However, the edge angle obtained by the edge angle calculation unit 102 includes an error depending on the amount of noise in the image. Therefore, the histogram generation unit 103 may create a histogram with a large bin width such as 2 to 8 degrees.
  • the image processing apparatus 100 may use an approximate curve of a histogram in order to derive the tilt angle with high accuracy.
  • the edge angle corresponding to the peak of the approximate curve can be used as a candidate for deriving the tilt angle with high accuracy.
  • the image processing apparatus 100 derives a coarse tilt angle with a histogram having a large bin width, and then recreates the histogram with a small bin width within the range indicated by the derived coarse tilt angle. May be. Thereby, the image processing apparatus 100 can derive the tilt angle with high accuracy.
  • the usage angle identification processing unit 104 identifies, as the usage angle, an edge angle having a number of pixels equal to or greater than the threshold value for each histogram created by the histogram generation unit 103 (S104).
  • the peak 601 corresponding to the angle of the edge 301, the peak 602 corresponding to the angle of the edge 302, the peak 603 corresponding to the angle of the edge 303, and the peak corresponding to the angle of the edge 304 are shown.
  • 604 is displayed.
  • threshold values 610 are respectively provided in the histograms of FIGS. 7A to 7D.
  • the edge angle corresponding to the peak 601 is specified as an appropriate use angle for deriving the tilt angle.
  • the use angle is not specified from the histograms of FIGS. 7B to 7D. Thereby, the edge angle to be used for deriving the tilt angle is specified as the use angle.
  • FIG. 8 is a diagram showing the depth map of the image 300 and the edges 301 to 304 superimposed on each other.
  • the depth map is data indicating a depth value for each pixel, and is visually represented as an image.
  • the depth map 310 of FIG. 8 indicates that the distance from the imaging position to the subject is shorter as the hatching is thinner, and the distance from the imaging position to the subject is longer as the hatching is darker.
  • the edge 301 that should be used for deriving the tilt angle appears only in the hatched portion of the depth map 310.
  • the edge 303 that should not be used for deriving the tilt angle appears from the thin hatched portion to the dark hatched portion in the depth map 310.
  • the use angle specifying processing unit 104 can specify not the edge angle that should not be used for deriving the tilt angle but the edge angle that should be used for deriving the tilt angle as the use angle.
  • an edge angle having two or more histograms having a number of pixels equal to or greater than the threshold value may be an edge angle corresponding to a line segment in the depth direction. Therefore, the use angle specifying processing unit 104 may specify an edge angle having the number of pixels equal to or greater than the threshold in only one histogram among the plurality of histograms as the use angle.
  • the tilt angle deriving unit 105 derives the tilt angle from the specified one or more use angles (S105).
  • the tilt angle deriving unit 105 may derive the specified use angle as the tilt angle as it is, or may derive an average of a plurality of use angles as the tilt angle.
  • the tilt angle deriving unit 105 may derive an angle closest to the horizontal direction or the vertical direction of the image as a tilt angle from a plurality of use angles.
  • the tilt angle deriving unit 105 may derive a use angle within a range specified based on sensor information from a plurality of use angles as the tilt angle.
  • the tilt angle deriving unit 105 holds the tilt angle derived one frame before in time series, and from among a plurality of use angles specified in the current frame, The use angle closest to the tilt angle derived one frame before may be derived as the tilt angle of the current frame.
  • the image processing apparatus 100 creates a histogram of edge angles for each depth level based on the depth value. Therefore, even when the image includes many line segments in the depth direction such as perspective, the image processing apparatus 100 can specify the edge angle to be used for deriving the tilt angle. Therefore, the image processing apparatus 100 can appropriately derive the tilt angle of the image.
  • edge detection is not limited to the above-described Sobel filter, and various methods using vertical and horizontal contrasts can be applied.
  • the depth value and the depth level are not limited to the above.
  • the depth resolution is preferably about 4 to 16.
  • the use angle specifying processing unit 104 specifies the edge angle corresponding to the peak 601 as the use angle to be used for deriving the tilt angle.
  • various other methods can be applied to specify the use angle.
  • the use angle specification processing unit 104 may specify all edge angles having an appearance frequency higher than the threshold 610 as use angles, or use an edge angle corresponding to a maximum value (peak) of a histogram as a use angle. It may be derived.
  • the use angle specifying processing unit 104 may specify only an edge angle having an appearance frequency larger than a preset threshold as a use angle among a plurality of edge angles corresponding to the maximum value. That is, the edge angle corresponding to the maximum peak 601 may be specified as the use angle in the histogram of FIG. 7A, and the threshold angle 610 is exceeded among a plurality of edge angles close to the edge angle corresponding to the maximum peak 601. All edge angles may be specified as the use angles.
  • the inclination correction unit 106 may be included in the configuration.
  • the tilt correction unit 106 corrects the tilt of the input image based on the tilt angle derived by the tilt angle deriving unit 105.
  • a technique such as affine transformation may be used for inclination correction.
  • Various other methods can be employed for the inclination correction without limitation.
  • an imaging unit that generates an image by imaging a subject may be added as a component.
  • a sensor that detects the tilt angle may be added as a component.
  • a depth map generation unit that generates a depth map may be added as a component.
  • FIG. 10 is a diagram showing the configuration of the image processing apparatus according to the present embodiment.
  • the same reference numerals are used for the same configurations as those in the first embodiment.
  • the 10 includes an edge detection unit 101, an edge angle calculation unit 102, a use angle specifying unit 209, and an inclination angle deriving unit 105.
  • the use angle specifying unit 209 includes a histogram generation unit 203, a use angle candidate specifying processing unit 204, and a use angle specifying processing unit 205.
  • FIG. 11 shows a procedure by which the image processing apparatus 200 derives the tilt angle.
  • the flow of deriving the tilt angle will be described with reference to FIGS. 10 and 11.
  • the edge detection unit 101 detects an edge of the input image (S201).
  • the edge detection unit 101 inputs edge information to the edge angle calculation unit 102.
  • the edge angle calculation unit 102 calculates an edge angle for each pixel based on the edge (S202).
  • the edge angle calculation unit 102 inputs the calculated edge angle information to the histogram generation unit 203.
  • the histogram generation unit 203 creates a histogram of all edge angles corresponding to all pixels in the image (S203). Then, the histogram generation unit 203 inputs the histogram to the use angle candidate identification processing unit 204.
  • the use angle candidate specification processing unit 204 specifies a plurality of use angle candidates whose number of pixels is equal to or greater than a threshold from the created histogram (S204). Then, the use angle candidate specification processing unit 204 inputs the use angle candidates to the use angle specification processing unit 205.
  • the use angle specification processing unit 205 calculates a depth variance value for each of the specified use angle candidates.
  • the depth dispersion value is a dispersion value of a plurality of depth values of a plurality of pixels corresponding to the use angle candidates.
  • the use angle identification processing unit 205 identifies a use angle candidate whose depth variance is equal to or less than a threshold value as a use angle (S205). Then, the use angle specifying processing unit 205 inputs the specified use angle to the tilt angle deriving unit 105. Finally, the inclination angle deriving unit 105 derives an inclination angle from the specified use angle (S206).
  • the image processing apparatus 200 performs edge detection (S201) and edge angle calculation (S202). Since the procedures of edge detection (S201) and edge angle calculation (S202) are the same as those in the first embodiment, description thereof will be omitted.
  • the histogram generation unit 203 generates a histogram of all edge angles corresponding to all the pixels in the image using the edge angle calculated by the edge angle calculation unit 102 (S203).
  • FIG. 12 shows a histogram generated by the histogram generation unit 203 based on the image 300 shown in FIG. 4A. That is, a histogram similar to the histogram shown in FIG. 6 is generated.
  • the histogram of FIG. 12 also has a peak 501 corresponding to the angle of the edge 301, a peak 502 corresponding to the angle of the edge 302, a peak 503 corresponding to the angle of the edge 303, and a peak 504 corresponding to the angle of the edge 304. .
  • the usage angle candidate identification processing unit 204 identifies a plurality of usage angle candidates from the histogram generated by the histogram generation unit 203 (S204).
  • each of the plurality of use angle candidates is an edge angle having an appearance frequency exceeding the threshold value 1100, and is an edge angle corresponding to the maximum value.
  • four edge angles corresponding to peak 501, peak 502, peak 503, and peak 504 are specified as use angle candidates.
  • the threshold value 1100 may be set in advance or may be appropriately changed depending on the number of pixels of the peak. For example, when the number of use angle candidates is previously determined to be 4, the threshold value 1100 is set to the value of the peak 503, which is the fourth highest local maximum value.
  • the use angle specification processing unit 205 calculates a depth dispersion value for each of the specified use angle candidates, and specifies a use angle candidate whose depth dispersion value is equal to or less than a threshold value as a use angle (S205).
  • the depth variance value is a value indicating the variance of all depth values of all pixels corresponding to the same edge angle. That is, a higher depth variance value indicates that a plurality of pixels corresponding to the same edge angle have various depth values.
  • the depth variance value is calculated by a variance value calculation method used in general statistics.
  • FIG. 13 is a graph showing the depth variance value calculated for each of the plurality of specified use angle candidates.
  • the depth dispersion value 1201 indicates a depth dispersion value corresponding to a use angle candidate based on the peak 501.
  • the depth dispersion value 1202 indicates a depth dispersion value corresponding to a use angle candidate based on the peak 502.
  • the depth dispersion value 1203 indicates a depth dispersion value corresponding to a use angle candidate based on the peak 503.
  • the depth dispersion value 1204 indicates a depth dispersion value corresponding to a use angle candidate based on the peak 504.
  • Threshold value 1200 is a threshold value for specifying the use angle from the use angle candidates according to the depth dispersion value, and is arbitrarily set.
  • the threshold 1200 may be a minimum depth variance value.
  • the use angle specification processing unit 205 may specify the use angle candidate corresponding to the minimum depth variance value as the use angle.
  • the above procedure is based on the fact that the depth value (depth) of the edge to be used for deriving the tilt angle is substantially constant, as in the first embodiment. Conversely, since the edge that should not be used for deriving the tilt angle appears along the depth direction, the depth value is not constant.
  • the use angle specifying processing unit 205 can specify not the edge angle that should not be used for deriving the tilt angle but the edge angle that should be used for deriving the tilt angle as the use angle.
  • the tilt angle deriving unit 105 derives the tilt angle from the specified one or more use angles (S206). Since this process is the same as that of the first embodiment, description thereof is omitted.
  • the image processing apparatus 200 specifies the edge angle to be used for deriving the tilt angle on the condition that the depth dispersion value is equal to or less than the threshold value. Therefore, even when the image includes many line segments in the depth direction such as perspective, the image processing apparatus 200 can appropriately specify the edge angle to be used for deriving the tilt angle. Therefore, the image processing apparatus 200 can appropriately derive the tilt angle of the image.
  • the image processing apparatus 200 specifies a plurality of use angle candidates, calculates a depth dispersion value for each of the plurality of use angle candidates, and specifies a use angle according to the depth dispersion value.
  • the use angle specified according to the depth dispersion value is used for deriving the tilt angle, thereby reducing the possibility that an incorrect tilt angle is derived.
  • the use angle candidate specification processing unit 204 specifies only the edge angle corresponding to the peak having the maximum value in the histogram as the use angle candidate. However, the use angle candidate specification processing unit 204 may specify all edge angles whose appearance frequencies exceed the threshold value 1100 as use angle candidates.
  • the use angle candidate identification processing unit 204 may not be provided. Then, the use angle identification processing unit 205 calculates the depth variance value corresponding to each of all the edge angles, and uses the use angle based on the ratio between the number of pixels corresponding to each of all the edge angles and the depth variance value. May be specified.
  • the modification described in the first embodiment can also be applied to the image processing apparatus 200 according to the second embodiment.
  • FIG. 14 is a configuration diagram of the image processing apparatus according to the present embodiment.
  • the image processing apparatus 400 shown in FIG. 14 derives the tilt angle of the image.
  • the image processing apparatus 400 includes an edge angle calculation unit 401, a use angle identification unit 402, and an inclination angle derivation unit 403.
  • FIG. 15 is a flowchart showing the operation of the image processing apparatus 400 shown in FIG.
  • the edge angle calculation unit 401 calculates a plurality of edge angles corresponding to the plurality of pixels by calculating an edge angle that is an edge angle in each of the plurality of pixels in the image (S401).
  • the use angle specifying unit 402 specifies one or more use angles using a plurality of depth values and a plurality of edge angles (S402).
  • the depth value is a value corresponding to the pixel and is a value indicating the depth of the pixel.
  • the use angle is an edge angle and a candidate for an inclination angle.
  • the inclination angle deriving unit 403 derives an inclination angle from one or more use angles (S403).
  • the depth dispersion is a degree of dispersion of a plurality of depth values.
  • the depth dispersion may be a dispersion value of a plurality of depth values or a difference between a maximum value and a minimum value of the plurality of depth values. For example, when the variance value of a plurality of depth values is equal to or less than a predetermined threshold value, the depth variance may be determined to be equal to or less than a predetermined depth variance. Further, when a plurality of depth values correspond to one depth level, the depth dispersion of the plurality of depth values may be determined to be equal to or less than a predetermined depth dispersion.
  • the predetermined appearance frequency may be determined based on the measurement result of the appearance frequency.
  • the predetermined appearance frequency may be the maximum appearance frequency or the maximum value of the appearance frequency.
  • the image processing apparatus 400 uses the edge angle and the depth value in deriving the tilt angle. Therefore, an appropriate inclination angle based on the edge angle and the depth value is derived.
  • the configuration according to the present invention may be realized as a device, or may be realized as a method including processing units constituting the device as steps. Further, the configuration according to the present invention may be realized as a program for causing a computer to execute these steps, or realized as a non-temporary recording medium such as a computer-readable CD-ROM in which the program is recorded. May be.
  • the configuration according to the present invention may be realized as information, data, or a signal indicating the program.
  • These programs, information, data, and signals may be distributed via a communication network such as the Internet.
  • the image processing apparatus 100 according to Embodiment 1 may be a part of an imaging apparatus.
  • the imaging device is a camera, and may be a video camera or a still camera.
  • the imaging apparatus includes an imaging unit that generates an image by imaging a subject. Then, the image processing device 100 included in the imaging device may derive the tilt angle of the generated image.
  • the configuration according to the present invention is not limited to the above-described plurality of embodiments.
  • the configuration according to the present invention may be in the form as shown below.
  • the image processing apparatus is a computer system including a microprocessor, a ROM, a RAM, a hard disk unit, a display unit, a keyboard, a mouse, and the like.
  • a computer program is stored in the RAM or hard disk unit.
  • the image processing apparatus achieves its functions by the microprocessor operating according to the computer program.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • a part or all of the plurality of constituent elements constituting the image processing apparatus may be configured by a single system LSI (Large Scale Integration).
  • the system LSI is a super multifunctional LSI manufactured by integrating a plurality of components on one chip, and specifically, a computer system including a microprocessor, a ROM, a RAM, and the like. .
  • the RAM stores computer programs.
  • the system LSI achieves its functions by the microprocessor operating according to the computer program.
  • a part or all of the constituent elements constituting the image processing apparatus may be configured by an IC card that can be attached to and detached from the image processing apparatus or a single module.
  • the IC card or module is a computer system that includes a microprocessor, ROM, RAM, and the like.
  • the IC card or module may include the above-mentioned super multifunctional LSI.
  • the IC card or the module achieves its function by the microprocessor operating according to the computer program.
  • the IC card or module may have tamper resistance.
  • the configuration according to the present invention may be the method described above.
  • the configuration according to the present invention may be a computer program that implements this method by a computer, or a digital signal that is configured by a computer program.
  • the configuration according to the present invention is a computer-readable recording medium such as a flexible disk, hard disk, CD-ROM, MO, DVD, DVD-ROM, DVD-RAM, BD (Blu-ray). Disc), or may be recorded in a semiconductor memory or the like.
  • the configuration according to the present invention may be a digital signal recorded on these recording media.
  • the configuration according to the present invention may be a configuration in which a computer program or a digital signal is transmitted via an electric communication line, a wireless communication line, a wired communication line, a network represented by the Internet, a data broadcast, or the like.
  • the configuration according to the present invention may be a computer system including a microprocessor and a memory.
  • the memory may store the above computer program, and the microprocessor may operate according to the computer program.
  • program or digital signal may be recorded on a recording medium and transferred, or transferred via a network or the like.
  • the configuration according to the present invention may be implemented by another independent computer system.
  • each component may be configured by dedicated hardware or may be realized by executing a software program suitable for each component.
  • Each component may be realized by a program execution unit such as a CPU or a processor reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.
  • the software that realizes the image processing apparatus according to each of the above embodiments is the following program.
  • this program is an image processing method for deriving an inclination angle of an image to a computer, and by calculating an edge angle that is an edge angle in each of the plurality of pixels in the image, the plurality of pixels A plurality of edge angles corresponding to the plurality of pixels, a plurality of values corresponding to the plurality of pixels, each of which is a value indicating the depth of the pixel, and the plurality of edge angles, One or more use angles, each of which is an edge angle, each of which is a candidate for the tilt angle, are specified, and an image processing method for deriving the tilt angle from the one or more use angles is executed.
  • Each component may be a circuit. These circuits may constitute one circuit as a whole, or may be separate circuits. Each of these circuits may be a general-purpose circuit or a dedicated circuit.
  • the present invention is not limited to this embodiment. Unless it deviates from the gist of the present invention, one or more of the present invention may be applied to various modifications that can be conceived by those skilled in the art, or forms constructed by combining components in different embodiments. It may be included within the scope of the embodiments.
  • a process executed by a specific processing unit may be executed by another processing unit.
  • the order of the plurality of processes may be changed, and the plurality of processes may be executed in parallel.
  • the present invention is useful for image tilt correction and can be used for cameras, scanners, copiers, facsimile machines, printers, television receivers, mobile phones, projectors, and the like.

Abstract

 画像処理装置(400)は、画像の傾き角度を導出する画像処理装置であって、画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、複数の画素に対応する複数のエッジ角度を算出するエッジ角度算出部(401)と、複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが傾き角度の候補である1以上の利用角度を特定する利用角度特定部(402)と、1以上の利用角度から傾き角度を導出する傾き角度導出部(403)とを備える。

Description

画像処理装置および画像処理方法
 本発明は、画像の傾き角度を導出する画像処理装置に関する。
 画像の傾き角度を導出する画像処理装置に関する技術として、特許文献1に記載の技術がある。
国際公開第2009/001512号
 しかしながら、画像の傾き角度が適切に導出されない場合がある。この場合、画像の傾きを補正することは困難である。
 そこで、本発明は、画像の傾き角度を適切に導出することができる画像処理装置を提供する。
 本発明の一態様に係る画像処理装置は、画像の傾き角度を導出する画像処理装置であって、前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出するエッジ角度算出部と、前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定する利用角度特定部と、前記1以上の利用角度から前記傾き角度を導出する傾き角度導出部とを備える。
 なお、これらの包括的または具体的な態様は、システム、方法、集積回路、コンピュータプログラムまたはコンピュータ読み取り可能なCD-ROMなどの非一時的な記録媒体で実現されてもよく、システム、装置、方法、集積回路、コンピュータプログラムおよび記録媒体の任意な組み合わせで実現されてもよい。
 本発明の画像処理装置は、画像の傾き角度を適切に導出することができる。
図1は、奥行き方向の線分を有する画像を示す図である。 図2は、実施の形態1に係る画像処理装置の構成図である。 図3は、実施の形態1に係る画像処理装置の動作を示すフローチャートである。 図4Aは、実施の形態1に係る入力画像を示す図である。 図4Bは、実施の形態1に係るエッジを示す図である。 図5は、実施の形態1に係るエッジ強度とエッジ角度とを示す図である。 図6は、実施の形態1に係る全ての画素に対応する全てのエッジ角度のヒストグラムである。 図7Aは、実施の形態1に係る第1のデプスレベルの複数のエッジ角度のヒストグラムである。 図7Bは、実施の形態1に係る第2のデプスレベルの複数のエッジ角度のヒストグラムである。 図7Cは、実施の形態1に係る第3のデプスレベルの複数のエッジ角度のヒストグラムである。 図7Dは、実施の形態1に係る第4のデプスレベルの複数のエッジ角度のヒストグラムである。 図8は、実施の形態1に係るデプスマップとエッジを示す図である。 図9は、実施の形態1の変形例に係る画像処理装置の構成図である。 図10は、実施の形態2に係る画像処理装置の構成図である。 図11は、実施の形態2に係る画像処理装置の動作を示すフローチャートである。 図12は、実施の形態2に係る全ての画素に対応する全てのエッジ角度のヒストグラムである。 図13は、実施の形態2に係るデプス分散値を示す図である。 図14は、実施の形態3に係る画像処理装置の構成図である。 図15は、実施の形態3に係る画像処理装置の動作を示すフローチャートである。
 (本発明の基礎となった知見)
 本発明者は、「背景技術」の欄において記載した、画像の傾き角度を導出する画像処理装置に関して、課題の存在を見出した。以下、具体的に説明する。
 近年、デジタルスチルカメラおよびデジタルムービーなどの撮像装置は小型化され軽量化されている。このような撮像装置は持ち運び可能であるが、撮像時に撮像装置が傾く可能性がある。これにより、撮像によって得られた画像が上下左右にずれたり、画像が傾いたりする。
 ここで、画像が上下左右にずれるとは、被写体が画像において上下左右にずれることを意味する。画像が傾くとは、被写体が画像において傾くことを意味する。つまり、画像が傾くとは、画像における被写体の横方向または縦方向と、画像の横方向または縦方向との間に差が発生していることを意味する。なお、画像の傾き角度は、画像における被写体の横方向または縦方向と、画像の横方向または縦方向との間の角度である。
 傾いた画像は、利用者にとって見づらい。したがって、画像の回転によって、画像の傾きを補正することが有効な場合がある。
 さらに、従来のデジタルスチルカメラおよびデジタルムービーに加えて、ウェアラブルカメラも近年登場している。例えば、ウェアラブルカメラは、常時、利用者の身体に装着され、利用者の周辺を撮像する。これにより、利用者が体験する出来事が、常時、記録される。したがって、利用者は、常時、安全および安心を確認することができる。
 一方で、ウェアラブルカメラが誤って斜めに装着された場合、あるいは、利用者がウェアラブルカメラの装着中に移動することなどによってウェアラブルカメラが傾いた場合、撮像により得られる画像も傾く。上記の通り、傾いた画像は、利用者にとって見づらいため、この場合も同様に、傾きの補正が有効である。
 画像の傾きを補正する方法として、画像から得られる情報を用いて、画像の傾き角度を導出(推定)し、傾きを補正する方法が知られている(例えば、特許文献1)。この方法は、画像に写る構造物を形成する線分が地面に対して水平または垂直である可能性が高いことを利用している。したがって、画像に含まれる線分の角度(画像に含まれる線分と、画像の縦方向または横方向との間の角度)は画像の傾き角度に対応している可能性が高い。
 そのため、画像に含まれる線分の角度から、画像の傾き角度が推定される。この方法は、画像において構造物が写っている場合に特に有効である。
 また、画像から得られる情報に加えて、センサから得られる情報が用いられてもよい。これにより、より正確な傾き角度が導出される。例えば、撮像装置に備えられたセンサは、撮像時に撮像装置の傾き角度の範囲を得ることができる。範囲の大きさは、センサの精度に基づく。得られた範囲内で、画像に含まれる線分の角度から傾き角度を導出することにより、より正確な傾き角度が導出される。
 例えば、画像の傾き角度を導出する画像処理装置は、まず、ソーベルフィルタ(Sobel Filter)を用いて、縦方向のエッジ強度と横方向のエッジ強度とを画像における画素毎に算出する。そして、画像処理装置は、縦方向のエッジ強度と横方向のエッジ強度とからエッジ角度を画素毎に算出する。
 そして、画像処理装置は、画像内の全ての画素に対応する全てのエッジ角度の分布を表すヒストグラムを作成する。画像処理装置は、ヒストグラムにおいて閾値以上の出現頻度(度数、画素数)を有するエッジ角度を用いて、傾き角度を導出する。
 センサが用いられる場合、画像処理装置は、センサから得られる情報を用いて、エッジ角度の範囲を限定する。そして、画像処理装置は、限定された範囲内で最大の出現頻度を有するエッジ角度を傾き角度として導出する。
 しかしながら、画像には水平または垂直を表す線分の他にも複数の線分が存在する。水平または垂直を表す複数の線分が、画像に含まれる全ての線分において支配的であれば傾き角度は正しく導出される。しかし、水平または垂直を表していない複数の線分が、画像に含まれる全ての線分において支配的であれば、傾き角度は正しく導出されない。この代表的な例として、構造物の線分が斜めに写っている画像がある。
 図1は、奥行き方向の線分を有する画像を示す図である。奥行き方向の線分は、パースとも呼ばれる。具体的には、図1の画像1310において、構造物が手前側から奥側にわたって存在する。そのため、画像1310に線分1300が斜めに現れている。斜めの線分1300は、撮像装置の傾き、または、画像1310の傾きを表していない。そして、この斜めの線分1300が画像1310において支配的である場合、画像1310の傾き角度は適切に導出されない。
 センサが用いられる場合でも、同様の課題が存在する。ウェアラブルカメラなどでは、歩行時の衝撃などにより、センサがウェアラブルカメラの傾き角度を適切に検出できない場合がある。つまり、センサが検出する傾き角度の誤差は大きい。したがって、センサで検出された傾き角度を用いて、画像の傾き角度の範囲を小さく限定することは難しい。そのため、センサで限定された範囲内に奥行き方向の線分の角度が含まれる場合がある。この場合、画像の傾き角度が適切に導出されない。
 すなわち、センサが用いられる場合でも、画像の傾き角度が適切に導出されない場合がある。
 このような課題を解決するために、本発明の一態様に係る画像処理装置は、画像の傾き角度を導出する画像処理装置であって、前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出するエッジ角度算出部と、前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定する利用角度特定部と、前記1以上の利用角度から前記傾き角度を導出する傾き角度導出部とを備える。
 これにより、画像処理装置は、複数の画素に対応する複数のデプス値を用いて、複数の画素に対応する複数のエッジ角度から、傾き角度の候補(利用角度)を適切に特定することができる。したがって、画像処理装置は、適切な傾き角度を導出することができる。
 例えば、前記利用角度特定部は、複数のデプス値の分散の度合いを示すデプス分散度が所定のデプス分散度以下である複数の画素に対応する複数のエッジ角度において出現頻度が所定の出現頻度以上である1以上のエッジ角度を前記1以上の利用角度として特定してもよい。
 これにより、画像処理装置は、デプス分散度が低い複数の画素に対応する複数のエッジ角度において出現頻度が高いエッジ角度を傾き角度の候補として特定することができる。
 また、例えば、前記利用角度特定部は、前記エッジ角度算出部で算出された複数のエッジ角度のヒストグラムをデプス値の大きさの度合いを示すデプスレベル毎に生成することにより、複数のヒストグラムを生成するヒストグラム生成部と、前記複数のヒストグラムにおいて所定の条件を満たす1以上のエッジ角度を前記1以上の利用角度として特定する利用角度特定処理部とを備えてもよい。
 これにより、画像処理装置は、デプスレベル毎に生成されたヒストグラムを用いて、傾き角度の候補を特定することができる。
 また、例えば、前記利用角度特定処理部は、前記複数のヒストグラムのいずれかにおいて出現頻度が所定の出現頻度以上である1以上のエッジ角度を前記1以上の利用角度として特定してもよい。
 これにより、画像処理装置は、1つのデプスレベルにおいて出現頻度が大きいエッジ角度を傾き角度の候補として特定する。1つのデプスレベルにおいて出現頻度が大きいエッジ角度は、奥行き方向の線分の角度とは異なる可能性が高い。したがって、画像処理装置は、傾き角度の候補を適切に特定することができる。
 また、例えば、前記利用角度特定処理部は、前記複数のヒストグラムにおいて出現頻度が最大である1以上のエッジ角度を前記1以上の利用角度として特定してもよい。
 これにより、画像処理装置は、デプスレベル毎に生成されたヒストグラムにおいて出現頻度が大きいエッジ角度を傾き角度の候補として特定する。ヒストグラムがデプスレベル毎に生成された場合、奥行き方向に対応するエッジ角度の出現頻度は、複数のヒストグラムに分散されるため減少する。したがって、画像処理装置は、傾き角度の候補を適切に特定することができる。
 また、例えば、前記利用角度特定処理部は、前記複数のヒストグラムのいずれかにおいて出現頻度が極大値である1以上のエッジ角度を前記1以上の利用角度として特定してもよい。
 これにより、画像処理装置は、デプスレベル毎に生成されたヒストグラムにおいて出現頻度が極大値であるエッジ角度を傾き角度の候補として特定する。ヒストグラムがデプスレベル毎に生成された場合、奥行き方向に対応する出現頻度は、減少し、極大値を構成しない可能性がある。したがって、画像処理装置は、傾き角度の候補を適切に特定することができる。
 また、例えば、前記利用角度特定部は、前記エッジ角度算出部で算出された複数のエッジ角度のヒストグラムを生成するヒストグラム生成部と、前記ヒストグラムにおいて所定の条件を満たす複数のエッジ角度であり、前記1以上の利用角度の複数の候補である複数の利用角度候補を特定する利用角度候補特定処理部と、複数のデプス値の分散の度合いを示すデプス分散度を利用角度候補毎に取得することにより前記複数の利用角度候補に対応する複数のデプス分散度を取得し、前記複数のデプス分散度に基づいて、前記複数の利用角度候補から前記1以上の利用角度を特定する利用角度特定処理部とを備えてもよい。
 これにより、画像処理装置は、デプス分散度に基づいて、傾き角度の候補を適切に特定することができる。
 また、例えば、前記利用角度特定処理部は、デプス分散度が所定のデプス分散度以下である1以上の利用角度候補を前記1以上の利用角度として特定してもよい。
 これにより、画像処理装置は、デプス分散度が小さい複数の画素に対応する複数のエッジ角度から、傾き角度の候補を適切に特定することができる。
 また、例えば、前記利用角度候補特定処理部は、前記ヒストグラムにおいて出現頻度が所定の出現頻度以上である複数のエッジ角度を前記複数の利用角度候補として特定してもよい。
 これにより、画像処理装置は、出現頻度の大きいエッジ角度を用いて、傾き角度の候補を適切に特定することができる。
 また、例えば、前記画像処理装置は、さらに、前記傾き角度導出部で導出された前記傾き角度を用いて、前記画像の傾きを補正する傾き補正部を備えてもよい。
 これにより、画像処理装置は、適切な傾き角度を用いて、画像の傾きを適切に補正できる。
 また、例えば、前記傾き角度導出部は、前記1以上の利用角度の平均値、または、前記1以上の利用角度のいずれかを前記傾き角度として導出してもよい。
 これにより、画像処理装置は、傾き角度に複数の候補が存在する場合でも、複数の候補から傾き角度を導出することができる。
 なお、これらの包括的または具体的な態様は、システム、方法、集積回路、コンピュータプログラムまたはコンピュータ読み取り可能なCD-ROMなどの非一時的な記録媒体で実現されてもよく、システム、装置、方法、集積回路、コンピュータプログラムまたは記録媒体の任意な組み合わせで実現されてもよい。
 以下、実施の形態について、図面を参照しながら具体的に説明する。なお、以下で説明する実施の形態は、いずれも包括的または具体的な例を示すものである。以下の実施の形態で示される数値、形状、材料、構成要素、構成要素の配置位置および接続形態、ステップ、ステップの順序などは、一例であり、本発明を限定する主旨ではない。また、以下の実施の形態における構成要素のうち、最上位概念を示す独立請求項に記載されていない構成要素については、任意の構成要素として説明される。
 (実施の形態1)
 図2は、本実施の形態における画像処理装置100の構成を示す図である。
 画像処理装置100は、エッジ検出部101と、エッジ角度算出部102と、利用角度特定部109と、傾き角度導出部105とを備える。また、利用角度特定部109は、ヒストグラム生成部103と、利用角度特定処理部104とを備える。
 図3は、画像処理装置100が傾き角度を導出する手順を示す。以下、傾き角度の導出の流れを図2および図3を用いて説明する。
 まず、エッジ検出部101は、入力画像のエッジを検出する(S101)。エッジ検出部101は、エッジ角度算出部102にエッジの情報を入力する。次に、エッジ角度算出部102は、エッジの情報から画素毎にエッジの角度であるエッジ角度を算出する(S102)。
 次に、エッジ角度算出部102で画素毎に算出されたエッジ角度の情報、および、画素毎のデプス値の情報(デプス情報)が、ヒストグラム生成部103に入力される。ヒストグラム生成部103は、エッジ角度のヒストグラムをデプスレベル毎に生成することにより、複数のヒストグラムを生成する(S103)。
 デプスレベルは、デプス値のレベルであり、デプス値の大きさに対応する。レベルは、度合い、程度、分類、階級、または、範囲等のような表現に置き換えられてもよい。デプス値は、デプス値の解像度であるデプス解像度に従って、複数のデプスレベルに分類される。デプスレベルは、デプス値と同じでもよい。例えば、デプス値が、0、1、2および3のいずれかに限られる場合、デプスレベルがデプス値と同じと扱われてもよい。
 次に、ヒストグラム生成部103は、デプスレベル毎のヒストグラムを利用角度特定処理部104に入力する。利用角度特定処理部104は、ヒストグラム毎に、利用角度(利用エッジ角度)を特定する(S104)。利用角度は、傾き角度の候補として用いられるエッジ角度である。
 例えば、利用角度特定処理部104は、複数のヒストグラムのいずれかにおいて、ヒストグラムの度数(出現頻度)に対応する画素数が閾値以上であるエッジ角度を利用角度として特定する。利用角度特定処理部104は、複数のヒストグラムのいずれかにおいて、ピークのエッジ角度を利用角度として特定してもよい。利用角度特定処理部104は、これらの組み合わせに基づいて、利用角度を特定してもよい。
 次に、利用角度特定処理部104は、利用角度の情報を傾き角度導出部105に入力する。傾き角度導出部105は、利用角度から傾き角度を導出する(S105)。
 以下、画像処理装置100の各構成要素、および、傾き角度を導出する手順をより詳細に図2~図7Dを用いて説明する。
 まず、撮像装置等が被写体を撮像することにより生成された画像が、エッジ検出部101に入力される。この入力画像は、撮像によって生成された原画像でもよいし、表色系の変換処理が施されたグレースケール画像などのように、変換後の画像でもよい。
 続いて、エッジ検出部101は、入力画像におけるエッジを検出する(S101)。具体的には、例えば、エッジ検出部101は、入力画像における画素毎に、ソーベルフィルタを用いて、入力画像の縦方向のエッジ強度と、入力画像の横方向のエッジ強度とを算出する。画素における縦方向のエッジ強度は、当該画素の値と、その上下の画素の値との差の大きさに比例する。画素における横方向のエッジ強度は、当該画素の値と、その左右の画素の値との差の大きさに比例する。
 図4Aは、本実施の形態に係る入力画像を示す。図4Aには、入力画像である画像300が示されている。
 図4Bは、本実施の形態に係るエッジを示す図である。図4Bには、画像300に対してエッジ検出を行うことにより得られる代表的なエッジ301~304は、画像300に重なって、表示されている。
 エッジ301は、横方向の線分に対応し、傾き角度の導出に用いるべきエッジ角度を有する画素で構成される。エッジ302は、縦方向の線分に対応し、傾き角度の導出に用いるべきエッジ角度を有する画素で構成される。エッジ303およびエッジ304は、傾き角度の導出に用いるべきではないエッジ角度を有する画素で構成される。
 エッジ303およびエッジ304は、上述の通り、パースと呼ばれる線分に対応するエッジであり、構造物の奥行き方向に対応する。
 続いて、エッジ角度算出部102は、エッジ検出部101で検出されたエッジから、画素毎にエッジ角度を算出する(S102)。図5は、画素に対応するエッジ角度θを示す。エッジ検出部101で検出されたエッジは、各画素において、縦方向のエッジ強度、および、横方向のエッジ強度を有する。エッジ角度算出部102は、縦方向のエッジ強度と、横方向のエッジ強度とを合成し、画素毎に、エッジ角度θを算出することができる。
 ここでは、合成によって得られるエッジ方向は、画像に現れる線分の法線方向に対応する。また、エッジ角度θは、画像の縦方向とエッジ方向との間の角度である。なお、この定義は、一例であり、エッジ方向は、画像に現れる線分に沿った方向でもよいし、エッジ角度θは、画像の横方向とエッジ方向との間の角度でもよい。
 エッジ角度算出部102は、全ての画素においてエッジ角度θを算出しなくてもよく、画素に対応する縦方向または横方向のエッジ強度が予め設定された閾値よりも大きい場合にのみ、当該画素に対応するエッジ角度θを算出してもよい。これは下記の理由による。
 構造物を表すエッジは、水平方向または垂直方向に対応しているため、傾き角度の導出に適切である。一方、空などの背景、または、ローテクスチャを表すエッジは、水平方向または垂直方向に対応していないため、傾き角度の導出に不適切である。つまり、傾き角度の導出において、背景またはローテクスチャを表すエッジはノイズである。そのため、画像処理装置100は、傾き角度の導出前に、ノイズである不要なエッジの情報を可能な限り除外した方がよい。このノイズの除去のため、エッジ強度が有用である。
 構造物を表すエッジでは、縦方向のコントラストおよび横方向のコントラストの少なくとも一方が大きいため、縦方向のエッジ強度および横方向のエッジ強度の少なくとも一方は大きい。一方、背景またはローテクスチャを表すエッジでは、縦方向および横方向のコントラストが小さいため、縦方向および横方向のエッジ強度が小さい。したがって、エッジ角度算出部102は、画素に対応するエッジ強度が小さい場合、当該画素に対応するエッジ角度を算出しなくてもよい。
 続いて、ヒストグラム生成部103は、エッジ角度算出部102で画素毎に算出されたエッジ角度、および、画素毎のデプス値に基づいて、エッジ角度と画素数との関係を示すヒストグラムを、予め設定されているデプスレベル毎に作成する(S103)。
 通常の画像処理装置は、全ての画素に対応する全てのエッジ角度の分布を表すヒストグラムを作成し、このヒストグラムにおいて閾値以上の出現頻度を有するエッジ角度を用いて、傾き角度を導出する。図6に示されたヒストグラムは、通常の画像処理装置によって画像300に基づいて作成されたヒストグラムであり、画像300の全ての画素に対応する全てのエッジ角度の統計を示す。ヒストグラムの縦軸で示される度数は画素数であり、ヒストグラムの横軸で示される階級はエッジ角度である。
 また、ヒストグラムには、エッジ301の角度に対応するピーク501、エッジ302の角度に対応するピーク502、エッジ303の角度に対応するピーク503、および、エッジ304の角度に対応するピーク504がある。
 通常の画像処理装置は、ヒストグラムに示された閾値510以上の画素数を有するピーク502およびピーク504に対応するエッジ角度を、傾き角度の導出に用いる。上述の通り、ピーク504に対応するエッジ角度は、パースに対応するエッジ304の角度である。したがって、ピーク504に対応するエッジ角度は、傾き角度の導出に用いるべきではない。
 そこで、本実施の形態に係る画像処理装置100のヒストグラム生成部103は、デプス値に基づいて、ヒストグラムを生成する。
 デプス値は、具体的には、画素に対応する奥行きの値であり、撮像位置から画素に対応する被写体までの距離を示す。例えば、デプス値は、0~255の値で表される。デプス値が小さいほど、撮像位置から被写体までの距離が長く、デプス値が大きいほど、撮像位置から被写体までの距離が短い。つまり、デプス値が0である場合、撮像位置から被写体までの距離が最も長い。デプス値が255である場合、撮像位置から被写体までの距離は最も短い。
 なお、上記のデプス値の特性は、一例である。デプス値は、0~255以外の値で表されてもよい。また、デプス値が小さいほど、撮像位置から被写体までの距離が短く、デプス値が大きいほど、撮像位置から被写体までの距離が長くてもよい。
 デプス値を取得する方法として、TOF(Time Of Flight)などのアクティブな測距方法、および、複数の画像におけるコントラストを用いるDFF(Depth From Focus)などのパッシブな測距方法がある。デプス値を取得する方法は限定されず、様々な方法が採用され得る。
 図7A~図7Dは、0~255のデプス値を4つのデプスレベルに分類し、デプスレベル毎に生成されたヒストグラムを示す。図7Aは、画像300において、192~255のデプス値を有する複数の画素に対応する複数のエッジ角度のヒストグラムを示す。同様に、図7Bは、128~191のデプス値に対応し、図7Cは、64~127のデプス値に対応し、図7Dは、0~63のデプス値に対応する。
 図7A~図7Dのヒストグラムでは、横軸のビン幅(階級間隔)は1度である。通常、ビン幅は1度で十分である。しかし、画像のノイズ量などによって、エッジ角度算出部102で得られるエッジ角度には、誤差が含まれる。したがって、ヒストグラム生成部103は、2~8度のように、大きいビン幅でヒストグラムを作成してもよい。
 大きいビン幅でヒストグラムが作成された場合、導出される傾き角度も、ビン幅に応じて粗くなる。画像処理装置100は、傾き角度を高精度に導出するため、ヒストグラムの近似曲線を用いてもよい。近似曲線のピークに対応するエッジ角度が、高精度に傾き角度を導出するための候補として、利用可能である。
 また、画像処理装置100は、傾き角度を高精度に導出するため、大きいビン幅のヒストグラムで粗い傾き角度を導出した後、導出された粗い傾き角度が示す範囲内において小さいビン幅でヒストグラムを作り直してもよい。これにより、画像処理装置100は、傾き角度を高精度に導出することができる。
 利用角度特定処理部104は、ヒストグラム生成部103で作成されたヒストグラム毎に、閾値以上の画素数を有するエッジ角度を利用角度として特定する(S104)。
 図7A~図7Dのヒストグラムには、エッジ301の角度に対応するピーク601、エッジ302の角度に対応するピーク602、エッジ303の角度に対応するピーク603、および、エッジ304の角度に対応するピーク604が表示されている。また、図7A~図7Dのヒストグラムには、それぞれ、閾値610が設けられている。
 図7Aのヒストグラムでは、ピーク601が閾値610を超える。したがって、ピーク601に対応するエッジ角度が、傾き角度の導出に適切な利用角度として特定される。図7B~図7Dのヒストグラムでは、閾値610を超えるピークが存在しない。そのため、図7B~図7Dのヒストグラムから、利用角度は特定されない。これにより、傾き角度の導出に用いるべきエッジ角度が利用角度として特定される。
 上記の手順は、傾き角度の導出に用いるべきエッジのデプス値(奥行き)がほぼ一定であることに基づく。逆に、パースのような傾き角度の導出に用いるべきではないエッジは奥行き方向に沿って現れるため、デプス値が一定ではない。この特徴を、図8を用いて説明する。
 図8は、画像300のデプスマップ、および、エッジ301~304を重ね合わせて示す図である。デプスマップは、画素毎のデプス値を示すデータであり、視覚的に画像で表現される。図8のデプスマップ310は、ハッチングが薄い程、撮像位置から被写体への距離が短く、ハッチングが濃い程、撮像位置から被写体への距離が長いことを示す。
 傾き角度の導出に用いるべきエッジ301は、デプスマップ310においてハッチングの薄い部分のみに現れている。一方で、傾き角度の導出に用いるべきではないエッジ303は、デプスマップ310においてハッチングの薄い部分からハッチングの濃い部分にまたがって現れている。
 よって、図7A~図7Dのように、デプスレベル毎にヒストグラムが作成された場合、傾き角度の導出に用いるべきエッジ角度の出現頻度は、1つのヒストグラムに集中して現れ、傾き角度の導出に用いるべきではないエッジ角度の出現頻度は、複数のヒストグラムにまたがって現れる。利用角度特定処理部104は、この特徴を利用することで、傾き角度の導出に用いるべきではないエッジ角度ではなく、傾き角度の導出に用いるべきエッジ角度を利用角度として特定することができる。
 なお、2つ以上のヒストグラムで閾値以上の画素数を有するエッジ角度は、奥行き方向の線分に対応するエッジ角度である可能性がある。そこで、利用角度特定処理部104は、複数のヒストグラムのうち1つのヒストグラムのみにおいて閾値以上の画素数を有するエッジ角度を利用角度として特定してもよい。
 そして、傾き角度導出部105は、特定された1つ以上の利用角度から傾き角度を導出する(S105)。
 傾き角度導出部105は、特定された利用角度をそのまま傾き角度として導出してもよいし、複数の利用角度の平均を傾き角度として導出してもよい。傾き角度導出部105は、複数の利用角度の中から、画像の横方向または縦方向に最も近い角度を傾き角度として導出してもよい。また、センサが用いられる場合、傾き角度導出部105は、複数の利用角度の中から、センサの情報に基づいて指定される範囲内の利用角度を傾き角度として導出してもよい。
 また、入力画像が動画である場合、傾き角度導出部105は、時系列において1フレーム前に導出された傾き角度を保持しておき、現在のフレームで特定された複数の利用角度の中から、1フレーム前に導出された傾き角度と最も近い利用角度を現在のフレームの傾き角度として導出してもよい。
 以上、本実施の形態に係る画像処理装置100は、デプス値に基づいてエッジ角度のヒストグラムをデプスレベル毎に作成する。したがって、画像にパースのような奥行き方向の線分が多く含まれる場合でも、画像処理装置100は、傾き角度の導出に用いるべきエッジ角度を特定することができる。よって、画像処理装置100は、画像の傾き角度を適切に導出することができる。
 なお、エッジ検出には、上述のソーベルフィルタに限らず、縦方向および横方向のコントラストを用いる様々な方法が適用され得る。
 また、デプス値およびデプスレベルは、上記に限られない。デプス解像度を高くすれば、高くするほど多くのヒストグラムが生成される。デプス解像度は4~16程度であることが望ましい。
 また、本実施の形態に係る利用角度特定処理部104は、ピーク601に対応するエッジ角度を傾き角度の導出に用いるべき利用角度として特定する。しかし、利用角度の特定には、その他の様々な方法が適用可能である。例えば、利用角度特定処理部104は、閾値610よりも大きい出現頻度を有する全てのエッジ角度を利用角度として特定してもよいし、ヒストグラムの極大値(ピーク)に対応するエッジ角度を利用角度として導出してもよい。
 また、利用角度特定処理部104は、極大値に対応する複数のエッジ角度の中で、予め設定された閾値よりも大きい出現頻度を有するエッジ角度のみを利用角度として特定してもよい。すなわち、図7Aのヒストグラムにおいて最大のピーク601に対応するエッジ角度が利用角度として特定されてもよいし、最大のピーク601に対応するエッジ角度に近い複数のエッジ角度のうち、閾値610を超えている全てのエッジ角度が利用角度として特定されてもよい。
 また、図9に示す画像処理装置110のように、傾き補正部106が構成に含まれていてもよい。傾き補正部106は、傾き角度導出部105で導出された傾き角度に基づいて、入力画像の傾きを補正する。例えば、傾きの補正には、アフィン変換などの手法が用いられてもよい。傾きの補正には、その他の様々な方法が限定されることなく採用され得る。
 また、被写体を撮像することにより画像を生成する撮像部が構成要素として追加されてもよい。また、傾き角度を検出するセンサが構成要素として追加されてもよい。また、デプスマップを生成するデプスマップ生成部が構成要素として追加されてもよい。
 (実施の形態2)
 図10は、本実施の形態に係る画像処理装置の構成を示す図である。本実施の形態において、実施の形態1と同様の構成には、同じ符号が用いられる。
 図10に示された画像処理装置200は、エッジ検出部101と、エッジ角度算出部102と、利用角度特定部209と、傾き角度導出部105とを備える。また、利用角度特定部209は、ヒストグラム生成部203と、利用角度候補特定処理部204と、利用角度特定処理部205とを備える。
 図11は、画像処理装置200が傾き角度を導出する手順を示す。以下、傾き角度の導出の流れを図10および図11を用いて説明する。
 まず、エッジ検出部101は、入力画像のエッジを検出する(S201)。そして、エッジ検出部101は、エッジ角度算出部102にエッジの情報を入力する。次に、エッジ角度算出部102は、エッジに基づいて、画素毎にエッジ角度を算出する(S202)。そして、エッジ角度算出部102は、算出されたエッジ角度の情報をヒストグラム生成部203に入力する。
 次に、ヒストグラム生成部203は、画像内の全ての画素に対応する全てのエッジ角度のヒストグラムを作成する(S203)。そして、ヒストグラム生成部203は、ヒストグラムを利用角度候補特定処理部204に入力する。次に、利用角度候補特定処理部204は、作成されたヒストグラムから画素数が閾値以上である複数の利用角度候補を特定する(S204)。そして、利用角度候補特定処理部204は、利用角度候補を利用角度特定処理部205に入力する。
 次に、利用角度特定処理部205は、特定された複数の利用角度候補のそれぞれについて、デプス分散値を算出する。デプス分散値は、利用角度候補に対応する複数の画素の複数のデプス値の分散値である。利用角度特定処理部205は、デプス分散値が閾値以下である利用角度候補を利用角度として特定する(S205)。そして、利用角度特定処理部205は、特定された利用角度を傾き角度導出部105に入力する。最後に、傾き角度導出部105は、特定された利用角度から傾き角度を導出する(S206)。
 以下、画像処理装置200の各構成要素、および、傾き角度を導出する手順をより詳細に図10~図13を用いて説明する。
 まず、画像処理装置200は、エッジ検出(S201)およびエッジ角度の算出(S202)を行う。エッジ検出(S201)およびエッジ角度の算出(S202)の手順は、実施の形態1と同様であるため、説明を省略する。
 次に、ヒストグラム生成部203は、エッジ角度算出部102で算出されたエッジ角度を用いて、画像内の全ての画素に対応する全てのエッジ角度のヒストグラムを生成する(S203)。
 図12は、図4Aに示した画像300に基づいてヒストグラム生成部203が生成するヒストグラムを示す。すなわち、図6に示したヒストグラムと同様のヒストグラムが生成される。図12のヒストグラムにも、エッジ301の角度に対応するピーク501、エッジ302の角度に対応するピーク502、エッジ303の角度に対応するピーク503、および、エッジ304の角度に対応するピーク504がある。
 続いて、利用角度候補特定処理部204は、ヒストグラム生成部203で生成されたヒストグラムから、複数の利用角度候補を特定する(S204)。例えば、複数の利用角度候補は、それぞれ、閾値1100を超える出現頻度を有するエッジ角度であり、極大値に対応するエッジ角度である。具体的には、ピーク501、ピーク502、ピーク503およびピーク504に対応する4つのエッジ角度が利用角度候補として特定される。
 ここで、閾値1100は、予め設定されていてもよいし、ピークの画素数によって適宜変更されてもよい。例えば、先に利用角度候補の数が4と決められている場合、閾値1100は、4番目に高い極大値であるピーク503の値に設定される。
 続いて、利用角度特定処理部205は、特定された複数の利用角度候補のそれぞれについて、デプス分散値を算出し、デプス分散値が閾値以下である利用角度候補を利用角度として特定する(S205)。デプス分散値は、同じエッジ角度に対応する全ての画素の全てのデプス値の分散を示す値である。すなわち、デプス分散値が高い程、同じエッジ角度に対応する複数の画素が様々なデプス値を有することを示す。例えば、デプス分散値は、一般的な統計で用いられる分散値の算出方法によって算出される。
 図13は、特定された複数の利用角度候補のそれぞれについて算出されたデプス分散値を示すグラフである。デプス分散値1201は、ピーク501に基づく利用角度候補に対応するデプス分散値を示す。デプス分散値1202は、ピーク502に基づく利用角度候補に対応するデプス分散値を示す。デプス分散値1203は、ピーク503に基づく利用角度候補に対応するデプス分散値を示す。デプス分散値1204は、ピーク504に基づく利用角度候補に対応するデプス分散値を示す。
 また、閾値1200は、デプス分散値に従って利用角度候補の中から利用角度を特定するための閾値であり、任意に設定される。ここで、図13では、デプス分散値1201が閾値1200より低いため、ピーク501に基づく利用角度候補が利用角度として特定される。これにより、傾き角度の導出に用いられるべき利用角度が特定される。例えば、閾値1200は、最小のデプス分散値でもよい。利用角度特定処理部205は、最小のデプス分散値に対応する利用角度候補を利用角度として特定してもよい。
 上記の手順は、実施の形態1と同様に、傾き角度の導出に用いるべきエッジのデプス値(奥行き)は、ほぼ一定であることに基づく。逆に、傾き角度の導出に用いるべきではないエッジは奥行きの方向に沿って現れるため、デプス値が一定ではない。
 すなわち、傾き角度の導出に用いるべきではないエッジには、図8のデプスマップ310のように、様々なデプス値が含まれるため、当該エッジに対応するデプス分散値は高い。利用角度特定処理部205は、この特徴を利用することで、傾き角度の導出に用いるべきではないエッジ角度ではなく、傾き角度の導出に用いるべきエッジ角度を利用角度として特定することができる。
 そして、傾き角度導出部105は、特定された1以上の利用角度から傾き角度を導出する(S206)。この処理は、実施の形態1と同様であるので説明を省略する。
 以上、本実施の形態に係る画像処理装置200は、デプス分散値が閾値以下であることを条件に用いて、傾き角度の導出に用いるべきエッジ角度を特定する。したがって、画像にパースのような奥行き方向の線分が多く含まれる場合でも、画像処理装置200は、傾き角度の導出に用いるべきエッジ角度を適切に特定することができる。よって、画像処理装置200は、画像の傾き角度を適切に導出することができる。
 具体的には、画像処理装置200は、複数の利用角度候補を特定し、複数の利用角度候補のそれぞれについてデプス分散値を算出し、デプス分散値に従って利用角度を特定する。デプス分散値に従って特定された利用角度が傾き角度の導出に用いられることにより、誤った傾き角度が導出される可能性が低減する。
 なお、上述において、利用角度候補特定処理部204は、ヒストグラムにおける極大値であるピークに対応するエッジ角度のみを利用角度候補として特定している。しかし、利用角度候補特定処理部204は、出現頻度が閾値1100を超える全てのエッジ角度を利用角度候補として特定してもよい。
 また、利用角度候補特定処理部204はなくてもよい。そして、利用角度特定処理部205は、全てのエッジ角度のそれぞれに対応するデプス分散値を算出し、全てのエッジ角度のそれぞれに対応する画素数とデプス分散値との比率に基づいて、利用角度を特定してもよい。
 また、実施の形態1に記載された変形例は、実施の形態2に係る画像処理装置200にも適用可能である。
 (実施の形態3)
 本実施の形態は、実施の形態1および実施の形態2に示された特徴的な構成を確認的に示す。
 図14は、本実施の形態に係る画像処理装置の構成図である。図14に示された画像処理装置400は、画像の傾き角度を導出する。そして、画像処理装置400は、エッジ角度算出部401、利用角度特定部402、および、傾き角度導出部403を備える。
 図15は、図14に示された画像処理装置400の動作を示すフローチャートである。まず、エッジ角度算出部401は、画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、複数の画素に対応する複数のエッジ角度を算出する(S401)。
 次に、利用角度特定部402は、複数のデプス値と、複数のエッジ角度とを用いて、1以上の利用角度を特定する(S402)。デプス値は、画素に対応する値であり、画素の奥行きを示す値である。利用角度は、エッジ角度であり傾き角度の候補である。次に、傾き角度導出部403は、1以上の利用角度から傾き角度を導出する(S403)。
 例えば、利用角度特定部402は、デプス分散度が所定のデプス分散度以下である複数の画素に対応する複数のエッジ角度において出現頻度が所定の出現頻度以上である1以上のエッジ角度を1以上の利用角度として特定してもよい。そして、より具体的な構成および手順として、実施の形態1または実施の形態2に係る構成および手順が適用されてもよい。
 ここで、デプス分散度は、複数のデプス値の分散の度合いである。デプス分散度は、複数のデプス値の分散値でもよいし、複数のデプス値の最大値と最小値との差でもよい。例えば、複数のデプス値の分散値が所定の閾値以下である場合、当該デプス分散度は、所定のデプス分散度以下であると判定されてもよい。また、複数のデプス値が1つのデプスレベルに対応する場合、当該複数のデプス値のデプス分散度は、所定のデプス分散度以下であると判定されてもよい。
 また、所定の出現頻度は、出現頻度の測定結果に基づいて定められてもよい。例えば、所定の出現頻度は、出現頻度の最大でもよいし、出現頻度の極大値でもよい。
 以上の通り、本実施の形態に係る画像処理装置400は、傾き角度の導出において、エッジ角度およびデプス値を用いる。したがって、エッジ角度およびデプス値に基づく適切な傾き角度が導出される。
 なお、本発明に係る構成は、装置として実現されてもよいし、その装置を構成する処理部をステップとして含む方法として実現されてもよい。また、本発明に係る構成は、それらのステップをコンピュータに実行させるためのプログラムとして実現されてもよいし、そのプログラムを記録したコンピュータ読み取り可能なCD-ROMなどの非一時的な記録媒体として実現されてもよい。
 また、本発明に係る構成は、そのプログラムを示す情報、データまたは信号として実現されてもよい。そして、それらプログラム、情報、データおよび信号は、インターネット等の通信ネットワークを介して配信されてもよい。
 また、実施の形態1に係る画像処理装置100は、撮像装置の一部でもよい。実施の形態1の変形例に係る画像処理装置110、実施の形態2に係る画像処理装置200、および、実施の形態3に係る画像処理装置400も、同様である。撮像装置は、具体的には、カメラであり、ビデオカメラでもよいし、スチールカメラでもよい。例えば、撮像装置は、被写体を撮像することにより画像を生成する撮像部を備える。そして、撮像装置に含まれる画像処理装置100等が、生成された画像の傾き角度を導出してもよい。
 (その他の変形例)
 本発明に係る構成は、上記の複数の実施の形態に限定されない。本発明に係る構成は、以下に示されるような形態でもよい。
 (1)上記の画像処理装置は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレイユニット、キーボードおよびマウスなどから構成されるコンピュータシステムである。
 RAMまたはハードディスクユニットには、コンピュータプログラムが記憶されている。マイクロプロセッサが、コンピュータプログラムにしたがって動作することにより、画像処理装置は、その機能を達成する。ここでコンピュータプログラムは、所定の機能を達成するために、コンピュータに対する指令を示す命令コードを複数個組み合わせて構成される。
 (2)上記の画像処理装置を構成する複数の構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)で構成されてもよい。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROMおよびRAMなどを含めて構成されるコンピュータシステムである。
 RAMには、コンピュータプログラムが記憶されている。マイクロプロセッサが、コンピュータプログラムにしたがって動作することにより、システムLSIは、その機能を達成する。
 (3)上記の画像処理装置を構成する構成要素の一部または全部は、画像処理装置に脱着可能なICカードまたは単体のモジュールで構成されてもよい。ICカードまたはモジュールは、マイクロプロセッサ、ROMおよびRAMなどで構成されるコンピュータシステムである。
 ICカードまたはモジュールは、上記の超多機能LSIを含んでもよい。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、ICカードまたはモジュールは、その機能を達成する。ICカードまたはモジュールは、耐タンパ性を有してもよい。
 (4)本発明に係る構成は、上記に示す方法でもよい。また、本発明に係る構成は、この方法をコンピュータにより実現するコンピュータプログラムでもよいし、コンピュータプログラムで構成されるデジタル信号でもよい。
 また、本発明に係る構成は、コンピュータプログラムまたはデジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD-ROM、MO、DVD、DVD-ROM、DVD-RAM、BD(Blu-ray Disc)、または、半導体メモリなどに記録されてもよい。また、本発明に係る構成は、これらの記録媒体に記録されているデジタル信号でもよい。
 また、本発明に係る構成は、コンピュータプログラムまたはデジタル信号を、電気通信回線、無線通信回線、有線通信回線、インターネットに代表されるネットワーク、または、データ放送等を経由して伝送する構成でもよい。
 また、本発明に係る構成は、マイクロプロセッサとメモリを備えるコンピュータシステムでもよい。そして、メモリは、上記のコンピュータプログラムを記憶していてもよいし、マイクロプロセッサは、コンピュータプログラムに従って動作してもよい。
 また、プログラムまたはデジタル信号は、記録媒体に記録されて移送されてもよいし、ネットワーク等を経由して移送されてもよい。そして、本発明に係る構成は、独立した他のコンピュータシステムにより実施されてもよい。
 (5)上記の実施の形態および上記の変形例を組み合わせてもよい。
 なお、上記各実施の形態において、各構成要素は、専用のハードウェアで構成されるか、各構成要素に適したソフトウェアプログラムを実行することによって実現されてもよい。各構成要素は、CPUまたはプロセッサなどのプログラム実行部が、ハードディスクまたは半導体メモリなどの記録媒体に記録されたソフトウェアプログラムを読み出して実行することによって実現されてもよい。ここで、上記各実施の形態の画像処理装置などを実現するソフトウェアは、次のようなプログラムである。
 すなわち、このプログラムは、コンピュータに、画像の傾き角度を導出する画像処理方法であって、前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出し、前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定し、前記1以上の利用角度から前記傾き角度を導出する画像処理方法を実行させる。
 また、各構成要素は、回路でもよい。これらの回路は、全体として1つの回路を構成してもよいし、それぞれ別々の回路でもよい。また、これらの回路は、それぞれ、汎用的な回路でもよいし、専用の回路でもよい。
 以上、本発明の一つまたは複数の態様に係る画像処理装置について、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。本発明の趣旨を逸脱しない限り、当業者が思いつく各種変形を本実施の形態に施したものや、異なる実施の形態における構成要素を組み合わせて構築される形態も、本発明の一つまたは複数の態様の範囲内に含まれてもよい。
 例えば、上記の各実施の形態において、特定の処理部が実行する処理を別の処理部が実行してもよい。また、複数の処理の順序が変更されてもよいし、複数の処理が並行して実行されてもよい。
 本発明は、画像の傾き補正に有用であり、カメラ、スキャナ、複写機、ファクシミリ装置、プリンタ、テレビジョン受像機、携帯電話およびプロジェクタ等に利用可能である。
 100、110、200、400 画像処理装置
 101 エッジ検出部
 102、401 エッジ角度算出部
 103、203 ヒストグラム生成部
 104、205 利用角度特定処理部
 105、403 傾き角度導出部
 106 傾き補正部
 109、209、402 利用角度特定部
 204 利用角度候補特定処理部
 300、1310 画像
 301、302、303、304 エッジ
 310 デプスマップ
 501、502、503、504、601、602、603、604 ピーク
 510、610、1100、1200 閾値
 1201、1202、1203、1204 デプス分散値
 1300 線分

Claims (14)

  1.  画像の傾き角度を導出する画像処理装置であって、
     前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出するエッジ角度算出部と、
     前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定する利用角度特定部と、
     前記1以上の利用角度から前記傾き角度を導出する傾き角度導出部とを備える
     画像処理装置。
  2.  前記利用角度特定部は、複数のデプス値の分散の度合いを示すデプス分散度が所定のデプス分散度以下である複数の画素に対応する複数のエッジ角度において出現頻度が所定の出現頻度以上である1以上のエッジ角度を前記1以上の利用角度として特定する
     請求項1に記載の画像処理装置。
  3.  前記利用角度特定部は、
     前記エッジ角度算出部で算出された複数のエッジ角度のヒストグラムをデプス値の大きさの度合いを示すデプスレベル毎に生成することにより、複数のヒストグラムを生成するヒストグラム生成部と、
     前記複数のヒストグラムにおいて所定の条件を満たす1以上のエッジ角度を前記1以上の利用角度として特定する利用角度特定処理部とを備える
     請求項1または2に記載の画像処理装置。
  4.  前記利用角度特定処理部は、前記複数のヒストグラムのいずれかにおいて出現頻度が所定の出現頻度以上である1以上のエッジ角度を前記1以上の利用角度として特定する
     請求項3に記載の画像処理装置。
  5.  前記利用角度特定処理部は、前記複数のヒストグラムにおいて出現頻度が最大である1以上のエッジ角度を前記1以上の利用角度として特定する
     請求項3または4に記載の画像処理装置。
  6.  前記利用角度特定処理部は、前記複数のヒストグラムのいずれかにおいて出現頻度が極大値である1以上のエッジ角度を前記1以上の利用角度として特定する
     請求項3~5のいずれか1項に記載の画像処理装置。
  7.  前記利用角度特定部は、
     前記エッジ角度算出部で算出された複数のエッジ角度のヒストグラムを生成するヒストグラム生成部と、
     前記ヒストグラムにおいて所定の条件を満たす複数のエッジ角度であり、前記1以上の利用角度の複数の候補である複数の利用角度候補を特定する利用角度候補特定処理部と、
     複数のデプス値の分散の度合いを示すデプス分散度を利用角度候補毎に取得することにより前記複数の利用角度候補に対応する複数のデプス分散度を取得し、前記複数のデプス分散度に基づいて、前記複数の利用角度候補から前記1以上の利用角度を特定する利用角度特定処理部とを備える
     請求項1または2に記載の画像処理装置。
  8.  前記利用角度特定処理部は、デプス分散度が所定のデプス分散度以下である1以上の利用角度候補を前記1以上の利用角度として特定する
     請求項7に記載の画像処理装置。
  9.  前記利用角度候補特定処理部は、前記ヒストグラムにおいて出現頻度が所定の出現頻度以上である複数のエッジ角度を前記複数の利用角度候補として特定する
     請求項7または8に記載の画像処理装置。
  10.  前記画像処理装置は、さらに、前記傾き角度導出部で導出された前記傾き角度を用いて、前記画像の傾きを補正する傾き補正部を備える
     請求項1~9のいずれか1項に記載の画像処理装置。
  11.  前記傾き角度導出部は、前記1以上の利用角度の平均値、または、前記1以上の利用角度のいずれかを前記傾き角度として導出する
     請求項1~10のいずれか1項に記載の画像処理装置。
  12.  画像の傾き角度を導出する画像処理方法であって、
     前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出し、
     前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定し、
     前記1以上の利用角度から前記傾き角度を導出する
     画像処理方法。
  13.  請求項12に記載の画像処理方法をコンピュータに実行させるためのプログラム。
  14.  画像の傾き角度を導出する集積回路であって、
     前記画像における複数の画素のそれぞれにおいて、エッジの角度であるエッジ角度を算出することにより、前記複数の画素に対応する複数のエッジ角度を算出するエッジ角度算出部と、
     前記複数の画素に対応する複数の値であり、それぞれが画素の奥行きを示す値である複数のデプス値と、前記複数のエッジ角度とを用いて、それぞれがエッジ角度であり、それぞれが前記傾き角度の候補である1以上の利用角度を特定する利用角度特定部と、
     前記1以上の利用角度から前記傾き角度を導出する傾き角度導出部とを備える
     集積回路。
PCT/JP2012/007932 2011-12-21 2012-12-12 画像処理装置および画像処理方法 WO2013094154A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2013550102A JP6021078B2 (ja) 2011-12-21 2012-12-12 画像処理装置および画像処理方法
CN201280017586.1A CN103460249B (zh) 2011-12-21 2012-12-12 图像处理装置以及图像处理方法
US14/009,958 US9183633B2 (en) 2011-12-21 2012-12-12 Image processing apparatus and image processing method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011280172 2011-12-21
JP2011-280172 2011-12-21

Publications (1)

Publication Number Publication Date
WO2013094154A1 true WO2013094154A1 (ja) 2013-06-27

Family

ID=48668073

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/007932 WO2013094154A1 (ja) 2011-12-21 2012-12-12 画像処理装置および画像処理方法

Country Status (4)

Country Link
US (1) US9183633B2 (ja)
JP (1) JP6021078B2 (ja)
CN (1) CN103460249B (ja)
WO (1) WO2013094154A1 (ja)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104732225B (zh) * 2013-12-24 2018-12-18 中国科学院深圳先进技术研究院 图像旋转处理方法
US9918008B2 (en) * 2015-02-06 2018-03-13 Wipro Limited Method and device for assisting a user to capture images
JP6127282B2 (ja) * 2015-02-25 2017-05-17 パナソニックIpマネジメント株式会社 画像処理装置、画像処理方法及びそれを実行させるためのプログラム
CN106153004A (zh) * 2015-04-08 2016-11-23 广东中星电子有限公司 一种建筑物倾斜检测方法和装置
JP6272387B2 (ja) * 2015-05-29 2018-01-31 キヤノン株式会社 撮像素子および撮像装置
US10841491B2 (en) 2016-03-16 2020-11-17 Analog Devices, Inc. Reducing power consumption for time-of-flight depth imaging
WO2017215764A1 (en) * 2016-06-17 2017-12-21 Huawei Technologies Co., Ltd. Devices and methods for 3d video coding
JP6810892B2 (ja) * 2017-06-05 2021-01-13 京セラドキュメントソリューションズ株式会社 画像処理装置
WO2019075473A1 (en) * 2017-10-15 2019-04-18 Analog Devices, Inc. METHODS AND SYSTEMS FOR PROCESSING FLIGHT TIME DEPTH IMAGE
CN109948521B (zh) * 2019-03-18 2021-05-11 北京华宇信息技术有限公司 图像纠偏方法和装置、设备及存储介质
US11623344B2 (en) * 2019-10-11 2023-04-11 Agr International, Inc. System and method for autonomously defining regions of interest for a container
CN113568595A (zh) * 2021-07-14 2021-10-29 上海炬佑智能科技有限公司 基于ToF相机的显示器组件的控制方法、装置、设备和介质

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011155161A1 (ja) * 2010-06-11 2011-12-15 パナソニック株式会社 画像処理装置および画像処理方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5054098A (en) * 1990-05-21 1991-10-01 Eastman Kodak Company Method of detecting the skew angle of a printed business form
JP3471578B2 (ja) * 1997-08-29 2003-12-02 シャープ株式会社 行方向判定装置、画像傾き検出装置及び画像傾き補正装置
EP1413982A1 (en) * 2001-05-25 2004-04-28 Matsushita Electric Industrial Co., Ltd. Wide-angle image generating device
US8139897B2 (en) * 2007-03-15 2012-03-20 Ricoh Company, Limited Detecting tilt in an image having different resolutions in different directions
JP5058686B2 (ja) * 2007-06-14 2012-10-24 キヤノン株式会社 情報処理方法及び情報処理装置
ATE501594T1 (de) 2007-06-27 2011-03-15 Panasonic Corp Bildgebungsgerät, verfahren, systemintegrierte schaltung und programm
CN101689294B (zh) * 2007-07-12 2012-07-04 松下电器产业株式会社 图像处理装置、图像处理方法及图像处理用处理器
JP4942205B2 (ja) * 2008-01-07 2012-05-30 キヤノン株式会社 画像形成装置、画像形成装置の制御方法およびプログラム
US8340432B2 (en) * 2009-05-01 2012-12-25 Microsoft Corporation Systems and methods for detecting a tilt angle from a depth image

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011155161A1 (ja) * 2010-06-11 2011-12-15 パナソニック株式会社 画像処理装置および画像処理方法

Also Published As

Publication number Publication date
US20140023292A1 (en) 2014-01-23
US9183633B2 (en) 2015-11-10
CN103460249A (zh) 2013-12-18
CN103460249B (zh) 2016-08-17
JPWO2013094154A1 (ja) 2015-04-27
JP6021078B2 (ja) 2016-11-02

Similar Documents

Publication Publication Date Title
JP6021078B2 (ja) 画像処理装置および画像処理方法
US9088715B2 (en) Image processing apparatus and image processing method for image correction
JP5576812B2 (ja) 画像処理装置、画像処理方法、画像処理プログラム、及び、撮像装置
US20200120323A1 (en) Data processing apparatus, imaging apparatus and data processing method
US9799118B2 (en) Image processing apparatus, imaging apparatus and distance correction method
JP4816725B2 (ja) 倍率色収差を画像解析する画像処理装置、画像処理プログラム、電子カメラ、および画像処理方法
WO2012096163A1 (ja) 画像処理装置、画像処理方法、及びそのプログラム
JP5075757B2 (ja) 画像処理装置、画像処理プログラム、画像処理方法、および電子機器
JP6642970B2 (ja) 注目領域検出装置、注目領域検出方法及びプログラム
JP6128987B2 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
US9224212B2 (en) Image processing apparatus and image processing method
JP6619565B2 (ja) 画像処理装置、画像処理方法およびプログラム
US20170142384A1 (en) Image processing apparatus, image processing method, image projection system, and storage medium
KR20150101952A (ko) 화상처리장치 및 그 제어 방법
US10430660B2 (en) Image processing apparatus, control method thereof, and storage medium
JP5914843B2 (ja) 画像処理装置及び画像処理方法
JP5841345B2 (ja) 画像処理装置、画像処理方法、画像処理プログラム、及び、撮像装置
JP6140478B2 (ja) 物体検出装置、プログラムおよび集積回路
JP2011259342A (ja) 画像処理装置および画像処理方法
JP6378496B2 (ja) 画像処理装置、制御方法及び記録媒体
US20170178337A1 (en) Edge detection apparatus and edge detection method
EP3979199A1 (en) Image processing method, image processing apparatus, and program
US11935275B2 (en) Image processing method, image processing device, and recording medium
JP2010079815A (ja) 画像補正装置
JP2009129221A (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: 12859982

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2013550102

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 14009958

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12859982

Country of ref document: EP

Kind code of ref document: A1