Optimal measurement parameter determination method and system for image detection, medium and electronic equipment

By capturing and correcting calibration images with multiple sets of shooting parameters and combining the perspective transformation matrix and entropy method to determine the optimal measurement parameters, the measurement error problem caused by changes in the installation position of the vehicle-mounted camera is solved, and the flexibility and accuracy of detection frame calibration and measurement are improved.

CN120807650APending Publication Date: 2025-10-17QIANFANG JIETONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510655128.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the existing technology, the measurement parameters of vehicle-mounted cameras are closely related to the camera installation position. Once the installation position changes, the measurement error increases significantly, reducing the flexibility and accuracy of the detection frame size measurement.

Method used

Multiple sets of shooting parameters are used to capture and correct calibration images. The perspective transformation matrix, horizontal conversion ratio, and vertical conversion ratio of each corrected image are determined through multiple combinations of ground clearance heights and downward inclination angles perpendicular to the road surface. The size error index of the matching detection frame is calculated, and the entropy method is used to calculate the comprehensive score to determine the optimal measurement parameters.

Benefits of technology

Improved flexibility and accuracy in detection frame calibration and measurement enable reliable measurement results in a variety of complex environments, ensuring that the selected measurement parameters perform optimally across multiple evaluation metrics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807650A_ABST
    Figure CN120807650A_ABST
Patent Text Reader

Abstract

The invention discloses an optimal measurement parameter determination method and system for image detection, a medium and electronic equipment, and the method comprises the steps: employing a plurality of groups of shooting parameters to shoot and correct a calibration image for a preset calibration site, and obtaining a plurality of corrected images; the plurality of groups of shooting parameters are obtained by permutation and combination of a plurality of terrain clearances and a plurality of downward inclination angles perpendicular to the road surface; determining a perspective transformation matrix, a transverse conversion ratio and a longitudinal conversion ratio of each corrected image to obtain a measurement parameter of each corrected image; calculating a size error index of a matching detection frame corresponding to each corrected image according to the measurement parameter of each corrected image and a matching vertex coordinate of a preset matching detection frame; and calculating the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image, and taking the measurement parameter of the corrected image corresponding to the highest comprehensive score as the optimal measurement parameter. Therefore, by adopting the embodiment of the invention, the flexibility and the accuracy of measuring the size of the detection frame can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image size measurement, and in particular to a method and system for determining optimal measurement parameters for image detection, a medium and an electronic device. BACKGROUND

[0002] With the rapid development of intelligent networked vehicle technology, vehicle-mounted cameras are increasingly widely used in vehicle perception systems. Through deep learning algorithms, vehicle-mounted cameras can achieve high-precision target detection and provide important visual information for automatic driving and assisted driving functions.

[0003] In related technologies, in order to achieve target detection, a group of parameters with fixed height and fixed angle are used to shoot an image on a known size calibration object, and the size of the target is measured through complex camera calibration technology combined with coordinate conversion calculation.

[0004] However, the measurement parameters in the prior art are only one group, and are closely related to the installation position of the camera. Once the installation position changes, the measurement error will significantly increase, thereby reducing the flexibility and accuracy of the detection frame size measurement. SUMMARY

[0005] The embodiments of the present application provide a method and system for determining optimal measurement parameters for image detection, a medium and an electronic device. In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not a general review, nor does it determine the key / important elements or delineate the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.

[0006] In a first aspect, the embodiments of the present application provide a method for determining optimal measurement parameters for image detection, the method comprising:

[0007] For a preset calibration site, a plurality of calibration images are obtained by shooting and correcting calibration images using a plurality of shooting parameters; the plurality of shooting parameters are obtained by arranging and combining a plurality of ground clearances and a plurality of inclination angles perpendicular to the downward road surface;

[0008] Determine the perspective transformation matrix, the horizontal conversion ratio and the vertical conversion ratio of each corrected image to obtain the measurement parameters of each corrected image;

[0009] According to the measurement parameters of each corrected image and the matching vertex coordinates of the preset matching detection frame, the size error index of the matching detection frame corresponding to each corrected image is calculated;

[0010] The computing module is configured to calculate a size error index of the matching detection frame corresponding to each rectified image according to the measurement parameter of each rectified image and matching vertex coordinates of the preset matching detection frame.

[0011] In a second aspect, the embodiments of the present application provide a system for determining optimal measurement parameters for image detection, which comprises:

[0012] The shooting module is configured to shoot and rectify calibration images by using multiple groups of shooting parameters for a preset calibration site to obtain multiple rectified images, wherein the multiple groups of shooting parameters are obtained by permutation and combination of multiple ground clearances and multiple tilt angles downward perpendicular to the road surface.

[0013] The determining module is configured to determine a perspective transformation matrix, a horizontal conversion ratio and a vertical conversion ratio of each rectified image to obtain a measurement parameter of each rectified image.

[0014] The computing module is configured to calculate a size error index of the matching detection frame corresponding to each rectified image according to the measurement parameter of each rectified image and matching vertex coordinates of the preset matching detection frame.

[0015] The optimization module is configured to calculate a comprehensive score of the size error index of the matching detection frame corresponding to each rectified image, and take the measurement parameter of the rectified image corresponding to the highest comprehensive score as the optimal measurement parameter.

[0016] In a third aspect, the embodiments of the present application provide a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to perform the method steps described above.

[0017] In a fourth aspect, the embodiments of the present application provide an electronic device, which can include a processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to perform the method steps described above.

[0018] The technical solutions provided by some embodiments of the present application can have the following beneficial effects:

[0019] In the embodiment of the present application, on the one hand, by adopting multiple sets of shooting parameters to shoot and correct the calibration image, the arrangement combination of multiple ground clearances and multiple inclination angles is considered when the shooting parameters are selected, which can adapt to different camera installation scenes, so that the measurement system can obtain reliable measurement results in various complex environments, thereby improving the flexibility of the detection frame calibration and measurement. On the other hand, according to the measurement parameters of each corrected image and the matching vertex coordinates of the pre-matching detection frame, the size error index of the matching detection frame corresponding to each corrected image is obtained, and then the evaluation weight value of the size error index of the matching detection frame is calculated by using the entropy value method. The evaluation weight value and the comprehensive score of the size error index of the matching detection frame are used to determine the optimal measurement parameter, which can ensure that the selected measurement parameter performs best on multiple (measurement error) evaluation indexes, and the optimal measurement parameter can be obtained, thereby improving the flexibility and accuracy of the detection frame calibration and measurement.

[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the application.

[0022] Figure 1 is a flow diagram of an optimal measurement parameter determination method for image detection provided by an embodiment of the present application;

[0023] Figure 2 is a perspective target point selection diagram provided by an embodiment of the present application;

[0024] Figure 3 is a calibration image perspective transformation effect and longitudinal and transverse calibration point selection diagram provided by an embodiment of the present application;

[0025] Figure 4 is a matching detection frame shooting and matching vertex coordinate selection diagram provided by an embodiment of the present application;

[0026] Figure 5 is a structural diagram of an optimal measurement parameter determination system for image detection provided by an embodiment of the present application;

[0027] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following description and drawings sufficiently illustrate specific embodiments of the present application to enable one skilled in the art to practice them.

[0029] It should be noted that the described embodiments are merely some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0030] The following description refers to the accompanying drawings. In the following description, same numbers in different drawings represent the same or similar elements unless otherwise represented. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of systems and methods consistent with some aspects of the present application as detailed in the appended claims.

[0031] In the description of the present application, it should be understood that the terms "first", "second" and the like are used only for the purpose of description, and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "a plurality of" means two or more, unless otherwise specified. "And / or", which describes the relationship between the associated objects, means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.

[0032] The following will be described in conjunction with the accompanying drawings Figure 1 -Appendix Figure 4 The optimal measurement parameter determination method for image detection provided by the embodiments of the present application is described in detail. The method can be realized by relying on a computer program and can run on an optimal measurement parameter determination system for image detection based on von Neumann system. The computer program can be integrated in an application or run as an independent tool class application.

[0033] Please refer to Figure 1 A flowchart of the optimal measurement parameter determination method for image detection provided by the embodiments of the present application is shown. As Figure 1 The method of the embodiments of the present application can include the following steps:

[0034] S101, for a preset calibration site, a plurality of sets of shooting parameters are used to shoot and correct calibration images to obtain a plurality of corrected images; the plurality of sets of shooting parameters are obtained by arranging and combining a plurality of ground clearances and a plurality of tilt angles downward perpendicular to the road surface;

[0035] The preset calibration site refers to a specific area or site that is pre-set for image size measurement. In this site, a calibration object with known dimensions (such as a checkerboard paper) is placed for subsequent image correction and calculation of measurement parameters. The multiple sets of shooting parameters refer to different combinations of parameters used when shooting calibration images. These parameters include the height above ground and the tilt angle of the camera. The height above ground refers to the vertical distance between the camera installation position and the ground. Different heights above ground will affect the viewing angle and range of the images captured by the camera. The tilt angle refers to the degree of inclination of the camera relative to the direction perpendicular to the road surface. The camera can be tilted downward at a certain angle to capture the calibration object on the road surface. Different tilt angles will affect the perspective effect of the image. The calibration image refers to the image obtained by shooting the preset calibration site using an image acquisition device with a fixed focal length. The corrected image refers to the image after image processing techniques (such as perspective transformation) are applied. The corrected image eliminates the image distortion caused by the camera's viewing angle and perspective effect, making the calibration object in the image closer to its actual geometric shape.

[0036] The multiple sets of shooting parameters are set according to the measurement requirements. The image acquisition device can be a separate acquisition device, i.e., a separate camera, or it can be the same as the image acquisition device in the vehicle. The pre-set specific area or site is an open site without interfering objects. A black and white checkerboard paper of a pre-set size is selected as the calibration object. The black and white checkerboard paper is laid out on the pre-set calibration site to obtain a site covered with black and white checkerboard paper, which is the pre-set calibration site. The image acquisition device is used for acquisition, such as a camera for shooting the pre-set calibration site to obtain a calibration image.

[0037] In some embodiments of the present application, the specific process of shooting and correcting the calibration image using multiple sets of shooting parameters to obtain multiple corrected images includes: taking the top-left corner point of each calibration image as the starting point, and marking the pixel coordinates of each corner in clockwise direction to obtain the perspective target coordinate points of each calibration image; calculating the perspective transformation matrix of each calibration image according to the perspective target coordinate points and the perspective mapping coordinates of each calibration image; the perspective mapping coordinates are calculated according to the resolution of each calibration image; and applying the perspective transformation matrix of each calibration image to the corresponding calibration image for perspective correction to obtain multiple corrected images.

[0038] For example Figure 2 As shown in the figure, the image acquisition device is fixed on the support at a certain height and downward tilt angle, ensuring the stability of the picture and making the black and white checkerboard paper be completely shot in the picture. m calibration images are obtained by shooting the pre-set calibration site. For the ith calibration image (i = 1, 2, 3, …, m), the perspective target points A i , B i , C i , and D iThe pixel coordinates of the perspective target coordinate points in the i-th calibration image are A i (u i1 , v i1 ), B i (u i , v i2 ), C i (u i3 , v i3 ), and D i (u i4 , v i4 ). Then, the resolution of each calibration image is obtained; the perspective mapping coordinates of each calibration image are calculated according to the resolution of each calibration image; and the perspective transformation matrix of each calibration image is calculated according to the perspective target coordinate points and the perspective mapping coordinates of each calibration image. The perspective transformation matrix maps points on a two-dimensional plane to another two-dimensional plane while preserving or introducing perspective effects, and is used for perspective correction. After correction, m corrected images are obtained.

[0039] For example, the resolution of the calibration image is (1920x1080), and the perspective mapping coordinates are A'(0, 0), B'(1920, 0), C'(1920, 1080), and D'(0, 1080). Perspective correction maps the calibration image from a front view perspective in the picture to a top view perspective to eliminate picture distortion.

[0040] S102, determine the perspective transformation matrix, the horizontal scaling ratio, and the vertical scaling ratio of each corrected image to obtain the measurement parameters of each corrected image.

[0041] The horizontal scaling ratio refers to the size scaling relationship in the width direction of the corrected image, and the vertical scaling ratio refers to the size scaling relationship in the height direction of the corrected image. The perspective transformation matrix of each corrected image is applied to the corresponding calibration image to perform perspective correction, and a plurality of corrected images are obtained.

[0042] In some embodiments of the present application, the specific process of determining the perspective transformation matrix, the horizontal scaling ratio, and the vertical scaling ratio of each corrected image to obtain the measurement parameters of each corrected image includes: taking the perspective transformation matrix of each calibration image as the perspective transformation matrix of the corresponding corrected image; determining the center position of each corrected image; selecting the coordinate points adjacent to the left and right of the center position of each corrected image as the horizontal calibration points of each corrected image in a clockwise direction; selecting the coordinate points adjacent to the top and bottom of the center position of each corrected image as the vertical calibration points of each corrected image in a clockwise direction; obtaining the physical distance and the pixel distance between the horizontal calibration points and the vertical calibration points; and calculating the horizontal scaling ratio and the vertical scaling ratio of each corrected image according to the physical distance and the pixel distance.

[0043] For example, the center position of each of the m corrected images is determined, and the left and right adjacent two coordinate points of the center position O' of the i-th corrected image are taken as the horizontal calibration points A stand(i) and B stand(i) of the i-th corrected image in a clockwise direction stand(i) and D stand(i) (i = 1, 2, 3, …, m). As shown in Figure 3 , Figure 3 is a schematic diagram for selecting the horizontal and vertical calibration points according to the perspective transformation effect of the image provided by the embodiments of the present application. For the i-th corrected image after perspective transformation, the left and right vertices A stand(i) and B stand(i) of the two adjacent chessboard grids in the horizontal center are taken as the horizontal calibration points; and the upper and lower vertices C stand(i) and D stand(i) of the two adjacent chessboard grids in the vertical center are taken as the vertical calibration points.

[0044] Then, the physical distance L stand(i) and the pixel distance L stand(i) between the horizontal calibration points A t1(i) and B p1(i) of the i-th corrected image are obtained, and the physical distance L stand(i) and the pixel distance L stand(i) between the vertical calibration points C t2(i) and D p2(i) of the i-th corrected image are obtained.

[0045] In some embodiments of the present application, the horizontal conversion ratio and the vertical conversion ratio of each corrected image are calculated according to the following formulas:

[0046]

[0047] In the above formula (1), scale 1(i) and scale 2(i) are the horizontal conversion ratio and the vertical conversion ratio of the i-th corrected image.

[0048] S103, according to the measurement parameters of each corrected image and the matching vertex coordinates of the preset matching detection frame, calculating the size error index of the matching detection frame corresponding to each corrected image;

[0049] In the embodiments of the present application, the matching vertex coordinates of the preset matching detection frame are generated according to the following steps, specifically including: capturing a matching image containing a calibration paper, the calibration paper being a rectangular matching detection calibration paper with a known standard size; obtaining pixel coordinates of four vertices of the calibration paper from the matching image; taking the known standard size of the calibration paper and the pixel coordinates of the four vertices as the standard size and vertex pixel coordinates of the matching detection frame.

[0050] Specifically, after the image acquisition device is fixed at a certain angle and an inclination angle, a rectangular matching detection calibration paper with a known size is placed on the road surface 3-4 m in front of the device to capture a matching image, the length, width and area of the rectangular matching detection paper are standard sizes x1, x2 and x3, and pixel coordinates of four vertices in the matching image are obtained in a clockwise direction from the left upper corner vertex as a starting point, the coordinates being matching vertex coordinates P1, P2, P3 and P4.

[0051] As shown in Figure 4 , Figure 4 a matching detection frame shooting and matching vertex coordinate selection schematic diagram is provided in the embodiments of the present application. In Figure 4 , after the image acquisition device is fixed at a certain angle and an inclination angle, a rectangular matching detection calibration paper with a known size is placed on the road surface 3-4 m in front of the device to capture a matching image. Pixel coordinates of four vertices in the matching image are obtained in a clockwise direction from the left upper corner vertex as a starting point, the coordinates being four vertex pixel coordinates P1, P2, P3 and P4.

[0052] In some embodiments of the present application, the specific process of calculating the size error index of the matching detection frame corresponding to each rectified image according to the measurement parameters of each rectified image and the matching vertex coordinates of the preset matching detection frame includes: converting the matching vertex coordinates of the preset matching detection frame into matching perspective vertex coordinates under a top-down perspective view by using the perspective transformation matrix of each rectified image, to obtain the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image; calculating the matching lateral physical distance and the matching longitudinal physical distance of the matching detection frame corresponding to each rectified image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image; calculating the matching area of the matching detection frame corresponding to each rectified image according to the matching lateral physical distance and the matching longitudinal physical distance; taking the matching area of the matching detection frame corresponding to each rectified image, the matching lateral physical distance and the matching longitudinal physical distance as the area, length and width of the matching detection frame corresponding to each rectified image; and calculating the error index of the area, length and width of the matching detection frame corresponding to each rectified image as the size error index of the matching detection frame corresponding to each rectified image.

[0053] The conversion formula of the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image is:

[0054]

[0055] In the above formula (2), A i is the perspective transformation matrix of the i-th rectified image (i = 1, 2, 3, …, m); x' and y' are the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image; x and y are the matching vertex coordinates P1, P2, P3, and P4 of the preset matching detection frame.

[0056] Specifically, the specific process of calculating the matching horizontal physical distance of the matching detection frame corresponding to each rectified image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image includes: obtaining the third and fourth coordinate points in the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image; calculating the pixel distance of the matching detection frame corresponding to each rectified image through the third and fourth coordinate points as the matching horizontal pixel distance of the matching detection frame corresponding to each rectified image; and calculating the matching horizontal physical distance of the matching detection frame corresponding to each rectified image according to the matching horizontal pixel distance of the matching detection frame corresponding to each rectified image and the horizontal conversion ratio of each rectified image. The third and fourth coordinate points are the matching perspective vertex coordinates in the horizontal direction of the matching detection frame.

[0057] wherein, for the matching perspective vertex coordinates P 1(i) ', P 2(i) ', P 3(i) ', and P 4(i) ' of the matching detection frame corresponding to the i-th rectified image, the third and fourth points, i.e., P 3(i) ' and P 4(i) ' coordinate points, are taken, the pixel distance thereof is calculated as the matching horizontal pixel distance D p1(i) of the matching detection frame corresponding to the i-th rectified image using the Euclidean distance formula, and the matching horizontal physical distance D 1(i) of the matching detection frame corresponding to the i-th rectified image is calculated in combination with the aforementioned horizontal conversion ratio scale t1(i) of the i-th rectified image.

[0058] Specifically, the specific process of calculating the matching longitudinal physical distance of the matching detection frame corresponding to each rectified image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image comprises: obtaining the first and second coordinate points in the matching perspective vertex coordinates of the matching detection frame corresponding to each rectified image; calculating the pixel distance of the matching detection frame corresponding to each rectified image through the first and second coordinate points as the matching longitudinal pixel distance of the matching detection frame corresponding to each rectified image; and calculating the matching longitudinal physical distance of the matching detection frame corresponding to each rectified image according to the matching longitudinal pixel distance of the matching detection frame corresponding to each rectified image and the longitudinal conversion ratio of each rectified image. The first and second coordinate points are the matching perspective vertex coordinates in the longitudinal direction of the matching detection frame.

[0059] wherein the matching perspective vertex coordinates P 1(i) ′, P 2(i) ′, P 3(i) ′ and P 4(i) ′ of the matching detection frame corresponding to the i-th rectified image are taken as the first and third points, i.e. P 1(i) ′ and P 3(i) ′, the pixel distance thereof is calculated as the matching longitudinal pixel distance D p2(i) of the i-th rectified image using the Euclidean distance formula, and the matching longitudinal physical distance D 2(i) of the i-th rectified image is calculated by combining the longitudinal conversion ratio scale t2(i) of the i-th rectified image.

[0060] Further, the matching area S t1(i) of the matching detection frame corresponding to each rectified image can be calculated according to the matching lateral physical distance D t2(i) and the matching longitudinal physical distance D (i) of the matching detection frame corresponding to the i-th rectified image. The matching area S (i) , the matching lateral physical distance D t1(i) and the matching longitudinal physical distance D t2(i) of the matching detection frame corresponding to each rectified image are taken as the area, length and width of the matching detection frame corresponding to each rectified image. The error index of the area, length and width of the matching detection frame corresponding to each rectified image is represented by X ij , and x ij is the value corresponding to the j-th error index of the i-th rectified image, wherein x i1 = |x1-D t1(i) |, x i2 = |x2-D t2(i) | and x i3 = |x3-S (i) .(i = 1, 2, 3..., m). x1, x2, x3 are the length, width and area of the rectangular matching detection paper.

[0061] In S104, a comprehensive score of the size error index of the matching detection frame corresponding to each corrected image is calculated, and the measurement parameter of the corrected image with the highest comprehensive score is taken as the optimal measurement parameter.

[0062] The size error index of the matching detection frame includes the error index of the area, length and width of the matching detection frame corresponding to each corrected image.

[0063] In some embodiments of the present application, the specific process of calculating the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image includes: performing negative normalization on the error index of the area, length and width of the matching detection frame corresponding to each corrected image to obtain standardized values corresponding to the error index of the length, width and area size; using the standardized values corresponding to the error index of the length, width and area size to calculate proportional values corresponding to the error index of the length, width and area size; using the proportional values corresponding to the error index of the length, width and area size to calculate information entropy corresponding to the error index of the length, width and area size; using the information entropy corresponding to the error index of the length, width and area size to calculate evaluation weights corresponding to the error index of the length, width and area size; and calculating the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image by using the error index of the length, width and area size of the matching detection frame corresponding to each corrected image and the evaluation weights corresponding thereto.

[0064] The evaluation weight value and the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image can be calculated using the entropy value method. The entropy value method is a multi-index evaluation method based on information entropy. The weights of different indexes are determined by calculating the entropy values of the indexes, and finally the weights are used to comprehensively evaluate each scheme or object. In the present application, the weights of the j indexes can be scientifically determined by the entropy value method, and the advantages and disadvantages of the m groups of measurement parameters can be objectively evaluated to match the best measurement parameter.

[0065] Specifically, the evaluation weight w j To calculate the weight of an index according to the entropy value, the greater the weight of an index, the greater the influence of the variation of the index on the overall decision. The comprehensive score Z i is a weighted sum of the weights of the j indexes and the scores of the m groups of corrected images on the j indexes, which reflects the comprehensive performance of the m groups of corrected images on the j evaluation indexes. In the embodiments of the present application, the lower the comprehensive score, the higher the matching degree of the group of measurement parameters.

[0066] For example, in the case of the unit of measurement of the j (j = 1, 2, 3) indicators and the direction are not unified, in order to facilitate the calculation of the comprehensive error, the error data obtained by measurement needs to be normalized in a negative direction, and the formula is as follows:

[0067]

[0068] In the above formula (5), x ij is the value corresponding to the jth error indicator of the ith corrected image; x' ij is the standardized value under the jth error indicator of the ith corrected image, ranging from [0, 1], and the larger the value, the smaller the error, i.e., the better the measurement parameter; Min(x j ) is the minimum value of the jth indicator; Max(x j ) is the maximum value of the jth indicator.

[0069] For example, in order to measure the uncertainty of the indicators, the information entropy E j of the j indicators is calculated, and for the jth indicator, the information entropy E j is calculated as follows:

[0070]

[0071] In the above formula (6), p ij represents the proportional value of the ith corrected image on the jth indicator, wherein,

[0072]

[0073] For example, the evaluation weight w j of the three indicators is calculated according to the information entropy E j , and the smaller the information entropy E j , the greater the amount of information provided by the indicator, and the greater the weight w j , and the weight calculation formula is as follows:

[0074]

[0075] For example, the comprehensive score Z i of the size error indicator of the matching detection frame corresponding to the ith corrected image is calculated,

[0076]

[0077] The comprehensive score reflects the weighted error advantage and disadvantage, and the measurement parameters of the corrected image corresponding to the highest comprehensive score, i.e., the perspective transformation matrix A i , the horizontal conversion ratio scale (1i) , and the vertical conversion ratio scale (2i) , are selected as the best matching measurement parameters and applied to actual measurement.

[0078] In the embodiment of the present application, on the one hand, by adopting multiple sets of shooting parameters to shoot and correct the calibration images, the arrangement combinations of multiple ground clearances and multiple tilt angles are considered when the shooting parameters are selected, and multiple sets of measurement parameters including the perspective transformation matrix, the lateral conversion ratio and the longitudinal conversion ratio corresponding to the corrected images are obtained according to different shooting parameters, which can adapt to different camera installation scenes, so that the measurement system can obtain reliable measurement results in various complex environments, thereby improving the flexibility of the detection frame calibration and measurement. On the other hand, according to the measurement parameters of each corrected image and the matching vertex coordinates of the pre-matching detection frame, the size error index of the matching detection frame corresponding to each corrected image is calculated, and then the evaluation weight value of the size error index of the matching detection frame is calculated by using the entropy method to determine the optimal measurement parameter through the comprehensive score, which can ensure that the selected parameter performs best on multiple evaluation indexes, and the optimal measurement parameter can be obtained, thereby improving the flexibility and accuracy of the detection frame calibration and measurement.

[0079] The following is an embodiment of the system of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the system embodiments of the present application, please refer to the method embodiments of the present application.

[0080] Please refer to Figure 5 , which shows the structure schematic diagram of the optimal measurement parameter determination system for image detection provided by an exemplary embodiment of the present application. The optimal measurement parameter determination system for image detection can be realized by software, hardware or a combination of both to become all or part of an electronic device. The system 1 includes a shooting module 10, a first matching determination module 20, a calculation module 30 and an optimization module 40.

[0081] The shooting module 10 is used to shoot and correct calibration images by adopting multiple sets of shooting parameters for a preset calibration site, and multiple corrected images are obtained; the multiple sets of shooting parameters are obtained by arranging and combining multiple ground clearances and multiple tilt angles perpendicular to the downward road surface;

[0082] The determination module 20 is used to determine the perspective transformation matrix, the lateral conversion ratio and the longitudinal conversion ratio of each corrected image, and obtain the measurement parameters of each corrected image;

[0083] The calculation module 30 is used to calculate the size error index of the matching detection frame corresponding to each corrected image according to the measurement parameters of each corrected image and the matching vertex coordinates of the pre-matching detection frame;

[0084] The optimization module 40 is used to calculate the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image, and take the measurement parameters of the corrected image corresponding to the highest comprehensive score as the optimal measurement parameters.

[0085] It should be noted that the optimal measurement parameter determination system for image detection provided in the above embodiment is only exemplified by the above division of functional modules when the optimal measurement parameter determination method for image detection is executed. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the optimal measurement parameter determination system for image detection provided in the above embodiment and the optimal measurement parameter determination method for image detection embodiment belong to the same concept, which embodies the realization process details of the method embodiment, which will not be repeated here.

[0086] The serial numbers of the embodiments of the present application are only for description, not representing the advantages and disadvantages of the embodiments.

[0087] In the embodiments of the present application, on the one hand, by adopting multiple sets of shooting parameters to shoot and correct the calibration image, the arrangement combination of multiple ground clearances and multiple tilt angles is considered when the shooting parameters are selected, which can adapt to different camera installation scenes, so that the measurement system can obtain reliable measurement results in various complex environments, thereby improving the flexibility of the detection frame calibration and measurement. On the other hand, according to the measurement parameters of each corrected image and the matching vertex coordinates of the pre-matching detection frame, the size error index of the matching detection frame corresponding to each corrected image is obtained, and then the evaluation weight value of the size error index of the matching detection frame is calculated by using the entropy value method. The evaluation weight value and the comprehensive score of the size error index of the matching detection frame are used to determine the optimal measurement parameter, which can ensure that the selected measurement parameter performs best on multiple (measurement error) evaluation indexes, and the optimal measurement parameter can be obtained, thereby improving the flexibility and accuracy of the detection frame calibration and measurement.

[0088] The present application also provides a computer readable medium having program instructions stored thereon, which, when executed by a processor, implement the optimal measurement parameter determination method for image detection provided by each of the above method embodiments.

[0089] The present application also provides a computer program product containing instructions which, when executed on a computer, cause the computer to perform the optimal measurement parameter determination method for image detection of each of the above method embodiments.

[0090] Please refer to Figure 6 The present application provides a structural schematic diagram of an electronic device. As shown in Figure 6 The electronic device 1000 can include at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.

[0091] The communication bus 1002 is used to realize the connection and communication between the components.

[0092] The user interface 1003 can include a display screen, a camera, and optionally a standard wired interface and a wireless interface.

[0093] The network interface 1004 can optionally include a standard wired interface and a wireless interface (e.g., a WI-FI interface).

[0094] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts of the electronic device 1000 through various interfaces and lines, and performs various functions of the electronic device 1000 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly used to process an operating system, a user interface, and an application program; the GPU is used to render and draw the content to be displayed on the display screen; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be implemented by a separate chip.

[0095] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1005 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1005 can also be at least one storage system located away from the aforementioned processor 1001. As shown in Figure 6 The memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and an application program for determining optimal measurement parameters for image detection.

[0096] In Figure 6 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an interface for user input and obtain user input data; and the processor 1001 can be used to call the application program for determining optimal measurement parameters for image detection stored in the memory 1005 and specifically perform the following operations:

[0097] For a preset calibration site, a plurality of calibration images are obtained by shooting and correcting calibration images using a plurality of sets of shooting parameters; the plurality of sets of shooting parameters are obtained by arranging and combining a plurality of ground clearances and a plurality of tilt angles downward perpendicular to the road surface;

[0098] The perspective transformation matrix, the lateral conversion ratio, and the longitudinal conversion ratio of each corrected image are determined to obtain the measurement parameters of each corrected image;

[0099] According to the measurement parameters of each corrected image and the matching vertex coordinates of the preset matching detection frame, the size error index of the matching detection frame corresponding to each corrected image is calculated;

[0100] The comprehensive score of the size error index of the matching detection frame corresponding to each corrected image is calculated, and the measurement parameters of the corrected image corresponding to the highest comprehensive score are taken as the optimal measurement parameters.

[0101] In one embodiment, when the processor 1001 performs shooting and correction of calibration images using a plurality of sets of shooting parameters to obtain a plurality of corrected images, the following operations are specifically performed:

[0102] Starting from the upper left corner of each calibration image, mark the pixel coordinates of each corner in a clockwise direction to obtain the perspective target coordinate point of each calibration image;

[0103] Calculate the perspective transformation matrix of each calibration image based on the perspective target coordinate points and perspective mapping coordinates of each calibration image; the perspective mapping coordinates are calculated based on the resolution of each calibration image;

[0104] The perspective transformation matrix of each calibration image is applied to the corresponding calibration image to perform perspective correction, and multiple corrected images are obtained.

[0105] In one embodiment, when determining the perspective transformation matrix, the horizontal conversion ratio, and the vertical conversion ratio of each rectified image, the processor 1001 specifically performs the following operations:

[0106] The perspective transformation matrix of each calibration image is used as the perspective transformation matrix of the corresponding rectified image;

[0107] Determine the center position of each rectified image;

[0108] Select the coordinate points adjacent to the center position of each corrected image in the clockwise direction as the horizontal calibration points of each corrected image;

[0109] Select the coordinate points above and below the center of each corrected image in a clockwise direction as the longitudinal calibration points of each corrected image;

[0110] Get the physical distance and pixel distance between horizontal and vertical calibration points;

[0111] Calculate the horizontal and vertical scaling ratios of each rectified image based on the physical distance and pixel distance.

[0112] In one embodiment, when the processor 1001 calculates the size error index of the matching detection frame corresponding to each corrected image based on the measurement parameters of each corrected image and the matching vertex coordinates of the preset matching detection frame, the following operations are specifically performed:

[0113] Using the perspective transformation matrix of each corrected image, the matching vertex coordinates of the preset matching detection frame are converted into the matching perspective vertex coordinates under the top-down perspective, and the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image are obtained;

[0114] Calculate the matching horizontal physical distance and the matching vertical physical distance of the matching detection frame corresponding to each corrected image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image;

[0115] According to the matching lateral physical distance, the matching longitudinal physical distance, the matching area of the matching detection frame corresponding to each corrected image is calculated;

[0116] The matching area of the matching detection frame corresponding to each corrected image, the matching lateral physical distance and the matching longitudinal physical distance corresponding thereto are taken as the area, length and width of the matching detection frame corresponding to each corrected image.

[0117] The error index of the area, length and width of the matching detection frame corresponding to each corrected image is calculated as the size error index of the matching detection frame corresponding to each corrected image.

[0118] In one embodiment, when the processor 1001 performs the operation of calculating the matching lateral physical distance of the matching detection frame corresponding to each corrected image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image, the following operation is specifically performed:

[0119] The third and fourth coordinate points in the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image are obtained.

[0120] The pixel distance of the matching detection frame corresponding to each corrected image is calculated as the matching lateral pixel distance of the matching detection frame corresponding to each corrected image through the third and fourth coordinate points.

[0121] The matching lateral physical distance of the matching detection frame corresponding to each corrected image is calculated according to the matching lateral pixel distance of the matching detection frame corresponding to each corrected image and the lateral conversion ratio of each corrected image.

[0122] In one embodiment, when the processor 1001 performs the operation of calculating the matching longitudinal physical distance of the matching detection frame corresponding to each corrected image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image, the following operation is specifically performed:

[0123] The first and second coordinate points in the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image are obtained.

[0124] The pixel distance of the matching detection frame corresponding to each corrected image is calculated as the matching longitudinal pixel distance of the matching detection frame corresponding to each corrected image through the first and second coordinate points.

[0125] The matching longitudinal physical distance of the matching detection frame corresponding to each corrected image is calculated according to the matching longitudinal pixel distance of the matching detection frame corresponding to each corrected image and the longitudinal conversion ratio of each corrected image.

[0126] In one embodiment, when the processor 1001 performs the operation of calculating the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image, the following operation is specifically performed:

[0127] The error indicators of the area, length and width of the matching detection frame corresponding to each corrected image are negatively normalized to obtain standardized values corresponding to the error indicators of the length, width and area dimensions;

[0128] The standardized values corresponding to the error indicators of the length, width and area dimensions are used to calculate proportional values corresponding to the error indicators of the length, width and area dimensions;

[0129] The proportional values corresponding to the error indicators of the length, width and area dimensions are used to calculate information entropy corresponding to the error indicators of the length, width and area dimensions;

[0130] The information entropy corresponding to the error indicators of the length, width and area dimensions is used to calculate evaluation weights corresponding to the error indicators of the length, width and area dimensions;

[0131] The error indicators of the length, width and area dimensions of the matching detection frame corresponding to each calibration image are used to calculate a comprehensive score of the size error indicator of the matching detection frame corresponding to each calibration image.

[0132] In the embodiments of the present application, on the one hand, the calibration images are photographed and corrected by using multiple groups of shooting parameters, and the arrangement combinations of multiple ground clearances and multiple tilt angles are considered when the shooting parameters are selected, which can adapt to different camera installation scenes, so that the measurement system can obtain reliable measurement results in various complex environments, thereby improving the flexibility of the detection frame calibration and measurement. On the other hand, according to the measurement parameters of each corrected image and the matching vertex coordinates of the pre-matching detection frame, the size error indicator of the matching detection frame corresponding to each corrected image is calculated, and then the evaluation weight value of the size error indicator of the matching detection frame is calculated by using the entropy value method. The optimal measurement parameter can be determined by using the evaluation weight value and the comprehensive score of the size error indicator of the matching detection frame, which can ensure that the selected measurement parameter performs best on multiple (measurement error) evaluation indicators, and the optimal measurement parameter can be obtained, thereby improving the flexibility and accuracy of the detection frame calibration and measurement.

[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The program for determining the optimal measurement parameter for image detection can be stored in a computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiments can be included. The storage medium of the program for determining the optimal measurement parameter for image detection can be a disk, an optical disk, a read-only memory or a random access memory, etc.

[0134] The above disclosure is only the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.

Claims

1. A method for determining optimal measurement parameters for image detection, characterized in that: The method comprises: For a preset calibration site, multiple sets of shooting parameters are used to shoot and correct calibration images to obtain multiple corrected images; the multiple sets of shooting parameters are obtained by arranging and combining multiple heights above the ground and multiple tilt angles perpendicular to the road surface downward; Determining the perspective transformation matrix, the horizontal conversion ratio, and the vertical conversion ratio of each corrected image to obtain measurement parameters of each corrected image; Calculating a size error index of a matching detection frame corresponding to each corrected image based on the measurement parameters of each corrected image and the matching vertex coordinates of a preset matching detection frame; Calculate the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image, and use the measurement parameters of the corrected image corresponding to the highest comprehensive score as the optimal measurement parameters.

2. The method according to claim 1, characterized in that The method of shooting and correcting calibration images using multiple sets of shooting parameters to obtain multiple corrected images includes: Taking the upper left corner vertex of each calibration image as the starting point, mark the pixel coordinates of each corner in a clockwise direction to obtain the perspective target coordinate point of each calibration image; Calculating a perspective transformation matrix of each calibration image according to the perspective target coordinate points and the perspective mapping coordinates of each calibration image; the perspective mapping coordinates are calculated according to the resolution of each calibration image; The perspective transformation matrix of each calibration image is applied to the corresponding calibration image to perform perspective correction to obtain multiple corrected images.

3. The method according to claim 1, characterized in that Determining the perspective transformation matrix, the horizontal conversion ratio, and the vertical conversion ratio of each corrected image includes: The perspective transformation matrix of each calibration image is used as the perspective transformation matrix of the corresponding rectified image; determining a center position of each of the rectified images; Selecting coordinate points adjacent to the center position of each corrected image on the left and right sides in a clockwise direction as lateral calibration points of each corrected image; Selecting coordinate points adjacent to the center position of each corrected image in a clockwise direction as longitudinal calibration points of each corrected image; Obtaining the physical distance and pixel distance between the horizontal calibration points and the vertical calibration points; The horizontal conversion ratio and the vertical conversion ratio of each corrected image are calculated according to the physical distance and the pixel distance.

4. The method according to claim 1, wherein The step of calculating a size error index of a matching detection frame corresponding to each corrected image according to the measurement parameters of each corrected image and the matching vertex coordinates of a preset matching detection frame includes: Using the perspective transformation matrix of each corrected image, the matching vertex coordinates of the preset matching detection frame are converted into matching perspective vertex coordinates under a top-down perspective, thereby obtaining the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image; Calculating a matching horizontal physical distance and a matching vertical physical distance of the matching detection frame corresponding to each corrected image according to the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image; Calculating a matching area of ​​a matching detection frame corresponding to each corrected image according to the matching horizontal physical distance and the matching vertical physical distance; The matching area of ​​the matching detection frame corresponding to each corrected image, and the corresponding matching horizontal physical distance and matching vertical physical distance are used as the area, length, and width of the matching detection frame corresponding to each corrected image; Calculate error indicators of the area, length, and width of the matching detection frame corresponding to each corrected image as size error indicators of the matching detection frame corresponding to each corrected image.

5. The method according to claim 4, characterized in that The calculating, based on the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image, the matching horizontal physical distance of the matching detection frame corresponding to each corrected image includes: Obtaining the third and fourth coordinate points in the matching perspective vertex coordinates of the matching detection box corresponding to each corrected image; Calculating the pixel distance of the matching detection frame corresponding to each corrected image using the third and fourth coordinate points as the matching horizontal pixel distance of the matching detection frame corresponding to each corrected image; The matching horizontal physical distance of the matching detection frame corresponding to each corrected image is calculated according to the matching horizontal pixel distance of the matching detection frame corresponding to each corrected image and the horizontal conversion ratio of each corrected image.

6. The method according to claim 4, characterized in that The calculating, based on the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image, the matching longitudinal physical distance of the matching detection frame corresponding to each corrected image includes: Obtaining first and second coordinate points in the matching perspective vertex coordinates of the matching detection frame corresponding to each corrected image; Calculating the pixel distance of the matching detection frame corresponding to each rectified image using the first and second coordinate points as the matching longitudinal pixel distance of the matching detection frame corresponding to each rectified image; The matching longitudinal physical distance of the matching detection frame corresponding to each corrected image is calculated according to the matching longitudinal pixel distance of the matching detection frame corresponding to each corrected image and the longitudinal conversion ratio of each corrected image.

7. The method according to claim 1, characterized in that The size error index of the matching detection frame includes error indexes of the area, length and width of the matching detection frame corresponding to each corrected image; Calculating a comprehensive score of a size error index of a matching detection frame corresponding to each corrected image includes: Performing negative normalization processing on the error indicators of the area, length, and width of the matching detection frame corresponding to each corrected image to obtain standardized values ​​corresponding to the error indicators of the length, width, and area dimensions; Calculating the proportional values ​​corresponding to the error indices of the length, width, and area dimensions by using the standardized values ​​corresponding to the error indices of the length, width, and area dimensions; Calculating information entropy corresponding to the error indicators of length, width, and area by using the ratio values ​​corresponding to the error indicators of length, width, and area; Calculate the evaluation weights corresponding to the error indicators of the length, width, and area dimensions by using the information entropy corresponding to the error indicators of the length, width, and area dimensions; The comprehensive score of the size error index of the matching detection frame corresponding to each calibration image is calculated by using the error index of the length, width and area size of the matching detection frame corresponding to each calibration image and the corresponding evaluation weight.

8. A device for determining optimal measurement parameters for image detection, characterized in that: The device comprises: A shooting module is used to shoot and correct calibration images at a preset calibration site using multiple sets of shooting parameters to obtain multiple corrected images; the multiple sets of shooting parameters are obtained by arranging and combining multiple ground clearance heights and multiple downward inclination angles perpendicular to the road surface; a determination module, configured to determine the perspective transformation matrix, the horizontal conversion ratio, and the vertical conversion ratio of each corrected image, and obtain measurement parameters of each corrected image; a calculation module, configured to calculate a size error index of a matching detection frame corresponding to each corrected image based on the measurement parameters of each corrected image and the matching vertex coordinates of a preset matching detection frame; The optimization module is used to calculate the comprehensive score of the size error index of the matching detection frame corresponding to each corrected image, and use the measurement parameters of the corrected image corresponding to the highest comprehensive score as the optimal measurement parameters.

9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.

10. A terminal, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps according to any one of claims 1 to 7.