Image processing device, image processing method, and program
The image processing device and method address the issue of erroneous feature points in SfM by calculating errors and setting thresholds to visualize and correct inaccuracies in three-dimensional shape construction.
Patent Information
- Application Number
- JP2020173185
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2024-08-14
- Estimated Expiration
- 2040-10-14
AI Technical Summary
Existing methods for constructing three-dimensional shapes from multiple images, such as SfM, struggle to effectively identify and remove erroneous feature point pairs, leading to inaccuracies in the reconstructed shapes.
An image processing device and method that calculates three-dimensional coordinates for feature point combinations, determines error thresholds, and visualizes the influence of erroneous combinations by displaying the state of the three-dimensional shape for different threshold settings.
Enables visualization of the impact of erroneous feature point combinations on the three-dimensional shape, allowing for more accurate construction and identification of areas that need correction.
Smart Images

Figure 0007533937000022 
Figure 0007533937000027 
Figure 0007533937000018
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing device and an image processing method that are useful when constructing a three-dimensional shape of an object from multiple images of the object, and further to a program for implementing these. [Background technology]
[0002] In recent years, technology that constructs the 3D shape of an object captured in an image has been attracting attention. A representative example of such technology is Structure from Motion (SfM). In SfM, a specific object is photographed multiple times while changing the viewpoint of the camera, and the 3D shape of the specific object is reconstructed from the multiple images obtained.
[0003] Specifically, in SfM, first, the feature amount (e.g., SIFT feature amount, SURF feature amount) is calculated for each image, and robust feature points that are resistant to image enlargement / reduction, rotation, and illumination change are extracted. Next, matching of the extracted feature points is performed between images, and pairs of matching feature points (hereinafter referred to as "feature point pairs") are extracted.
[0004] Then, for each of several pairs of feature points, a fundamental matrix is calculated based on the geometric relationship between the pairs of feature points, and the geometric relationship between the pairs of feature points is adjusted so that the difference between the calculated fundamental matrices is minimized. Then, a three-dimensional shape (point cloud data) is reconstructed based on the adjusted geometric relationship.
[0005] However, in the above-mentioned SfM, matching errors between feature points may occur, in which case erroneous feature point pairs are extracted, reducing the accuracy of the reconstructed 3D shape. For this reason, the systems disclosed in Patent Documents 1 and 2 accept designation of corresponding line segments or points in each pair of images of the object, extract erroneous feature point pairs based on the accepted line segments or points, and delete the extracted feature point pairs.
[0006] In addition, in the above-mentioned SfM, erroneous feature point pairs are also removed by filtering such as bundle adjustment. For example, in bundle adjustment, after a 3D shape is constructed, one of the feature point pairs is reprojected onto the original 2D image using the 3D coordinates obtained from it and the camera matrix corresponding to the image from which it was extracted. Then, the 2D coordinates of the projected position are compared with the 2D coordinates of the position at the time of extraction, and the difference between the former 2D coordinates and the latter 2D coordinates is calculated. If the difference is equal to or less than a threshold as a result of the calculation, the target feature point is determined to be correct and to be a feature point pair without an error. On the other hand, if the difference is greater than the threshold as a result of the calculation, the target feature point is determined to be incorrect and to be a feature point pair with an error. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Patent No. 5311465 [Patent Document 2] International Publication No. 2019 / 065784 Summary of the Invention [Problem to be solved by the invention]
[0008] However, even when using the systems disclosed in Patent Documents 1 and 2, and even when performing bundle adjustment, it is difficult to remove all erroneous feature points pairs. On the other hand, even if a feature points pair is determined to have an error, depending on the degree of the error, it may not affect the three-dimensional shape (point cloud). For this reason, there is a demand for visualizing the effect of erroneous feature points on the three-dimensional shape (point cloud data).
[0009] One example of the objective of the present invention is to provide an image processing device, an image processing method, and a program that can visualize the effect that an erroneous combination of feature points has on a three-dimensional shape when a combination of corresponding feature points is extracted from multiple images to construct the three-dimensional shape. [Means for solving the problem]
[0010] In order to achieve the above object, an image processing device according to one aspect of the present invention comprises: an error calculation unit that, when three-dimensional coordinates of a corresponding object are calculated for each combination of corresponding feature points extracted from each of a plurality of images of the object, calculates an error for the corresponding three-dimensional coordinates for each combination of feature points; a threshold setting unit that identifies a maximum value and a minimum value from the errors calculated for each combination of the feature points, and sets a plurality of thresholds between the minimum value and the maximum value; a state specifying unit that specifies a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; a status display unit that displays the identified status for each of the plurality of thresholds on a screen; Equipped with It is characterized by:
[0011] In order to achieve the above object, an image processing method according to one aspect of the present invention comprises: an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than each of the plurality of thresholds is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; The present invention is characterized in that it has the following features:
[0012] Furthermore, in order to achieve the above object, a program according to one aspect of the present invention comprises: On the computer, an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than each of the plurality of thresholds is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; The present invention is characterized in that the above-mentioned is executed. Effect of the Invention
[0013] As described above, according to the present invention, when extracting combinations of corresponding feature points from multiple images to construct a 3D shape, it is possible to visualize the effect that an erroneous combination of feature points has on the 3D shape. [Brief description of the drawings]
[0014] [Figure 1] FIG. 1 is a diagram showing a schematic configuration of an image processing device according to an embodiment. [Diagram 2] FIG. 2 is a block diagram specifically showing the configuration of the image processing device according to the embodiment. [Diagram 3] FIG. 3 is a diagram showing an example of a plurality of images to be processed in the embodiment. [Figure 4] FIG. 4 is a diagram showing an example of a pair of images from which combinations of feature points are extracted. [Diagram 5]FIG. 5 is a diagram showing an example of the three-dimensional coordinates and rotation matrix of the camera of the initial pair of images, which are determined from the camera matrix. [Figure 6] FIG. 6 is a diagram showing an example of a combination of an image newly selected after selection of an initial pair of images and feature points extracted therefrom. [Figure 7] FIG. 7 is a diagram illustrating an example of the error calculation process according to the embodiment. [Figure 8] FIG. 8 is a diagram illustrating another example of the error calculation process according to the embodiment. [Figure 9] FIG. 9 is a flow diagram showing the operation of the image processing device in the embodiment. [Figure 10] FIG. 10 is a diagram showing an example of an index for each threshold value displayed on the screen in step A8 shown in FIG. [Figure 11] FIG. 11 is a diagram showing an example of point cloud data displayed on a screen. [Figure 12] FIG. 12 is a block diagram illustrating an example of a computer that realizes the image processing device according to the embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] (Embodiment) Hereinafter, an image processing device, an image processing method, and a program according to an embodiment will be described with reference to FIGS.
[0016] [Device configuration] First, a schematic configuration of an image processing device in an embodiment will be described with reference to Fig. 1. Fig. 1 is a configuration diagram showing a schematic configuration of an image processing device in an embodiment.
[0017] The image processing device in the embodiment shown in Fig. 1 is a device that is useful when constructing a three-dimensional shape of an object from multiple images of the object. As shown in Fig. 1, the image processing device 10 includes an error calculation unit 11, a threshold setting unit 12, a state identification unit 13, and a state display unit 14.
[0018] When the three-dimensional coordinates of the object corresponding to each combination of corresponding feature points extracted from each of multiple images of the object have been calculated, the error calculation unit 11 calculates the error for the corresponding three-dimensional coordinates for each combination of feature points.
[0019] The threshold setting unit 12 identifies the maximum and minimum values from the errors calculated for each combination of feature points, and sets multiple thresholds between the minimum and maximum values. For each set threshold, the state identifying unit 13 identifies the state of the three-dimensional shape of the object when a combination of feature points with an error equal to or greater than the threshold is removed. The state display unit 14 displays the identified state for each threshold on the screen.
[0020] In this manner, in the embodiment, for each combination of feature points, an error in the corresponding 3D coordinates is calculated, and the state of the 3D shape of the object is displayed on the screen when the error threshold for removing the combination of feature points as being erroneous is changed stepwise. Therefore, when extracting corresponding combinations of feature points from multiple images to construct a 3D shape, the effect of an erroneous combination of feature points on the 3D shape is visualized.
[0021] Next, the configuration and functions of the image processing device in the embodiment will be specifically described with reference to Figures 2 to 8. Figure 2 is a configuration diagram specifically showing the configuration of the image processing device in the embodiment.
[0022] 2, in the embodiment, the image processing device 10 further includes an image acquisition unit 15, a feature point extraction unit 16, a three-dimensional coordinate calculation unit 17, a three-dimensional shape construction unit 18, and a data storage unit 19, in addition to the above-mentioned error calculation unit 11, threshold setting unit 12, state identification unit 13, and state display unit 14. In addition, a display device 20 is connected to the image processing device 10.
[0023] The image acquisition unit 15 acquires image data of each of a plurality of images in which a construction target of a three-dimensional shape is captured from an external device, such as an imaging device, a terminal device, or a storage device that holds image data. Fig. 3 is a diagram showing an example of a plurality of images to be processed in the embodiment. In the example of Fig. 3, a pair of images is illustrated, but the number of images to be processed in the embodiment is not particularly limited.
[0024] The feature point extraction unit 16 extracts a combination of corresponding feature points from each of a plurality of images of the object. Specifically, the feature point extraction unit 16 calculates, for example, SIFT features or SURF features for each image to identify feature points, and further extracts corresponding feature points between images as a combination of corresponding feature points. In the example of FIG. 3, since there are two images, the combination of feature points is a feature point pair. In FIG. 3, the circled portion is one of the feature points. In addition, the two images from which a combination of corresponding feature points has been extracted will be referred to as a "pair image" hereinafter.
[0025] The three-dimensional coordinate calculation unit 17 calculates, for each combination of feature points, a camera matrix for each of the feature points constituting each combination, and calculates the three-dimensional coordinates of the object corresponding to the feature points of each combination using the calculated camera matrix.
[0026] The calculation process of the three-dimensional coordinates by the three-dimensional coordinate calculation unit 17 will be specifically described with reference to Fig. 4 to Fig. 6. Fig. 4 is a diagram showing an example of a pair of images from which a combination of feature points has been extracted. Fig. 5 is a diagram showing an example of the three-dimensional coordinates and rotation matrix of the camera of the initial pair of images, which are determined from the camera matrix. Fig. 6 is a diagram showing an example of an image newly selected after the selection of the initial pair of images and a combination of feature points extracted from the image.
[0027] As shown in FIG. 4, the three-dimensional coordinate calculation unit 17 first selects an image 31 and an image 32 as a pair of images (initial pair of images). In this case, the feature points (m1 to m5) extracted from the image 31 correspond to the feature points (m'1 to m'5) extracted from the image 32. m1 and m'1, m2 and m'2, m3 and m'3, m4 and m'4, and m5 and m'5 are combinations of feature points (hereinafter also referred to as "feature point pairs"). In the example of FIG. 4, the image 31 is photographed by the camera 41, and the image 32 is photographed by the camera 42. In FIG. 4, M (M1 to M5) are three-dimensional coordinates on the object corresponding to each feature point.
[0028] Next, three-dimensional coordinate calculation unit 17 calculates camera matrix P of camera 41 that captured image 31 and camera matrix P' of camera 42 that captured image 32, using feature point pairs (m1 to m5, m'1 to m'5) extracted from each of the initial pair images. Furthermore, camera matrix P and camera matrix P' can be expressed by the following Equation 1 and Equation 2, respectively, assuming that the position of camera 41 is the origin.
[0029]
number
[0030]
number
[0031] In the above formula 1, I is the rotation matrix of the camera 41. As shown in FIG. 5, the position of the camera 41 is the origin, so I=(1,1,1). Also, in the above formula 2, R is the rotation matrix of the camera 42 (R=(R x ,R y ,R z )). As described above, t is a translation matrix, and corresponds to the three-dimensional coordinates of the position of the camera 42 (t=(t x ,t y ,t z )).
[0032] Therefore, in this case, R and t can be calculated by performing reverse calculations from the camera matrix P and the camera matrix P'. Specifically, the three-dimensional coordinate calculation unit 17 calculates R and t by solving the equations shown in the following formulas 3 to 5 using the coordinates of each feature point. In formulas 3 to 5, m is the coordinate on image A obtained by normalizing m (m1 to m5). Similarly, m' is the coordinate on image B obtained by normalizing m' (m'1 to m'5). E is an essential matrix, and K is a camera calibration matrix.
[0033]
number
[0034]
number
[0035]
number
[0036] The calibration matrix K can be calculated from the following equations 6 and 7. x , c y is the center coordinate of the camera.
[0037]
number
[0038]
number
[0039] Next, the three-dimensional coordinate calculation unit 17 calculates the three-dimensional coordinates M (M1 to M5) of the feature points by triangulation using the three-dimensional coordinates of the positions of the cameras and the rotation matrix.
[0040] 6, the three-dimensional coordinate calculation unit 17 newly selects one image 33 from among the images other than the initial pair images, which are images from which feature points have been extracted, and sets the newly selected image 33 and one of the initial pair images as a new pair image. The image 33 is captured by a camera 43.
[0041] Then, the three-dimensional coordinate calculation unit 17 identifies feature points (m''1 to m''3) of the image 33 that correspond to the feature points of the image 32, and sets the feature points of the image 32 and the feature points of the image 33 as feature point pairs. Then, the three-dimensional coordinate calculation unit 17 calculates a camera matrix Pn of the camera 43 that captured the image 33. The camera matrix Pn can be expressed by the following equation 8.
[0042]
number
[0043] Specifically, the three-dimensional coordinate calculation unit 17 calculates Rn and tn of the camera matrix Pn of the camera 43 by the PnP method using three-dimensional coordinates M1 to M3 corresponding to the two-dimensional coordinates in the image 33 of the identified feature points in the image 33.
[0044] The three-dimensional shape construction unit 18 constructs a three-dimensional shape of the object using the three-dimensional coordinates of each feature point calculated by the three-dimensional coordinate calculation unit 17. Specifically, the three-dimensional shape construction unit 18 constructs point cloud data consisting of a set of feature points existing at three-dimensional coordinates. The three-dimensional shape construction unit 18 also stores the three-dimensional coordinates of each feature point and the point cloud data in the data storage unit 19.
[0045] In the embodiment, the error calculation unit 11 first applies, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting each combination of feature points is extracted to the three-dimensional coordinates of each combination. This calculates, for each combination of feature points, two-dimensional coordinates obtained by projecting the three-dimensional coordinates of each combination onto an image from which one feature point is extracted. Then, for each combination of feature points, the error calculation unit 11 calculates, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates in the extraction source of one feature point.
[0046] The error calculation process by the error calculation unit 11 will be specifically described with reference to FIG. 7. FIG. 7 is a diagram for explaining an example of the error calculation process in the embodiment. The example of FIG. 7 shows an example of reprojecting one of the feature points on the image 32 shown in FIG. 4. Furthermore, in FIG. 7, the three-dimensional coordinates corresponding to the feature point, that is, the three-dimensional coordinates in the world coordinate system, are expressed as (X W ,Y W ,Z W ), and the two-dimensional coordinates of the position at the time of extracting the feature point are (x f ,y f ) and the coordinates of the feature points in the camera coordinate system are (X C ,Y C ,Z C )
[0047] First, the error calculation unit 11 calculates the camera matrix P' (=[R|t]) and the three-dimensional coordinates (X W ,Y W ,Z W ) and the coordinates of the feature points in the camera coordinate system (X C ,Y C ,Z C ) is calculated.
[0048]
number
[0049] Next, the error calculation unit 11 calculates the coordinates (X C ,Y C ,Z C ) is normalized.
[0050]
number
[0051] Next, the error calculation unit 11 calculates the coordinates normalized by the above equation 10 and the internal parameters of the camera (in the example of FIG. 7, the focal length f of the camera 42 and the coordinates of the image center position (c x ,c y ) and the following equation 11 are applied to obtain the two-dimensional coordinates (x p ,y p ) is calculated.
[0052]
number
[0053] Next, the error calculation unit 11 calculates the reprojected two-dimensional coordinate (x p ,y p ) and the two-dimensional coordinates of the position at the time of feature point extraction (x f ,y f ) is calculated as the error for the corresponding three-dimensional coordinates.
[0054]
number
[0055] In this manner, in the embodiment, the error is calculated by reprojecting the feature points onto the image. However, in the embodiment, the error calculation method is not limited to the reprojection method, and other methods such as a method using an epipolar line may be used.
[0056] Another example of the error calculation process by the error calculation unit 11 will be described with reference to FIG. 8. FIG. 8 is a diagram for explaining another example of the error calculation process in the embodiment. In FIG. 8, i and feature point p' iThe combination of is the object of error calculation. In FIG. 8, E indicates the epipolar plane, and O i indicates the center position of the camera in one image, and O' i indicates the center position of the camera of the other image. Furthermore, in Fig. 8, the parallelograms shown on the left and right indicate the frames of the images, respectively.
[0057] In the example of FIG. 8, the error calculation unit 11 calculates the feature point p i Then, the error calculation unit 11 calculates an epipolar line l'1 corresponding to the epipolar line l1 on which the feature point p' exists. i The distance between the feature point p and the corresponding three-dimensional coordinate is calculated as the error d. i and feature point p' i is the point in 3-dimensional space corresponding to e i and e' i indicate the intersection points of the corresponding epipolar lines with the epipolar plane E.
[0058]
number
[0059] In the above formula 13, F is a fundamental matrix (see reference). The fundamental matrix is calculated from the following formula 14. In the following formula 14, "x" is a two-dimensional point obtained by projecting point X in three-dimensional space onto one image. "x'" is a two-dimensional point obtained by projecting point X in three-dimensional space onto the other image. T is a transpose matrix.
[0060] References: Richard Hartley and Andrew Zisserman, “Multiple View Geometry in Computer Vision Second Edition”, Cambridge University Press, March 2004.
[0061]
number
[0062] In the embodiment, the threshold setting unit 12 first selects the maximum value d max and the minimum value d min Then, the threshold setting unit 12 determines the minimum value d min Above, maximum value d max Within the following range, n thresholds Th1, Th2, Th3, ..., Th n Set (Number 15).
[0063]
number
[0064] In the embodiment, the state identification unit 13 identifies the state of the three-dimensional shape of the object by calculating an index indicating the state of the point cloud data for each threshold value when a combination of feature points whose error is equal to or greater than the threshold value is removed.
[0065] Furthermore, the state specifying unit 13 can calculate, for each threshold value, at least one of the following (a) to (d) as an index. (a) Number of points constituting the point cloud data after removing combinations of feature points (b) Average error for combinations of feature points that were not removed (c) The ratio of the number of points in the point cloud data after removing the combination of feature points to the number of points in the point cloud data before removing the combination of feature points (hereinafter referred to as the "error ratio"). (d) The ratio of the average error after removing a combination of feature points to the average error before removing the combination (hereinafter referred to as the "remaining point group ratio").
[0066] In the embodiment, the status display unit 14 displays each threshold value and an index calculated for each threshold value on the screen of the display device 20. The status display unit 14 can also display the point cloud data constructed by the 3D shape construction unit 18 on the screen of the display device 20. When one of the multiple threshold values is selected, a portion of the point cloud data corresponding to the combination of feature points removed by the selected threshold value is identified, and the point cloud data is displayed together with an icon representing the identified portion.
[0067] When multiple thresholds are set by the threshold setting unit 12, the 3D shape construction unit 18 can also remove, for each threshold, the 3D coordinates of the combination of feature points whose error is equal to or greater than the threshold, and construct point cloud data of the object using the 3D coordinates that have not been removed. In this case, the status display unit 14 displays the thresholds and the corresponding point cloud data on the screen of the display device 20.
[0068] [Device operation] Next, the operation of the image processing device 10 in the embodiment will be described with reference to Fig. 9. Fig. 9 is a flow diagram showing the operation of the image processing device in the embodiment. In the following description, Figs. 1 to 8 will be referred to as appropriate. Also, in the first embodiment, an image processing method is implemented by operating the image processing device 10. Therefore, the description of the image processing method in the embodiment will be replaced with the following description of the operation of the image processing device 10.
[0069] As shown in FIG. 9, first, the image acquisition unit 15 acquires image data of each of a plurality of images including an object from, for example, an imaging device, a terminal device, a storage device that holds image data, or the like (step A1).
[0070] Next, the feature point extraction unit 16 extracts corresponding combinations of feature points from each of the image data acquired in step A1 (step A2).
[0071] Next, the three-dimensional coordinate calculation unit 17 calculates the camera matrix of each of the feature points constituting each combination of feature points extracted in step A2, and calculates the three-dimensional coordinates of the object corresponding to the feature points of each combination using the calculated camera matrix (step A3).
[0072] Next, the three-dimensional shape construction unit 18 uses the three-dimensional coordinates of each feature point calculated in step A3 to construct the three-dimensional shape of the object, specifically, point cloud data composed of a set of feature points existing in three-dimensional space (step A4).
[0073] Next, for each combination of feature points extracted in step A2, the error calculation unit 11 calculates an error for the three-dimensional coordinates calculated in step A3, for example, by reprojecting one of the feature points onto the image (step A5).
[0074] Next, the threshold setting unit 12 selects the maximum value d max and the minimum value d min Identify the minimum value d min Above, maximum value d max Within the following range, n thresholds Th1, Th2, Th3, ..., Th n (Step A6).
[0075] Next, for each threshold value set in step A6, the condition identification unit 13 calculates an index indicating the state of the point cloud data when a combination of feature points whose error is equal to or greater than the threshold value is removed, and thereby identifies the state of the three-dimensional shape of the object (step A7).
[0076] Next, the status display unit 14 displays the index calculated in step A7 for each threshold value set in step 6 on the screen of the display device 20 (step A8). After step A8 is executed, the processing in the image processing device 10 ends. FIG. 10 is a diagram showing an example of the index for each threshold value displayed on the screen in step A8 shown in FIG. 9. In addition, in step A8, the status display unit 14 can also display the point cloud data constructed in step A4 on the screen of the display device 20.
[0077] Furthermore, in step A8, the status display unit 14 can also accept the selection of any one of a plurality of thresholds. Then, when the user selects any one of the thresholds (thresholds marked with ● in FIG. 10), the status display unit 14 can identify a portion of the point cloud data corresponding to (a combination of) feature points removed by the selected threshold, as shown in FIG. 11, and display an icon representing the identified portion. FIG. 11 is a diagram showing an example of point cloud data displayed on a screen. In the example of FIG. 11, a star is used as the icon representing the identified portion.
[0078] [Effects of the embodiment] As described above, in the embodiment, multiple thresholds are set for errors in feature point combinations, an index showing the state of the point cloud data of the object is calculated for each threshold, and the index for each threshold is displayed on the screen. When the user selects one of the thresholds, the part of the point cloud data that will be deleted according to the selected threshold is displayed. In other words, according to the embodiment, when corresponding feature point combinations are extracted from multiple images to construct a three-dimensional shape, the effect of an erroneous feature point combination on the three-dimensional shape is visualized.
[0079] [program] An example of the program in the embodiment is a program that causes a computer to execute steps A1 to A8 shown in FIG. 9. By installing and executing this program in a computer, the image processing device and image processing method in the embodiment can be realized. In this case, the processor of the computer functions as an error calculation unit 11, a threshold setting unit 12, a state identification unit 13, a state display unit 14, an image acquisition unit 15, a feature point extraction unit 16, a three-dimensional coordinate calculation unit 17, and a three-dimensional shape construction unit 18, and performs processing. In the embodiment, the data storage unit 19 can be realized by a storage device such as a hard disk provided in the computer. Examples of the computer include a general-purpose PC, a smartphone, and a tablet terminal device.
[0080] The program in the embodiment may be executed by a computer system constructed by a plurality of computers. In this case, for example, each computer may function as any one of the error calculation unit 11, threshold setting unit 12, state identification unit 13, state display unit 14, image acquisition unit 15, feature point extraction unit 16, 3D coordinate calculation unit 17, and 3D shape construction unit 18.
[0081] [Physical configuration] Here, a computer that realizes the image processing device by executing the program in the embodiment will be described with reference to Fig. 12. Fig. 12 is a block diagram showing an example of a computer that realizes the image processing device in the embodiment.
[0082] 12, the computer 110 includes a CPU (Central Processing Unit) 111, a main memory 112, a storage device 113, an input interface 114, a display controller 115, a data reader / writer 116, and a communication interface 117. These components are connected to each other via a bus 121 so as to be able to communicate data with each other.
[0083] Furthermore, the computer 110 may include a GPU (Graphics Processing Unit) or an FPGA (Field-Programmable Gate Array) in addition to or instead of the CPU 111. In this embodiment, the GPU or FPGA can execute the programs in the embodiments.
[0084] The CPU 111 loads a program in the embodiment, which is composed of a group of codes and is stored in the storage device 113, into the main memory 112, and executes each code in a predetermined order to perform various calculations. The main memory 112 is typically a volatile storage device such as a DRAM (Dynamic Random Access Memory).
[0085] Moreover, the program in the embodiment is provided in a state stored in a computer-readable recording medium 120. The program in the embodiment may be distributed on the Internet connected via the communication interface 117.
[0086] Specific examples of the storage device 113 include a hard disk drive and a semiconductor storage device such as a flash memory. The input interface 114 mediates data transmission between the CPU 111 and input devices 118 such as a keyboard and a mouse. The display controller 115 is connected to a display device 119 and controls the display on the display device 119.
[0087] Data reader / writer 116 mediates data transmission between CPU 111 and recording medium 120, reads programs from recording medium 120, and writes processing results in computer 110 to recording medium 120. Communication interface 117 mediates data transmission between CPU 111 and other computers.
[0088] Specific examples of the recording medium 120 include general-purpose semiconductor storage devices such as CF (Compact Flash (registered trademark)) and SD (Secure Digital), magnetic recording media such as a flexible disk, or optical recording media such as a CD-ROM (Compact Disk Read Only Memory).
[0089] The image processing device 10 in the embodiment can be realized by using hardware (e.g., circuits) corresponding to each part, instead of a computer with a program installed. Furthermore, the image processing device 10 may be partially realized by a program and the remaining part by hardware.
[0090] A part or all of the above-described embodiment can be expressed by (Additional Notes 1) to (Additional Notes 18) described below, but is not limited to the following descriptions.
[0091] (Appendix 1) an error calculation unit that, when three-dimensional coordinates of a corresponding object are calculated for each combination of corresponding feature points extracted from each of a plurality of images of the object, calculates an error for the corresponding three-dimensional coordinates for each combination of feature points; a threshold setting unit that identifies a maximum value and a minimum value from the errors calculated for each combination of the feature points, and sets a plurality of thresholds between the minimum value and the maximum value; a state specifying unit that specifies a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; a status display unit that displays the identified status for each of the plurality of thresholds on a screen; Equipped with 13. An image processing device comprising:
[0092] (Appendix 2) 2. The image processing device according to claim 1, The error calculation unit, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; 13. An image processing device comprising:
[0093] (Appendix 3) 3. The image processing device according to claim 1, a feature point extraction unit that extracts a combination of corresponding feature points from each of the plurality of images of the object; a three-dimensional coordinate calculation unit that calculates, for each combination of the feature points, a camera matrix for each of the feature points constituting the combination, and calculates three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrix; a three-dimensional shape constructing unit that constructs a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; The device further comprises: 13. An image processing device comprising:
[0094] (Appendix 4) 4. The image processing device according to claim 3, the three-dimensional shape construction unit constructs point cloud data composed of a set of points existing at the three-dimensional coordinates as the three-dimensional shape of the object; the state specifying unit specifies a state of the three-dimensional shape of the object by calculating an index indicating a state of the point cloud data when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; the status display unit displays the calculated index for each of the plurality of thresholds. 13. An image processing device comprising:
[0095] (Appendix 5) 5. The image processing device according to claim 4, The state specifying unit specifies, as the index, for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; 13. An image processing device comprising:
[0096] (Appendix 6) 6. The image processing device according to claim 4, when one of the plurality of thresholds is selected, the status display unit identifies a portion in the point cloud data corresponding to a combination of the feature points to be removed by the selected threshold, and displays the point cloud data and an icon representing the identified portion. 13. An image processing device comprising:
[0097] (Appendix 7) an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than each of the plurality of thresholds is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; having 13. An image processing method comprising:
[0098] (Appendix 8) 8. The image processing method according to claim 7, further comprising: In the error calculation step, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; 13. An image processing method comprising:
[0099] (Appendix 9) 9. The image processing method according to claim 7 or 8, a feature point extraction step of extracting a combination of corresponding feature points from each of the plurality of images of the object; a three-dimensional coordinate calculation step of calculating, for each combination of feature points, a camera matrix for each of the feature points constituting the combination, and calculating three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrices; a three-dimensional shape construction step of constructing a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; Further comprising 13. An image processing method comprising:
[0100] (Appendix 10) 10. The image processing method according to claim 9, further comprising: In the three-dimensional shape construction step, point cloud data composed of a set of points existing at the three-dimensional coordinates is constructed as the three-dimensional shape of the object; In the state identifying step, a state of the three-dimensional shape of the object is identified by calculating an index indicating a state of the point cloud data when a combination of the feature points having an error equal to or greater than each of the thresholds is removed for each of the plurality of thresholds; In the state display step, the calculated index is displayed for each of the plurality of thresholds. 13. An image processing method comprising:
[0101] (Appendix 11) 11. The image processing method according to claim 10, further comprising: In the state specifying step, the index is set for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; 13. An image processing method comprising:
[0102] (Appendix 12) 12. The image processing method according to claim 10, further comprising: In the state display step, when one of the plurality of thresholds is selected, a portion of the point cloud data corresponding to the combination of the feature points to be removed by the selected threshold is identified, and the point cloud data is displayed, and an icon representing the identified portion is also displayed. 13. An image processing method comprising:
[0103] (Appendix 13) On the computer, an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than each of the plurality of thresholds is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; A program to execute.
[0104] (Appendix 14) 14. The program of claim 13, In the error calculation step, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; A program characterized by:
[0105] (Appendix 15) 15. The program according to claim 13 or 14, The computer includes: a feature point extraction step of extracting a combination of corresponding feature points from each of the plurality of images of the object; a three-dimensional coordinate calculation step of calculating, for each combination of feature points, a camera matrix for each of the feature points constituting the combination, and calculating three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrices; a three-dimensional shape construction step of constructing a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; Further execute A program characterized by:
[0106] (Appendix 16) 16. The program of claim 15, In the three-dimensional shape construction step, point cloud data composed of a set of points existing at the three-dimensional coordinates is constructed as the three-dimensional shape of the object; In the state identifying step, a state of the three-dimensional shape of the object is identified by calculating an index indicating a state of the point cloud data when a combination of the feature points having an error equal to or greater than each of the thresholds is removed for each of the plurality of thresholds; In the state display step, the calculated index is displayed for each of the plurality of thresholds. A program characterized by:
[0107] (Appendix 17) 17. The program of claim 16, In the state specifying step, the index is set for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; A program characterized by:
[0108] (Appendix 18) 18. The program according to claim 16 or 17, In the state display step, when one of the plurality of thresholds is selected, a portion of the point cloud data corresponding to the combination of the feature points to be removed by the selected threshold is identified, and the point cloud data is displayed, and an icon representing the identified portion is also displayed. A program characterized by: [Industrial Applicability]
[0109] As described above, according to the present invention, when extracting combinations of corresponding feature points from multiple images to construct a 3D shape, it is possible to visualize the effect of an erroneous combination of feature points on the 3D shape. The present invention is useful for technology such as SfM that constructs a 3D shape from multiple images. [Explanation of symbols]
[0110] 10 Image processing device 11 Error calculation section 12 Threshold setting section 13. Status Identification Unit 14 Status display section 15 Image acquisition section 16 Feature point extraction section 17 3D coordinate calculation section 18 3D shape construction section 19 Data storage section 20 Display device 110 Computer 111 CPU 112 Main memory 113 Storage device 114 Input Interface 115 Display Controller 116 Data Reader / Writer 117 Communication Interface 118 Input Devices 119 Display device 120 Recording media 121 Bus
Claims
1. an error calculation unit that, when three-dimensional coordinates of a corresponding object are calculated for each combination of corresponding feature points extracted from each of a plurality of images of the object, calculates an error for the corresponding three-dimensional coordinates for each combination of feature points; a threshold setting unit that identifies a maximum value and a minimum value from the errors calculated for each combination of the feature points, and sets a plurality of thresholds between the minimum value and the maximum value; a state specifying unit that specifies a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; a status display unit that displays the identified status for each of the plurality of thresholds on a screen; Equipped with 13. An image processing device comprising:
2. 2. The image processing device according to claim 1, The error calculation unit, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; 13. An image processing device comprising:
3. 3. The image processing device according to claim 1, a feature point extraction unit that extracts a combination of corresponding feature points from each of the plurality of images of the object; a three-dimensional coordinate calculation unit that calculates, for each combination of the feature points, a camera matrix for each of the feature points constituting the combination, and calculates three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrix; a three-dimensional shape constructing unit that constructs a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; The device further comprises:
13. An image processing device comprising:
4. 4. The image processing device according to claim 3, the three-dimensional shape construction unit constructs point cloud data composed of a set of points existing at the three-dimensional coordinates as the three-dimensional shape of the object; the state specifying unit specifies a state of the three-dimensional shape of the object by calculating an index indicating a state of the point cloud data when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; the status display unit displays the calculated index for each of the plurality of thresholds.
13. An image processing device comprising:
5. 5. The image processing device according to claim 4, The state specifying unit specifies, as the index, for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; 13. An image processing device comprising:
6. 6. The image processing device according to claim 4, when one of the plurality of thresholds is selected, the status display unit identifies a portion on the point cloud data corresponding to a combination of the feature points to be removed by the selected threshold, and displays the point cloud data and an icon representing the identified portion.
13. An image processing device comprising:
7. an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; having 13. An image processing method comprising:
8. 8. The image processing method according to claim 7, In the error calculation step, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; 13. An image processing method comprising:
9. 9. The image processing method according to claim 7 or 8, a feature point extraction step of extracting a combination of corresponding feature points from each of a plurality of images of the object; a three-dimensional coordinate calculation step of calculating, for each combination of the feature points, a camera matrix for each of the feature points constituting the combination, and calculating three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrices; a three-dimensional shape construction step of constructing a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; Further comprising 13. An image processing method comprising:
10. 10. The image processing method according to claim 9, In the three-dimensional shape construction step, point cloud data composed of a set of points existing at the three-dimensional coordinates is constructed as the three-dimensional shape of the object; In the state identifying step, an index indicating a state of the point cloud data is calculated for each of a plurality of thresholds when a combination of the feature points having an error equal to or greater than the threshold is removed, thereby identifying a state of the three-dimensional shape of the object; In the state display step, the calculated index is displayed for each of the plurality of thresholds.
13. An image processing method comprising:
11. 11. The image processing method according to claim 10, In the state specifying step, the index is set for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; 13. An image processing method comprising:
12. 12. The image processing method according to claim 10, further comprising the steps of: In the state display step, when one of the plurality of thresholds is selected, a portion of the point cloud data corresponding to the combination of the feature points to be removed by the selected threshold is identified, and the point cloud data is displayed, and an icon representing the identified portion is also displayed.
13. An image processing method comprising:
13. On the computer, an error calculation step of calculating an error in the corresponding three-dimensional coordinates of an object for each combination of corresponding feature points extracted from each of a plurality of images of the object when the corresponding three-dimensional coordinates of the object have been calculated for the combination of the feature points; a threshold setting step of identifying a maximum value and a minimum value from the errors calculated for each combination of feature points, and setting a plurality of threshold values between the minimum value and the maximum value; a state specifying step of specifying a state of the three-dimensional shape of the object when a combination of the feature points having an error equal to or greater than a corresponding threshold is removed for each of the plurality of thresholds; a state display step of displaying the identified state on a screen for each of the plurality of thresholds; A program to execute.
14. The program according to claim 13, In the error calculation step, calculating, for each combination of feature points, a camera matrix corresponding to an image from which one feature point constituting the combination of feature points is extracted, to the three-dimensional coordinates of the combination, thereby calculating two-dimensional coordinates when the three-dimensional coordinates of the combination are projected onto the image from which the one feature point is extracted, and calculating, as an error, a difference between the calculated two-dimensional coordinates and the two-dimensional coordinates of the one feature point; A program characterized by:
15. 15. The program according to claim 13 or 14, The computer includes: a feature point extraction step of extracting a combination of corresponding feature points from each of a plurality of images of the object; a three-dimensional coordinate calculation step of calculating, for each combination of the feature points, a camera matrix for each of the feature points constituting the combination, and calculating three-dimensional coordinates of the object corresponding to the feature points of the combination using the calculated camera matrices; a three-dimensional shape construction step of constructing a three-dimensional shape of the object using the three-dimensional coordinates calculated for each combination of the feature points; Further execute A program characterized by:
16. The program according to claim 15, In the three-dimensional shape construction step, point cloud data composed of a set of points existing at the three-dimensional coordinates is constructed as the three-dimensional shape of the object; In the state identifying step, an index indicating a state of the point cloud data is calculated for each of a plurality of thresholds when a combination of the feature points having an error equal to or greater than the threshold is removed, thereby identifying a state of the three-dimensional shape of the object; In the state display step, the calculated index is displayed for each of the plurality of thresholds. A program characterized by:
17. The program according to claim 16, In the state specifying step, the index is set for each of the plurality of thresholds, calculating at least one of the number of points constituting the point cloud data after the removal of the combination of feature points, an average error in the combination of feature points that was not removed, a ratio between the number of points in the point cloud data after the removal of the combination of feature points and the number of points in the point cloud data before the removal, and a ratio between the average error after the removal of the combination of feature points and the average error before the removal; A program characterized by:
18. 18. The program according to claim 16 or 17, In the state display step, when one of the plurality of thresholds is selected, a portion of the point cloud data corresponding to the combination of the feature points to be removed by the selected threshold is identified, and the point cloud data is displayed, and an icon representing the identified portion is also displayed. A program characterized by:
Citation Information
Patent Citations
Device for sorting transferred pieces
JP1978011465A
Distance measurement device and distance measurement method
JP2016136112A
Image processor, image processing method and program
JP2017130049A
Surveying device, surveying method, and program
JP2020041950A
Image processing device, image processing method, and computer-readable recording medium
WO2019065784A1
