This application claims the benefit under 35 U.S.C. § 119(a)-(d) of United Kingdom Patent Application No. GB2217946.9, filed on Nov. 29, 2022, and entitled “Spatial calibration method”. The above cited patent application is incorporated herein by reference in its entirety.
The present disclosure relates generally to image processing systems and, more particularly, to methods and devices for spatially calibrating an image against another image.
The deployment of camera-based surveillance systems has rapidly increased over the past decades to maximize safety and security. The large-scale deployment of camera-based surveillance systems has become possible thanks to a wide variety of technologies, related to both hardware and software aspects, making their deployment, management and monitoring efficient and cost-effective.
The use of camera-based surveillance systems has evolved from the simple task of detecting objects in a monitored area to more advanced applications concerned with the static and/or dynamic behaviors of the detected objects. Accurate metric information related to the detected objects is required to infer such behaviors. Examples of metric information of the detected objects include their dimensions and their kinematics, such as the position and the velocity, relatively to a global frame of reference, i.e., a frame of reference that is not attached to any of the surveillance cameras.
One known solution to determine metric information of objects appearing in an image relatively to a given frame of reference consists in making use of another image that is expressed in the given frame of reference, provided the existence of an overlapping area covered by the two images. In this case, a spatial calibration between the two images is performed, starting by establishing correspondences between specific points of the overlapping area in the two images. Then, a projection model between the two images is inferred based on pairs of corresponding points by solving for example a minimization problem. The inferred projection model may then be applied to each point of the image where the objects appear in order to get its position relatively to the given frame of reference, allowing the extraction of metric information.
Despite its feasibility in real scenarios, the performance of this solution is strongly dependent on several factors including, without limitation, the geometric features of the overlapping area and the quality of each of the two images. For example, when the extent of the overlapping area is narrow and/or when the two images are taken according to two different sets of capture parameters, including a field of view and a line of sight, the selection of the specific points, as well as their matching, cannot be achieved accurately. Furthermore, this inaccuracy may be increased if the quality of one or both of the two images is degraded because, for example, of weather conditions, such as rain or fog. Also, the technique used to carry out the selection and/or the matching of the specific points may have limitations or impairments susceptible to further increase the inaccuracy. These factors and others result in an approximate projection model that is unable to provide accurate metric information.
Thus, there is a need for an improved spatial calibration between two images that overcomes the limitations of the prior art.
In accordance with a first aspect of the present disclosure, there is provided a method for spatial calibration of a first image against a second image, the method comprising:
Accordingly, the method of spatial calibration allows an efficient and precise spatial calibration between two images despite the inaccuracy that occurs when selecting points of interest on the two images. This is achieved by exploring for one or more points of interest some or all of its direct and distant neighbors on the corresponding image.
In some embodiments, an iteration of the determining may comprise determining a projection model candidate using multiple pairs of points of interest as obtained at the obtaining step without displacing any position of one of their points of interest.
In some embodiments, the iterated steps of determining a projection model candidate and evaluating its associated reprojection error may be repeated for different sets of positions of the plurality of points of interest of one of the first or second images until a completion condition is fulfilled.
In some embodiments, for at least one point of interest, a set of positions may be explored, the set of positions comprises an initial position of the point of interest as obtained and one or more other positions resulting from displacing the position of the point of interest according to a displacement policy.
In some embodiments, the displacement policy may define a search area relatively to a reference position and one or more displacement lengths.
In some embodiments, the set of explored positions may be the positions reachable using the one or more displacement lengths within the search area where the reference position is the initial position.
In some embodiments, the set of explored positions may be the positions reachable using the one or more displacement lengths within a plurality of search areas determined iteratively, the reference position of an initial search area is the initial position and the reference position of a following search area is the position explored in a previous search area for which the corresponding reprojection error is the lowest or below a threshold.
In some embodiments, the method may further comprise selecting an enhanced position among the set of explored positions for a point of interest for which the corresponding reprojection error is the lowest or below a threshold.
Accordingly, using a displacement policy to manage the displacements of a point of interest allows the point of interest to approach its target position within a few displacements, which requires reduced resources in terms of storage and processing for its implementation.
In some embodiments, the method may further comprise, if the enhanced position is equal to the reference position for the point of interest:
In some embodiments, updating the displacement policy may comprise reducing the one or more displacement lengths and narrowing the search area.
Accordingly, by updating the displacement policy in a spirit of refinement, it is possible to significantly reduce the reprojection error, as the points of interest are brought closer to their respective target positions, with respect to a scenario where the displacement policy is not updated.
In some embodiments, the completion condition may be fulfilled if one of the following conditions is fulfilled:
In some embodiments, the completion condition may be fulfilled if enhanced positions for all points of interest are equal to their corresponding reference positions.
In some embodiments, a projection model candidate may be determined by solving an optimization problem using the multiple pairs of points of interest.
In some embodiments, the projection model may be chosen as the projection model candidate associated with the lowest evaluated reprojection error.
In accordance with a second aspect of the present disclosure, there is provided a processing device configured to perform the method according to any aspect or embodiment described above.
Any feature in one aspect of the present disclosure may be applied to other aspects of the present disclosure, in any appropriate combination. In particular, method aspects may be applied to apparatus/device/unit aspects, and vice versa.
Furthermore, features implemented in hardware may be implemented in software, and vice versa. Any reference to software and hardware features herein should be construed accordingly. For example, in accordance with other aspects of the present disclosure, there are provided a computer program comprising instructions which, when the program is executed by a processing unit, cause the processing unit to carry out the method of any aspect or example described above and a computer readable storage medium carrying the computer program.
Embodiments of the present disclosure will now be described, by way of example only, and with reference to the following drawings in which:
Embodiments of the present disclosure provide methods for spatial calibration of a first image against a second image, the two images covering at least partially a same scene, also referred to as common scene. Before applying such methods, each of the two images is expressed in an associated frame of reference, which means that the position of a point of one of the two images can be expressed by a set of coordinates in the frame of reference associated with the corresponding image. The objective of the spatial calibration is to provide a projection model between the first and second images allowing to express each point of one of the two images relatively to the frame of reference associated with the other image.
According to some embodiments of the present disclosure, the first image is an uncalibrated image, whereas the second image is a calibrated image. The methods according to these embodiments thus concern the spatial calibration of an uncalibrated image against a calibrated image. The positions of the points of an uncalibrated image and the distances between them can only be expressed in terms of pixels in a frame of reference associated with the uncalibrated image. On the other hand, the calibrated image is expressed in an associated frame of reference which is not necessarily attached to the calibrated image. In such a scenario, the spatial calibration is required in order to express the position of each point of the uncalibrated 20 image in the frame of reference in which the calibrated image is expressed.
According to other embodiments of the present disclosure, the first image is captured using an imaging device whose parameters are unknown. The methods according to these embodiments may be adapted to perform a camera resectioning process, also referred to as camera calibration process. Such a process aims at estimating the parameters, e.g., extrinsic and intrinsic parameters, of the imaging device used to capture the first image relatively to the frame of reference in which the second image is expressed. The camera calibration process is described in more detail below with reference to
Methods according to various embodiments of the present disclosure may be implemented in imaging systems used in a wide variety of applications. Exemplary applications comprise, without limitation, intelligent transport systems (ITS), aerospace and avionics, medical imaging, closed-circuit television (CCTV).
In the exemplary implementation of the present disclosure in an ITS, images of roads and surroundings of the ITS may be spatially calibrated relatively to a world frame of reference in order to determine the kinematics of each object appearing in the taken images. This is useful to predict and/or to detect hazardous situations, and alert the ITS users thereof.
In the exemplary implementation of the present disclosure in aerospace and avionics, images taken by a spacecraft may be spatially calibrated relatively to a world frame of reference in order to allow an accurate positioning of the spacecraft. This is particularly important in case of autonomous navigation.
For illustration purposes only, the following description of certain embodiments of the present disclosure will be made with reference to ITS applications. However, the skilled person will readily understand that the various embodiments of the present disclosure may be applied to various other applications.
For example, each of the first and second images may be a digital image that comprises a two-dimensional (2D) arrangement of pixels. Such a 2D arrangement of pixels may either be regular or irregular. Further, each of the pixels may comprise one or more components. For example, each of the pixels of a colored image may comprise three or more components corresponding to different colors, e.g., red, green and blue. In the case of a panchromatic or an infrared image, each pixel may comprise only one component.
In addition, each of the first and second images is taken in a way to capture the common scene according to a set of capture parameters. Examples of capture parameters include, without limitation, the field of view and the line of sight. The set of capture parameters according to which the first image is taken may be different from those according to which the second image is taken. Of course, the common scene may only be a part of each of the first and second images.
As mentioned above, each of the first and second images is expressed in an associated frame of reference. Each of the two frames of reference may be represented by a variety of coordinate systems, each of them specifying differently how to identify a point in the associated frame of reference. One type of coordinate system is a Cartesian coordinate system having three perpendicular axes x, y, and z. Another type of coordinate system is a spherical coordinate system. In the context of global positioning, an example of a global coordinate system is the WGS 84 (World Geodetic System 1984) used in GPS (Global Positioning System) as its reference coordinate system to express the coordinates of any point on or near the Earth surface as latitude, longitude and altitude. Another example of a global coordinate system is the UTM (Universal Transverse Mercator) that is based on dividing the Earth surface into zones and projecting each zone onto a plane.
Advantageously, the common scene may be chosen in a way to comprise one or more static objects, i.e., objects which are permanently stationary or present in the common scene. Such a criterion guarantees, if the first and second images are taken at different times, the appearance of the static objects in the two images. In the example of an ITS, the common scene may comprise, as static objects, multiple road surface markings used on paved roadways to provide guidance and information to drivers and pedestrians. The road surface markings may be of various geometric shapes and may include, without limitation, dashed lines, through and turn lane-use arrows, triangles, and pedestrian crossings. In the example of an ITS, static objects may also comprise, without limitation, curb borders, pedestrian or cyclist lane separation, traffic line, and road signal poles. Advantageously, one or more of the static objects may have at least one vertex.
In some embodiments, one of the two images involved in the spatial calibration may be supplied to a processing device implementing the spatial calibration method directly after being taken by an imaging device or may temporarily be stored in a volatile or non-volatile memory medium after being taken by the imaging device. In the latter case, the processing device may be configured to access the memory medium in order to obtain the taken image. An example of a first image involved in the spatial calibration is shown in
In other embodiments, one of the two images involved in the spatial calibration may be supplied to the processing device implementing the spatial calibration method by an external database server storing high-resolution images. The stored high-resolution images may be aerial images of type “top-down”, i.e., bird's-eye view, and may be taken using aircrafts or satellites. Alternatively, the stored high-resolution images may be taken using stationary or mobile terrestrial imaging devices. An example of a second image involved in the spatial calibration is shown in
In step S210, multiple pairs of points of interest are obtained, each pair matching a point of interest on the first image 10 to a corresponding point of interest on the second image 20. Advantageously, step S210 may comprise a first sub-step consisting in selecting multiple points of interest on each of the first and second images, and a second sub-step consisting in matching the selected points of interest, thus obtaining the multiple pairs of points of interest.
For example, a point of interest may be selected, in the first sub-step of step S210, in a way to correspond to an object 11 of the common scene, i.e., an object 11 appearing in the first and second images. More precisely, depending on the shape of the corresponding object 11, a point of interest may correspond, without limitation, to a vertex or to the center of the corresponding object 11. When selecting a point of interest on an image, an initial position for the point of interest is determined by a set of coordinates in the frame of reference in which the image is expressed. In
As illustrated in the zoomed-in area of
In some embodiments, step S210 may be performed manually by providing an operator with two adjacent screens displaying respectively the first and second images. The operator may also be provided with means to select points of interest on the displayed images, and to match the selected points of interest, thus obtaining the multiple pairs of points of interest.
In other embodiments, step S210 may be performed in a fully automatic manner using one or more (deep) machine learning algorithms or one or more image analysis algorithms, or a combination of one or more of these algorithms. For example, a single machine learning algorithm or image analysis algorithm may be used to perform the two sub-steps of step S210. Alternatively, each of the two sub-steps of step S210 may be performed using a different machine learning algorithm or image analysis algorithm. Examples of machine learning algorithms comprise, without limitation, artificial neural networks. In such embodiments, a machine learning algorithm may first be trained using a set of images that may either be real or computer generated.
In further embodiments, step S210 may be performed according to a hybrid approach combining a manual implementation of one of the two sub-steps described above and an automatic implementation of the other sub-step.
In step S220, a projection model between the first and second images is determined iteratively using pairs of points of interest obtained in step S210. The projection model may be represented by a matrix of real or complex-valued elements whose dimensions, denoted M, N respectively, are constant. The value of an element of the matrix representing the projection model is, however, liable to change after each iteration performed in step S220. As stated above, the projection model may be used to express the position of each point of one of the two images in the frame of reference in which the other image is expressed. Consequently, the dimensions of the matrix representing the projection model, M and N, may depend on the number of coordinates required to express the position of a point in each of the two frames of reference.
In step S310, the position of a point of interest 12 from the obtained pairs is displaced with respect to the initial position 61 of the point of interest 12. This displacement may be performed according to a displacement direction and a displacement length which may both be chosen arbitrarily. Preferably, the position to which the point of interest 12 is displaced may be chosen in a way to not coincide with a position previously tested for the same point of interest 12.
In step S320, a projection model candidate is determined using multiple pairs of points of interest including the point of interest 12 whose position is displaced in step S310 of the current iteration of the loop L301 represented by steps S310 to S340. The used multiple pairs are also referred to as “calibration pairs” and may correspond to some or all of the pairs obtained in step S210. The projection model candidate may be determined, using the calibration pairs, by solving a minimization problem defined by a cost function and an optimization algorithm. The cost function may represent a quadratic sum of individual errors, each individual error being associated with one of the calibration pairs and measuring the distance between a point of interest 12 of the associated pair and the projection, using the current projection model, of the other point of interest 12 of the associated pair. Further, the optimization algorithm may terminate after a finite number of steps or until it converges closely enough to a solution. Examples of algorithms that terminate after a finite number of steps include, without limitation, simplex algorithm and quantum optimization algorithm. Examples of algorithms that converge to a solution include, without limitation, Newton's method and Gradient descent method. When solving a minimization problem as described above, the projection model candidate is the one associated with the minimum value of the cost function.
In some embodiments, when determining a projection model candidate in step S320, the points of interest of the calibration pairs, excepting the one whose position is displaced in step S310 of the current iteration of the loop L301, are placed at their initial positions 61 as provided in step S210.
In other embodiments, when determining a projection model candidate in step S320, a given point of interest 12 of the calibration pairs, which is different from the one whose position is displaced in step S310 of the current iteration of the loop L301, is placed at a position different from the corresponding initial position 61. This may only be allowed if one or more iterations of the loop L301 had been triggered with respect to the given point of interest 12, i.e., if one or more positions had been tested or explored for the given point of interest 12.
In step S330, a reprojection error between the positions of points of interest of one of the two images, as projected using the projection model candidate on the other image, and the corresponding points of interest is evaluated. The reprojection error may be evaluated, without limitation, using multiple pairs, also referred to as “projection pairs”. The projection pairs may correspond, without limitation, to the calibration pairs used to determine the projection model candidate or to all the pairs obtained in step S210. For example, the reprojection error may be evaluated as the quadratic sum of individual errors, each individual error being associated with one of the projection pairs and measuring the distance between a point of interest 12 of the associated pair and the projection, using the projection model candidate, of the other point of interest 12 of the associated pair. One advantage of using the calibration pairs as projection pairs when evaluating the reprojection error is that the latter may already be calculated when determining the corresponding projection model candidate (step S320). Since reprojection errors evaluated at different iterations of the loop L301 may be compared to each other, it is preferable to keep the same projection pairs to evaluate each of the reprojection errors and/or to normalize each evaluated reprojection error by the corresponding number of projection pairs.
In step S340, a test is conducted by checking whether a completion condition is fulfilled. If the completion condition is fulfilled, the loop L301 is interrupted (algorithm terminated) and step S350 is then executed. Otherwise, a new iteration of the loop L301 is triggered. Examples of the completion condition include, without limitation, the lastly evaluated reprojection error is below a certain reprojection error threshold, the number of iterations of the loop L301 reaches a certain number of iterations threshold, at least one point of interest 12 of the obtained plurality of pairs of step S210 is tested at least once by displacing its position, all positions of a given search area are explored (tested) for each point of interest 12, all sets of positions defined for the points of interest 12 are explored, etc. Of course, the completion condition may be expressed as a combination of multiple elementary conditions, such as those listed above.
In some embodiments, a new iteration of the loop L301 is triggered with respect to a point of interest 12 different from the one tested in the current implementation of such a loop. A point of interest 12 tested in an implementation of the loop L301, or with respect to which an iteration of the loop L301 is triggered, is the one whose position is displaced in step S310 of the considered loop L301.
In other embodiments, a new iteration of the loop L301 is triggered with respect to a point of interest 12 different from the one tested in the current implementation of such a loop, only if an end of exploration condition is fulfilled. For example, the end of exploration condition may be related to the number of iterations of the loop L301 triggered with respect to the same point of interest 12 and/or to the lastly evaluated reprojection error.
In step S350, a projection model is determined by choosing a projection model candidate based on the evaluated reprojection errors associated with the already determined projection model candidates. For example and without limitation, the projection model may be chosen in a way to correspond to the determined projection model candidate that is associated with the lowest evaluated reprojection error.
Referring back to
In some embodiments, at least one iteration of the loop L301 is performed so as to determine a projection model candidate corresponding to a configuration where each point of interest 12 of the calibration pairs is placed at its initial position 61 as provided in step S210.
In other embodiments, the loop L301 may be repeated for different sets of positions of the points of interest of one or more calibration pairs until the fulfillment of the completion condition. This may be achieved in step S320 of the multiple iterations of the loop L301 by considering different positions for a same point of interest 12 or for several points of interest of the one or more calibration pair. Such a same point of interest 12 of the one or more calibration pairs may be the one whose position is displaced in step S310 of each iteration of the loop L301.
The imaging device 41 may be placed in a hard-to-reach location, for security reasons and/or for a wider field of view, for example. This makes it difficult to directly access the imaging device 41 in order to obtain its parameters. More generally, the parameters of the imaging device 41, such as its location, are assumed to be unknown. This means that the position of a point of any taken image can only be expressed in terms of pixels in a frame of reference 44c attached to the screen 42 on which the taken image is shown.
The processing device 43 is configured to receive a first image 10 taken by means of the imaging device 41, and to receive a second image 20, by accessing an external database for example, covering a same captured scene as the first image 10. The second image 20 is expressed in an associated frame of reference 44a that may be a global frame of reference, such as the World Geodetic System (WGS) used in satellite navigation. Further, the processing device 43 is configured to implement the spatial calibration method based on a plurality of pairs of points of interest obtained from the first and second images.
The projection model obtained when applying the spatial calibration method to the first and second images may be used to estimate the parameters of the imaging device 41 used to take the first image 10 relatively to the frame of reference in which the second image 20 is expressed. This makes it possible to simply and remotely monitor the imaging device 41, spatially calibrating any other image taken by the imaging device 41 subsequent to the adjustment of any of its parameters, e.g., the field of view, etc. As mentioned above, the process of estimating the parameters of an imaging device 41 is also referred to as “camera resectioning” or “camera calibration”.
In order to estimate the parameters of the imaging device 41 used to take the first image 10 relatively to the frame of reference associated with the second image 20, the projection model returned by the spatial calibration method is designed to be represented by a real-valued (3×4) projection matrix [M] derived from a matrix of extrinsic parameters [T] and a matrix of intrinsic parameters [K], according to following expression:
s.{x}=[K][T]{X
W
}=[M]{X
W}
{XW}={XW,YW,ZW,1}T represents the homogeneous 3D coordinates of a point P of the captured scene as expressed in the frame of reference 44a associated with the second image 20, {xs}={xs,ys, 1}T represents the homogenous 2D coordinates of the projection of the point P on the first image 10 as expressed in the frame of reference 44c associated with the first image 10, s is an arbitrary scaling factor, [T] and [K] are respectively given by:
[T] is a 4-order matrix which may be decomposed into a rotation matrix [R] (parametrized, for example, by three angles of rotation) and a translation vector {t} (defined by three translation components). These six parameters (three angles of rotation and three translation components) are also referred to as extrinsic parameters and define the position of the imaging device 41 in the frame of reference 44a associated with the second image 20. [K] is a real-valued (3×4) matrix involving five intrinsic parameters of the imaging device 41: the horizontal (fx) and vertical (fy) focal lengths in pixels, the position of the optical center in pixels (cx,cy), and the skew coefficient γ which is non-zero if the first image 10 axes are not perpendicular.
The projection matrix [M] may either be expressed implicitly as a (3×4) matrix containing 12 terms, or explicitly, via the 11 independent extrinsic and intrinsic parameters presented above.
Advantageously, the projection model returned by the spatial calibration method may also be designed to further include distortions caused by imperfections in the optical part of the imaging device 41. Such distortions may include, without limitation, radial and tangential lens distortions.
In step S510, an unexplored position for the point of interest 12 is determined on the corresponding image according to the displacement policy. An unexplored position stands for a position at which the point of interest 12 has not yet been placed. More precisely, the unexplored position is determined with respect to the reference position of the point of interest 12 along a displacement direction and according to a displacement length, which are both specified by the displacement policy.
In step S520, a projection model candidate is determined using a set of calibration pairs including the point of interest 12 to which the elementary procedure is applied, such a point of interest 12 being placed at the unexplored position determined in step S510 of the current iteration of the loop L501. As explained above with reference to step S320, a projection model candidate may be determined, giving the calibration pairs, by solving a minimization problem defined by a cost function and an optimization algorithm. For example, the same set of calibration pairs and/or the same minimization problem may be used in each iteration of the loop L501.
In step S530, a reprojection error between the positions of points of interest of one of the two images, as projected using the determined projection model candidate on the other image, and the corresponding points of interest is evaluated. The reprojection error may be evaluated, without limitation, by using the calibration pairs or all the pairs obtained in step S210 as projection pairs. In addition, each evaluated reprojection error may be normalized by the corresponding number of projection pairs and/or the same set of projection pairs may be used in each iteration of the loop L501. Advantageously, step S530 may further comprise storing in a memory medium the determined projection model candidate, together with the corresponding evaluated reprojection error and the corresponding explored position of the point of interest 12.
In step S540, a test is conducted by checking whether an end of exploration condition is fulfilled. If the end of exploration condition is fulfilled, the loop L501 is interrupted and the elementary procedure applied to the point of interest 12 ends. Otherwise, a new iteration of the loop L501 is triggered. Examples of the end of exploration condition include, without limitation, the exploration of all the possible positions for the point of interest 12 as given by the displacement policy, the lastly evaluated reprojection error is below a certain reprojection error threshold, the lastly evaluated reprojection error corresponds to a reduction by at least a reduction factor threshold with respect to the firstly evaluated reprojection error, etc. Of course, the end of exploration condition may be expressed as a combination of multiple elementary conditions, such as those listed above.
In some embodiments, the elementary procedure of
In other embodiments, the elementary procedure of
The displacement parameters may comprise a displacement direction parameter specifying all the allowed directions of displacement 62 that may be explored for a point of interest 12. For example, the allowed directions of displacement 62 may comprise the four main directions, i.e., left, right, up and down. They may also comprise one or two diagonal directions. More generally, the allowed directions of displacement 62 may be specified as angles comprised between 0 and 360 degrees considering an arbitrary direction, e.g., the right direction, as corresponding to 0 degree. The common vertex of such angles is the reference position 65 of the point of interest 12. In the illustrative example of
The displacement parameters further comprise a displacement length parameter specifying, for each allowed direction of displacement 62, one or more displacement lengths 63. A displacement length 63 of an allowed displacement direction 62 gives the accurate position to which the point of interest 12 may be displaced, the displacement being conducted along the allowed direction of displacement 62 and starting from the reference position 65 of the point of interest 12. Of course, the displacement length parameter may specify one or more displacement lengths 63 without associating them with any allowed direction of displacement 62. In this case, an unassociated displacement length 63 applies to all the allowed directions of displacement 62. In the illustrative example of
The displacement parameters may also comprise a search area 64. The search area 64 includes the reference position 65 of the point of interest 12 and its extent along each allowed direction of displacement 62 is given by the longest associated displacement length 63. The search area 64 may, without limitation, have the shape of any geometric form. In the illustrative example of
In some embodiments of the present disclosure, only the positions within a single search area 64 of the displacement policy 60 applied to a point of interest 12 placed at its initial position 61 are allowed to be explored. This is illustrated in
In other embodiments of the present disclosure, several search areas 64 are used to explore positions for a point of interest 12 initially defined by its initial position 61. This scenario is illustrated in
In step S710, a plurality of pairs of points of interest is obtained. Each of the obtained pairs matches a point of interest 12 of one of the two images to a corresponding point of interest 12 of the other image. Each point of interest 12 of the obtained plurality of pairs is defined by a reference position 65 initialized to an initial position 61 expressed in the frame of reference associated with the corresponding image. As explained above, when selecting a point of interest 12 on one of the two images, errors of various origins may occur causing a deviation between the selected initial position 61 of the point of interest 12 and its target position 67.
Subsequently to step S710, the method of
In step S730, multiple positions on the corresponding image are explored for the selected point of interest 12 according to a displacement policy 60. For example, the exploration may be performed by applying to the selected point of interest 12 an elementary procedure, such as one described with reference to
In step S740, an enhanced position 66 for the selected point of interest 12 is selected among the explored positions of the current iteration of the loop L701, based on the evaluated reprojection errors.
In one aspect of step S740, the enhanced position 66 is selected as the explored position corresponding to the lowest evaluated reprojection error among all the explored positions for the selected point of interest 12. Of course, the enhanced position 66 of the selected point of interest 12 may be its reference position 65.
In another aspect of step S740, the enhanced position 66 of the selected point of interest 12 is selected, among the explored positions of the current iteration of the loop L701, so as to be any explored position whose associated evaluated reprojection error is below a certain reprojection error threshold. If none of the explored positions satisfies such a condition, the enhanced position may be selected in a way to correspond to the lowest evaluated reprojection error among all the explored positions for the selected point of interest 12, or in a way to coincide with its reference positions 65.
Step S740 may further comprise storing in a memory medium the enhanced position 66 of the selected point of interest 12, together with the associated projection model candidate and the associated reprojection error. The initial positions 61 may be kept in the memory medium for later use; for example, for determining a projection model candidate using the initial positions 61 of the other points of interest while using the enhanced position for the currently selected point of interest 12. Alternatively, when storing an enhanced position 66 for a selected point of interest 12, any other stored position for the selected point of interest 12 may be deleted. This may include, without limitation, the initial position 61 and any previously determined enhanced position 66. The stored enhanced positions 66 of the selected points of interest may be used in step S760 to directly compute the projection model between the two images from a set of calibration pairs, and/or may be used while repeating the loop L701 to compute other projection model candidates. In this latter scenario, the enhanced position 66 of a given point of interest 12 determined in a current iteration of the loop L701 may be used to update its reference position 65 (the reference position 65 is set to the enhanced position 66) when the given point of interest 12 is selected, once again, in a new iteration of the loop L701 and/or when the given point of interest 12 is part of a calibration pair or of a projection pair used in a new iteration of the loop L701.
In step S750, a test is conducted by checking whether a completion condition is fulfilled. If the completion condition is fulfilled, the loop L701 is interrupted and step S760 is then executed. Otherwise, a new iteration of the loop L701 is triggered. Examples of the completion condition include, without limitation, the lastly evaluated reprojection error is below a certain reprojection error threshold, the number of iterations of the loop L701 reaches a certain number of iterations threshold, an enhanced position 66 is selected for at least one point of interest 12 of each of the obtained plurality of pairs, etc. Of course, the completion condition may be expressed as a combination of multiple elementary conditions, such as those listed above.
In step S760, a projection model is determined by choosing a projection model candidate based on the evaluated reprojection errors associated with the already determined projection model candidates.
In one aspect of step S760, the projection model may be chosen in a way to correspond to the determined projection model candidate associated with the lowest evaluated reprojection error among all the determined projection model candidates. This allows avoiding the computation complexity associated with computing a new projection model from a set of calibration pairs, and is particularly advantageous when a projection model candidate is determined using points of interest 12 placed at their respective enhanced positions 66.
In another aspect of step S760, the projection model is determined by choosing a projection model candidate that is not determined while repeating the loop L701. The chosen projection model candidate, in this other aspect, may be computed using a set of calibration pairs whose points of interest have been selected while repeating the loop L701. More precisely, the points of interest 12 of the calibration pairs placed at their respective enhanced positions 66 may be used to compute the projection model between the two images. This is particularly advantageous when the enhanced position 66 of a point of interest 12 is determined while keeping the other points of interest 12 of the associated set of calibration pairs at their respective initial positions 61.
In step S810, a plurality of pairs of points of interest is obtained. Each of the obtained pairs matches a point of interest 12 of one of the two images to a corresponding point of interest 12 of the other image. Each point of interest 12 of the obtained plurality of pairs is defined by a reference position 65 initialized to an initial position 61 that may deviate from the target position 67 of the point of interest 12, as errors may occur when selecting and/or matching the points of interest of the obtained plurality of pairs.
Subsequently to step S810, the method of
In step S830, multiple positions, including its reference position 65, on the corresponding image are explored for the selected point of interest 12 according to a displacement policy 60. For example, the exploration may be performed by applying to the selected point of interest 12 an elementary procedure, such as one described with reference to
In step S840, an enhanced position 66 for the selected point of interest 12 is selected among the explored positions of the current iteration of the loop L801, based on the evaluated reprojection errors. For example, the enhanced position 66 may be selected as the explored position corresponding to the lowest evaluated reprojection error among all the explored positions for the selected point of interest 12. Of course, the enhanced position 66 of the selected point of interest 12 may be its reference position 65 used by the displacement policy 60 to determine the explored positions in step S830 of the current iteration of the loop 801. Advantageously, step S840 may further comprise storing in a memory medium the enhanced position 66 of the selected point of interest 12, together with the associated projection model candidate and the associated reprojection error.
In step S850, a test is conducted by comparing for the selected point of interest 12 its reference position 65 with its enhanced position 66 as selected in step S840. The result of such a test is positive or negative depending on whether the reference position 65 and the enhanced position 66 coincide or differ from each other, respectively. For a point of interest 12 selected for the first time in step S820 when repeating the loop L801, the associated reference position 65 is its initial position 61 as given in step S810. Depending on the result of such a test, one of the two steps S860 and S870 is executed next.
In step S860 performed in the case of a negative result of the conducted test of step S850, an adjustment of the reference position 65 of the selected point of interest 12 is performed by setting its value to the enhanced position 66, as selected in step S840. Further, step S860 comprises labelling the selected point of interest 12 as “being improved”. In fact, a negative result of the conducted test of step S850 reflects that the enhanced position 66 is still most likely different from the target position 67 of the selected point of interest 12. Further, the labelling “being improved” associated with a selected point of interest 12 may only be removed in step S850 of a new iteration of the loop L801 triggered with respect to this selected point of interest 12, if the result of the conducted test of step S850 is positive.
In step S870, performed subsequently to step S860 or directly after step S850 if the result of the conducted test of step S850 is positive, it is checked whether a completion condition is fulfilled or not. If the completion condition is fulfilled, the loop L801 is interrupted and step S880 is then executed. Otherwise, a new iteration of the loop L801 is triggered. According to embodiments of the present disclosure described with reference to
In step S880, a projection model is determined by choosing a projection model candidate based on the evaluated reprojection errors associated with the already determined projection model candidates. In a first aspect of step S880, the projection model may be chosen in a way to correspond to the determined projection model candidate associated with the lowest evaluated reprojection error. In a second aspect of step S880, the projection model may be a projection model candidate computed in step S880 using a set of calibration pairs whose points of interest 12 are at their respective reference positions 65.
In some embodiments, a common displacement policy 60 may be used to perform each iteration of the loop L801. The parameters of the common displacement policy 60 may be chosen in a way to get a compromise between accuracy, as reflected by the evaluated reprojection errors, and computational complexity, as given by the number of explored positions for each selected point of interest 12.
In other embodiments compatible with the first and second aspects of step S880, a pair of points of interest used as a calibration pair and/or as a projection pair in a current iteration of the loop L801, excepting the one whose point of interest 12 is selected, is configured so as its points of interest 12 are located at their reference positions 65, i.e., at their lastly determined enhanced positions 66.
In further embodiments compatible with the second aspect of step S880, a pair of points of interest used as a calibration pair and/or as a projection pair in a current iteration of the loop L801, excepting the one whose point of interest 12 is selected, is configured so as its points of interest 12 are located at their initial positions 61.
The embodiments described with reference to
The method of
In step S1020, a point of interest 12 is selected from the obtained plurality of pairs. For example, the selection may be made arbitrarily or according to a selection strategy by considering points of interest of one or both of the two images. Further, step S1020 comprises obtaining an initial displacement policy 60. Subsequent to step S1020, an iteration of the inner loop L1011 is triggered with respect to the selected point of interest 12.
In step S1030 of the inner loop L1011, multiple positions, including its reference position 65, on the corresponding image are explored for the selected point of interest 12 according to the initial displacement policy 60. For example, the exploration may be performed by applying to the selected point of interest 12 an elementary procedure, such as one described with reference to
In step S1040 of the inner loop L1011, an enhanced position 66 for the selected point of interest 12 is selected among the explored positions of the current iteration of the inner loop L1011, based on the evaluated reprojection errors. For example, the enhanced position 66 may be selected as the explored position corresponding to the lowest evaluated reprojection error among all the explored positions for the selected point of interest 12. Advantageously, step S1040 may further comprise storing in a memory medium the enhanced position 66 of the selected point of interest 12, together with the associated projection model candidate and/or the associated reprojection error. In step S1050 of the inner loop L1011, a test is conducted by comparing for the selected point of interest 12 its reference position 65 with its enhanced position 66 as selected in step S1040. The result of such a test is positive or negative depending on whether the reference position 65 and the enhanced position 66 coincide or differ from each other, respectively. For a point of interest 12 selected for the first time in step S1020 when repeating the outer loop L1012, the associated reference position 65 is its initial position 61 as given in step S1010. In case of a positive result of the conducted test of step S1050, the inner loop L1011 is interrupted. Otherwise, step S1060 of the inner loop L1011 is executed before triggering a new iteration of the inner loop L1011 with respect to a same selected point of interest 12 and a same displacement policy 60 as the current iteration of the inner loop L1011.
In step S1060 of the inner loop L1011, an adjustment of the reference position 65 of the selected point of interest 12 is performed by setting its value to the enhanced position 66, as selected in step S1040. Thus, the new iteration of the inner loop L1011, triggered subsequently to step S1060, is performed by only adjusting the reference position 65 of the selected point of interest 12. By repeating the inner loop L1011 with respect to a same selected point of interest 12 until a positive result of the conducted test of step S1050 is achieved, each iteration of the inner loop L1011 brings the enhanced position 66 of the selected point of interest 12 closer to its target position 67. This leads to a significant decrease in the evaluated reprojection error.
In some embodiments, step S1090 is executed directly after interrupting the inner loop L1011 by checking whether a completion condition is fulfilled or not. If the completion condition is fulfilled, the outer loop L1012 is interrupted and step S1100 is then executed. Otherwise, a new iteration of the outer loop L1012 is triggered with respect to an unprocessed point of interest 12, the latter being a point of interest 12 not yet selected in the previous iterations of the outer loop L1012, the initial displacement policy being used when executing the step S1020. Examples of the completion condition include, without limitation, the lastly evaluated reprojection error is below a certain reprojection error threshold, the number of iterations of the outer loop L1012 reaches a certain number of iterations threshold, etc. Of course, the completion condition may be expressed as a combination of multiple elementary conditions, such as those listed above.
In other embodiments, optional steps S1070 and S1080, showed in dotted lines in
In the optional step S1070, it is checked whether or not a maximum number of changes (updates) of the displacement policy 60 is reached for the selected point of interest 12. If such a maximum number is not yet reached, the optional step S1080 is executed and a new iteration of the loop L1013 is then triggered with respect to the same selected point of interest 12. Otherwise, the loop L1013 is interrupted and step S1090 is then executed.
In the optional step S1080, the displacement policy 60 is updated and used to perform the new iteration of the loop L1013. The updating of the displacement policy 60 may be carried out in a spirit of refinement. For example, the new displacement policy 60 may be inferred from the previous one by narrowing the search area 64, shortening the displacement lengths 63 and/or increasing the number of allowed directions of displacement 62. Step S1080 further comprises computing the number of updates of the displacement policy 60 since the initial displacement policy 60.
Referring back to
In some embodiments compatible with the first and second aspects of step S1100, a pair of points of interest used as a calibration pair and/or as a projection pair in a current iteration of the loop L1012, excepting the one whose point of interest 12 is selected, is configured so as its points of interest 12 are located at their reference positions 65, i.e., at their lastly determined enhanced positions 66.
In other embodiments compatible with the second aspect of step S1100, a pair of points of interest used as a calibration pair and/or as a projection pair in a current iteration of the loop L1012, excepting the one whose point of interest 12 is selected, is configured so as its points of interest 12 are located at their initial positions 61.
In some embodiments, the inner loop L1011 of
In other embodiments, the loop L1013 is modified in a way to include step S1020 which is executed directly after step S1080. In this case, step S1020 may comprise selecting a previously processed (tested) point of interest 12.
In one aspect, a weight, e.g., a real number comprised between 0 and 1, may be associated with each pair of points of interest involved in determining a projection model between two images. These weights may be used, without limitation, in ordering the pairs of points of interest and/or in determining a projection model (candidate) between the two images. In the latter case, the weights may be used by the cost function and/or by the optimization algorithm used by the minimization problem to determine a projection model (candidate). As an example, the cost function may represent a weighted quadratic sum of individual errors. According to this aspect, the weight associated with a pair of points of interest may be subjected to modification while iteratively determining the projection model. For example, a weight of a given pair may represent a reprojection error determined using a set of calibration pairs and a set of projection pair that exclude the given pair.
In another aspect, the weight associated with a pair of points of interest may be restricted to be a positive integer. In this case, when determining a projection model (candidate) between two images using a plurality of weighted pairs of points of interest, each pair is replicated a number of times corresponding to the associated weight. For example, if a pair has an associated weight equal to 3, then when determining a projection model (candidate) using this pair, 3 occurrences of this pair of points of interest are included in the list of pairs of points of interest used for determining the projection model (candidate).
Accordingly, the method of spatial calibration, according to the various embodiments of the present disclosure, allows an efficient and precise spatial calibration between two images despite the inaccuracy that occurs when selecting points of interest on the two images. This is achieved by exploring for one or more points of interest some or all of its direct and distant neighbors on the corresponding image.
Further, using a displacement policy to manage the displacements of a point of interest allows the point of interest to approach its target position within a few displacements, which requires reduced resources in terms of storage and processing for its implementation.
In addition, by updating the displacement policy in a spirit of refinement, it is possible to significantly reduce the reprojection error, as the points of interest are brought closer to their respective target positions, with respect to a scenario where the displacement policy is not updated.
While the present disclosure has been described with reference to embodiments, it is to be understood that the present disclosure is not limited to the disclosed embodiments. It will be appreciated by those skilled in the art that various changes and modification might be made without departing from the scope of the present disclosure, as defined in the appended claims. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and/or all of the steps of any method or process so disclosed, may be combined in any combination, except combinations where at least some of such features and/or steps are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed is one example only of a generic series of equivalent or similar features.
In the claims, the word “comprising” does not exclude other elements or steps, and the indefinite article “a” or “an” does not exclude a plurality. The mere fact that different features are recited in mutually different dependent claims does not indicate that a combination of these features cannot be advantageously used.
In the preceding embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over, as one or more instructions or code, a computer-readable medium and executed by a hardware-based processing unit.
Computer-readable media may include computer-readable storage media, which corresponds to a tangible medium such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, e.g., according to a communication protocol. In this manner, computer-readable media generally may correspond to (1) tangible computer-readable storage media which is non-transitory or (2) a communication medium such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementation of the techniques described in this disclosure. A computer program product may include a computer-readable medium.
By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage, or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but are instead directed to non-transient, tangible storage media. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Number | Date | Country | Kind |
---|---|---|---|
2217946.9 | Nov 2022 | GB | national |