Image mapping method, electronic device and computer readable storage medium

By identifying and adjusting the calibration elements in the image and determining the image mapping relationship, the problem of low image fusion efficiency is solved, and efficient mapping between the first image and the second image is achieved, which is suitable for scenarios such as intelligent transportation.

CN114463232BActive Publication Date: 2024-09-27ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111617705.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-09-27
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently fuse two images with different information together, and lacks a fast and automated image mapping method, resulting in low information integration efficiency.

Method used

By acquiring the first image and the second image, identifying the calibration elements, determining the adjustment conversion relationship, converting the first image into the third image, and determining the mapping relationship between the first image and the second image according to the mapping relationship, the image is realized Efficient integration.

Benefits of technology

It achieves fast and efficient mapping relationship determination between the first image and the second image without manual participation, improves the efficiency of information integration, and is suitable for application scenarios such as intelligent transportation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463232B
    Figure CN114463232B
Patent Text Reader

Abstract

The present application discloses an image mapping method, an electronic device and a computer-readable storage medium, the image mapping method comprising: acquiring a first image and a second image, the first image and the second image corresponding to the same target scene; identifying a calibration element in the first image; determining an adjustment conversion relationship for adjusting the calibration element to a predetermined posture; converting the first image into a third image according to the adjustment conversion relationship; determining a mapping relationship between the third image and the second image; determining a mapping relationship between the first image and the second image according to the adjustment conversion relationship and the mapping relationship. The image mapping method provided by the present application can efficiently realize the calibration between the first image and the second image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image mapping method, an electronic device, and a computer-readable storage medium. Background Art

[0002] As the Internet and network technologies become more mature, expressive, convenient and fast images are becoming more and more popular as a medium for conveying information.

[0003] The inventors of the present application have discovered that different images usually display different information, but if two images corresponding to the same scene but displaying different information are fused together, richer information can be obtained. Summary of the invention

[0004] The present application provides an image mapping method, an electronic device, and a computer-readable storage medium, which can efficiently realize calibration between a first image and a second image.

[0005] A first aspect of an embodiment of the present application provides an image mapping method, the method comprising: acquiring a first image and a second image, the first image and the second image corresponding to the same target scene; identifying a calibration element in the first image; determining an adjustment transformation relationship for adjusting the calibration element to a predetermined posture; converting the first image into a third image according to the adjustment transformation relationship; determining a mapping relationship between the third image and the second image; and determining a mapping relationship between the first image and the second image according to the adjustment transformation relationship and the mapping relationship.

[0006] A second aspect of an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a communication circuit, wherein the processor is coupled to the memory and the communication circuit, respectively, and program data is stored in the memory. The processor implements the steps in the above method by executing the program data in the memory.

[0007] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the above method.

[0008] The beneficial effect is that the present application first determines the adjustment conversion relationship for adjusting the calibration elements in the first image to the predetermined posture, and then converts the first image into the third image according to the adjustment conversion relationship. Then, since the third image and the second image correspond to the same target scene, including the same elements, and the setting of the predetermined posture, the mapping relationship between the third image and the second image can be determined very efficiently. Finally, the mapping relationship between the first image and the second image is determined according to the adjustment conversion relationship and the mapping relationship. The whole process is fast and efficient, and no human intervention is required. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0010] Figure 1 It is a flowchart of an implementation method of the image mapping method of the present application;

[0011] Figure 2 is a schematic diagram of a second image in an application scenario;

[0012] Figure 3 is a schematic diagram of a first image in an application scenario;

[0013] Figure 4 is a schematic diagram of a third image in an application scenario;

[0014] Figure 5 is a schematic diagram of merging the first image and the second image;

[0015] Figure 6 yes Figure 1 Schematic diagram of the process of step S130;

[0016] Figure 7 is a schematic diagram of corner points in the first image;

[0017] Figure 8 is a schematic diagram after corner points are screened in the first image;

[0018] Fig. 9 yes Figure 1 Schematic diagram of the process of step S150;

[0019] Fig.10 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0020] Fig.11 It is a structural schematic diagram of another embodiment of the electronic device of the present application;

[0021] Fig.12 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

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

[0023] See also Figure 1 , Figure 1 : is a flow chart of an embodiment of an image mapping method of the present application, the method comprising:

[0024] S110: Acquire a first image and a second image, where the first image and the second image correspond to the same target scene.

[0025] The first image and the second image correspond to the same target scene and include the same elements.

[0026] The following mapping relationship can be established between the first image and the second image:

[0027] p=F(U),U=G(p),F=G -1 , G=F -1 , where U = (u, v) represents the coordinates of any pixel in the first image, p = (x, y) represents the coordinates of a point in the second image corresponding to a pixel in the first image, F(*) represents mapping the first image to the second image, and G(*) represents mapping the second image to the first image.

[0028] In one application scenario, the first image is an image taken by a camera, and the second image is an image extracted from a map (such as a high-precision map). In this case, the coordinates of the midpoint of the second image can be expressed in rectangular coordinates or in GPS.

[0029] A map is a static data system, usually a high-precision vector map drawn by a professional manufacturer. It is a proportional map of the real world. All the elements contained in it are obtained by scaling objects in the real world. Figure 2 The camera is a real-time perception system. The number and position of the targets it obtains will change over time. In addition, the camera image is a perspective image, and objects near are larger than objects far away. Figure 3 .

[0030] The camera shoots the target scene to obtain a first image, and then a rectangular frame is manually selected in the map, and the image within the rectangular frame is the second image, wherein the rectangular frame at least partially overlaps with the monitoring range of the camera, so that the first image and the second image include the same elements.

[0031] In order to improve the accuracy of subsequent recognition and calibration, the first image is obtained by taking a picture of the target scene by the camera under good lighting conditions, such as during a clear day, and the first image does not include dynamic objects, such as pedestrians and vehicles.

[0032] For example, the camera photographs a road without dynamic objects such as pedestrians and vehicles under good lighting conditions to obtain a first image, or the camera photographs a building under good lighting conditions to obtain a first image.

[0033] S120: Identify calibration elements in the first image.

[0034] Among them, the calibration elements are elements with obvious characteristics in the first image. For example, when the first image is a road image, the calibration elements may be zebra crossings, arrows or lane lines on the road; when the first image is an image of a building taken by a camera, the calibration elements may be windows, lightning arresters, etc. on the building.

[0035] In one application scenario, in order to improve recognition accuracy and speed, a deep learning method based on instance segmentation is used to identify calibration elements in a first image.

[0036] S130: Determine an adjustment conversion relationship for adjusting the calibration element to a predetermined posture.

[0037] The standard for establishing the predetermined posture is that, after the third image is obtained, the second image can be mapped by simply transforming the third image, wherein the simple transformation includes but is not limited to translation, rotation and scaling.

[0038] S140: Convert the first image into a third image according to the adjusted conversion relationship.

[0039] See also Figure 4 , according to the adjustment conversion relationship, Figure 3 The first image in is converted to Figure 4 The third image in .

[0040] S150: Determine a mapping relationship between the third image and the second image.

[0041] Since the third image is converted from the first image, the first image and the second image include the same elements, and therefore the third image and the second image also include the same elements. Moreover, due to the establishment of the predetermined posture, the mapping relationship between the third image and the second image can be determined very efficiently.

[0042] S160: Determine a mapping relationship between the first image and the second image according to the adjusted conversion relationship and the mapping relationship.

[0043] The third image is obtained by adjusting the first image according to the adjustment conversion relationship, and the mapping relationship between the third image and the second image is known, so the mapping relationship between the first image and the second image can be determined according to the adjustment conversion relationship and the mapping relationship.

[0044] According to the mapping relationship between the first image and the second image, the first image and the second image may be merged together so that the same element overlaps.

[0045] The first image is still taken by the camera, and the second image is extracted from the map for illustration:

[0046] In intelligent transportation, the spatial location information and speed information of the target (mainly referring to the car) play an important role in event detection and traffic statistics. For example, a certain road scene is often congested. After investigation, the cause of the congestion is the unreasonable configuration of traffic light time. In fact, this phenomenon is very common in daily life. For example, in the straight lane, during peak hours in the morning and evening, the green light time is too short and the red light time is too long; during off-peak hours, the green light time is too long or even idle, causing vehicles at other intersections to wait for a long time.

[0047] By using the method in this embodiment, the mapping relationship between the camera image and the map can be determined, so that the position of the camera and the monitoring range of the camera can be marked on the map, that is, each monitoring target in the camera can be marked on the map in real time. For example, for an intersection on the road, all vehicle information at the intersection can be marked on the map, and the effect is as follows: Figure 5 As shown ( Figure 5 The middle camera is indicated by reference numeral 10), at this time, the information of all vehicles at the intersection can be globally grasped from the map, and the density of vehicles on each lane can be sensed, so that the traffic light time can be dynamically set reasonably as needed to improve the traffic efficiency of the passage.

[0048] It can be understood that, through the above method, information in the first image can be marked on the second image, and information in the second image can also be marked on the first image.

[0049] See also Figure 6In this embodiment, step S130 determines the step of adjusting the conversion relationship, including:

[0050] S131: In a first image, determine a plurality of first target points of calibration elements.

[0051] S132: Determine, on the calibration element adjusted to a predetermined posture, second target points corresponding to each first target point.

[0052] S133: Determine an adjustment conversion relationship according to the multiple first target points and the second target points corresponding to each of the first target points.

[0053] Specifically, i represents the point index, (u i , v i ) represents the first target point of the calibration element in the first image, (x i ,y i ) indicates that on the calibration element adjusted to the predetermined posture, the first target point (u i , v i ) The first target point and the corresponding second target point constitute a pair of target points.

[0054] Construct the following homogeneous equation:

[0055] Formula 1:

[0056] Transforming the above homogeneous equation, we get:

[0057] Formula 2: x i =a 11 ·u i +a 12 ·v i +a 13 ;

[0058] Formula 3: y i =a 21 ·u i +a 22 ·v i +a 23 ;

[0059] Formula 4: 1 = a 31 ·u i +a 32 ·v i +a 33 ;

[0060] Consider the above formula 4 as a constraint, and then mathematically it can be equivalent to:

[0061] Formula 5:

[0062] Formula 6:

[0063] Divide the numerator and denominator on the right side of Formula 5 and Formula 6 by a at the same time 33 , and order

[0064] get:

[0065] Formula 7:

[0066] Formula 8:

[0067] Formula 7 and Formula 8 are the radar calibration functions, and the coefficient matrix is ​​constructed as follows:

[0068] Formula 9:

[0069] Where W = [b 11 , b 12 , b 13 , b 21 , b 22 , b 23 , b 31 , b 32 ] T Based on Formula 9, we know that there are 8 unknown quantities to be solved, so only four pairs of target points are needed to solve the problem. Using four pairs of target points, the following measurement equation can be constructed:

[0070] Formula 10:

[0071] The formula 10 is simplified as:

[0072] Formula 11: AW=b;

[0073] According to formula 11, we can get:

[0074] Formula 12: W = (A T A) -1 A T b.

[0075] Formula 12 is the coefficient solution result, and then the coefficient solution result is substituted into Formula 7 and Formula 8 to obtain the adjustment conversion relationship.

[0076] From the above, it can be seen that only four pairs of target points are needed to determine the adjustment transformation relationship.

[0077] The first target point is a pixel point with obvious features on the punctuation element in the first image, for example, the first target point is a corner point (the corner point of two line segments), or the first target point is a boundary point.

[0078] In this embodiment, step S131 determines multiple first target points of the calibration element, including: in the first image, from the corner points of the calibration element, screening out multiple first target points that constitute a first predetermined shape; step S132 determines the second target points corresponding to each first target point, including: among the corner points that constitute any second predetermined shape, determining the second target points corresponding to each first target point.

[0079] In this embodiment, the first predetermined shape is a parallelogram, and the second predetermined shape is a rectangle.

[0080] In order to introduce step S131 and step S132, Figure 7 as well as Figure 8 , the first image is the camera image, the second image is the image extracted from the map, and the calibration element is the arrow on the road:

[0081] In the real world, most arrows are composed of horizontal and vertical line segments, but in camera images, the arrows are deformed. Specifically, the rectangular segments of the arrows are transformed into parallelogram segments. Therefore, based on the transformation relationship between the corner points that constitute the parallelogram and the corner points that constitute the rectangle, the adjustment transformation relationship for adjusting the calibration element to a predetermined posture can be determined.

[0082] The corner points of the rectangle here can be the corner points of any rectangle, that is, in the third image and the second image, the rectangular segments of the arrows are both rectangular, but have different aspect ratios. Therefore, the third image can be mapped to the second image subsequently by translation, scaling and rotation.

[0083] That is, the second predetermined shape is established in such a way that, after the third image is obtained, the second image can be obtained by simply transforming the third image, wherein the simple transformation includes but is not limited to translation, rotation and scaling.

[0084] In other application implementations, the first predetermined shape and the second predetermined shape can also be other shapes. For example, the first predetermined shape is a trapezoid and the second predetermined shape is a rectangle, or the first predetermined shape is an arbitrary triangle and the second predetermined shape is an isosceles triangle, which is set according to actual needs.

[0085] In this embodiment, for the accuracy of the algorithm, step S131 specifically includes: selecting multiple first target points constituting the first predetermined shape with the largest area from the corner points of the calibration element. For example, when there are multiple parallelograms in Figure (7c), the parallelogram with the largest area is determined, and the corner points of the parallelogram with the largest area are the selected multiple first target points.

[0086] In other implementations, as long as the multiple first target points screened out in step S131 can form the first predetermined shape, it is not necessarily required that the area thereof is the largest.

[0087] In this embodiment, in order to ensure the accuracy of the determined adjustment transformation relationship, the step S120 identifies the calibration elements, including: identifying at least two calibration elements in the first image; the step S130 determines the adjustment transformation relationship, including: respectively determining the transformation relationship for adjusting at least two calibration elements to corresponding predetermined postures; respectively determining the accuracy of each transformation relationship; and determining the transformation relationship with the highest accuracy as the adjustment transformation relationship.

[0088] For ease of understanding, combined Figure 7 , to illustrate the identification of three arrows in the first image, wherein the arrow in Figure (7a) is recorded as the first arrow, the arrow in Figure (7b) is recorded as the second arrow, and the arrow in Figure (7c) is recorded as the third arrow.

[0089] First, four first target points constituting a parallelogram are extracted from the first arrow. Then, among the corner points constituting the first rectangle, the second target points corresponding to each first target point are determined. Next, a conversion relationship is determined based on the four first target points and their corresponding second target points, which is recorded as the first conversion relationship.

[0090] Then, the four first target points that form the parallelogram are extracted from the second arrow, and then the second target points corresponding to each first target point are determined among the corner points that form the second rectangle. Next, the conversion relationship is determined based on the four first target points and their corresponding second target points, which is recorded as the second conversion relationship.

[0091] Then, four first target points constituting a parallelogram are extracted from the third arrow, and then the second target points corresponding to each first target point are determined among the corner points constituting the third rectangle, and then a conversion relationship is determined based on the four first target points and the second target points corresponding to each of them, which is recorded as the third conversion relationship. The first rectangle, the second rectangle, and the third rectangle can be rectangles with different aspect ratios or rectangles with the same aspect ratio.

[0092] Then, the accuracy of the first conversion relationship, the second conversion relationship and the third conversion relationship is determined, wherein the accuracy of the first conversion relationship is described as an example: the second arrow and the third arrow are adjusted and converted according to the first conversion relationship, and then a polygon consisting of pixel points corresponding to the four first target points in the second arrow before adjustment is determined in the adjusted second arrow, and the opposite sides are compared with a rectangle to obtain a first comparison result; and a polygon consisting of pixel points corresponding to the four first target points in the third arrow before adjustment is determined in the adjusted third arrow, and the polygon is compared with a rectangle to obtain a second comparison result. Finally, the accuracy of the first conversion relationship is obtained based on the first comparison result and the second comparison result.

[0093] By analogy, the accuracy of the second conversion relationship and the third conversion relationship is obtained.

[0094] Finally, the one with the highest corresponding accuracy among the first conversion relationship, the second conversion relationship and the third conversion relationship is taken as the final adjusted conversion relationship.

[0095] The process of comparing the polygon with the rectangle may be: determining the absolute value of the difference between each angle of the polygon and the right angle, and then adding the absolute values ​​corresponding to each angle to obtain a comparison result. At this time, according to the first comparison result and the second comparison result, the process of obtaining the accuracy of the first conversion relationship may be: adding the first comparison result and the second comparison result and then calculating the inverse to obtain the accuracy of the first conversion relationship.

[0096] In this embodiment, refer to Fig. 9 , step S150 determines a mapping relationship between the third image and the second image, including:

[0097] S151: In the third image, determine a plurality of third target points.

[0098] S152: In the second image, determine fourth target points corresponding to each third target point.

[0099] When the second image is an image extracted from a map, the second image is firstly binarized, and then the fourth target point corresponding to the third target point is determined.

[0100] S153: Determine a mapping relationship according to the plurality of third target points and the fourth target points corresponding to each of the third target points.

[0101] The third image can be mapped to obtain the second image by translation, scaling and rotation. The third target point in the third image and the fourth target point in the second image corresponding to the third target point constitute a pair of target points.

[0102] It can be assumed that the third target point on the third image is The fourth target point on the second image is Its translation expression is:

[0103] Formula 13:

[0104] The rotation expression is:

[0105] Formula 14:

[0106] The scaling expression is:

[0107] Formula 15:

[0108] From formula 13 to formula 15, we can see that there are five unknowns in total, namely u o 、v o ,θ,k u and k v , so only three pairs of target points are needed to obtain the mapping relationship K from the third image to the second image:

[0109] Formula 16:

[0110] In this embodiment, for the convenience of calculation, the third target point and the fourth target point are corner points of the calibration elements. At this time, the calibration elements in the third image and the second image are first extracted, and then the corresponding corner points are determined.

[0111] In other implementations, the third target point and the fourth target point may also be other pixel points, such as any boundary points, as long as the third target point and the fourth target point remain corresponding.

[0112] In order to ensure the correctness of the mapping relationship, after determining the mapping relationship between the third image and the second image, it is also necessary to verify the correctness of the mapping relationship. The specific process includes:

[0113] (a) In the third image, at least one fifth target point different from the third target point is determined.

[0114] After the mapping relationship is determined using three pairs of target points, the correctness of the mapping relationship is verified using the remaining target points.

[0115] (b) In the second image, determine the sixth target point corresponding to each fifth target point.

[0116] (c) According to the mapping relationship, each fifth target point is converted into a seventh target point.

[0117] (d) determining a first deviation distance between the sixth target point corresponding to each fifth target point and the corresponding seventh target point.

[0118] Specifically, the first deviation distance E between the sixth target point and the seventh target point corresponding to the fifth target point is calculated using the following formula: k :

[0119] Formula 17: E k =||Bp i -K·Gp i ||2, where Gp i is the fifth target point, K·Gp i is the seventh target point corresponding to the fifth target point, K is the mapping relationship between the third image and the second image determined previously, Bp i The sixth target point corresponding to the fifth target point.

[0120] (e) Obtaining a total deviation distance according to the first deviation distances corresponding to each fifth target point.

[0121] The total deviation distance E is calculated according to the following formula:

[0122] Formula 18: E = ∑E k , that is, the first deviation distances corresponding to all fifth target points are added together to obtain the total deviation distance.

[0123] (f) In response to the total deviation distance being greater than the first threshold, returning to the step of determining a plurality of third target points in the third image.

[0124] If the total deviation distance is greater than the first threshold, it means that when determining the mapping relationship, the third target point and the fourth target point are not correctly matched. It is necessary to replace the three pairs of target points and redetermine the mapping relationship until the total deviation distance is no greater than the first threshold.

[0125] If the first image is an image taken by a camera and the second image is an image extracted from a map, it can be understood that when the position of the camera changes, the position of the calibration element in the first image changes accordingly, so that the mapping relationship between the first image and the second image will also change. Therefore, in order to be able to update the mapping relationship between the first image and the second image in time when the position of the camera changes, after determining the mapping relationship in step S170, it also includes:

[0126] (g) Saving the first position of the calibration element in the first image.

[0127] (h) In response to satisfying the trigger condition, acquiring a fourth image of the target scene captured by the camera, identifying a calibration element in the fourth image, and obtaining a second position of the calibration element.

[0128] The trigger condition may be receiving a trigger instruction, or reaching a set period, such as presetting to detect whether the position of the camera changes every 12 hours, or the current environment meets the preset requirements, such as the preset requirements include few dynamic objects in the environment, at which time the camera can be considered to be in an idle state, and whether the position of the camera changes can be detected. There is no limitation on the trigger condition here.

[0129] (i) In response to the deviation distance between the first position and the second position being greater than the second threshold, returning to the step of acquiring the first image and the second image.

[0130] If the change between the position of the same calibration element in the first image and the position in the fourth image exceeds the threshold, it means that the position of the camera has changed, and the above process is re-executed, that is, the mapping relationship between the first image and the second image is re-determined. If there is no change, no action is performed.

[0131] Through the above method, the mapping relationship between the first image and the second image can be automatically corrected without manual intervention.

[0132] Among them, after obtaining the mapping relationship between the first image and the second image, in addition to being able to merge the first image and the second image together to make the same elements overlap, the first image and the second image can also be interchanged, for example, the first image can be converted into the second image, or the second image can be converted into the first image, to meet the needs of various application scenarios.

[0133] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 200 includes a processor 210, a memory 220 and a communication circuit 230. The processor 210 is coupled to the memory 220 and the communication circuit 230 respectively. The memory 220 stores program data. The processor 210 implements the method steps in any of the above embodiments by executing the program data in the memory 220. The detailed steps can be found in the above embodiments and will not be repeated here.

[0134] The electronic device 200 may be any device with image processing capability, such as a computer or a mobile phone, and is not limited here.

[0135] See also Fig.11 , Fig.11 The electronic device 300 includes an acquisition module 310 , an identification module 320 , a first determination module 330 , a conversion module 340 , a second determination module 350 and a mapping module 360 ​​.

[0136] The acquisition module 310 is used to acquire a first image and a second image, where the first image and the second image correspond to the same target scene.

[0137] The recognition module 320 is connected to the acquisition module 310 and is used to recognize the calibration element in the first image.

[0138] The first determination module 330 is connected to the identification module 320 and is used to determine an adjustment conversion relationship for adjusting the calibration element to a predetermined posture.

[0139] The conversion module 340 is connected to the first determination module 330 and the acquisition module 310, and is used to convert the first image into a third image according to the adjusted conversion relationship.

[0140] The second determination module 350 is connected to the conversion module 340 and the acquisition module 310 and is used to determine a mapping relationship between the third image and the second image.

[0141] The mapping module 360 ​​is connected to the second determination module 350 and the first determination module 330, and is used to determine the mapping relationship between the first image and the second image according to the adjusted conversion relationship and the mapping relationship.

[0142] In one embodiment, the first determination module 330 is specifically used to: determine multiple first target points of the calibration element in the first image; determine the second target point corresponding to each first target point on the calibration element adjusted to a predetermined posture; and determine the adjustment conversion relationship based on the multiple first target points and the second target point corresponding to each first target point.

[0143] In one embodiment, the first determination module 330 is specifically used to: in the first image, screen out multiple first target points that constitute a first predetermined shape from the corner points of the calibration elements; and determine the second target points corresponding to each first target point among the corner points that constitute any second predetermined shape.

[0144] In one embodiment, the first predetermined shape is a parallelogram, and the second predetermined shape is a rectangle.

[0145] In one implementation, the first determination module 330 is specifically configured to select, from the corner points of the calibration element, a plurality of first target points constituting a first predetermined shape with a maximum area.

[0146] In one embodiment, the identification module 320 is specifically used to: identify at least two calibration elements in the first image; the first determination module 330 is specifically used to: respectively determine the conversion relationships for adjusting the at least two calibration elements to corresponding predetermined postures; respectively determine the accuracy of each conversion relationship; and determine the conversion relationship with the highest accuracy as the adjusted conversion relationship.

[0147] In one embodiment, the second determination module 350 is specifically used to: determine multiple third target points in the third image; determine the fourth target point corresponding to each third target point in the second image; and determine a mapping relationship based on the multiple third target points and the fourth target point corresponding to each third target point.

[0148] In one embodiment, the electronic device 300 also includes a first verification module, which is used to: after the second determination module 350 determines the mapping relationship between the third image and the second image, determine at least one fifth target point different from the third target point in the third image; determine the sixth target point corresponding to each fifth target point in the second image; convert each fifth target point into a seventh target point according to the mapping relationship; determine the first deviation distance between the sixth target point corresponding to each fifth target point and the corresponding seventh target point; obtain the total deviation distance according to the first deviation distance corresponding to each fifth target point; when the total deviation distance is greater than the first threshold, the second determination module 350 returns to execute the step of determining multiple third target points in the third image.

[0149] In one embodiment, the first image is an image taken by a camera of a target scene, and the second image is an image extracted from a map. The electronic device 300 also includes a second verification module, which is used to: save the first position of the calibration element in the first image after the mapping module 360 ​​determines the mapping relationship between the first image and the second image; in response to satisfying the trigger condition, obtain a fourth image taken by the camera of the target scene, identify the calibration element in the fourth image, and obtain the second position of the calibration element; when the deviation distance between the first position and the second position is greater than a second threshold, the acquisition module 310 returns to execute the steps of acquiring the first image and the second image.

[0150] In one embodiment, the electronic device 300 further includes a fusion module, which is used to fuse the first image and the second image according to a mapping relationship between the first image and the second image, so that the same elements in the first image and the second image overlap.

[0151] The electronic device 300 may be any device with image processing capability such as a computer or a mobile phone, and is not limited here. When the electronic device 300 is working, it executes the method steps in any of the above embodiments. The detailed method steps can be found in the above embodiments, and will not be repeated here.

[0152] See also Fig.12 , Fig.12 The computer-readable storage medium 400 stores a computer program 410, which can be executed by a processor to implement the steps in any of the above methods.

[0153] Among them, the computer-readable storage medium 400 can specifically be a device that can store the computer program 410, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the computer program 410. The server can send the stored computer program 410 to other devices for execution, or it can also run the stored computer program 410 by itself.

[0154] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An image mapping method, characterized in that: The method comprises: Acquire a first image and a second image, wherein the first image and the second image correspond to the same target scene; identifying calibration elements in the first image; Determining an adjustment conversion relationship for adjusting the calibration element to a predetermined posture; converting the first image into a third image according to the adjustment conversion relationship; determining a mapping relationship between the third image and the second image; Determining a mapping relationship between the first image and the second image according to the adjustment conversion relationship and the mapping relationship; The standard for establishing the predetermined posture is that after obtaining the third image, the third image is simply transformed to obtain the second image; Wherein, the step of determining the adjustment conversion relationship for adjusting the calibration element to a predetermined posture includes: In the first image, determining a plurality of first target points of the calibration element; Determining, on the calibration element adjusted to the predetermined posture, second target points corresponding to each of the first target points; The adjustment conversion relationship is determined according to a plurality of the first target points and the second target points corresponding to each of the first target points.

2. The method according to claim 1, characterized in that: The step of determining a plurality of first target points of the calibration element in the first image comprises: In the first image, a plurality of the first target points constituting a first predetermined shape are screened out from the corner points of the calibration elements; The step of determining, on the calibration element adjusted to the predetermined posture, the second target point corresponding to each of the first target points comprises: Among the corner points constituting any second predetermined shape, the second target points corresponding to each of the first target points are determined.

3. The method according to claim 2, characterized in that The first predetermined shape is a parallelogram, and the second predetermined shape is a rectangle.

4. The method according to claim 2, characterized in that: The step of selecting, in the first image, a plurality of the first target points constituting a first predetermined shape from the corner points of the calibration elements comprises: In the first image, a plurality of the first target points constituting the first predetermined shape with the largest area are screened out from the corner points of the calibration elements.

5. The method according to claim 1, characterized in that The step of identifying the calibration element in the first image comprises: identifying at least two of the calibration elements in the first image; The step of determining an adjustment conversion relationship for adjusting the calibration element to a predetermined posture comprises: respectively determining a conversion relationship for adjusting at least two of the calibration elements to the corresponding predetermined postures; Determining the accuracy of each of the conversion relationships respectively; The conversion relationship with the highest accuracy is determined as the adjusted conversion relationship.

6. The method according to claim 1, characterized in that The step of determining a mapping relationship between the third image and the second image comprises: In the third image, determining a plurality of third target points; In the second image, determining fourth target points corresponding to each of the third target points; The mapping relationship is determined according to the plurality of third target points and the fourth target point corresponding to each of the third target points.

7. The method according to claim 6, characterized in that After determining the mapping relationship between the third image and the second image, the method further includes: In the third image, determining at least one fifth target point different from the third target point; In the second image, determining sixth target points corresponding to each of the fifth target points; According to the mapping relationship, each of the fifth target points is converted into a seventh target point; Determine a first deviation distance between the sixth target point corresponding to each of the fifth target points and the corresponding seventh target point; Obtaining a total deviation distance according to the first deviation distances corresponding to the fifth target points; In response to the total deviation distance being greater than the first threshold, returning to the step of determining a plurality of third target points in the third image.

8. The method according to claim 1, characterized in that The first image is an image of the target scene taken by a camera, and the second image is an image extracted from a map. After determining the mapping relationship between the first image and the second image according to the adjustment conversion relationship and the mapping relationship, the method further includes: saving a first position of the calibration element in the first image; In response to satisfying a trigger condition, acquiring a fourth image of the target scene captured by the camera, identifying the calibration element in the fourth image, and obtaining a second position of the calibration element; In response to the deviation distance between the first position and the second position being greater than a second threshold, returning to the step of acquiring the first image and the second image.

9. The method according to claim 1, characterized in that: After determining the mapping relationship between the first image and the second image according to the adjustment conversion relationship and the mapping relationship, the method further includes: According to the mapping relationship between the first image and the second image, the first image and the second image are fused so that the same elements in the first image and the second image overlap.

10. An electronic device, characterized in that: The electronic device includes a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit respectively, the memory stores program data, and the processor implements the steps in the method as described in any one of claims 1 to 9 by executing the program data in the memory.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 to 9.