WO2020100215A1 - 撮像装置、画像補正方法および画像補正プログラム - Google Patents

撮像装置、画像補正方法および画像補正プログラム Download PDF

Info

Publication number
WO2020100215A1
WO2020100215A1 PCT/JP2018/041988 JP2018041988W WO2020100215A1 WO 2020100215 A1 WO2020100215 A1 WO 2020100215A1 JP 2018041988 W JP2018041988 W JP 2018041988W WO 2020100215 A1 WO2020100215 A1 WO 2020100215A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
correction amount
local
standard
optical path
Prior art date
Application number
PCT/JP2018/041988
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 PCT/JP2018/041988 priority Critical patent/WO2020100215A1/ja
Publication of WO2020100215A1 publication Critical patent/WO2020100215A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • G01B11/245Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures using a plurality of fixed, simultaneously operating transducers
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/02Details
    • G01C3/06Use of electric means to obtain final indication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/223Analysis of motion using block-matching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/122Improving the 3D impression of stereoscopic images by modifying image signal contents, e.g. by filtering or adding monoscopic depth cues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • H04N13/207Image signal generators using stereoscopic image cameras using a single 2D image sensor
    • H04N13/211Image signal generators using stereoscopic image cameras using a single 2D image sensor using temporal multiplexing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/296Synchronisation thereof; Control thereof

Definitions

  • the present invention relates to an imaging device, an image correction method, and an image correction program.
  • an imaging device having two different optical paths and having a stereo measurement function for measuring the three-dimensional coordinates of a subject and the size of the subject based on the principle of stereo measurement has been used.
  • some image pickup apparatuses having a stereo measurement function have a function of generating a 3D stereoscopic observation image (stereo image) from two images generated from light that has passed through two different optical paths.
  • Imaging devices with stereo measurement functions are widely used in industrial endoscopes that perform non-destructive visual inspections for internal scratches and corrosion such as in engines, turbines, and chemical plants.
  • the industrial endoscope can measure the size of scratches and corrosion of the imaged subject by the stereo measurement function of the imaging device. Further, the industrial endoscope can generate and display a 3D stereoscopic observation image by the stereo measurement function of the imaging device. The user can clearly understand the surface condition and unevenness of the subject from the 3D stereoscopic image.
  • the measurement endoscope apparatus described in Patent Document 1 includes two optical systems having parallax.
  • the measurement endoscope apparatus simultaneously captures the optical image obtained by each optical system.
  • the measurement endoscope apparatus uses the two generated images to calculate the three-dimensional coordinates of the subject and the size of the subject based on the principle of stereo measurement.
  • the stereo measurement device described in Patent Document 2 forms two images of a subject formed by light that has passed through two different optical paths (referred to as a first optical path and a second optical path) on a common area of an image sensor. It has an optical system.
  • the stereo measurement device also includes an optical path switching unit that switches the optical path so as to capture a subject image formed by only light that has passed through one of the two optical paths.
  • an image (referred to as a first image) is generated by capturing an image based on the first subject image formed by the light passing through the first optical path. Subsequently, the optical path is switched, and an image (referred to as a second image) is generated by imaging based on the second subject image formed by the light that has passed through the second optical path. Based on the parallax of the first image and the second image, the shape of the subject is measured using the principle of stereo measurement (hereinafter, this measurement method is referred to as "time division stereo method").
  • the first image and the second image are images captured at different times, and thus a motion shift occurs between the first image and the second image due to an imaging time difference.
  • a motion shift occurs between the first image and the second image due to an imaging time difference.
  • one of the first image and the second image is corrected to a temporally preceding and following predicted image, and the imaging time difference is corrected. Need to be resolved.
  • the imaging device needs to calculate the correction amount with high accuracy in order to perform stereo measurement with high accuracy. Therefore, the calculation of the correction amount requires a lot of time because the calculation amount required for the calculation is large.
  • the imaging device when the imaging device simultaneously generates a 3D stereoscopic observation image, the imaging device is required to provide the 3D stereoscopic observation image to the user without significant delay.
  • the imaging apparatus calculates the correction amount with high accuracy in order to perform the stereo measurement with high accuracy, it takes time to calculate the correction amount, and the generation of the 3D stereoscopic observation image is delayed.
  • the present invention provides an imaging device, an image correction method, and an image correction program that can perform stereo measurement with high accuracy and can generate a 3D stereoscopic observation image without significant delay. To aim.
  • An image pickup apparatus switches a first optical path and a second optical path having a parallax with the first optical path in time series, and detects an object formed by light passing through the first optical path.
  • An image pickup apparatus for picking up a first image based on an image and a second image based on an image of a subject formed by light passing through the second optical path, the reference being selected from a plurality of the first images.
  • an image correction amount calculation unit that calculates a correction amount to be corrected, and the correction amount calculated by the image correction amount calculation unit is the total correction amount in the entire area of the first image and the first image. And a local correction amount in the local area.
  • An image correction method provides a subject formed by light passing through the first optical path by switching a first optical path and a second optical path having a parallax with the first optical path in time series.
  • a reference first selected from a plurality of the first images.
  • the reference first image or the reference first image based on the pixel movement amount in the entire region of the image and the reference first image having a different capture time from the reference first image, and the reference first image or the reference first image at the capture time of the second image.
  • stereo measurement can be performed with high accuracy, and a 3D stereoscopic observation image can be generated without significant delay.
  • FIG. 6 is an explanatory diagram of a reference frame in setting a motion vector calculation area of the imaging device. It is an explanatory view of a reference frame in a motion vector calculation area setting of the imaging device. It is explanatory drawing regarding the motion vector calculation of the same imaging device.
  • FIG. 6 is a schematic diagram of a motion vector detected by the image correction amount calculation unit of the imaging device in the entire area of the first image. It is explanatory drawing of the measurement point which performs a stereo measurement by the same imaging device. It is a schematic diagram of the motion vector detected around the same measurement point. It is a block diagram of the control part of the same imaging device. It is an example of a display image which the imaging device generates. It is an example of a display image which the imaging device generates. It is a display screen when a user sets the coordinate (measurement coordinate) of a measurement point.
  • FIG. 1 is a configuration diagram of an imaging device 100 according to the first embodiment of the present invention.
  • the imaging device 100 is an endoscope device.
  • the image pickup apparatus 100 includes an insertion section 1, a control unit 5, an operation section 6, and a display section 7.
  • the insertion unit 1 is inserted inside the object to be measured.
  • the insertion portion 1 has a tip portion 2 and an elongated insertion portion main body 3 extending along the longitudinal axis direction of the insertion portion 1.
  • the tip part 2 is arranged at the tip of the insertion part body 3.
  • the tip portion 2 has a first optical system 21, a second optical system 22, an optical path setting unit 23, an image forming optical system 24, an image pickup element (image pickup unit) 25, and an illumination unit 26.
  • the first optical system 21 and the second optical system 22 have an objective lens that is a combination of a concave lens and a convex lens.
  • the second optical system 22 is arranged so as to have a parallax with respect to the first optical system 21. That is, the first optical system 21 and the second optical system 22 are separated in the parallax direction.
  • the parallax direction is a direction of a straight line passing through the optical center (principal point) of the first optical system 21 and the optical center (principal point) of the second optical system 22.
  • the light incident on the first optical system 21 passes through the first optical path L1.
  • the light incident on the second optical system 22 passes through a second optical path L2 different from the first optical path L1.
  • the first optical system 21 forms a first image of the subject
  • the second optical system 22 forms a second image of the subject.
  • the optical path setting unit 23 is provided between the first optical path L1 and the second optical path L2 so that only one of the first image and the second image is imaged in the imaging area of the imaging device 25. Switch the optical path. That is, the optical path setting unit 23 selects one of the first optical path L1 and the second optical path L2 so that only one of the first image and the second image is imaged in the imaging area of the imaging element 25. Either one is set as the optical path at the time of image pickup.
  • the optical path setting unit 23 is configured to transmit only the light passing through one of the first optical path L1 and the second optical path L2 and block the light passing through the other.
  • the optical path setting unit 23 includes a light blocking plate that is inserted into only one of the first optical path L1 and the second optical path L2.
  • the optical path setting unit 23 transmits the light of the first optical path L1
  • the light blocking plate is inserted in the second optical path L2 and the light of the second optical path L2 is blocked.
  • the optical path setting unit 23 transmits the light of the second optical path L2
  • the light blocking plate is inserted in the first optical path L1 and the light of the first optical path L1 is blocked.
  • the imaging optical system 24 forms a subject image based on either the light passing through the first optical path L1 or the light passing through the second optical path L2 in the imaging area of the imaging element 25.
  • the image sensor 25 has a common first image of the subject formed by the light passing through the first optical path L1 and a second image of the subject formed by the light passing through the second optical path L2 different from the first optical path L1. It has an imaging region to be imaged.
  • the image pickup device 25 photoelectrically converts the formed subject image to generate an image pickup signal.
  • the image sensor 25 is, for example, an RGB primary color system single-plate CCD (Charge Coupled Device) image sensor.
  • the image sensor 25 may be composed of a CMOS (Complementary Metal Oxide Semiconductor).
  • the image sensor 25 captures the first image via the first optical system 21 at the first image capturing timing.
  • the image pickup device 25 generates an image pickup signal of “first image” based on the first image formed in the image pickup area.
  • the image pickup device 25 outputs the image pickup signal of the first image to the control unit 5.
  • the image sensor 25 captures the second image via the second optical system 22 at a second image capturing timing different from the first image capturing timing.
  • the image pickup device 25 generates an image pickup signal of a “second image” based on the second image formed in the image pickup area.
  • the image pickup device 25 outputs the image pickup signal of the second image to the control unit 5.
  • the illumination unit 26 has a light source that generates illumination light with which a subject is illuminated.
  • the light source is an LED (Light Emitting Diode).
  • the illumination unit 26 may be arranged in the control unit 5, and the illumination light generated by the illumination unit 26 may be guided to the tip 2 by the light guide.
  • Control unit 5 The control unit (control device) 5 is connected to the insertion portion 1. As shown in FIG. 1, the control unit 5 includes an imaging processing unit 50, an image correction amount calculation unit 51, an image generation unit 52, a measurement unit 53, a memory 54, and a control unit 55.
  • Imaging processing unit 50 controls the optical path switching operation by the optical path setting unit 23 and the operation of the imaging device 25 based on the instruction of the control unit 55.
  • the image pickup processing unit 50 processes an image pickup signal input from the image pickup element 25 to generate an image signal. Specifically, the image pickup processing unit 50 converts the image pickup signal of the first image and the image pickup signal of the second image, which are input from the image pickup device 25, into digital signals, and performs white balance processing, image format conversion, interpolation processing, and the like. To generate the image signal.
  • FIG. 2 is an explanatory diagram showing the image signals generated by the imaging processing unit 50 in time series.
  • the imaging processing unit 50 controls the optical path setting unit 23 at time t1 to transmit only the light passing through the first optical path L1.
  • the image pickup device 25 picks up a first image via the first optical system 21, and outputs an image pickup signal of the first image based on the first image formed in the image pickup region to the image pickup processing unit 50.
  • the image pickup processing unit 50 converts the image pickup signal of the first image into the image signal G11 of the first image.
  • the imaging processing unit 50 controls the optical path setting unit 23 at time t2 so that only the light passing through the second optical path L2 is transmitted.
  • the image pickup device 25 picks up a second image via the second optical system 22, and outputs an image pickup signal of the second image based on the second image formed in the image pickup region to the image pickup processing unit 50.
  • the image pickup processing unit 50 converts the image pickup signal of the second image into the image signal G22 of the second image.
  • the imaging processing unit 50 controls the optical path setting unit 23 to allow only the light passing through the first optical path L1 to pass again.
  • the image pickup device 25 picks up a first image via the first optical system 21, and outputs an image pickup signal of the first image based on the first image formed in the image pickup region to the image pickup processing unit 50.
  • the imaging processing unit 50 converts the imaging signal of the first image into the image signal G13 of the first image.
  • the imaging device 100 is a time-division stereo imaging device that acquires the first image and the second image in a time-division manner. Therefore, the first image G11, the second image G22, and the first image G13 generated by the image capturing processing unit 50 are image signals captured at different times.
  • first image G11 and the first image G13 and the second image G22 are used.
  • first image (G11 or G13) and the second image (G22) are images captured at different times, a motion shift occurs between the first image and the second image due to the difference in image capturing time.
  • the motion shift caused by the image pickup time difference between the first image and the second image becomes remarkable. If a motion shift occurs due to a difference in imaging time, stereo measurement may not be performed correctly.
  • the control unit 5 corrects either one of the first images (G11 or G13) into a predicted image G′12 that is temporally preceding or succeeding.
  • the predicted image G′12 is, as shown in FIG. 2, a predicted image of the first image at the image capturing time t2 when the second image G22 was captured. If the predicted image G′12 and the second image G22 are used for the stereo measurement, it is possible to suppress the motion shift caused by the imaging time difference in the stereo measurement.
  • the predicted image G′12 is generated by the image correction amount calculation unit 51 and the image generation unit 52.
  • the imaging processing unit 50 outputs the second image G22, the first image G11, and the first image G13 to the memory 54.
  • the image correction amount calculation unit 51 calculates a pixel movement amount from two first images (one is referred to as a “reference frame” and the other is referred to as a “reference frame”) selected from a plurality of first images having the same image size. Then, a correction amount for correcting one of the first images (G11 or G13) into the predicted image G′12 of the first image at the image capturing time t2 of the second image (G22) based on the pixel movement amount. calculate.
  • the pixel movement amount is a movement amount (blurring amount) of pixels in two images having different imaging times. In the two images with different imaging times, the position of the pixel moves due to the movement of the subject or the imaging device. The moving amount of the pixel is called the pixel moving amount.
  • the image correction amount calculation unit 51 calculates the pixel movement amount using the motion vector.
  • the image correction amount calculation unit 51 reads two first images (G11 and G13) having different image capturing times from the memory 54.
  • the image correction amount calculation unit 51 uses the first image G11 as a reference frame (reference first image) and the first image G13 as a reference frame (reference first image) to calculate a motion vector from the first image G11 to the first image G13. calculate.
  • FIG. 3 shows a first image G11 that is a reference frame (reference first image) and a first image G13 that is a reference frame (reference first image).
  • the subject O has moved to the upper right in the first image G13 as compared with the first image G11.
  • the pixel displaying the subject O has moved to the upper right.
  • the image correction amount calculation unit 51 calculates the pixel movement amount by calculating the motion vector from the first image G11 to the first image G13.
  • FIG. 4 and 5 are explanatory diagrams related to the motion vector calculation area setting.
  • FIG. 4 shows a standard frame
  • FIG. 5 shows a reference frame.
  • the image correction amount calculation unit 51 detects an area (matching block M) similar to the specific area (standard block B) in the standard frame from the specific area (search block S) in the reference frame, and determines the standard block B.
  • a motion vector is calculated based on the positional relationship between the matching block M and the matching block M.
  • the reference block B and the matching block M have the same area size.
  • the reference block (divided region) B is a reference frame, for example, a region of 5 pixels in the horizontal direction and 5 pixels in the vertical direction (hereinafter, referred to as “5 ⁇ 5”), and is divided into regions having a predetermined size at predetermined intervals. The area divided by.
  • the reference points of the reference block B (for example, the center point, the pixel at the upper left end, the center of gravity, etc.) are arranged at predetermined pixel intervals in the horizontal and vertical directions.
  • the search block S is a region larger than the reference block B, for example, a “9 ⁇ 9” region, and is used as a search region for the matching block M.
  • XY coordinates will be used to describe the pixel position of the image.
  • the horizontal direction is the X-axis direction
  • the vertical direction is the Y-axis direction
  • the upper left is the origin.
  • the image correction amount calculation unit 51 sets a search block S to be searched for each reference block B.
  • the search block S is set such that the reference point coordinates of the reference block B are included in the coordinate range of the search block S. For example, as shown in FIGS. 4 and 5, when the central coordinates of the reference block B1 are (x1, y1), the search block S1 is set such that (x1, y1) is the central image.
  • the image correction amount calculation unit 51 calculates a motion vector from the reference block B and the image data of the search block S paired with the reference block B.
  • a process of calculating a motion vector from the reference block B1 which is one of the reference blocks B and the image data of the search block S1 paired with the reference block B1 will be described.
  • FIG. 6 is an explanatory diagram related to motion vector calculation.
  • the image correction amount calculation unit 51 sets the search block S1 as a reference block (R1-R25) having the same area size as the standard block B1, and sets the reference block B1 and the reference block (R1-R25). The degree of similarity with R25) is calculated.
  • the reference blocks (R1 to R25) are a plurality of regions that differ by one pixel in the X direction or the Y direction in the region of the search block S1.
  • the degree of similarity for example, SAD (Sum of Absolute Differences: sum of absolute difference), SSD (Sum of Squared Differences: sum of squared difference), NCC (Normalized Cross Correlation), and ZNCC (Zero CC) ZeroCrossCorrelationCorrelation.
  • SAD Sud of Absolute Differences: sum of absolute difference
  • SSD Sud of Squared Differences: sum of squared difference
  • NCC Normalized Cross Correlation
  • ZNCC ZeroCrossCorrelationCorrelation.
  • the value is available. Since the motion vector normally obtained by the block matching method has integer precision, the motion vector may be calculated with subpixel precision using a known subpixel estimation process such as linear interpolation or parabola fitting.
  • the image correction amount calculation unit 51 sequentially calculates the similarity between the reference blocks adjacent vertically and horizontally from the reference block R13 having the center coordinates (x1, y1) of the standard block B1 as the starting point. Good. Further, the image correction amount calculation unit 51 may calculate the similarity of a plurality of reference blocks set in the search block S1 in parallel.
  • the image correction amount calculation unit 51 sets the reference block with the highest similarity as the matching block M1.
  • the image correction amount calculation unit 51 calculates the difference between the coordinates of the predetermined reference points (for example, the center point, the pixel at the upper left end, the center of gravity, etc.) of the selected matching block M1 as the coordinates of the reference points of the reference block B1 as “movement”. Defined as “vector”.
  • the motion vector detection result is "undetected".
  • the image correction amount calculation unit 51 calculates the correction amount after calculating the motion vector of the reference block B.
  • the correction amount calculated by the image correction amount calculation unit 51 is of two types: the total correction amount in the entire region of the first image and the local correction amount in the local region of the first image.
  • the overall correction amount is a rough correction amount in the entire area of the first image.
  • the local correction amount is a highly accurate correction amount only in the local area of the first image.
  • FIG. 7 is a schematic diagram of motion vectors detected in 4 ⁇ 4 (16 in total) reference blocks B in the entire area of the first image.
  • the motion vector is a two-dimensional vector composed of X and Y direction components.
  • the image correction amount calculation unit 51 calculates the pixel movement amount Vimg in the entire region of the first image by using the plurality of motion vectors calculated in the 16 reference blocks B as shown in FIG. 7, for example.
  • the total correction amount Vcorr can be calculated by Equation 2 (the total correction amount). Amount calculation step).
  • the total correction amount Vcorr shown in Expression 2 is a correction amount for correcting the first image G13 at the image capturing time t3 into the predicted image G′12 of the first image at the image capturing time t2 (see FIG. 2).
  • the overall correction amount may be a correction amount for correcting the first image G11 at the image capturing time t1 to the predicted image G′12 of the first image at the image capturing time t2.
  • the total correction amount is a rough correction amount in the entire area of the first image
  • a plurality of widely distributed correction areas such as 16 reference blocks B evenly distributed over the entire screen as shown in FIG. It is desirable that the reference block B of 1 is selected and used to calculate the overall correction amount Vcorr. Since the total correction amount is a rough correction amount in the entire area of the first image, the reference block B used to calculate the total correction amount Vcorr is, for example, 16 reference blocks B as shown in FIG. , It is desirable to select the reference block B that is set by roughly dividing the first image.
  • FIG. 8 shows four measurement points p1 to p4 for performing stereo measurement in this embodiment. In the following description, the calculation of the local correction amount for the measurement point p1 will be described.
  • FIG. 9 is a schematic diagram of motion vectors calculated around the measurement point p1.
  • FIG. 9 shows the detection results (V 0 to V 8 from the upper left) of motion vectors detected in the 3 ⁇ 3 (9 in total) reference blocks B set in the local region Lp1 around the measurement point p1. ..
  • the motion vector is V 4 .
  • the motion vector of the reference block B including the subject O (for example, V 4 ) is calculated to be relatively larger than the motion vector of the reference block B including no subject O (for example, V 2 ). This is because the closer the subject distance is, the larger the pixel movement amount on the image is, and the more easily the image is captured.
  • the pixel movement amount Vp1 of the image of the local area Lp1 around the measurement point p1 is calculated.
  • the pixel movement amount Vp1 of the local region Lp1 is expressed by Expression 3.
  • ai in Expression 3 is a variable that takes a value of 1 or 0 as shown in Expression 4, and is defined as the motion vector Vc (V 4 in the example shown in FIG. 9) and the motion vector Vi at the measurement point p1. It becomes 1 when the magnitude of the difference vector is equal to or smaller than the predetermined threshold value thr. That is, a motion vector having a size exceeding a predetermined threshold is excluded from the motion vector Vc of the reference block B including the measurement point p1 and an average vector of a plurality of motion vectors is calculated, so that the local area around the measurement point p1 is calculated.
  • the pixel movement amount Vp1 of the region Lp1 can be robustly calculated.
  • the local correction amount Vp1_corr shown in Expression 5 corrects the local region image L13 of the local region Lp1 of the first image G13 at the image capturing time t3 to the local predicted image L′ 12 of the local region Lp1 of the first image at the image capturing time t2.
  • the correction amount (see FIG. 2).
  • the local correction amount is a correction amount for correcting the local region image L11 of the local region Lp1 of the first image G11 at the image capturing time t1 to the local predicted image L′ 12 of the local region Lp1 of the first image at the image capturing time t2. It may be.
  • the image correction amount calculation unit 51 calculates the local correction amount Vp1_corr at the measurement point p1 and then calculates the local correction amount at the measurement points p2 to p4 by an equivalent method.
  • the image correction amount calculation unit 51 outputs the calculated total correction amount and local correction amount to the memory 54.
  • the memory 54 records the total correction amount and the local correction amount.
  • the image generator 52 performs two types of image generation. One is the predicted image G′12 in the entire area of the first image at the imaging time t2. The other is a predicted image in the local region of the first image at the imaging time t2 (around the measurement points p1 to p4).
  • the image generation unit 52 sets the first image G13 in the entire area of the first image at the imaging time t3 to the predicted image G′12 in the entire area of the first image at the imaging time t2 based on the overall correction amount Vcorr in the entire area.
  • the pixel value of the coordinate (x ', y') of the predicted image G'12 is the expression 6 for converting the coordinate (x, y) of the first image G13 captured at the time t3 into the coordinate (x ', y'). It is generated based on.
  • Formula 6 indicates that the pixels of the first image G13 are shifted in the XY directions based on the overall correction amount Vcorr.
  • the image generation unit 52 may obtain the pixel value at the coordinates (x ′, y ′) by a known pixel interpolation unit such as Bilineear interpolation or Bicubic interpolation. good.
  • the image generation unit 52 determines, based on the total correction amount.
  • the first image G11 is corrected to the predicted image G'12.
  • the image generation unit 52 generates a 3D stereoscopic observation image using the predicted image G′12 of the first image at the capturing time t2 and the second image G22 at the capturing time t2 (3D stereoscopic observation image generating step).
  • the display unit 7 When the display unit 7 is a two-dimensional display and the subject is displayed as 3D point cloud data, the three-dimensional coordinates of each coordinate are calculated from the stereo image pair (the first image G'12 and the second image G22 at the same image capturing time).
  • the calculated data group becomes a 3D stereoscopic observation image.
  • the depth Z value of the coordinate is calculated by a general stereo measurement method as shown in Expression 7.
  • B represents the base line length, f the focal length, and S the parallax between the left and right images.
  • the image generation unit 52 generates a 3D stereoscopic observation image for autostereoscopic viewing.
  • the image generation unit 52 sets the local predicted image L of the local region image L13 in the local region Lp1 of the first image G13 at the image capturing time t3 based on the corresponding local correction amount Vp1_corr to the local region Lp1 of the first image at the image capturing time t2. Correction to '12 (local predicted image generation step).
  • the pixel value of the coordinate (x ', y') of the local prediction image L'12 is the coordinate (x ', y') of the coordinate (x, y) of the local area image L13 of the first image G13 captured at time t3. ) Is generated based on Equation 8.
  • the local correction amount is a correction amount for correcting the local region image L11 in the local region Lp1 of the first image G11 at the image capturing time t1 to the local predicted image L′ 12 in the local region Lp1 of the first image at the image capturing time t2.
  • the image generation unit 52 corrects the local area image L11 into a local predicted image L'12 based on the local correction amount.
  • the image generation unit 52 generates the local prediction image L′ 12 in the local region Lp1 around the measurement point p1 and then calculates the local prediction image in the local region around the measurement points p2 to p4 by an equivalent method.
  • the image generation unit 52 outputs the generated image to the memory 54.
  • the memory 54 records the input image.
  • the measurement unit 53 uses the local prediction image L'12 in the local region Lp1 of the first image at the imaging time t2 and the local region image L22 in the local region Lp1 of the second image G22 at the imaging time t2 to calculate the parallax amount. Then, the subject distance z1 at the measurement point p1 is measured (measurement parallax amount calculation step). The subject distance z1 is measured using a known stereo measurement technique. The measurement unit 53 can measure the subject distance with high accuracy by using the first image and the second image at the same imaging time for stereo measurement.
  • the measuring unit 53 measures the subject distance z1 at the measurement point p1 and then measures the subject distances z2 to z4 at the measurement points p2 to p4 by an equivalent method.
  • the measuring unit 53 may calculate the distance between two measurement points after measuring the subject distances z1 to Z4.
  • the measuring unit 53 outputs the measured subject distance and the distance between two points to the memory 54.
  • the memory 54 records the input subject distance and the distance between two points.
  • the control unit 55 includes the imaging processing unit 50, the image correction amount calculation unit 51, the image generation unit 52, the measurement unit 53, the memory 54, the distal end portion 2, the operation unit 6, and the display unit 7. Control. The control unit 55 sets operation parameters for these, based on the input from the operation unit 6.
  • FIG. 10 is a configuration diagram of the control unit 55.
  • the control unit 55 is a program-executable processing device (computer) having a processor 550, a program readable memory 551, a storage unit 552, and an input / output control unit 553. ..
  • the function of the control unit 55 is realized by the processor 550 executing the program provided to the control unit 55.
  • the processor 550 is a CPU, a DSP (Digital Signal Processor), a GPU (Graphics Processing Unit), or a combination thereof.
  • the input / output control unit 553 performs internal communication in the control unit 5 and communication for operation control with the tip 2, the operation unit 6 and the display unit 7.
  • the storage unit 552 is a non-volatile recording medium that stores the above-mentioned program and necessary data.
  • the storage unit 552 is composed of, for example, a ROM or a flash memory.
  • the program recorded in the storage unit 552 is read into the memory 551 and executed by the processor 550.
  • the above-mentioned program may be provided by a "computer-readable recording medium” such as a flash memory. Further, the above-described program may be transmitted to the imaging device 100 from a computer having a storage device or the like in which the program is stored, via a transmission medium or by a transmission wave in the transmission medium.
  • the "transmission medium” for transmitting the program is a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
  • the above-described program may be a difference file (difference program) that can realize the function of the control unit 55 in combination with the program already recorded in the control unit 55.
  • the image pickup processing unit 50, the image correction amount calculation unit 51, the image generation unit 52, and the measurement unit 53 have a program-executable processing device (computer) having a processor or the like or a dedicated electronic device. It may be configured by a circuit (logic circuit or the like) or a combination thereof. Further, the image pickup processing unit 50, the image correction amount calculation unit 51, the image generation unit 52, the measurement unit 53, and the control unit 55 may be configured by separate processing devices or electronic circuits, respectively. At least a part of them may be configured by a common processing device or electronic circuit.
  • the control unit 55 transfers the 3D observation stereoscopic observation image recorded in the memory 54 to the display unit 7 as a display image at a predetermined transfer timing.
  • the control unit 55 may generate a display image by superimposing a graphics display regarding the subject distances z1 to z4 at the measurement points p1 to p4 on the 3D observation stereoscopic observation image. The user can intuitively understand the subject distance at the measurement points p1 to p4 from the displayed image. As shown in FIG. 12, the control unit 55 may further overlap the distances between the two measurement points p1 to p4 to generate a display image. The user can easily intuitively understand the distance between the two measurement points p1 to p4 from the displayed image.
  • the operation unit 6 is a user interface that receives instructions from the user. A user operates the operation unit 6 to input instructions necessary for controlling various operations of the entire imaging device 100. The operation unit 6 outputs a signal indicating the instruction received from the user to the control unit 55.
  • the operation unit 6 is at least one of a shutter button, a setting button, a setting switch, a key, a mouse, a joystick, a touch pad, a trackball, and a touch panel.
  • the display unit 7 displays the display image output by the control unit 55.
  • the display unit 7 also displays the operation control content.
  • the operation control content is displayed as a menu.
  • the display unit 7 is at least one of a liquid crystal display and an organic EL (Electro Luminescence) display.
  • the display unit 7 may be a touch panel display. In that case, the operation unit 6 and the display unit 7 are integrated.
  • the operation unit 6 and the display unit 7 are not essential in the imaging device 100.
  • the imaging device 100 captures the first image G11 at time t1, as shown in FIG. Next, at time t2, the imaging apparatus 100 controls the optical path setting unit 23 to switch the optical path and capture the second image G22. Next, at time t3, the imaging device 100 controls the optical path setting unit 23 to switch the optical path and capture the first image G13.
  • the image pickup apparatus 100 After the image pickup of the first image G13 is completed, the image pickup apparatus 100 generates the entire predicted image G′12 in the entire region and the local region image in the local region around the measurement points p1 to p4 from the first image G13.
  • the overall prediction image G'12 Since the overall prediction image G'12 has a rough correction amount, the prediction accuracy is low but the amount of calculation is small as compared with the local prediction image. Therefore, the generation of the overall predicted image G'12 is completed before the local predicted image.
  • the local prediction image (for example, L'12) has a highly accurate correction amount in the local region, the prediction accuracy is high but the calculation amount is large compared to the overall prediction image G'12. Therefore, the local predicted image requires more time than the overall predicted image G'12 by calculation.
  • the imaging device 100 When the overall prediction image G′12 and a plurality of local prediction images are generated at the same time, the imaging device 100 generates the overall prediction image first because the overall prediction image G′12 has a smaller amount of calculation. You can The imaging apparatus 100 uses the previously generated overall prediction image G′12 to generate a 3D observation stereoscopic observation image and transfers it to the display unit 7 as a display image. The user can confirm the 3D observation stereoscopic observation image without significant delay.
  • the imaging apparatus 100 generates a plurality of local prediction images and measures the subject distances z1 to Z4 at the measurement points p1 to p4, and then, on the 3D observation stereoscopic observation image, the graphics relating to the subject distances z1 to z4 at the measurement points p1 to p4.
  • Display image is generated by superimposing the image display. The user can confirm the object distances z1 to z4 measured based on the correction amount calculated with high accuracy in the display image as shown in FIG. 11 together with the 3D observation stereoscopic observation image.
  • the imaging device 100 After the calculation of the distance between the two points, the imaging device 100 further superimposes a graphics display regarding the distance between the two points on the 3D observation stereoscopic observation image to generate a display image.
  • the user can confirm the distance between the two points measured based on the correction amount calculated with high accuracy and the 3D observation stereoscopic observation image on the display image as shown in FIG. 12.
  • a 3D stereoscopic observation image can be generated and provided to the user without significant delay, and measurement of the subject distance and the like can be performed with high accuracy.
  • the first embodiment of the present invention has been described in detail with reference to the drawings, but the specific configuration is not limited to this embodiment, and includes design changes and the like within a range not departing from the gist of the present invention. .. Further, the constituent elements shown in the above-described first embodiment and the modifications described below can be appropriately combined and configured.
  • At least a part of the functions of the image capturing apparatus 100 according to the above embodiment may be realized by a computer.
  • the program for realizing this function may be recorded in a computer-readable recording medium, and the program recorded in this recording medium may be read by a computer system and executed.
  • the “computer system” mentioned here includes an OS and hardware such as peripheral devices.
  • the “computer-readable recording medium” refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, a CD-ROM, or a storage device such as a hard disk built in a computer system.
  • the "computer-readable recording medium” means to hold a program dynamically for a short time like a communication line when transmitting the program through a network such as the Internet or a communication line such as a telephone line.
  • a volatile memory inside a computer system that serves as a server or a client in that case may hold a program for a certain period of time.
  • the image pickup signal is output from the image pickup device 25 to the external computer system as Raw data and the ISO sensitivity information and the image signal size as header information.
  • the external computer system realizes the remaining functions of the imaging device 100 by executing the program.
  • the first image shown in FIG. 7 was used without image processing when calculating the pixel movement amount Vimg in the entire area of the first image.
  • the calculation method of the pixel movement amount Vimg is not limited to this. Not limited.
  • the pixel movement amount Vimg may be calculated, for example, from a reduced version of the first image or a sampled sample at equal intervals.
  • the pixel movement amount Vimg of the entire region can be calculated at a higher speed by reducing the calculation amount.
  • the image generation unit 52 uses the formula 6 to calculate the first image G13 in the entire region of the first image at the image capturing time t3 based on the overall correction amount Vcorr in the entire region, and the Although the prediction image G′12 in the entire area of one image is corrected, the method of generating the prediction image G′12 is not limited to this.
  • the image generation unit may obtain a projective transformation matrix from a plurality of motion vectors by a known 8-point algorithm and generate the predicted image G′12 using the projective transformation matrix, as shown in Expression 9.
  • h 11 to h 33 are projective transformation coefficients obtained from the 8-point algorithm.
  • the pixel movement amount is calculated from the detected motion vector, but the method of calculating the pixel movement amount is not limited to this.
  • the pixel movement amount between the reference frame (reference first image) and the reference frame (reference first image) is, for example, that of the tip portion obtained from a motion sensor (posture detection portion) such as a gyro sensor provided in the tip portion 2. It may be calculated from the moving distance.
  • the pixel movement amount in the entire area of the first image is calculated at high speed by a low-resolution motion sensor.
  • the pixel movement amount in the local area of the first image is calculated with high accuracy by using a plurality of high-resolution motion sensors.
  • the measurement point is set at a predetermined position, but the mode of the measurement point is not limited to this.
  • the imaging device may be configured to have an input unit that allows the user to set the position of the measurement point by operating the operation unit.
  • FIG. 13 is a display screen when the user sets the coordinates of the measurement points (measurement coordinates). As shown in FIG. 13, by providing the user with a 3D stereoscopic observation image when setting the measurement coordinates, the user can accurately set the measurement coordinates at the intended position. The user designates a measurement point on the 3D stereoscopic observation image by inputting from the operation unit.
  • the designated measurement point Pin designated by the operator is the coordinate designated in the 3D stereoscopic observation image at the imaging time t2. Therefore, when performing stereo measurement at the measurement point designated by the user, as shown in Expression 10, the total correction amount Vcorr is used to calculate the measurement point p at the imaging time t1 from the designated measurement point Pin.
  • the stereo measurement operation after the calculation of the measurement point p is the same as in the above embodiment.
  • the image pickup apparatus 100B includes an insertion section 1, a control unit 5B, an operation section 6, and a display section 7.
  • the control unit 5B includes an image pickup processing unit 50, an image correction amount calculation unit 51, an image generation unit 52B, a measurement unit 53B, a memory 54, and a control unit 55.
  • the image correction amount calculation unit 51 calculates the total correction amount Vcorr as shown in Expression 11 by the same method as in the first embodiment.
  • the image correction amount calculation unit 51 calculates the local correction amount at the measurement point p from the pixel movement amount Vp of the local region Lp around the measurement point p as shown in Expression 12 by the same method as in the first embodiment. Calculate Vp_corr.
  • the measurement unit 53B measures the provisional parallax amount Sp in the local region between the second image G22 and the reference first image G13 (local region parallax amount calculation step).
  • the provisional parallax amount Sp between the second image G22 and the reference first image G13 is calculated by Expression 13.
  • the coordinates (XR1, YR1) on the second image G22 are coordinates that are stereo-matched with the coordinates (XL2, YL2) on the reference first image G13 as a reference.
  • Stereo matching may use a general method of searching block matching on the epipolar line, but since the search target is the provisional parallax amount before correction to the actual parallax amount, the search range is expanded slightly from the epipolar line. It is desirable to search.
  • the measurement unit 53B calculates the provisional parallax amount Sp in the local region based on the local correction amount Vp_corr in the local region between the second image G22 and the predicted image G′12 of the first image, as shown in Expression 14.
  • the parallax amount Sp_corr is corrected, and at least one of the shape of the subject and the distance to the subject in the local region is measured.
  • the measurement unit 53B measures the provisional parallax amount S in the entire region of the second image G22 and the reference first image G13 (whole region parallax amount calculation step). Furthermore, the measurement unit 53B calculates the provisional parallax amount S in the entire region based on the overall correction amount Vcorr as shown in Expression 15, and the parallax in the entire region between the second image G22 and the predicted image G′12 of the first image. The quantity Scorr is calculated and data for 3D stereoscopic observation is generated.
  • the image generation unit 52B generates a 3D stereoscopic observation image using the data for 3D stereoscopic observation.
  • the imaging device 100B of the present embodiment it is possible to generate a 3D stereoscopic observation image without significant delay and provide it to the user, and it is possible to perform measurement of the object distance matching with high accuracy. Since the stereo measurement can be performed without generating the locally predicted image (for example, L'12), the stereo measurement can be performed at high speed as compared with the first embodiment.
  • the present invention can be applied to a time-division stereo type imaging device.

Abstract

撮像装置は、第1光路と、前記第1光路と視差を有する第2光路とを時系列に切り替えて、前記第1光路を通った光が形成する被写体の像に基づく第1画像と、前記第2光路を通った光が形成する被写体の像に基づく第2画像と、を撮像する撮像装置であって、複数の前記第1画像から選択された、基準第1画像と前記基準第1画像と撮像時刻が異なる参照第1画像とに基づいて、前記基準第1画像または前記参照第1画像を前記第2画像の撮像時刻における前記第1画像の予測画像に補正する補正量を算出する画像補正量算出部と、を備え、前記画像補正量算出部が算出する前記補正量は、前記第1画像の全体領域における全体補正量と、前記第1画像の局所領域における局所補正量と、を含む。

Description

撮像装置、画像補正方法および画像補正プログラム
 本発明は、撮像装置、画像補正方法および画像補正プログラムに関する。
 従来、2つの異なる光路を有し、ステレオ計測の原理に基づいて被写体の3次元座標および被写体の大きさを計測するステレオ計測機能を備える撮像装置が用いられている。また、ステレオ計測機能を備える撮像装置は、2つの異なる光路を通った光から生成された2つの画像から3D立体観察画像(ステレオ画像)を生成する機能を有するものもある。
 ステレオ計測機能を備える撮像装置は、例えば、エンジン、タービン、化学プラントなどの内部の傷や腐食の外観検査を非破壊で行う工業用内視鏡において広く用いられている。工業用内視鏡は、撮像装置のステレオ計測機能により、撮像された被写体の傷や腐食の大きさを計測することができる。また、工業用内視鏡は、撮像装置のステレオ計測機能により、3D立体観察画像を生成して表示することができる。使用者は、3D立体観察画像により、被写体の表面状態や凹凸を一目瞭然に把握することができる。
 例えば、特許文献1に記載された計測内視鏡装置は、視差のある2個の光学系を備える。計測内視鏡装置は、それぞれの光学系により得られる光学像を同時に撮像する。計測内視鏡装置は、生成された2つの画像を用いて、ステレオ計測の原理に基づいて被写体の3次元座標および被写体の大きさを算出する。
 特許文献2に記載されたステレオ計測装置は、2つの異なる光路(第1光路および第2光路とよぶ)を通った光が形成する被写体の2つの像を撮像素子の共通の領域に結像させる光学系を備える。また、ステレオ計測装置は、2つの光路のうちのいずれか一方を通った光のみが形成する被写体像を撮像するように光路を切り替える光路切り替え手段を備える。
 特許文献2のステレオ計測装置を用いて被写体の計測を行う場合、第1光路を通った光が形成する第1被写体像に基づく撮像により画像(第1画像とよぶ)が生成される。続いて、光路が切り替えられ、かつ第2光路を通った光が形成する第2被写体像に基づく撮像により画像(第2画像とよぶ)が生成される。第1画像および第2画像が有する視差に基づき、ステレオ計測の原理を用いて被写体の形状が計測される(以降、この計測方式を「時分割ステレオ方式」とよぶ)。
 時分割ステレオ方式の撮像装置では、第1画像と第2画像とが異なる時刻に撮像された画像であるため、第1画像と第2画像との間に撮像時間差に起因する動きずれが生じる場合がある。特に被写体が速く動いている場合や、手ブレ等によって撮像装置が動いている場合に、第1画像と第2画像との間に撮像時間差に起因する動きずれが顕著となる。撮像時間差に起因する動きずれが生じた場合、ステレオ計測を正しく行えない場合がある。
 時分割ステレオ方式の撮像装置で発生する撮像時間差に起因する動きずれを抑制するため、第1画像と第2画像のいずれか一方の画像を、時間的に前後する予測画像に補正し、撮像時間差を解消する必要がある。
 画像を時間的に前後する予測画像に補正する方法として、動きベクトル等を用いて画像の画素移動量を算出し、画素移動量に基づいて予測画像に補正するための補正量を算出する方法が用いられている。
特開2004-049638号公報 特開2010-128354号公報
 撮像装置は、ステレオ計測を高精度に実施するために、補正量の算出を高精度に行う必要がある。そのため、補正量の算出は、算出に必要な演算量が多いため、時間を要する。一方、撮像装置が3D立体観察画像を同時に生成する場合、撮像装置は3D立体観察画像を使用者に大幅な遅延なく提供することが求められる。しかしながら、撮像装置は、ステレオ計測を高精度に実施するために補正量の算出を高精度に行うと、補正量の算出に時間を要し、3D立体観察画像の生成が遅れ、3D立体観察画像を使用者に大幅な遅延なく提供することができないという課題があった。
 上記事情を踏まえ、本発明は、ステレオ計測を高精度に実施することができ、3D立体観察画像を大幅な遅延なく生成することができる撮像装置、画像補正方法および画像補正プログラムを提供することを目的とする。
 上記課題を解決するために、この発明は以下の手段を提案している。
 本発明の第一の態様に係る撮像装置は、第1光路と、前記第1光路と視差を有する第2光路とを時系列に切り替えて、前記第1光路を通った光が形成する被写体の像に基づく第1画像と、前記第2光路を通った光が形成する被写体の像に基づく第2画像と、を撮像する撮像装置であって、複数の前記第1画像から選択された、基準第1画像と前記基準第1画像と撮像時刻が異なる参照第1画像とに基づいて、前記基準第1画像または前記参照第1画像を前記第2画像の撮像時刻における前記第1画像の予測画像に補正する補正量を算出する画像補正量算出部と、を備え、前記画像補正量算出部が算出する前記補正量は、前記第1画像の全体領域における全体補正量と、前記第1画像の局所領域における局所補正量と、を含む。
 本発明の第二の態様に係る画像補正方法は、第1光路と、前記第1光路と視差を有する第2光路とを時系列に切り替えて、前記第1光路を通った光が形成する被写体の像に基づく第1画像と、前記第2光路を通った光が形成する被写体の像に基づく第2画像と、を撮像する撮像装置において、複数の前記第1画像から選択された基準第1画像と前記基準第1画像と撮像時刻が異なる参照第1画像との全体領域における画素移動量に基づいて、前記基準第1画像または前記参照第1画像を、前記第2画像の撮像時刻における前記第1画像の全体領域における予測画像に補正する全体補正量を算出する全体補正量算出工程と、前記基準第1画像と前記参照第1画像との局所領域における画素移動量に基づいて、前記基準第1画像または前記参照第1画像の局所領域画像を、前記第2画像の撮像時刻における前記第1画像の局所領域における予測画像に補正する局所補正量を算出する局所補正量算出工程と、を備える。
 本発明の撮像装置、画像補正方法および画像補正プログラムによれば、ステレオ計測を高精度に実施することができ、3D立体観察画像を大幅な遅延なく生成することができる。
本発明の第一実施形態に係る撮像装置の構成図である。 同撮像装置の撮像処理部によって生成される画像信号を時系列で表した説明図である。 同撮像装置が撮像する第一画像である、基準フレーム(基準第1画像)および参照フレーム(参照第1画像)を示している。 同撮像装置の動きベクトル算出領域設定における基準フレームの説明図である。 同撮像装置の動きベクトル算出領域設定における参照フレームの説明図である。 同撮像装置の動きベクトル算出に関する説明図である。 同撮像装置の画像補正量算出部が、第1画像の全体領域において検出した動きベクトルの模式図である。 同撮像装置によりステレオ計測を行う計測点の説明図である。 同計測点の周辺において検出した動きベクトルの模式図である。 同撮像装置の制御部の構成図である。 同撮像装置が生成する表示画像例である。 同撮像装置が生成する表示画像例である。 計測点の座標(計測座標)を使用者が設定する際の表示画面である。
(第一実施形態)
 本発明の第一実施形態について、図1から図13を参照して説明する
 図1は、本発明の第一実施形態に係る撮像装置100の構成図である。以下では、撮像装置100が内視鏡装置である例を説明する。
 撮像装置100は、図1に示すように、挿入部1と、コントロールユニット5と、操作部6と、表示部7と、を備える。
[挿入部1]
 挿入部1は、計測対象の物体の内部に挿入される。挿入部1は、先端部2と、挿入部1の長手軸方向に沿って延設される長尺の挿入部本体3と、を有する。
 先端部2は、挿入部本体3の先端に配置されている。先端部2は、第1光学系21と、第2光学系22と、光路設定部23と、結像光学系24と、撮像素子(撮像部)25と、照明部26と、を有する。
 例えば、第1光学系21および第2光学系22は、凹レンズと凸レンズとを組み合わせた対物レンズを有する。第2光学系22は、第1光学系21に対して視差を有するように配置されている。つまり、第1光学系21および第2光学系22は、視差方向に離間している。視差方向は、第1光学系21の光学中心(主点)と第2光学系22の光学中心(主点)とを通る直線の方向である。第1光学系21に入射した光は第1光路L1を通る。第2光学系22に入射した光は第1光路L1と異なる第2光路L2を通る。第1光学系21は被写体の第1の像を形成し、かつ第2光学系22は被写体の第2の像を形成する。
 光路設定部23は、第1の像および第2の像のうちのいずれか一方のみが撮像素子25の撮像領域に結像されるように、第1光路L1と第2光路L2との間で光路を切り替える。つまり、光路設定部23は、第1の像および第2の像のうちのいずれか一方のみが撮像素子25の撮像領域に結像されるように、第1光路L1および第2光路L2のうちいずれか一方を撮像時の光路として設定する。光路設定部23は、第1光路L1および第2光路L2のうちいずれか一方を通る光のみを透過させ、かつ他方を通る光を遮蔽させるように構成されている。
 例えば、光路設定部23は、第1光路L1および第2光路L2のうちいずれか一方のみに挿入される遮光板を含む。光路設定部23が第1光路L1の光を透過させるとき、遮光板が第2光路L2に挿入され、第2光路L2の光は遮蔽される。光路設定部23が第2光路L2の光を透過させるとき、遮光板が第1光路L1に挿入され、第1光路L1の光は遮蔽される。
 結像光学系24は、第1光路L1を通った光と第2光路L2を通った光とのいずれか一方に基づく被写体像を撮像素子25の撮像領域に結像させる。第1光路L1および第2光路L2のうち撮像時の光路として設定された光路のみを通った光に基づく被写体像が撮像素子25の撮像領域に結像される。
 撮像素子25は、第1光路L1を通った光が形成する被写体の第1の像、および第1光路L1と異なる第2光路L2を通った光が形成する被写体の第2の像が共通に結像される撮像領域を有する。撮像素子25は、結像された被写体像を光電変換し、撮像信号を生成する。撮像素子25は、例えば、RGB原色系の単板CCD(Charge  Coupled  Device;電荷結合素子)イメージセンサである。なお、撮像素子25はCMOS(Complementary Metal Oxide Semiconductor)で構成されていてもよい。
 撮像素子25は、第1光学系21を介して第1の像を第1撮像タイミングで撮像する。撮像素子25は、撮像領域に結像された第1の像に基づく「第1画像」の撮像信号を生成する。撮像素子25は、第1画像の撮像信号をコントロールユニット5に出力する。
 撮像素子25は、第2光学系22を介して第2の像を第1撮像タイミングと異なる第2撮像タイミングで撮像する。撮像素子25は、撮像領域に結像された第2の像に基づく「第2画像」の撮像信号を生成する。撮像素子25は、第2画像の撮像信号をコントロールユニット5に出力する。
 照明部26は、被写体に照射される照明光を発生する光源を有する。例えば、光源はLED(Light Emitting Diode)である。照明部26がコントロールユニット5内に配置され、かつ照明部26が発生した照明光がライトガイドによって先端部2に導かれてもよい。
[コントロールユニット5]
 コントロールユニット(制御装置)5は、挿入部1に接続されている。コントロールユニット5は、図1に示すように、撮像処理部50と、画像補正量算出部51と、画像生成部52と、計測部53と、メモリ54と、制御部55と、を有する。
[撮像処理部50]
 撮像処理部50は、制御部55の指示に基づき、光路設定部23による光路の切替動作や撮像素子25の動作を制御する。
 撮像処理部50は、撮像素子25から入力される撮像信号を処理して画像信号を生成する。具体的には、撮像処理部50は、撮像素子25から入力される第1画像の撮像信号および第2画像の撮像信号を、デジタル信号に変換し、ホワイトバランス処理、画像フォーマット変換、補間処理等が行われた画像信号を生成する。
 図2は、撮像処理部50によって生成される画像信号を時系列で表した説明図である。
 撮像処理部50は、時刻t1において、光路設定部23を制御し、第1光路L1を通る光のみを透過させる。撮像素子25は、第1光学系21を介して第1の像を撮像し、撮像領域に結像された第1の像に基づく第1画像の撮像信号を撮像処理部50に出力する。撮像処理部50は、第1画像の撮像信号を第1画像の画像信号G11に変換する。
 次に、撮像処理部50は、時刻t2において、光路設定部23を制御し、第2光路L2を通る光のみを透過させる。撮像素子25は、第2光学系22を介して第2の像を撮像し、撮像領域に結像された第2の像に基づく第2画像の撮像信号を撮像処理部50に出力する。撮像処理部50は、第2画像の撮像信号を第2画像の画像信号G22に変換する。
 次に、撮像処理部50は、時刻t3において、光路設定部23を制御し、再度第1光路L1を通る光のみを透過させる。撮像素子25は、第1光学系21を介して第1の像を撮像し、撮像領域に結像された第1の像に基づく第1画像の撮像信号を撮像処理部50に出力する。撮像処理部50は、第1画像の撮像信号を第1画像の画像信号G13に変換する。
 図2に示すように、撮像装置100は、時分割で第1画像および第2画像を取得する時分割ステレオ方式の撮像装置である。そのため、撮像処理部50が生成した第1画像G11と、第2画像G22と、第1画像G13とは、異なる時刻に撮像された画像信号となる。
 第1画像および第2画像が有する視差に基づき、ステレオ計測が行われる場合、第1画像G11と第1画像G13のいずれか一方と、第2画像G22とが用いられる。しかしながら、第1画像(G11もしくはG13)と第2画像(G22)とは異なる時刻に撮像された画像であるため、第1画像と第2画像との間に撮像時間差に起因する動きずれが生じる場合がある。特に被写体が速く動いている場合や、手ブレ等によって撮像装置が動いている場合に、第1画像と第2画像との間に撮像時間差に起因する動きずれが顕著となる。撮像時間差に起因する動きずれが生じた場合、ステレオ計測を正しく行えない場合がある。
 そこで、コントロールユニット5は、第1画像(G11もしくはG13)のいずれか一方の画像を、時間的に前後する予測画像G´12に補正する。予測画像G´12は、図2に示すように、第2画像G22が撮像された撮像時刻t2における第1画像の予測画像である。予測画像G´12と第2画像G22とをステレオ計測に使用すれば、ステレオ計測における撮像時間差に起因する動きずれを抑制することができる。予測画像G´12は、画像補正量算出部51と、画像生成部52とによって生成される。
 撮像処理部50は、第2画像G22、第1画像G11および第1画像G13をメモリ54に出力する。
[画像補正量算出部51]
 画像補正量算出部51は、同じ画像サイズの複数の第1画像から選択された2枚の第1画像(一方を「基準フレーム」、他方を「参照フレーム」と称す)から画素移動量を算出し、画素移動量に基づいて、第1画像(G11もしくはG13)のいずれか一方の画像を第2画像(G22)の撮像時刻t2における第1画像の予測画像G´12に補正する補正量を算出する。ここで、画素移動量とは、撮像時間が異なる二枚の画像における画素の移動量(ブレ量)である。撮像時間が異なる二枚の画像において、被写体や撮像装置が移動することよって、画素の位置が移動する。その画素の移動量を画素移動量という。
 本実施形態において、画像補正量算出部51は、動きベクトルを用いて画素移動量を算出する。画像補正量算出部51は、撮像時刻が異なる二枚の第1画像(G11およびG13)をメモリ54から読み出す。画像補正量算出部51は、第1画像G11を基準フレーム(基準第1画像)、第1画像G13を参照フレーム(参照第1画像)として、第1画像G11から第1画像G13に対する動きベクトルを算出する。
 図3は、基準フレーム(基準第1画像)である第1画像G11と、参照フレーム(参照第1画像)である第1画像G13を示している。被写体Oは、第1画像G13において、第一画像G11と比較して、右上に移動している。被写体Oを表示する画素が、右上に移動している。画像補正量算出部51は、第1画像G11から第1画像G13に対する動きベクトルを算出することで、画素移動量を算出する。
 図4および図5は、動きベクトル算出領域設定に関する説明図である。図4は基準フレームを示し、図5は参照フレームを示している。
 画像補正量算出部51は、参照フレーム内の特定の領域(探索ブロックS)から、基準フレーム内の特定の領域(基準ブロックB)と類似する領域(マッチングブロックM)を検出し、基準ブロックBとマッチングブロックMとの位置関係に基づき動きベクトルを算出する。なお、基準ブロックBとマッチングブロックMとは領域の大きさが等しい。
 基準ブロック(分割領域)Bは、基準フレームを、例えば水平方向に5画素および垂直方向に5画素(以降、「5x5」と称す)の領域のように、所定の大きさの領域を所定の間隔で分割した領域である。基準ブロックBの基準点(例えば、中心点、左上端の画素、重心点、等)は水平方向および垂直方向に所定の画素間隔で配列される。
 探索ブロックSは、基準ブロックBよりも大きな領域、例えば「9x9」の領域であり、マッチングブロックMの探索領域として用いられる。
 以降の説明において、画像の画素の位置を説明するためにXY座標を用いる。水平方向をX軸方向、垂直方向をY軸方向とし、左上を原点とする。XY座標は、(X,Y)=(0,0)のように表現する。
 画像補正量算出部51は、基準ブロックBごとに探索対象となる探索ブロックSを設定する。探索ブロックSは、基準ブロックBの基準点座標が探索ブロックSの座標範囲に含まれるように設定される。例えば、図4および図5に示すように、基準ブロックB1の中心座標が(x1,y1)である場合、探索ブロックS1は(x1,y1)が中心画像となるように設定される。
 画像補正量算出部51は、基準ブロックBと、該基準ブロックBとペアとなる探索ブロックSの画像データとから、動きベクトルを算出する。以降、基準ブロックBの一つである基準ブロックB1と、該基準ブロックB1とペアとなる探索ブロックS1の画像データとから、動きベクトルを算出する工程を説明する。
 図6は、動きベクトル算出に関する説明図である。
 画像補正量算出部51は、図6に示すように、探索ブロックS1を、基準ブロックB1と領域の大きさが等しい参照ブロック(R1-R25)を設定し、基準ブロックB1と参照ブロック(R1-R25)との類似度を算出する。参照ブロック(R1-R25)は、図6に示すように、探索ブロックS1の領域内において、X方向もしくはY方向に1画素ずつ異なる複数の領域である。
 類似度として、例えば、SAD(Sum of Absolute Differences:差分絶対値和)、SSD(Sum of Squared Differences:差分二乗和)、NCC(Normalized Cross Correlation)、およびZNCC(Zero means Normalized Cross Correlation)などの指標値が利用可能である。なお、ブロックマッチング手法で通常求まる動きベクトルは整数精度のため、直線内挿やパラボラフィッティング等の公知のサブピクセル推定処理を用いてサブピクセル精度にて動きベクトルを算出しても良い。
 画像補正量算出部51は、基準ブロックB1の中心座標である(x1,y1)が中心座標となる参照ブロックR13を起点として、上下左右に隣接する参照ブロックの類似度を順次演算して求めてもよい。また、画像補正量算出部51は、探索ブロックS1内に設定される複数の参照ブロックの類似度を並列に演算して求めてもよい。
 画像補正量算出部51は、基準ブロックB1と、全ての参照ブロック(R1-R25)との類似度の算出が完了すると、最も類似度が高かった参照ブロックをマッチングブロックM1とする。画像補正量算出部51は、選択したマッチングブロックM1の所定の基準点(例えば、中心点、左上端の画素、重心点、等)の座標から基準ブロックB1の基準点の座標の差分を「動きベクトル」として定める。ただし、基準ブロックB1と参照ブロック(R1-R25)との類似度がいずれも所定の類似度に達しなかった場合、動きベクトルの検出結果は「未検出」となる。
 画像補正量算出部51は、基準ブロックBの動きベクトルを算出した後、補正量を算出する。画像補正量算出部51が算出する補正量は、第1画像の全体領域における全体補正量および第1画像の局所領域における局所補正量の二種類である。全体補正量は、第1画像の全体領域における大まかな補正量である。局所補正量は、第1画像の局所領域のみにおける高精度な補正量である。
<全体領域における全体補正量>
 図7は、第1画像の全体領域において、4×4個(計16個)の基準ブロックBにおいて検出した動きベクトルの模式図である。動きベクトルは、X,Y方向成分から成る二次元ベクトルである。
 画像補正量算出部51は、例えば図7に示すような16個の基準ブロックBにおいて算出した複数の動きベクトルを用いて、第1画像の全体領域における画素移動量Vimgを算出する。画素移動量Vimgは、例えば全ての動きベクトルの平均値で算出される。基準ブロック数N、各基準ブロックの動きベクトルがVi=(Xi,Yi)とすると、画素移動量Vimgは式1から算出される。
Figure JPOXMLDOC01-appb-M000001
 画像補正量算出部51は、第1画像の全体領域における画素移動量Vimgから全体補正量Vcorr=(Xcorr,Ycorr)を算出する。本実施形態では、撮像時刻t1と撮像時刻t2との間隔と、撮像時刻t2と撮像時刻t3との間隔とが同じであるため、全体補正量Vcorrは式2により算出することができる(全体補正量算出工程)。
Figure JPOXMLDOC01-appb-M000002
 式2に示す全体補正量Vcorrは、撮像時刻t3における第1画像G13を、撮像時刻t2における第1画像の予測画像G´12に補正する補正量である(図2参照)。なお、全体補正量は、撮像時刻t1における第1画像G11を、撮像時刻t2における第1画像の予測画像G´12に補正する補正量であってもよい。
 全体補正量は第1画像の全体領域における大まかな補正量であるため、例えば図7に示すように画面全域に均等に分布する16個の基準ブロックBのように、全体領域に広く分布する複数の基準ブロックBが選択され、全体補正量Vcorrの算出に用いられることが望ましい。また、全体補正量は第1画像の全体領域における大まかな補正量であるため、全体補正量Vcorrの算出に用いる基準ブロックBは、例えば図7に示すように16個の基準ブロックBのように、第一画像を大まかに分割して設定された基準ブロックBが選択されることが望ましい。
<局所領域における局所補正量>
 図8は、本実施形態においてステレオ計測を行う4個の計測点p1~p4を示している。以降の説明では、計測点p1に関する局所補正量の算出に関して説明を行う。
 図9は、計測点p1周辺において算出した動きベクトルの模式図である。図9は、計測点p1周辺の局所領域Lp1に設定された3×3個(計9個)の基準ブロックBにおいて検出した動きベクトルの検出結果(左上からV~V)を示している。ここで、計測点p1を含む基準ブロックBにおける動きベクトルの検出結果は、動きベクトルはVである。
 ここで、図9に示す被写体Oが撮像された領域は、その他領域に比べて撮像装置に対して近距離で撮像されている。そのため、被写体Oを含む基準ブロックBにおける動きベクトル(例えばV)は、被写体Oを含まない基準ブロックBにおける動きベクトル(例えばV)に比べて相対的に大きな動きベクトルが算出される。被写体距離がより近い被写体ほど、画像上でより大きな画素移動量となって撮像されやすいためである。
 算出した計測点p1周辺の動きベクトルを用いて、計測点p1周辺の局所領域Lp1の画像の画素移動量Vp1を算出する。計測点p1周辺の基準ブロック数をN、各基準ブロックの動きベクトルをVi=(Xi,Yi)とすると、局所領域Lp1の画素移動量Vp1は式3で表される。
Figure JPOXMLDOC01-appb-M000003
 ここで、式3におけるaiは、式4に示すように、1もしくは0の値をとる変数であり、計測点p1における動きベクトルVc(図9に示す例ではV)と動きベクトルViとの差分ベクトルの大きさが所定の閾値thr以下であるときに1となる。つまり、計測点p1を含む基準ブロックBの動きベクトルVcより所定の閾値を超えた大きさの動きベクトルを除外して、複数の動きベクトルの平均ベクトルを算出することで、計測点p1周辺の局所領域Lp1の画素移動量Vp1をロバストに算出することができる。
Figure JPOXMLDOC01-appb-M000004
 画像補正量算出部51は、式5に示すように、計測点p1における画素移動量Vp1から局所補正量Vp1_corr=(Xp1_corr,Yp1_corr)を算出する(局所補正量算出工程)。画像全体領域に対する全体補正量の算出と同様に、局所補正量Vp1_corrの大きさは、画素移動量Vp1の大きさの1/2となる。
Figure JPOXMLDOC01-appb-M000005
 式5に示す局所補正量Vp1_corrは、撮像時刻t3における第1画像G13の局所領域Lp1の局所領域画像L13を、撮像時刻t2における第1画像の局所領域Lp1の局所予測画像L´12に補正する補正量である(図2参照)。なお、局所補正量は、撮像時刻t1における第1画像G11の局所領域Lp1の局所領域画像L11を、撮像時刻t2における第1画像の局所領域Lp1の局所予測画像L´12に補正する補正量であってもよい。
 画像補正量算出部51は、計測点p1における局所補正量Vp1_corrを算出した後、計測点p2~p4における局所補正量を同等の方法により算出する。
 画像補正量算出部51は、算出した全体補正量および局所補正量をメモリ54に出力する。メモリ54は、全体補正量および局所補正量を記録する。
[画像生成部52]
 画像生成部52は、二種類の画像生成を行う。一方は、撮像時刻t2における第1画像の全体領域における予測画像G´12である。他方は、撮像時刻t2における第1画像の局所領域(計測点p1~p4周辺)における予測画像である。
<全体領域における予測画像(全体予測画像)>
 画像生成部52は、全体領域における全体補正量Vcorrに基づき、撮像時刻t3における第一画像の全体領域における第1画像G13を、撮像時刻t2における第1画像の全体領域における予測画像G´12に補正する(全体予測画像生成工程)。予測画像G´12の座標(x´,y´)の画素値は、時刻t3に撮像された第1画像G13の座標(x,y)を座標(x´,y´)へ変換する式6に基づいて生成される。式6は、第1画像G13の画素を、全体補正量Vcorrに基づいて、XY方向にシフトしていることを示す。
Figure JPOXMLDOC01-appb-M000006
 全体補正量Vcorrがサブピクセル精度で算出されている場合、画像生成部52は、Bilinear補間やBicubic補間等の公知の画素補間手段によって、座標(x´,y´)の画素値を求めても良い。
 なお、全体補正量が撮像時刻t1における第1画像G11を撮像時刻t2における第1画像の予測画像G´12に補正する補正量である場合、画像生成部52は、当該全体補正量に基づき、第1画像G11を予測画像G´12に補正する。
<3D立体観察画像の生成>
 画像生成部52は、撮像時刻t2における第1画像の予測画像G´12と撮像時刻t2における第2画像G22とを用いて3D立体観察画像を生成する(3D立体観察画像生成工程)。
 表示部7が2次元ディスプレイであり、3D点群データとして被写体を表示する場合は、ステレオ画像ペア(同撮像時刻の第一画像G´12と第二画像G22)から各座標の3次元座標を算出したデータ群が 3D立体観察画像となる。座標の奥行Z値は、式7に示すように、一般的なステレオ計測の方法により算出される。式7において、Bは基線長、fは焦点距離、Sは左右画像の視差を表している。
Figure JPOXMLDOC01-appb-M000007
 表示部7が裸眼立体視が可能なディスプレイである場合は、画像生成部52は裸眼立体視用の3D立体観察画像を生成する。
<局所領域における予測画像(局所予測画像)>
 画像生成部52は、撮像時刻t3における第1画像G13の局所領域Lp1における局所領域画像L13を、対応する局所補正量Vp1_corrに基づき、撮像時刻t2における第1画像の局所領域Lp1における局所予測画像L´12に補正する(局所予測画像生成工程)。局所予測画像L´12の座標(x´,y´)の画素値は、時刻t3に撮像された第1画像G13の局所領域画像L13の座標(x,y)を座標(x´,y´)へ変換する式8に基づいて生成される。
Figure JPOXMLDOC01-appb-M000008
 なお、局所補正量が、撮像時刻t1における第1画像G11の局所領域Lp1における局所領域画像L11を、撮像時刻t2における第1画像の局所領域Lp1における局所予測画像L´12に補正する補正量である場合、画像生成部52は、局所領域画像L11を、当該局所補正量に基づき、局所予測画像L´12に補正する。
 画像生成部52は、計測点p1周辺の局所領域Lp1における局所予測画像L´12を生成した後、計測点p2~p4周辺の局所領域における局所予測画像を同等の方法により算出する。
 画像生成部52は、生成した画像をメモリ54に出力する。メモリ54は、入力される画像を記録する。
[計測部53]
<被写体距離の計測>
 計測部53は、撮像時刻t2における第1画像の局所領域Lp1における局所予測画像L´12と、撮像時刻t2における第2画像G22の局所領域Lp1における局所領域画像L22と、を用いて視差量を求め、計測点p1の被写体距離z1を計測する(計測用視差量算出工程)。被写体距離z1の計測は公知のステレオ計測技術を用いて行う。計測部53は、同じ撮像時刻における第1画像と第2画像とをステレオ計測に用いることで、高精度に被写体距離を計測することができる。
 計測部53は、計測点p1における被写体距離z1を計測した後、計測点p2~p4における被写体距離z2~z4を同等の方法により計測する。計測部53は、被写体距離z1~Z4を計測した後、計測点間の2点間距離を算出してもよい。
 計測部53は、計測した被写体距離および2点間距離をメモリ54に出力する。メモリ54は、入力される被写体距離および2点間距離を記録する。
[制御部55]
 制御部55は、撮像処理部50と、画像補正量算出部51と、画像生成部52と、計測部53と、メモリ54に加え、先端部2と、操作部6と、表示部7とを制御する。制御部55は、これらに対して、操作部6からの入力に基づき、動作パラメータを設定する。
 図10は、制御部55の構成図である。
 制御部55は、図10に示すように、プロセッサ550と、プログラムを読み込み可能なメモリ551と、記憶部552と、入出力制御部553と、を有するプログラム実行可能な処理装置(コンピュータ)である。制御部55の機能は、制御部55に提供されたプログラムをプロセッサ550が実行することにより実現される。なお、制御部55の少なくとも一部の機能を、専用の論理回路等によって構成してもよい。
 例えば、プロセッサ550は、CPU、DSP(Digital Signal Processor)もしくはGPU(Graphics Processing Unit)またはこれらの組合せである。
 入出力制御部553は、コントロールユニット5における内部通信や、先端部2、操作部6および表示部7と動作制御のための通信を実施する。
 記憶部552は、上述したプログラムや必要なデータを記憶する不揮発性の記録媒体である。記憶部552は、例えばROMやフラッシュメモリで構成される。記憶部552に記録されたプログラムは、メモリ551に読み込まれ、プロセッサ550によって実行される。
 上述したプログラムは、例えばフラッシュメモリのような「コンピュータ読み取り可能な記録媒体」により提供されてもよい。また、上述したプログラムは、このプログラムが保存された記憶装置等を有するコンピュータから、伝送媒体を介して、あるいは伝送媒体中の伝送波により撮像装置100に伝送されてもよい。プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように、情報を伝送する機能を有する媒体である。さらに、上述したプログラムは、制御部55の機能を制御部55に既に記録されているプログラムとの組合せで実現できる差分ファイル(差分プログラム)であってもよい。
 なお、撮像処理部50と、画像補正量算出部51と、画像生成部52と、計測部53とは、制御部55同様、プロセッサ等を有するプログラム実行可能な処理装置(コンピュータ)もしくは専用の電子回路(論理回路等)またはこれらの組合せで構成されてよい。
 また、撮像処理部50と、画像補正量算出部51と、画像生成部52と、計測部53と、制御部55とは、それぞれ別個の処理装置や電子回路で構成されてもよいし、これらのうち少なくとも一部が共通の処理装置や電子回路で構成されてもよい。
 制御部55は、メモリ54に記録された3D観察立体観察画像を、表示部7に所定の転送タイミングで表示画像として転送する。
 図11と図12は制御部55が生成する表示画像の例である。
 制御部55は、3D観察立体観察画像に、計測点p1~p4における被写体距離z1~z4に関するグラフィックス表示を重畳し、表示画像を生成してもよい。使用者は、表示画像により、計測点p1~p4における被写体距離を直感的に把握しやすい。
 制御部55は、図12に示すように、計測点p1~p4の2点間距離を、さらに重畳して表示画像を生成してもよい。使用者は、表示画像により、計測点p1~p4の2点間距離を直感的に把握しやすい。
[操作部6]
 操作部6は、使用者から指示を受け付けるユーザインターフェースである。使用者は、操作部6を操作することにより、撮像装置100全体の各種動作制御に必要な指示を入力する。操作部6は、使用者から受け付けた指示を示す信号を制御部55に出力する。例えば、操作部6は、シャッターボタン、設定用ボタン、設定用スイッチ、キー、マウス、ジョイスティック、タッチパッド、トラックボール、およびタッチパネルの少なくとも1つである。
[表示部7]
 表示部7は、制御部55が出力した表示画像を表示する。また、表示部7は、操作制御内容を表示する。例えば、操作制御内容はメニューとして表示される。例えば、表示部7は、液晶ディスプレイおよび有機EL(Electro Luminescence)ディスプレイの少なくとも1つである。表示部7は、タッチパネルディスプレイであってもよい。その場合、操作部6および表示部7は一体化される。
 なお、操作部6および表示部7は、撮像装置100において必須ではない。
[撮像装置100の動作]
 次に、第1実施形態に係る撮像装置100の動作を説明する。
 初めに、使用者は先端部2を被写体を撮像できる位置に移動させる。次に使用者は操作部6を操作して、撮像装置100による撮像を開始する。
 撮像装置100は、図2に示すように、時刻t1において第1画像G11を撮像する。次に、撮像装置100は、時刻t2において、光路設定部23を制御して光路を切り替え、第2画像G22を撮像する。次に、撮像装置100は、時刻t3において、光路設定部23を制御して光路を切り替え、第1画像G13を撮像する。
 撮像装置100は、第1画像G13の撮像が完了後、第1画像G13から全体領域における全体予測画像G´12と、計測点p1~p4周辺における局所領域における局所領域画像と、を生成する。
 全体予測画像G´12は、大まかな補正量であるため、局所予測画像と比較すると、予測の精度は低いが演算量が少ない。そのため、全体予測画像G´12は局所予測画像より先に生成が完了する。
 局所予測画像(例えば、L´12)は、局所領域において高精度に補正量であるため、全体予測画像G´12と比較すると、予測の精度は高いが演算量が多い。そのため、局所予測画像は、全体予測画像G´12より演算により時間を要する。
 撮像装置100は、全体予測画像G´12と、複数の局所予測画像と、を同時に生成した場合、全体予測画像G´12の方が演算量が少ないため、全体予測画像を先に生成することができる。撮像装置100は、先に生成された全体予測画像G´12を用いて、3D観察立体観察画像を生成して、表示部7に表示画像として転送する。使用者は大幅な遅延なく3D観察立体観察画像を確認することができる。
 撮像装置100は、複数の局所予測画像の生成と計測点p1~p4での被写体距離z1~Z4を計測した後、3D観察立体観察画像に、計測点p1~p4における被写体距離z1~z4に関するグラフィックス表示を重畳し、表示画像を生成する。使用者は、図11に示すような表示画像で、高精度に算出された補正量に基づいて計測された被写体距離z1~z4を、3D観察立体観察画像とともに確認することができる。
 撮像装置100は、2点間距離の算出後、さらに3D観察立体観察画像に2点間距離に関するグラフィックス表示を重畳し、表示画像を生成する。使用者は、図12に示すような表示画像で、高精度に算出された補正量に基づいて計測された2点間距離を、3D観察立体観察画像とともに確認することができる。
 本実施形態の撮像装置100によれば、3D立体観察画像を大幅な遅延なく生成して使用者に提供でき、かつ、被写体距離等の計測を高精度に実施することができる。
 以上、本発明の第一実施形態について図面を参照して詳述したが、具体的な構成はこの実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の設計変更等も含まれる。また、上述の第一実施形態および以下で示す変形例において示した構成要素は適宜に組み合わせて構成することが可能である。
(変形例1)
 上記の実施形態に係る撮像装置100の少なくとも一部の機能を、コンピュータで実現するようにしてもよい。その場合、この機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって実現してもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間の間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでもよい。
 例えば、撮像素子25から撮像信号がRawデータとして、ISO感度情報や画像信号サイズなどがヘッダー情報として、外部のコンピュータシステムに出力される。外部のコンピュータシステムは、プログラムを実行することで、撮像装置100の残りの機能を実現する。
(変形例2)
 上記の実施形態では、第一画像の全体領域における画素移動量Vimgの算出の際に、図7に示す第1画像を画像処理せずに使用したが、画素移動量Vimgの算出方法はこれに限定されない。画素移動量Vimgは、例えば第1画像を縮小したものや等間隔サンプリングしたものから算出してもよい。全体領域の画素移動量Vimgの算出を、演算量を減らして、より高速に実施することができる。
(変形例3)
 上記の実施形態では、画像生成部52は、全体領域における全体補正量Vcorrに基づき、式6を用いて、撮像時刻t3における第一画像の全体領域における第1画像G13を、撮像時刻t2における第1画像の全体領域における予測画像G´12に補正していたが、予測画像G´12の生成方法はこれに限定されない。画像生成部は、式9に示すように、複数の動きベクトルから公知の8点アルゴリズムによって射影変換行列を求め、射影変換行列を用いて予測画像G´12を生成しても良い。式9において、h11~h33は8点アルゴリズムから求まる射影変換係数である。
Figure JPOXMLDOC01-appb-M000009
(変形例4)
 上記の実施形態では、画素移動量は検出した動きベクトルから算出していたが、画素移動量の算出方法はこれに限定されない。基準フレーム(基準第1画像)と参照フレーム(参照第1画像)との画素移動量は、例えば、先端部2に設けられたジャイロセンサー等のモーションセンサー(姿勢検出部)から取得した先端部の移動距離から算出してもよい。
 例えば、第一画像の全体領域における画素移動量は、低解像度のモーションセンサーによって高速に算出する。一方、第一画像の局所領域における画素移動量は、高解像度のモーションセンサーを複数用いて高精度に算出する。
(変形例5)
 上記の実施形態では、計測点は予め定められた位置に設定されていたが、計測点の態様はこれに限定されない。撮像装置は使用者が操作部を操作して計測点の位置を設定できる入力部を有して構成されていてもよい。図13は、計測点の座標(計測座標)を使用者が設定する際の表示画面である。図13に示すように、計測座標を設定する際に使用者に3D立体観察画像を提供することで、使用者は意図する位置に正確に計測座標を設定することができる。使用者は操作部から入力により、3D立体観察画像上において計測点を指定する。
 操作者が指定した指定計測点Pinは、撮像時刻t2における3D立体観察画像において指定された座標である。そのため、使用者が指定した計測点でステレオ計測を行う場合は、式10に示すように、全体補正量Vcorrを用いて、指定計測点Pinから撮像時刻t1における計測点pを算出する。計測点pの算出後のステレオ計測動作は、上記の実施形態と同じである。
Figure JPOXMLDOC01-appb-M000010
(第二実施形態)
 本発明の第二実施形態について説明する。以降の説明において、既に説明したものと共通する構成については、同一の符号を付して重複する説明を省略する。本実施形態は、撮像時刻t2における予測画像を生成せずにステレオ計測を行う点が、第一実施形態と異なっている。
 本実施形態に係る撮像装置100Bは、挿入部1と、コントロールユニット5Bと、操作部6と、表示部7と、を備える。
 コントロールユニット5Bは、撮像処理部50と、画像補正量算出部51と、画像生成部52Bと、計測部53Bと、メモリ54と、制御部55と、を有する。
[画像補正量算出部51]
 画像補正量算出部51は、第一実施形態と同様の方法で、式11に示すように、全体補正量Vcorrを算出する。
Figure JPOXMLDOC01-appb-M000011
 また、画像補正量算出部51は、第一実施形態と同様の方法で、式12に示すように、計測点p周辺の局所領域Lpの画素移動量Vpから、計測点pでの局所補正量Vp_corrを算出する。
Figure JPOXMLDOC01-appb-M000012
[計測部53B]
 計測部53Bは、第2画像G22と参照第1画像G13との局所領域における暫定視差量Spを計測する(局所領域視差量算出工程)。
 第2画像G22と参照第1画像G13との暫定視差量Spは、式13により算出される。式13において、第2画像G22上の座標(XR1,YR1)は、参照第1画像G13上の座標(XL2,YL2)を基準にステレオマッチングをした座標である。ステレオマッチングはブロックマッチングをエピポーラライン上にて探索する一般的な手法を用いれば良いが、探索対象は実際の視差量への補正前の暫定視差量であるため、探索範囲をエピポーララインより若干広げて探索することが望ましい。
Figure JPOXMLDOC01-appb-M000013
 次に、計測部53Bは、式14に示すように、局所補正量Vp_corrに基づき、局所領域における暫定視差量Spを、第2画像G22と第1画像の予測画像G´12との局所領域における視差量Sp_corrに補正し、局所領域における被写体の形状及び被写体までの距離の少なくとも一方を計測する。
Figure JPOXMLDOC01-appb-M000014
 計測部53Bは、第2画像G22と参照第1画像G13との全体領域における暫定視差量Sを計測する(全体領域視差量算出工程)。
 さらに、計測部53Bは、式15に示すように、全体補正量Vcorrに基づき、全体領域における暫定視差量Sを、第2画像G22と第1画像の予測画像G´12との全体領域における視差量Scorrを算出し、3D立体観察用のデータを生成する。
Figure JPOXMLDOC01-appb-M000015
[画像生成部52B]
 画像生成部52Bは、3D立体観察用のデータを用いて3D立体観察画像を生成する。
 本実施形態の撮像装置100Bによれば、3D立体観察画像を大幅な遅延なく生成して使用者に提供でき、かつ、被写体距離当等の計測を高精度に実施することができる。ステレオ計測を局所予測画像(例えば、L´12)を生成することなく実施できるため、第一実施形態と比較して、ステレオ計測を高速に行うことができる。
 以上、本発明の第二実施形態について図面を参照して詳述したが、具体的な構成はこの実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の設計変更等も含まれる。また、上述の第二実施形態および変形例において示した構成要素は適宜に組み合わせて構成することが可能である。
 本発明は、時分割ステレオ方式の撮像装置に適用することができる。
100,100B 撮像装置
1   挿入部
2   先端部
21  第1光学系
22  第2光学系
23  光路設定部
24  結像光学系
25  撮像素子(撮像部)
26  照明部
3   挿入部本体
5,5B コントロールユニット(制御装置)
50  撮像処理部
51  画像補正量算出部
52,52B 画像生成部 画像生成部
53,53B 計測部 計測部
54  メモリ
55  制御部
550 プロセッサ
551 メモリ
552 記憶部
553 入出力制御部
6   操作部
7   表示部
G11  撮像時刻t1における第1画像
G´12 撮像時刻t2における第1画像の全体領域における全体予測画像
G13  撮像時刻t3における第1画像
G22  撮像時刻t2における第2画像
L11  撮像時刻t1における第1画像の局所領域Lp1における局所領域画像
L´12 撮像時刻t2における第1画像の局所領域Lp1における局所予測画像
L13  撮像時刻t3における第1画像の局所領域Lp1における局所領域画像
L22  撮像時刻t2における第2画像の局所領域Lp1における局所領域画像

Claims (13)

  1.  第1光路と、前記第1光路と視差を有する第2光路とを時系列に切り替えて、前記第1光路を通った光が形成する被写体の像に基づく第1画像と、前記第2光路を通った光が形成する被写体の像に基づく第2画像と、を撮像する撮像装置であって、
     複数の前記第1画像から選択された、基準第1画像と前記基準第1画像と撮像時刻が異なる参照第1画像とに基づいて、前記基準第1画像または前記参照第1画像を前記第2画像の撮像時刻における前記第1画像の予測画像に補正する補正量を算出する画像補正量算出部と、を備え、
     前記画像補正量算出部が算出する前記補正量は、
      前記第1画像の全体領域における全体補正量と、
      前記第1画像の局所領域における局所補正量と、を含む
     撮像装置。
  2.  前記全体補正量を算出するための演算量は、前記局所補正量を算出するための演算量よりも少ない、
     請求項1に記載の撮像装置。
  3.  前記画像補正量算出部は、前記基準第1画像と前記参照第1画像との画素移動量に基づいて、前記基準第1画像または前記参照第1画像を前記第2画像の撮像時刻における前記第1画像の予測画像に補正する前記補正量を算出する、
     請求項1または請求項2に記載の撮像装置。
  4.  前記全体補正量は、前記基準第1画像と前記参照第1画像とから算出される前記全体領域における動きベクトルから算出される前記画素移動量に基づいて算出され、
     前記局所補正量は、前記基準第1画像と前記参照第1画像とから算出される前記局所領域における動きベクトルから算出される前記画素移動量に基づいて算出される、
     請求項3に記載の撮像装置。
  5.  前記局所補正量に基づき、前記基準第1画像または前記参照第1画像を、前記局所領域における前記予測画像である局所予測画像に補正する画像生成部と、
     前記第2画像と前記第1画像の前記局所予測画像との前記局所領域における視差量を算出し、前記視差量に基づいて前記被写体の形状及び前記被写体までの距離の少なくとも一方を計測する計測部と、
     をさらに有する、
     請求項3または請求項4に記載の撮像装置。
  6.  前記全体補正量に基づき、前記基準第1画像または前記参照第1画像を、前記全体領域における前記予測画像である全体予測画像に補正する画像生成部と、
     前記第2画像と前記第1画像の前記全体予測画像とを用いて3D立体観察用のデータを生成する3D立体観察データ生成部と、をさらに有する
     請求項3または請求項4に記載の撮像装置。
  7.  前記局所補正量に基づき、前記基準第1画像または前記参照第1画像を、前記局所領域における前記予測画像である局所予測画像に補正し、前記全体補正量に基づき、前記基準第1画像または前記参照第1画像を、前記全体領域における前記予測画像である全体予測画像に補正する画像生成部と、
     前記第2画像と前記第1画像の前記局所予測画像との前記局所領域における視差量を算出し、前記視差量に基づいて前記被写体の形状及び前記被写体までの距離の少なくとも一方を計測する計測部と、
     前記第2画像と前記第1画像の前記全体予測画像とを用いて3D立体観察用のデータを生成する3D立体観察データ生成部とをさらに有する、
     請求項3または請求項4に記載の撮像装置。
  8.  前記第2画像と前記基準第1画像または前記参照第1画像との、前記局所領域における視差量を算出し、
     前記視差量を前記局所補正量に基づき補正し、前記局所領域における前記被写体の形状及び前記被写体までの距離の少なくとも一方を計測する
     計測部をさらに有する、
     請求項3または請求項4に記載の撮像装置。
  9.  前記第2画像と前記基準第1画像または前記参照第1画像との、前記全体領域における視差量を算出し、前記視差量を前記全体補正量に基づいて補正し、3D立体観察用のデータを生成する3D立体観察データ生成部をさらに有する
     請求項8に記載の撮像装置。
  10.  前記3D立体観察用のデータを3D立体観察表示する表示部と、
     前記3D立体観察表示における3D座標の入力を受け付ける入力部、とをさらに備え、
     前記3D座標を、前記全体補正量と前記局所補正量を用いて、計測座標に変換し、前記計測座標にて前記被写体の計測を行う
     請求項6または請求項9に記載の撮像装置。
  11.  前記画像生成部は、前記画素移動量に基づいて前記基準第1画像または前記参照第1画像に射影変換および平行移動の少なくとも一方を適用することにより前記第1画像の前記全体予測画像を生成し、
     前記画像生成部は、前記画素移動量に基づいて前記基準第1画像または前記参照第1画像に平行移動を適用することにより前記予測画像である局所予測画像を生成する、
     請求項6に記載の撮像装置。
  12.  前記基準第1画像と前記参照第1画像が撮像されたときの前記撮像装置の姿勢を検出する姿勢検出部を備え、
     前記画像生成部は、
     前記姿勢検出部により検出された前記姿勢を用いて算出された前記画素移動量に基づいて前記第1画像の前記全体予測画像を生成し、
     前記基準第1画像と前記参照第1画像とから前記局所領域において算出された動きベクトルを用いて算出された前記画素移動量に基づいて前記第1画像の前記局所予測画像を生成する、
     請求項7に記載の撮像装置。
  13.  第1光路と、前記第1光路と視差を有する第2光路とを時系列に切り替えて、前記第1光路を通った光が形成する被写体の像に基づく第1画像と、前記第2光路を通った光が形成する被写体の像に基づく第2画像と、を撮像する撮像装置において、
     複数の前記第1画像から選択された基準第1画像と前記基準第1画像と撮像時刻が異なる参照第1画像との全体領域における画素移動量に基づいて、前記基準第1画像または前記参照第1画像を、前記第2画像の撮像時刻における前記第1画像の全体領域における予測画像に補正する全体補正量を算出する全体補正量算出工程と、
     前記基準第1画像と前記参照第1画像との局所領域における画素移動量に基づいて、前記基準第1画像または前記参照第1画像の局所領域画像を、前記第2画像の撮像時刻における前記第1画像の局所領域における予測画像に補正する局所補正量を算出する局所補正量算出工程と、を備える、
     画像補正方法。
PCT/JP2018/041988 2018-11-13 2018-11-13 撮像装置、画像補正方法および画像補正プログラム WO2020100215A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/041988 WO2020100215A1 (ja) 2018-11-13 2018-11-13 撮像装置、画像補正方法および画像補正プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/041988 WO2020100215A1 (ja) 2018-11-13 2018-11-13 撮像装置、画像補正方法および画像補正プログラム

Publications (1)

Publication Number Publication Date
WO2020100215A1 true WO2020100215A1 (ja) 2020-05-22

Family

ID=70731418

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/041988 WO2020100215A1 (ja) 2018-11-13 2018-11-13 撮像装置、画像補正方法および画像補正プログラム

Country Status (1)

Country Link
WO (1) WO2020100215A1 (ja)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007288483A (ja) * 2006-04-17 2007-11-01 Matsushita Electric Ind Co Ltd 画像変換装置
JP2008118620A (ja) * 2007-08-06 2008-05-22 Sharp Corp 画像表示装置及び方法、画像処理装置及び方法
JP2008236098A (ja) * 2007-03-19 2008-10-02 Hitachi Ltd 映像処理装置及び映像表示装置
JP2010263382A (ja) * 2009-05-01 2010-11-18 Sony Corp 送信装置、立体画像データの送信方法、受信装置、立体画像データの受信方法、中継装置および立体画像データの中継方法
JP2012080469A (ja) * 2010-10-05 2012-04-19 Canon Inc 立体映像表示装置及びその制御方法
WO2012053136A1 (ja) * 2010-10-20 2012-04-26 パナソニック株式会社 立体映像処理回路および立体映像撮影装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007288483A (ja) * 2006-04-17 2007-11-01 Matsushita Electric Ind Co Ltd 画像変換装置
JP2008236098A (ja) * 2007-03-19 2008-10-02 Hitachi Ltd 映像処理装置及び映像表示装置
JP2008118620A (ja) * 2007-08-06 2008-05-22 Sharp Corp 画像表示装置及び方法、画像処理装置及び方法
JP2010263382A (ja) * 2009-05-01 2010-11-18 Sony Corp 送信装置、立体画像データの送信方法、受信装置、立体画像データの受信方法、中継装置および立体画像データの中継方法
JP2012080469A (ja) * 2010-10-05 2012-04-19 Canon Inc 立体映像表示装置及びその制御方法
WO2012053136A1 (ja) * 2010-10-20 2012-04-26 パナソニック株式会社 立体映像処理回路および立体映像撮影装置

Similar Documents

Publication Publication Date Title
JP4790086B2 (ja) 多眼撮像装置および多眼撮像方法
WO2018086348A1 (zh) 双目立体视觉系统及深度测量方法
US20110249117A1 (en) Imaging device, distance measuring method, and non-transitory computer-readable recording medium storing a program
JP2019033917A (ja) 内視鏡システム
JPWO2017199696A1 (ja) 画像処理装置及び画像処理方法
JP2018197674A (ja) 計測装置の作動方法、計測装置、計測システム、3次元形状復元装置、およびプログラム
TWI528783B (zh) 產生深度影像之方法及其系統及電腦程式產品
JP7271215B2 (ja) 同期制御装置、同期制御方法、及びプログラム
JP7032532B2 (ja) 撮像装置、画像補正方法および画像補正プログラム
JP5996233B2 (ja) 画像撮像装置
WO2020017377A1 (ja) 測距カメラ
WO2020100215A1 (ja) 撮像装置、画像補正方法および画像補正プログラム
WO2017094122A1 (ja) 撮像装置、内視鏡装置及び撮像方法
JP2017059998A (ja) 画像処理装置およびその方法、並びに、撮像装置
JP5310890B2 (ja) 画像生成装置、画像生成方法及びプログラム
JP2011217229A (ja) 撮像装置および表示方法
JP2020034743A (ja) 画像取得装置および画像取得装置の作動方法
WO2017057426A1 (ja) 投影装置、コンテンツ決定装置、投影方法、および、プログラム
JP5167614B2 (ja) 距離画像生成装置、距離画像生成方法及びプログラム
JP7233261B2 (ja) 3次元測量装置、撮像装置、制御方法及びプログラム
JP2017028606A (ja) 撮像装置
JP5689693B2 (ja) 描画処理装置
JP2017103695A (ja) 画像処理装置、画像処理方法、及びそのプログラム
JP2021033857A (ja) 画像処理装置及び画像処理方法
JP7482070B2 (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: 18939793

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: 18939793

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP