Image parameter calibration method, device and equipment

By determining the coordinates of the vertices of the convex quadrilateral in the image and determining the order of the vertices based on vector operations, the problem of random coordinate point order caused by the irregular quadrilateral frame is solved, and the accuracy of image parameter calibration and the reliability of recognition are improved.

CN118608750AActive Publication Date: 2024-09-06GUANGDONG ZESHENG TRANSPORTATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411082321.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-09-06
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

During the image recognition process, due to the influence of the shooting angle and the shape of the target, the quadrilateral frame of the target area is irregular, resulting in a random order of coordinate points, which may lead to rectangular conversion errors and affect the reliability of image recognition.

Method used

By obtaining the vertex coordinates of the convex quadrilateral of the target area in the image to be calibrated, determine the vertex with the smallest ordinate value as the first vertex, calculate the vector between the first vertex and other vertices, and determine the coordinates of the remaining vertices based on the vector operation results to ensure that the coordinate sequence is accurate.

Benefits of technology

It improves the convenience and accuracy of image parameter calibration, reduces the generation of erroneous data, and enhances the reliability of image recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608750A
    Figure CN118608750A
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses an image parameter calibration method, device and equipment, and the method comprises the steps: obtaining vertex coordinates of vertex coordinates of a convex quadrangle corresponding to a target region in a to-be-calibrated image, and recording the vertex coordinates as first vertex coordinates; calculating a first vector of the first vertex coordinate and one unmarked vertex coordinate, and two second vectors of the first vertex coordinate and any other unmarked vertex coordinate; based on a vector operation result between the first vector and the second vector, determining a second vertex coordinate, a third vertex coordinate and a fourth vertex coordinate corresponding to the unmarked vertex coordinates; based on the first vertex coordinate, the second vertex coordinate, the third vertex coordinate and the fourth vertex coordinate, performing parameter calibration on the to-be-calibrated image; the method can improve the convenience and accuracy of image parameter calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, device and equipment for calibrating image parameters. Background Art

[0002] After the target recognition in the image, including text recognition, it is usually necessary to frame the target in the image with a quadrilateral, and obtain the coordinates of the four vertices after the frame. Then, the target area is captured according to the four coordinate points, and another rectangular image is generated by image transformation. This generated rectangular image is the final result as the recognition training material, because the quadrilateral area is the main body of the target, and the image including the background image cannot be used as the training for image recognition.

[0003] However, in the actual image recognition process, due to the influence of factors such as shooting angle and target shape, the target area is often complex, so the resulting quadrilateral is also irregular, with both acute and obtuse angles, and any rotation angle is possible. At the same time, in the large amount of work of annotating data, in order to pursue work speed, operators often annotate the targets in any convenient way, and the order of the marked coordinate points is not fixed, but has a lot of randomness. If these coordinate points are not arranged in order, the left and right may be reversed and the top and bottom may be reversed when converting the rectangle, resulting in a large amount of erroneous data, especially the reversal of text, which will lead to errors in the order and font of the text in the sentence, which greatly affects the reliability of image recognition training. Summary of the invention

[0004] In view of this, the present invention provides a method, device and apparatus for calibrating image parameters to solve the problems of low convenience and accuracy of image parameter calibration in the related art.

[0005] In a first aspect, the present invention provides a method for calibrating image parameters, the method comprising: Get the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated; Get the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and mark them as the first vertex coordinates; Calculate a first vector between the coordinates of the first vertex and the coordinates of one of the unmarked vertices, and two second vectors between the coordinates of the first vertex and the coordinates of any of the remaining unmarked vertices; Determine the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector; Based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates, parameter calibration is performed on the image to be calibrated.

[0006] In some optional implementations, obtaining the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral and marking them as the first vertex coordinates includes: Get the ordinate value of each vertex coordinate in the vertex coordinates of the convex quadrilateral; Compare the coordinate values ​​of each vertex coordinate to obtain the vertex coordinate with the smallest ordinate value among the vertex coordinates of the convex quadrilateral; Mark the vertex coordinate with the smallest ordinate value as the first vertex coordinate.

[0007] In some optional implementations, determining the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector includes: Calculate the product of the first vector and the two second vectors respectively to obtain two vector products; When the two vector products have the same sign, update the first vector; When the two vector products have different signs, determine the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates; Based on the vector product of the two vector products that is greater than zero, the second vertex coordinates corresponding to the unmarked vertex coordinates are determined.

[0008] In some optional implementations, when the two vector products have different signs, determining the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates includes: When two vector products have different signs, the unmarked vertex coordinates in the first vector are used as the third vertex coordinates; Based on the vector product of the two vector products being less than zero, the unmarked vertex coordinates in the second vector are used as the fourth vertex coordinates.

[0009] In some optional implementations, determining the second vertex coordinates corresponding to the unmarked vertex coordinates based on the vector product of the two vector products that is greater than zero includes: Based on the vector product of the two vector products being greater than zero, the unmarked vertex coordinates in the second vector are taken as the second vertex coordinates.

[0010] In some optional embodiments, before calculating the first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and the two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates, the method further includes: Obtain the first vertex coordinates and the first coordinate value of one of the unmarked vertex coordinates, and the second coordinate values ​​of the remaining two unmarked vertex coordinates; The first coordinate value is compared with the second coordinate value to obtain a coordinate value comparison result, wherein the coordinate value comparison result includes that the maximum horizontal coordinate value and the maximum vertical coordinate value between the first vertex coordinate and one of the unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value between the other two unmarked vertex coordinates, and the maximum horizontal coordinate value and the maximum vertical coordinate value between the other two unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value between the first vertex coordinate and one of the unmarked vertex coordinates.

[0011] In some optional implementations, the above method further includes: Obtain a first slope of a line segment formed by the first vertex coordinates and the second vertex coordinates, and a second slope of a line segment formed by the first vertex coordinates and the fourth vertex coordinates; Comparing the absolute value of the first slope with the absolute value of the second slope to obtain a slope comparison value result; The positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates are adjusted based on the slope comparison value result.

[0012] In some optional implementations, the above method further includes: Obtain a first distance between the first vertex coordinates and the second vertex coordinates, and a second distance between the first vertex coordinates and the fourth vertex coordinates; Comparing the absolute value of the first distance with the absolute value of the second distance to obtain a distance comparison value result; The positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates are adjusted based on the distance comparison value result.

[0013] In a second aspect, the present invention provides a device for calibrating image parameters, the device comprising: A coordinate acquisition module is used to obtain the coordinates of the convex quadrilateral vertices corresponding to the target area in the image to be calibrated; A first marking module, used to obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and mark them as the first vertex coordinates; A coordinate marking module is used to obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral and mark them as the first vertex coordinates; A vector calculation module, used for calculating a first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates; A coordinate determination module, for determining a second vertex coordinate, a third vertex coordinate, and a fourth vertex coordinate corresponding to the unmarked vertex coordinate based on a vector operation result between the first vector and the second vector; The parameter calibration module is used to perform parameter calibration on the image to be calibrated based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates.

[0014] In a third aspect, the present invention provides a computer device, comprising: The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image parameter calibration method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image parameter calibration method of the first aspect or any corresponding embodiment thereof.

[0016] The technical solution provided by the embodiment of the present invention obtains the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated, and then determines the first vertex coordinate based on the vertex coordinate with the smallest ordinate value in the vertex coordinates of the convex quadrilateral; calculates the first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and the two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates, and determines the second vertex coordinate, the third vertex coordinate and the fourth vertex coordinate corresponding to the unmarked vertex coordinate based on the vector operation result between the first vector and the second vector; and performs parameter calibration on the image to be calibrated based on the first vertex coordinate, the second vertex coordinate, the third vertex coordinate and the fourth vertex coordinate, thereby improving the convenience and accuracy of image parameter calibration.

[0017] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 is a flow chart of a method for calibrating image parameters according to an embodiment of the present invention; Figure 2is a schematic diagram of a scene for calibration of image parameters according to an embodiment of the present invention; Figure 3 is a structural block diagram of an image parameter calibration device according to an embodiment of the present invention; Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] In this embodiment, a method for calibrating image parameters is provided. Figure 1 1 is a flow chart of a method for calibrating image parameters according to an embodiment of the present invention, which is applied to an image parameter calibration device. The flow chart includes the following steps: Step S101, obtaining the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated.

[0022] The target area of ​​the image to be calibrated may be the area where the target image is located, or the area where the target text is located. The vertex coordinates of the convex quadrilateral corresponding to the target area may be determined based on the plane coordinate system where the image to be calibrated is located, or may be determined by the coordinate system established by the plane where the convex quadrilateral is located in the calibration interface of the image parameter calibration device.

[0023] Step S102, obtaining the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and marking them as the first vertex coordinates.

[0024] Specifically, first obtain the ordinate value of each vertex coordinate in the vertex coordinates of the convex quadrilateral; then compare the coordinate values ​​of each vertex coordinate to obtain the vertex coordinate with the smallest ordinate value in the vertex coordinates of the convex quadrilateral; finally, mark the vertex coordinate with the smallest ordinate value as the first vertex coordinate.

[0025] For example, see Figure 2, first compare the ordinate values ​​in the vertex coordinates of the convex quadrilateral (i.e., the four vertex coordinates) to obtain the vertex coordinates with the smallest ordinate value; mark the vertex coordinates with the smallest ordinate value as the starting point, and mark it as the first vertex coordinate p1. It can be understood that the first vertex is closest to the x-axis of the convex quadrilateral, that is, the two endpoints of the top edge. Generally speaking, the points at positions p4 and p1 in the example figure may also be the first vertex. If there are two vertices with the smallest ordinate, take the one with the smaller abscissa.

[0026] Step S103, calculating a first vector between the first vertex coordinate and one of the unmarked vertex coordinates, and two second vectors between the first vertex coordinate and any of the remaining unmarked vertex coordinates.

[0027] As described above, by calculating the first vertex coordinate and the first vector of one of the unmarked vertex coordinates, and the two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates, the coordinate positions of other vertices can be confirmed based on the first vector and the second vector.

[0028] Step S104 , determining the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector.

[0029] Specifically, calculate the product of the first vector and the two second vectors respectively to obtain two vector products; when the two vector products have the same sign, update the first vector; when the two vector products have different signs, determine the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates; based on the vector product greater than zero in the two vector products, determine the second vertex coordinates corresponding to the unmarked vertex coordinates.

[0030] In some optional embodiments, when two vector products have different signs, the unmarked vertex coordinates in the first vector are used as the third vertex coordinates; based on the vector product of the two vector products that is less than zero, the unmarked vertex coordinates in the second vector are used as the fourth vertex coordinates; based on the vector product of the two vector products that is greater than zero, the unmarked vertex coordinates in the second vector are used as the second vertex coordinates.

[0031] For example, see Figure 2, suppose the coordinates of p1, p2, p3, and p4 are (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. The first vertex coordinate p1 and one of the unmarked vertex coordinates, such as p3, form the first vector p1p3. The two second vectors of the first vertex coordinate p1 and any of the remaining unmarked vertex coordinates (p2 or p4) are p1p2 and p1p4 respectively. Calculate the vector product of the first vector p1p3 with the two vectors p1p2 and p1p4 in the second vector, and we have p1p3×p1p2 and p1p3×p1p4. If the results of these two vector products are of opposite signs, then p3 can be determined as the third coordinate point. If the result is greater than zero, such as p1p3×p1p2>0, p2 can be determined as the second coordinate. Correspondingly, if p1p3×p1p4<0, then p4 is the fourth coordinate.

[0032] In some optional embodiments, the diagonal point of the first vertex coordinate can be determined and marked as the third vertex coordinate based on the first vertex coordinate and the first vector of one of the unmarked vertex coordinates, and the result of a vector operation between the first vertex coordinate and two second vectors of any of the remaining unmarked vertex coordinates.

[0033] Specifically, obtain the first coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates, and the second coordinate value of the remaining two unmarked vertex coordinates; compare the first coordinate value with the second coordinate value to obtain a coordinate value comparison result; calculate the first vector of the first vertex coordinate and any unmarked vertex coordinate, and the vector product between the first vertex coordinate and the second vector of the remaining two unmarked vertex coordinates in the vertex coordinates of the convex quadrilateral to obtain a vector operation result; based on the vector operation result, if the two vector products have different signs, determine the diagonal point of the first vertex coordinate and mark it as the third vertex coordinate, as well as the second vertex coordinate and the fourth vertex coordinate. Wherein, the coordinate value comparison result includes the maximum horizontal coordinate value and the maximum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates, both of which are greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the remaining two unmarked vertex coordinates, and the maximum horizontal coordinate value and the maximum vertical coordinate value of the remaining two unmarked vertex coordinates are greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates.

[0034] For example, see Figure 2, suppose the coordinates of p1, p2, p3, and p4 are (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. If the line segment p1p3 intersects with the line segment p2p4, the larger value of x1 and x3 will be greater than the smaller value of x2 and x4, the larger value of y1 and y3 will be greater than the smaller value of y2 and y4, the larger value of x2 and x4 will be greater than the smaller value of x1 and x3, and the larger value of y2 and y4 will be greater than the smaller value of y1 and y3. If all four conditions are met, it is a necessary condition for the line segments to intersect. If any of them are not met, the two line segments must not intersect, thereby eliminating the situation where part of the two line segments do not intersect, thereby improving the efficiency of parameter determination.

[0035] If p2 and p4 are at both ends of the line segment p1p3, the vector product of the first vector p1p3 and the vector p1p2 in the second vector has the opposite sign to the vector product of the first vector p1p3 and the vector p1p4 in the second vector, that is, by calculating p1p3×p1p2 and p1p3×p1p4, it is determined whether p3 is the diagonal point of p1. At this time, if p2 is a clockwise point relative to the first vertex coordinate p1, the result of the vector product calculation is greater than 0, that is, p1p3×p1p2=(x3-x1)(y2-y1)-(x2-x1)(y3-y1)>0; similarly, if p4 is a counterclockwise point relative to the first vertex coordinate p1, then p1p3×p1p4=(x3-x1)(y4-y1)-(x4-x1)(y3-y1)<0. By calculating the vector product, the positions of p2 and p4 can be determined while confirming p3.

[0036] In the operation, since the first vertex coordinate p1 is a known point obtained in the above step, the remaining three endpoints find corresponding diagonal points based on the first vector operation result, that is, the third vertex coordinate p3.

[0037] It can be understood that if the result of the vector product calculation is not of different signs, then the coordinate value comparison and the first vector operation are performed on the remaining three coordinates of the convex quadrilateral vertex coordinates in a loop, in order to find the diagonal point of the first vertex coordinate p1 that meets the conditions, recorded as the third vertex coordinate p3. That is, if the third vertex coordinate p3 is the diagonal point, then points p2 and p4 are on both sides of the first vector p1p3.

[0038] In some optional embodiments, when determining the second vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector, it is also possible to determine that the corresponding unmarked vertex coordinates in the second vector are located in the clockwise direction of the first vertex coordinates when the vector product of the first vector (i.e., the vector corresponding to the first vertex coordinates and the third vertex coordinates) and the second vector is greater than zero; when the vector product of the first vector and the second vector is less than zero, determine that the corresponding unmarked vertex coordinates in the fourth vector are located in the counterclockwise direction of the first vertex coordinates.

[0039] Step S105 , performing parameter calibration on the image to be calibrated based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates.

[0040] As described above, by calibrating the vertex coordinates of the convex quadrilateral corresponding to the target area in the calibrated image based on the positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates, the convenience and accuracy of the image parameter calibration are improved.

[0041] In some optional embodiments, the first slope of the line segment formed by the first vertex coordinates and the second vertex coordinates, as well as the second slope of the line segment formed by the first vertex coordinates and the fourth vertex coordinates can also be obtained; the absolute value of the first slope is compared with the absolute value of the second slope to obtain a slope comparison value result; and the positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates are adjusted based on the slope comparison value result.

[0042] Specifically, due to the huge amount of annotation data, it is inevitable that the angle of the target position will be special. Finally, a final step is required to determine whether to adjust the coordinate order, such as Figure 2 As shown, in general, vertex p4 is more suitable as the upper left corner point (first vertex coordinate) p1. At this time, according to the absolute value of the slope of the two line segments connected to the point closest to the x-axis (first vertex coordinate) p1, take the smaller line segment as the top of the convex quadrilateral, and the left endpoint of this line segment is p1. That is, if |(y1-y4) / (x1-x4)|<|(y1-y2) / (x1-x2)|, then change points p1, p2, p3, p4 to p2, p3, p4, p1 respectively.

[0043] In some optional embodiments, it is also possible to obtain a first distance between the first vertex coordinates and the second vertex coordinates, and a second distance between the first vertex coordinates and the fourth vertex coordinates; compare the absolute value of the first distance with the absolute value of the second distance to obtain a distance comparison value result; and adjust the positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates based on the distance comparison value result.

[0044] Specifically, the method of modifying the starting point again based on the absolute value of the slope is universal, but it may be modified for different specific image scenarios. For example, in text recognition, for modern text typesetting, the text is arranged horizontally, resulting in the final result being a horizontal long rectangle. This is not only true for text recognition. The specific operation depends on the specific business scenario and is combined with reality. At this time, the method of modifying the coordinates of the first vertex again based on the absolute value of the slope must be changed to modifying it based on the vertex distance. That is, if |p1p4|>|p1p3|, it is equivalent to (x1-x4) 2 +(y1-y4) 2 >(x1-x3) 2 +(y1-y3) 2 , then change the points p1, p2, p3, and p4 to p2, p3, p4, and p1 respectively.

[0045] The technical solution provided by the embodiment of the present invention obtains the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated, and then determines the first vertex coordinate based on the vertex coordinate with the smallest ordinate value in the vertex coordinates of the convex quadrilateral; calculates the first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and the two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates, and determines the second vertex coordinate, the third vertex coordinate and the fourth vertex coordinate corresponding to the unmarked vertex coordinate based on the vector operation result between the first vector and the second vector; and performs parameter calibration on the image to be calibrated based on the first vertex coordinate, the second vertex coordinate, the third vertex coordinate and the fourth vertex coordinate, thereby improving the convenience and accuracy of image parameter calibration.

[0046] This embodiment provides a device for calibrating image parameters, such as Figure 3 As shown, including: The coordinate acquisition module 301 is used to acquire the coordinates of the vertices of the convex quadrilateral corresponding to the target area in the image to be calibrated.

[0047] The coordinate marking module 302 is used to obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and mark them as the first vertex coordinates.

[0048] The vector calculation module 303 is used to calculate a first vector between the first vertex coordinate and one of the unmarked vertex coordinates, and two second vectors between the first vertex coordinate and any of the remaining unmarked vertex coordinates.

[0049] The coordinate determination module 304 is used to determine the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector.

[0050] The parameter calibration module 350 is used to perform parameter calibration on the image to be calibrated based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates.

[0051] In some optional implementations, the coordinate marking module 302 includes: The coordinate value acquisition unit is used to obtain the ordinate value of each vertex coordinate in the vertex coordinates of the convex quadrilateral.

[0052] The coordinate value comparison unit is used to compare the coordinate values ​​of each vertex coordinate to obtain the vertex coordinate with the smallest ordinate value among the vertex coordinates of the convex quadrilateral.

[0053] The coordinate marking unit is used to mark the vertex coordinate with the smallest ordinate value as the first vertex coordinate.

[0054] In some optional implementations, the coordinate determination module 304 includes: The vector product calculation unit is used to calculate the product of the first vector and two second vectors respectively to obtain two vector products.

[0055] A first vector updating unit, used for updating the first vector when the two vector products have the same sign; The first coordinate determining unit is used to determine the third vertex coordinate and the fourth vertex coordinate corresponding to the unmarked vertex coordinate when the two vector products have different signs.

[0056] Specifically, when two vector products have different signs, the unmarked vertex coordinates in the first vector are used as the third vertex coordinates; based on the vector product of the two vector products that is less than zero, the unmarked vertex coordinates in the second vector are used as the fourth vertex coordinates.

[0057] The second coordinate calibration unit is used to determine the second vertex coordinates corresponding to the unmarked vertex coordinates based on the vector product greater than zero of the two vector products.

[0058] Specifically, based on the vector product of the two vector products that is greater than zero, the unmarked vertex coordinates in the second vector are used as the second vertex coordinates.

[0059] In some optional implementations, the vector calculation module 303 includes: A coordinate value acquisition unit, used for acquiring the first vertex coordinate and the first coordinate value of one of the unmarked vertex coordinates, and the second coordinate values ​​of the remaining two unmarked vertex coordinates; The coordinate value comparison unit compares the first coordinate value with the second coordinate value to obtain a coordinate value comparison result, wherein the coordinate value comparison result includes that the maximum horizontal coordinate value and the maximum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the other two unmarked vertex coordinates, and the maximum horizontal coordinate value and the maximum vertical coordinate value of the other two unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates.

[0060] In some optional embodiments, the coordinate determination module 304 is further used to obtain a first slope of a line segment formed by the first vertex coordinates and the second vertex coordinates, and a second slope of a line segment formed by the first vertex coordinates and the fourth vertex coordinates; compare the absolute value of the first slope with the absolute value of the second slope to obtain a slope comparison value result; and adjust the positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates based on the slope comparison value result.

[0061] In some optional embodiments, the coordinate determination module 304 is also used to obtain a first distance between the first vertex coordinates and the second vertex coordinates, and a second distance between the first vertex coordinates and the fourth vertex coordinates; compare the absolute value of the first distance with the absolute value of the second distance to obtain a distance comparison value result; and adjust the positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates based on the distance comparison value result.

[0062] The image parameter calibration device provided in the present embodiment and the technical solution provided in the embodiment of the present invention obtain the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated, and then determine the first vertex coordinates based on the vertex coordinates with the smallest ordinate value in the vertex coordinates of the convex quadrilateral; calculate the first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and the two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates, and determine the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates based on the vector operation result between the first vector and the second vector; calibrate the parameters of the image to be calibrated based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates, thereby improving the convenience and accuracy of image parameter calibration.

[0063] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0064] The image parameter calibration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0065] The embodiment of the present invention also provides a computer device having the above Figure 3 The battery health status prediction device shown.

[0066] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

[0067] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0068] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0069] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0070] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0071] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0072] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0073] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for calibrating image parameters, characterized in that: The method comprises: Get the vertex coordinates of the convex quadrilateral corresponding to the target area in the image to be calibrated; Obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and mark them as the first vertex coordinates; Calculate a first vector between the first vertex coordinate and one of the unmarked vertex coordinates, and two second vectors between the first vertex coordinate and any of the remaining unmarked vertex coordinates; Determine, based on a vector operation result between the first vector and the second vector, a second vertex coordinate, a third vertex coordinate, and a fourth vertex coordinate corresponding to the unmarked vertex coordinate; Based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates, parameter calibration is performed on the image to be calibrated.

2. The method according to claim 1, characterized in that The step of obtaining the vertex coordinates of the convex quadrilateral with the smallest ordinate value and marking them as first vertex coordinates includes: Obtaining the ordinate value of each vertex coordinate in the vertex coordinates of the convex quadrilateral; Compare the coordinate values ​​of the vertex coordinates to obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral; The vertex coordinate with the smallest vertical coordinate value is marked as the first vertex coordinate.

3. The method according to claim 1, characterized in that The determining, based on the vector operation result between the first vector and the second vector, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates corresponding to the unmarked vertex coordinates comprises: Calculate the product of the first vector and the two second vectors respectively to obtain two vector products; When the two vector products have the same sign, updating the first vector; When the two vector products have different signs, determining the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates; Based on the vector product of the two vector products that is greater than zero, a second vertex coordinate corresponding to the unmarked vertex coordinate is determined.

4. The method according to claim 3, characterized in that When the two vector products have different signs, determining the third vertex coordinates and the fourth vertex coordinates corresponding to the unmarked vertex coordinates comprises: When the two vector products have different signs, the unmarked vertex coordinates in the first vector are used as the third vertex coordinates; Based on the vector product of the two vector products being less than zero, the unmarked vertex coordinates in the second vector are used as fourth vertex coordinates.

5. The method according to claim 3, characterized in that: The determining, based on the vector product of the two vector products that is greater than zero, the second vertex coordinates corresponding to the unmarked vertex coordinates comprises: Based on the vector product of the two vector products that is greater than zero, the unmarked vertex coordinates in the second vector are used as second vertex coordinates.

6. The method according to claim 1, characterized in that Before calculating a first vector between the first vertex coordinate and one of the unlabeled vertex coordinates, and two second vectors between the first vertex coordinate and any of the remaining unlabeled vertex coordinates, the method further includes: Obtaining the first vertex coordinate and the first coordinate value of one of the unmarked vertex coordinates, and the second coordinate values ​​of the remaining two unmarked vertex coordinates; The first coordinate value is compared with the second coordinate value to obtain a coordinate value comparison result, wherein the coordinate value comparison result includes that the maximum horizontal coordinate value and the maximum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the other two unmarked vertex coordinates, and the maximum horizontal coordinate value and the maximum vertical coordinate value of the other two unmarked vertex coordinates are both greater than the minimum horizontal coordinate value and the minimum vertical coordinate value of the first vertex coordinate and one of the unmarked vertex coordinates.

7. The method according to claim 1, characterized in that The method further comprises: Obtaining a first slope of a line segment formed by the first vertex coordinates and the second vertex coordinates, and a second slope of a line segment formed by the first vertex coordinates and the fourth vertex coordinates; Comparing the absolute value of the first slope with the absolute value of the second slope to obtain a slope comparison value result; The positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates are adjusted based on the slope comparison result.

8. The method according to claim 1, characterized in that The method further comprises: Acquire a first distance between the first vertex coordinates and the second vertex coordinates, and a second distance between the first vertex coordinates and the fourth vertex coordinates; Comparing the absolute value of the first distance with the absolute value of the second distance to obtain a distance comparison value result; The positions of the first vertex coordinates, the second vertex coordinates, the third vertex coordinates, and the fourth vertex coordinates are adjusted based on the distance comparison value result.

9. A device for calibrating image parameters, characterized in that: The device comprises: A coordinate acquisition module is used to obtain the coordinates of the convex quadrilateral vertices corresponding to the target area in the image to be calibrated; A coordinate marking module, used to obtain the vertex coordinates with the smallest ordinate value among the vertex coordinates of the convex quadrilateral, and mark them as the first vertex coordinates; A vector calculation module, used for calculating a first vector of the first vertex coordinate and one of the unmarked vertex coordinates, and two second vectors of the first vertex coordinate and any of the remaining unmarked vertex coordinates; a coordinate determination module, configured to determine, based on a vector operation result between the first vector and the second vector, a second vertex coordinate, a third vertex coordinate, and a fourth vertex coordinate corresponding to the unmarked vertex coordinate; The parameter calibration module is used to perform parameter calibration on the image to be calibrated based on the first vertex coordinates, the second vertex coordinates, the third vertex coordinates and the fourth vertex coordinates.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image parameter calibration method according to any one of claims 1 to 8 by executing the computer instructions.

Citation Information

Patent Citations

  • Passenger flow statistics method and device, electronic equipment and storage medium

    CN112132119A

  • Photovoltaic panel marking method and device, electronic equipment and storage medium

    CN114140608A

  • Method for calibrating convex quadrangle of image, electronic equipment and computer readable medium

    CN116468798A

  • Vector-plotting device and storage medium

    JP2002032346A

  • Image-autocrop method for calibrating image-input

    US20030083835A1