Image registration correctness detection method, device, equipment and storage medium

By obtaining the pixel coordinates of preset points in the image and camera internal parameters, calculating the camera coordinates and using geometric constraints to determine the accuracy of the pixel coordinates, it solves the problem of large computational complexity in image registration correctness detection in the field of computer vision, and achieves a fast and efficient Accurate detection.

CN112785570BActive Publication Date: 2024-10-29ZHEJIANG SENSETIME TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110070801.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-19
Publication Date
2024-10-29
Estimated Expiration
2041-01-19

AI Technical Summary

Technical Problem

Existing image registration correctness detection methods require a large amount of calculation and are difficult to implement efficient image registration correctness detection in the field of computer vision.

Method used

By obtaining the pixel coordinates of preset points in the image and camera internal parameters, the camera coordinates are calculated, and the geometric constraints of the vanishing point are used to determine the accuracy of the pixel coordinates, reducing the amount of calculation and improving the inspection speed.

Benefits of technology

It achieves fast and accurate image registration correctness detection, reduces the amount of calculation, speeds up image inspection, and avoids the complexity of pixel value calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112785570B_ABST
    Figure CN112785570B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, equipment and computer-readable storage medium for detecting the correctness of image registration. The detection method includes: obtaining the pixel coordinates of a preset point of a given image in a scanned image, and the internal parameters of the camera corresponding to the scanned image; calculating the camera coordinates corresponding to the preset point by using the pixel coordinates and the internal parameters of the camera; calculating the camera coordinates of the vanishing point by using the camera coordinates corresponding to the preset point; judging whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image. The judgment is made using geometric constraints, which does not involve the calculation of pixel values, thereby reducing the amount of calculation of the image registration correctness inspection algorithm and speeding up the image inspection speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and storage medium for detecting the correctness of image registration. Background Art

[0002] In recent years, with the popularization of artificial intelligence, the field of computer vision has become a hot topic. Different from traditional keyboard and mouse input, computer vision uses cameras as input devices and processes image algorithms to digitize the surrounding environment, thereby obtaining the experience of interacting with the real environment.

[0003] The image registration problem is a key issue in the field of computer vision. The definition of the image registration problem is: given an image F, find image T in the given image F through an algorithm, and give the pixel coordinates of the four corner points of image T. After we obtain the coordinates of the four corner points through the algorithm, we need to detect their correctness. An existing method for detecting the correctness of the coordinates of the four corner points is: SSD (Sum of Squared Differences), which uses the SDD algorithm to calculate the square of the difference between the intensity value of each pixel in image T and its corresponding pixel intensity value in image F. The smaller the result, the higher the similarity between image T and image F, and the more accurate the position of image registration. Another method for detecting the correctness of the coordinates of the four corner points is: NCC (Normalized Cross Correlation), which adds the mean value to the calculation based on the SDD algorithm to reduce the impact of the calculation result on lighting.

[0004] Both of the above algorithms have high precision and accuracy and can effectively detect the accuracy of the four corner points. However, such methods are computationally intensive and require traversing all pixels. Therefore, a method for verifying the correctness of image registration with low computational complexity and high accuracy is needed. Summary of the invention

[0005] The present invention provides a method, device, equipment and storage medium for detecting the correctness of image registration.

[0006] In order to solve the above technical problems, the first technical solution provided by the present disclosure is: to provide a method for detecting the correctness of image registration, including: obtaining the pixel coordinates of a preset point of a given image in a scanned image, and the intrinsic parameters of the camera corresponding to the scanned image; calculating the camera coordinates corresponding to the preset point by using the pixel coordinates and the intrinsic parameters of the camera; calculating the camera coordinates of the vanishing point by using the camera coordinates corresponding to the preset point; judging whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image. The correctness of image registration is checked by the preset points, which reduces the amount of calculation and speeds up the image inspection.

[0007] Wherein, the preset points are four corner points of the given image in the scanned image; the camera coordinates of the vanishing points calculated by using the camera coordinates corresponding to the preset points include: sorting the camera coordinates corresponding to the four corner points in a clockwise or counterclockwise order; calculating the equations of the first straight line, the second straight line, the third straight line and the fourth straight line, the camera coordinates corresponding to the first corner point and the second corner point after the first straight line is sorted, the camera coordinates corresponding to the second corner point and the third corner point after the second straight line is sorted, the camera coordinates corresponding to the third corner point and the fourth corner point after the third straight line is sorted, and the camera coordinates corresponding to the first corner point and the fourth corner point after the fourth straight line is sorted; calculating the coordinates of the intersection of the first straight line and the third straight line as the camera coordinates of the first vanishing point, and the coordinates of the intersection of the second straight line and the fourth straight line as the camera coordinates of the second vanishing point, and the vanishing points include the first vanishing point and the second vanishing point. The correctness of image registration is verified by four corner points, which reduces the amount of calculation and speeds up image verification.

[0008] The predetermined shape is a rectangle, and the geometric constraints include: the first straight line is parallel to the third straight line, the second straight line is parallel to the fourth straight line, and the first straight line and / or the third straight line are perpendicular to the second straight line and / or the fourth straight line. The correctness of the image registration is checked by four corner points, which reduces the amount of calculation and speeds up the image inspection.

[0009] Wherein, judging whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image includes: calculating the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point; judging whether the pixel coordinates of the four corner points are accurate according to the comparison result of the vanishing point product and a preset threshold. The correctness of image registration is verified by four corner points, which reduces the amount of calculation and speeds up the image verification.

[0010] The calculation of the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point includes: calculating the dot product of a first vector and a second vector as the vanishing point product, the first vector being a vector of the camera coordinates whose origin of the camera coordinate system points to the camera coordinates of the first vanishing point, and the second vector being a vector of the camera coordinates whose origin of the camera coordinate system points to the camera coordinates of the second vanishing point. The correctness of the image registration is verified by four corner points, which reduces the amount of calculation and speeds up the image verification.

[0011] Wherein, judging whether the pixel coordinates of the four corner points are accurate according to the comparison result of the vanishing point product and the preset threshold value includes: judging whether the vanishing point product falls within the preset range defined by the preset threshold value; if so, judging that the pixel coordinates of the four corner points are accurate, otherwise judging that the pixel coordinates of the four corner points are inaccurate. The correctness of the image registration is verified by four corner points, which reduces the amount of calculation and speeds up the image verification.

[0012] Wherein, the preset threshold is cos100°~cos80°.

[0013] The intrinsic parameters of the camera include the focal length of the camera and the center offset of the camera.

[0014] Among them, the camera coordinates corresponding to the preset point are calculated through the pixel coordinates and the intrinsic parameters of the camera, including: obtaining an intrinsic parameter matrix according to the focal length of the camera and the center offset of the camera; and obtaining the camera coordinates corresponding to the preset point according to the intrinsic parameter matrix and the pixel coordinates.

[0015] In order to solve the above technical problems, the second technical solution provided by the present disclosure is: to provide a detection device for the correctness of image registration, including: an acquisition module, used to acquire the pixel coordinates of a preset point of a given image in a scanned image, and the intrinsic parameters of the camera corresponding to the scanned image; a camera coordinate calculation module, used to calculate the camera coordinates corresponding to the preset point through the pixel coordinates and the intrinsic parameters of the camera; a vanishing point camera coordinate calculation module, used to calculate the camera coordinates of the vanishing point using the camera coordinates corresponding to the preset point; and a judgment module, used to judge whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image.

[0016] To solve the above technical problems, the third technical solution provided by the present disclosure is: to provide an image registration correctness detection device, comprising a memory and a processor, wherein the memory stores program instructions, and the processor calls the program instructions from the memory to execute any one of the above-mentioned image registration correctness detection methods.

[0017] In order to solve the above technical problems, the fourth technical solution provided by the present disclosure is: providing a computer-readable storage medium storing a program file, wherein the program file can be executed to implement any of the above-mentioned methods for detecting the correctness of image registration.

[0018] The beneficial effects of the present disclosure are different from the prior art. The present disclosure obtains the camera coordinates corresponding to the preset point by calculating the pixel coordinates of the preset point in the scanned image and the internal parameters of the camera corresponding to the scanned image; obtains the camera coordinates of the vanishing point by using the camera coordinates corresponding to the preset point; and determines whether the pixel coordinates of the preset point are accurate based on whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image. The judgment is made using geometric constraints without involving the calculation of pixel values, thereby reducing the amount of calculation of the image registration correctness inspection algorithm and speeding up the image inspection speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0020] Figure 1 is a flow chart of a first embodiment of the method for detecting correctness of image registration disclosed in the present invention;

[0021] Figure 2 yes Figure 1 A flowchart of a specific embodiment of step S13;

[0022] Figure 3 is a schematic diagram of the positions of four corner points in a specific embodiment of the present invention;

[0023] Figure 4 yes Figure 1 A schematic flow chart of a specific embodiment of step S14;

[0024] Figure 5 yes Figure 3 A flowchart of a specific embodiment of step S142;

[0025] Figure 6 It is a structural schematic diagram of a detection device for image registration correctness disclosed in the present invention;

[0026] Figure 7 It is a schematic diagram of the structure of the detection device for the correctness of image registration disclosed in the present invention;

[0027] Figure 8 It is a schematic diagram of the structure of the computer-readable storage medium disclosed in the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0029] The present disclosure is described in detail below with reference to the accompanying drawings and embodiments.

[0030] See also Figure 1 , is a flow chart of an embodiment of a method for detecting correctness of image registration disclosed in the present invention, comprising:

[0031] Step S11: Obtain pixel coordinates of a preset point of a given image in a scanned image, and intrinsic parameters of a camera corresponding to the scanned image.

[0032] Specifically, a given image is scanned by a camera to obtain a scanned image. The scanned image includes the given image. Image registration is to find the coordinates of the given image in the scanned image. In one embodiment, the pixel coordinates of the four corner points of the given image are found in the scanned image by an image registration method. In order to ensure the accuracy of the coordinates, the pixel coordinates of the four corner points need to be detected. During the detection process, the intrinsic parameters of the camera that scans the given image to obtain the scanned image also need to be obtained.

[0033] In a specific embodiment, the intrinsic parameters of the camera include the focal length f of the camera. x ,f y , and the camera center offset (C x ,C y ).

[0034] Step S12: Obtain the camera coordinates corresponding to the preset point through the pixel coordinates and the camera's internal parameters.

[0035] The preset points are four corner points of the given image in the scanned image.

[0036] Specifically, assume that the pixel coordinates of the four corner points A, B, C, and D of the acquired given image in the scanned image are A=(x A ,y A ); B = (x B ,y B ); C = (x C ,y C ); D = (x D ,y D ); Convert the pixel coordinates of the four corner points A, B, C, and D into homogeneous coordinates, which are: A = (x A ,y A, 1) T ; B = (x B ,y B , 1) T ; C = (x C ,y C , 1) T ; D = (x D ,y D , 1) T , where T is the transpose.

[0037] The camera coordinates corresponding to the four corner points are obtained by calculating the internal parameters of the pixel coordinates and the camera coordinates:

[0038] The intrinsic parameter matrix is ​​obtained based on the focal length of the camera and the center offset of the camera. Specifically, the focal length of the camera is f x ,f y , and the camera center offset is (C x ,C y ), the internal parameter matrix is:

[0039]

[0040] The camera coordinates corresponding to the four corner points are calculated based on the intrinsic parameter matrix K and the pixel coordinates. Specifically, the pixel coordinates are first converted into homogeneous coordinates, which are:

[0041]

[0042] The camera coordinates are obtained by the internal parameter matrix K, i.e., formula (1), and the homogeneous coordinates, i.e., formula (2):

[0043]

[0044] Step S13: Calculate the camera coordinates of the vanishing point using the camera coordinates corresponding to the preset point.

[0045] For details, see Figure 2 , when calculating the camera coordinates of the vanishing point, also include:

[0046] Step S131: sort the camera coordinates corresponding to the four corner points in a clockwise or counterclockwise order.

[0047] Combination Figure 3 , assuming that the four points in the figure are A, B, C, and D, and the order of the camera coordinates of the four points A, B, C, and D is A′=K -1 A; B′=K -1 B; C′=K -1 C; D′=K -1D. If the four points A, B, C, and D are sorted counterclockwise, the order of the camera coordinates of the four points A, B, C, and D is A′=K -1 A; D′=K -1 D; C′=K -1 C; B′=K -1 B

[0048] Step S132: Calculate the equations of the first straight line, the second straight line, the third straight line and the fourth straight line.

[0049] Specifically, take the four points A, B, C, and D as an example to be sorted in clockwise order. Connect A, B, C, and D to obtain four straight lines, namely the first straight line L1, the second straight line L2, the third straight line L3, and the fourth straight line L4. Among them, the camera coordinate A′ corresponding to the first corner point A of the first straight line L1 after sorting is = K -1 A and the camera coordinates corresponding to the second corner point B are B′=K -1 B; the camera coordinates B′ corresponding to the second corner point B of the second straight line L2 after sorting = K -1 B and the camera coordinates corresponding to the third corner point C' = K -1 C; the camera coordinate C′ corresponding to the third corner point C of the third straight line L3 after sorting = K -1 C and the camera coordinates corresponding to the fourth corner point D are D′=K -1 D; the camera coordinate A′ corresponding to the first corner point A of the fourth straight line L4 after sorting = K -1 A and the camera coordinates corresponding to the fourth corner point D are D′=K -1 D.

[0050] The result of the cross product of the two points is the equation of the straight line passing through the two points, and the equations of the first straight line L1, the second straight line L2, the third straight line L3 and the fourth straight line L4 are calculated.

[0051] Specifically, the first straight line L1 passes through point A and point B, and the linear equation of the first straight line L1 is:

[0052] A′×B′=(x A′ ,y A′ , 1) T ×(x B′ ,y B′ , 1) T

[0053] A′×B′=(y A′ -y B′ , x B′ -x A′ , x A′ y B′ -x B′ yA′ ) T ,

[0054] Among them, (x A′ ,y A′ , 1) T is the camera coordinate of point A; (x B′ ,y B′ , 1) T is the camera coordinate of point B.

[0055] The second straight line L2 passes through point B and point C, so the linear equation of the second straight line L2 is:

[0056] B′×C′=(x c′ ,y c′ , 1) T ×(x B′ ,y B′ , 1) T

[0057] B′×C′=(y B′ -y c′ , x c′ -x B′ , x B′ y C′ -x C′ y B′ ) T .

[0058] The third straight line L3 passes through point C and point D, and the linear equation of the third straight line L3 is:

[0059] C′×D′=(x D′ ,y D′ , 1) T ×(x C′ ,y C′ , 1) T ,

[0060] C′×D′=(y C′ -y D′ , x D′ -x C′ , x C′ y D′ -x D′ y C′ ) T .

[0061] The fourth straight line L4 passes through point D and point A, and the linear equation of the fourth straight line L4 is:

[0062] D′×A′=(x A′ ,y A′ , 1) T ×(x D′,y D′ , 1) T ,

[0063] C′×D′=(y D′ -y A′ , x A′ -x D′ , x D′ y A′ -x A′ y D′ ) T .

[0064] Step S133: calculating the coordinates of the intersection of the first straight line and the third straight line as the camera coordinates of the first vanishing point, and calculating the coordinates of the intersection of the second straight line and the fourth straight line as the camera coordinates of the second vanishing point.

[0065] Specifically, the vanishing point includes a first vanishing point and a second vanishing point. In an image, parallel lines intersect at a vanishing point, so the first vanishing point is the intersection of the first straight line L1 and the third straight line L3, and the second vanishing point is the intersection of the second straight line L2 and the fourth straight line L4.

[0066] Combination Figure 3 It can be seen that the predetermined shape formed by the first straight line L1, the second straight line L2, the third straight line L3 and the fourth straight line L4 formed by the lines connecting the four corner points A, B, C, and D is a rectangle, wherein the first straight line L1 and the third straight line L3 are parallel, the second straight line L2 and the fourth straight line L4 are parallel, and the first straight line L1 and / or the third straight line L3 are perpendicular to the second straight line L2 and / or the fourth straight line L4. Parallel lines intersect at a point at infinity, i.e., the vanishing point. The vanishing point refers to the visual intersection point of parallel lines. For example, when looking at two rails along a railway line or the trees neatly arranged on both sides along a highway line, the lines connecting the two parallel rails or the two rows of trees intersect at a point very far away, which is called the vanishing point in the perspective view.

[0067] According to the vanishing point principle, the cross product of the first straight line L1 and the third straight line L3 is calculated to obtain the coordinates of the first vanishing point; the cross product of the second straight line L2 and the fourth straight line L4 is calculated to obtain the coordinates of the second vanishing point.

[0068] Specifically, the coordinates of the first vanishing point V1 = A'B'×C'D',

[0069] V1=(y A′ -y B′ , x B′ -x A′ , x A′ y B′ -x B′ y A′ ) T×(y C′ -y D′ , x C′ -x D′ , x C′ y D′ -x D′ y C′ ) T .

[0070] The coordinates of the second vanishing point V2 = A'D' × C'B',

[0071] V1=(y A' -y D' ,x D' -x A' ,x A' y D' -x D' y A' ) T ×(y C' -y B' ,x C' -x B' ,x C' y B' -x B' y C' ) T .

[0072] Step S14: judging whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point satisfy the geometric constraints of the predetermined shape of the given image.

[0073] Specifically, the predetermined shape is a rectangle, and the geometric constraints are that the first straight line L1 is parallel to the third straight line L3, the second straight line L2 is parallel to the fourth straight line L4, and the first straight line L1 and / or the third straight line L3 is perpendicular to the second straight line L2 and / or the fourth straight line L4.

[0074] Please combine Figure 4 , judging whether the pixel coordinates of the four corner points are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraints of the predetermined shape of the given image, specifically includes:

[0075] Step S141: Calculate the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point.

[0076] Specifically, calculating the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point includes calculating the dot product of a first vector and a second vector as the vanishing point product, wherein the first vector is a vector of the camera coordinates whose origin points to the first vanishing point V1, and the second vector is a vector of the camera coordinates whose origin points to the second vanishing point V2.

[0077] Specifically, the vanishing point product between the camera coordinates of the first vanishing point V1 and the camera coordinates of the second vanishing point V2 is calculated as: M=V1·V2.

[0078] Step S142: judging whether the pixel coordinates of the four corner points are accurate according to the comparison result of the vanishing point product and the preset threshold.

[0079] For details, please combine Figure 5 ,include:

[0080] Step S1421: Determine whether the vanishing point product falls within a preset range defined by a preset threshold.

[0081] For example, the preset threshold is cos100° to cos80°. This step is to determine whether the value of the vanishing point product M is within the interval [cos100°, cos80°].

[0082] Step S1422: The pixel coordinates of the four corner points are accurate.

[0083] Specifically, if the vanishing point product is greater than cos100° and less than cos80°, the detection result indicates that the pixel coordinates of the four corner points of the acquired given image in the scanned image are accurate.

[0084] Step S1423: The pixel coordinates of the four corner points are inaccurate.

[0085] Specifically, if the vanishing point product is less than cos100° or greater than cos80°, the detection result indicates that the pixel coordinates of the four corner points of the acquired given image in the scanned image are inaccurate.

[0086] The detection of image registration correctness provided by the present disclosure obtains the pixel coordinates of the four corner points of a given image in the scanned image, and detects whether the pixel coordinates of the four corner points are accurate through the geometric relationship corresponding to the pixel coordinates of the four corner points. It only requires four corner points for detection, has a small amount of calculation, and has a fast detection speed.

[0087] See also Figure 6 , is a detection device for image registration correctness disclosed in the present invention, comprising an acquisition module 51, a camera coordinate calculation module 52, a vanishing point camera coordinate calculation module 53 and a judgment module 54.

[0088] The acquisition module 51 is used to acquire the pixel coordinates of a preset point of a given image in the scanned image, and the intrinsic parameters of the camera corresponding to the scanned image. Specifically, the intrinsic parameters of the camera include the focal length f of the camera. x ,f y , and the camera center offset (C x ,C y ). The preset points are four corner points of the given image in the scanned image.

[0089] The camera coordinate calculation module 52 is used to calculate the camera coordinates corresponding to the preset point through the pixel coordinates and the camera's internal parameters. Specifically, the camera coordinate calculation module 52 is also used to obtain the internal parameter matrix according to the focal length of the camera and the center offset of the camera, and calculate the camera coordinates corresponding to the four corner points according to the internal parameter matrix and the pixel coordinates.

[0090] The vanishing point camera coordinate calculation module 53 is used to calculate the camera coordinates of the vanishing point using the camera coordinates corresponding to the preset points. Specifically, the vanishing point camera coordinate calculation module 53 is also used to sort the camera coordinates corresponding to the four corner points in a clockwise or counterclockwise order. Calculate the equations of the first straight line, the second straight line, the third straight line, and the fourth straight line. Among them, the camera coordinate A′ corresponding to the first corner point A of the first straight line L1 after sorting is = K -1 A and the camera coordinates corresponding to the second corner point B are B′=K -1 B; the camera coordinates B′ corresponding to the second corner point B of the second straight line L2 after sorting = K -1 B and the camera coordinates corresponding to the third corner point C' = K -1 C; the camera coordinate C′ corresponding to the third corner point C of the third straight line L3 after sorting = K -1 C and the camera coordinates corresponding to the fourth corner point D are D′=K -1 D; the camera coordinate A′ corresponding to the first corner point A of the fourth straight line L4 after sorting = K -1 A and the camera coordinates corresponding to the fourth corner point D are D′=K -1 D. The result of the cross product of the two points is the equation of the line passing through the two points, and the equations of the first straight line L1, the second straight line L2, the third straight line L3 and the fourth straight line L4 are calculated. Specifically, the camera coordinate calculation module 53 of the vanishing point is also used to calculate the coordinates of the intersection of the first straight line and the third straight line as the camera coordinates of the first vanishing point, and the coordinates of the intersection of the second straight line and the fourth straight line as the camera coordinates of the second vanishing point. Specifically, according to the intersection of parallel lines at a vanishing point, the cross product of the first straight line L1 and the third straight line L3 is calculated to obtain the coordinates of the first vanishing point; the cross product of the second straight line L2 and the fourth straight line L4 is calculated to obtain the coordinates of the second vanishing point.

[0091] The judging module 54 is used to judge whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point meet the geometric constraint conditions of the predetermined shape of the given image. Specifically, the predetermined shape is a rectangle, and the geometric constraint conditions are that the first straight line L1 is parallel to the third straight line L3, the second straight line L2 is parallel to the fourth straight line L4, and the first straight line L1 and / or the third straight line L3 are perpendicular to the second straight line L2 and / or the fourth straight line L4. The judging module 54 is also used to calculate the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point. That is, calculating the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point includes calculating the dot product of the first vector and the second vector as the vanishing point product, the first vector is a vector whose origin of the camera coordinate system points to the camera coordinates of the first vanishing point V1, or a vector whose camera coordinates of the first vanishing point V1 points to the origin of the camera coordinate system. The second vector is a vector whose origin of the camera coordinate system points to the camera coordinates of the second vanishing point V2, or a vector whose camera coordinates of the second vanishing point V2 points to the origin of the camera coordinate system. The judgment module 54 is also used to judge whether the pixel coordinates of the four corner points are accurate according to the comparison result of the vanishing point product and the preset threshold. Specifically, the preset threshold is cos100° to cos80°. If the vanishing point product is greater than cos100° and less than cos80°, the detection result indicates that the pixel coordinates of the four corner points of the acquired given image in the scanned image are accurate; if the vanishing point product is less than cos100° or greater than cos80°, the detection result indicates that the pixel coordinates of the four corner points of the acquired given image in the scanned image are inaccurate.

[0092] The image registration correctness detection device provided by the present disclosure obtains the pixel coordinates of the four corner points of a given image in a scanned image, and detects whether the pixel coordinates of the four corner points are accurate through the geometric relationship corresponding to the pixel coordinates of the four corner points. It only needs four corner points to perform detection, has a small amount of calculation, and has a fast detection speed.

[0093] See also Figure 7 , is a schematic diagram of the structure of the image registration correctness detection device disclosed in the present invention. The image registration correctness detection device includes a memory 62 and a processor 61 connected to each other.

[0094] The memory 62 is used to store program instructions for implementing any one of the above-mentioned methods for detecting the correctness of image registration.

[0095] The processor 61 is used to execute program instructions stored in the memory 62 .

[0096] The processor 61 may also be referred to as a CPU (Central Processing Unit). The processor 61 may be an integrated circuit chip having the ability to process signals. The processor 61 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0097] The memory 62 can be a memory stick, a TF card, etc., which can store all the information in the image registration correctness detection device, including the input raw data, computer programs, intermediate operation results and final operation results are all stored in the memory. It stores and retrieves information according to the position specified by the controller. With the memory, the image registration correctness detection device has a memory function and can ensure normal operation. The memory of the image registration correctness detection device can be divided into main memory (internal memory) and auxiliary memory (external memory) according to the purpose of the memory, and there is also a classification method of dividing it into external memory and internal memory. External memory is usually a magnetic medium or an optical disk, etc., which can store information for a long time. Memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but is only used to temporarily store programs and data. If the power is turned off or the power is cut off, the data will be lost.

[0098] In the several embodiments provided in the present disclosure, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0099] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0100] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0101] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a system server, or a network device, etc.) or a processor to perform all or part of the steps of the methods of various embodiments of the present disclosure.

[0102] See also Figure 8 , which is a schematic diagram of the structure of the computer-readable storage medium of the present invention. The storage medium of the present invention stores a program file 71 that can implement the detection method for the correctness of all the above-mentioned image registrations, wherein the program file 71 can be stored in the above-mentioned storage medium in the form of a software product, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage device includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.

[0103] The above are only implementation modes of the present disclosure, and are not intended to limit the patent scope of the present disclosure. Any equivalent structure or equivalent process transformation made using the contents of the present disclosure and the drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present disclosure.

Claims

1. A method for detecting the correctness of image registration, characterized in that: include: Obtaining pixel coordinates of a preset point of a given image in a scanned image, and intrinsic parameters of a camera corresponding to the scanned image; Obtaining the camera coordinates corresponding to the preset point by calculating the pixel coordinates and the intrinsic parameters of the camera; The camera coordinates of the vanishing point are calculated using the camera coordinates corresponding to the preset point; determining whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point satisfy the geometric constraint conditions of the predetermined shape of the given image; Wherein, the preset points are four corner points of the given image in the scanned image; The method of calculating the camera coordinates of the vanishing point using the camera coordinates corresponding to the preset points includes: sorting the camera coordinates corresponding to the four corner points in a clockwise or counterclockwise order; calculating equations of a first straight line, a second straight line, a third straight line and a fourth straight line, the camera coordinates corresponding to the first corner point and the second corner point after the first straight line is sorted, the camera coordinates corresponding to the second corner point and the third corner point after the second straight line is sorted, the camera coordinates corresponding to the third corner point and the fourth corner point after the third straight line is sorted, and the camera coordinates corresponding to the first corner point and the fourth corner point after the fourth straight line is sorted; calculating the coordinates of the intersection of the first straight line and the third straight line as the camera coordinates of the first vanishing point, and the coordinates of the intersection of the second straight line and the fourth straight line as the camera coordinates of the second vanishing point, the vanishing points include the first vanishing point and the second vanishing point.

2. The detection method according to claim 1, characterized in that: The predetermined shape is a rectangle, and the geometric constraints include: The first straight line is parallel to the third straight line, the second straight line is parallel to the fourth straight line, and the first straight line and / or the third straight line are perpendicular to the second straight line and / or the fourth straight line.

3. The detection method according to claim 2, characterized in that: The step of judging whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point satisfy the geometric constraint condition of the predetermined shape of the given image comprises: calculating a vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point; Whether the pixel coordinates of the four corner points are accurate is determined according to a comparison result of the vanishing point product and a preset threshold.

4. The detection method according to claim 3, characterized in that: Calculating the vanishing point product using the camera coordinates of the first vanishing point and the camera coordinates of the second vanishing point includes: A dot product of a first vector and a second vector is calculated as the vanishing dot product, wherein the first vector is a vector of camera coordinates whose origin of a camera coordinate system points to the first vanishing point, and the second vector is a vector of camera coordinates whose origin of the camera coordinate system points to the second vanishing point.

5. The detection method according to claim 3, characterized in that: The step of judging whether the pixel coordinates of the four corner points are accurate according to the comparison result of the vanishing point product and a preset threshold value comprises: Determining whether the vanishing point product falls within a preset range defined by the preset threshold; If so, it is determined that the pixel coordinates of the four corner points are accurate; otherwise, it is determined that the pixel coordinates of the four corner points are inaccurate.

6. The detection method according to claim 5, characterized in that: The preset threshold is cos100° to cos80°.

7. The detection method according to claim 1, characterized in that: The intrinsic parameters of the camera include the focal length of the camera and the center offset of the camera.

8. The detection method according to claim 7, characterized in that: The step of calculating the camera coordinates corresponding to the preset point through the pixel coordinates and the intrinsic parameters of the camera includes: Obtaining an intrinsic parameter matrix according to the focal length of the camera and the center offset of the camera; The camera coordinates corresponding to the preset point are calculated according to the intrinsic parameter matrix and the pixel coordinates.

9. A device for detecting the correctness of image registration, characterized in that: include: An acquisition module, used to acquire pixel coordinates of a preset point of a given image in a scanned image, and an intrinsic parameter of a camera corresponding to the scanned image; A camera coordinate calculation module, used to calculate the camera coordinates corresponding to the preset point through the pixel coordinates and the intrinsic parameters of the camera; A camera coordinate calculation module for a vanishing point, configured to calculate the camera coordinates of the vanishing point using the camera coordinates corresponding to the preset points; specifically, the preset points are four corner points of the given image in the scanned image; and the camera coordinates corresponding to the four corner points are sorted in a clockwise or counterclockwise order; Calculate equations of a first straight line, a second straight line, a third straight line, and a fourth straight line, wherein the camera coordinates corresponding to the first corner point and the second corner point of the first straight line after sorting, the camera coordinates corresponding to the second corner point and the third corner point of the second straight line after sorting, the camera coordinates corresponding to the third corner point and the fourth corner point of the third straight line after sorting, and the camera coordinates corresponding to the first corner point and the fourth corner point of the fourth straight line after sorting; calculate the coordinates of the intersection of the first straight line and the third straight line as the camera coordinates of the first vanishing point, and the coordinates of the intersection of the second straight line and the fourth straight line as the camera coordinates of the second vanishing point, wherein the vanishing points include the first vanishing point and the second vanishing point; The judging module is used to judge whether the pixel coordinates of the preset point are accurate according to whether the camera coordinates of the vanishing point satisfy the geometric constraint conditions of the predetermined shape of the given image.

10. A device for detecting the correctness of image registration, characterized in that: The method comprises a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method for detecting the correctness of image registration according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: A program file is stored, and the program file can be executed to implement the method for detecting the correctness of image registration according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Camera self-calibration method based on two vanishing points

    CN105389808A

  • Three-dimensional registering method for single image

    CN106327532A