Coordinate conversion method, device, electronic device and storage medium

Through adaptive single-target matching detection technology, the target coordinates in GIS data are determined, which solves the problems of insufficient coordinate conversion accuracy and low efficiency in the prior art, and achieves high-precision and high-efficiency coordinate conversion.

CN115660945BActive Publication Date: 2025-05-23CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211330427.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2025-05-23
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

The coordinate conversion method in the prior art cannot meet the high-precision requirements, and requires manual observation to perform accurate position calibration and error measurement, resulting in inefficient and inability to realize coordinate conversion tasks of large data volumes.

Method used

By acquiring the initial map image and the target map image, the template image and the reference image are intercepted based on the preset scaling ratio, adaptive single-target matching detection is performed, the matching area is determined, and the target coordinates of the target point are determined based on the position information and scaling ratio of the matching area.

Benefits of technology

It improves the accuracy of coordinate conversion, meets the needs of high-precision applications, reduces the dependence of manual calibration, improves the conversion efficiency, and can realize coordinate conversion tasks of large data volumes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115660945B_ABST
    Figure CN115660945B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a coordinate conversion method, device, electronic device and storage medium, including: obtaining an initial map image and a target map image; based on a preset zoom ratio, intercepting a template image corresponding to a target point from the initial map image, and intercepting a reference image corresponding to the target point from the target map image, wherein the target point is located at the center point of the template image and the reference image, and the side length of the reference image is greater than the side length of the template image; based on the template image, performing adaptive single target matching detection on the reference image, and determining a matching area in the reference image that matches the template image; based on the position information of the matching area in the reference image and the preset zoom ratio, determining the target coordinates of the target point in the coordinate system corresponding to the reference image. In this way, adaptive single target matching detection is performed using the fields of computer vision and image recognition technology, and a new type of coordinate conversion model is established, which can meet high-precision application demand scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a coordinate conversion method, device, electronic device and storage medium. Background Art

[0002] GIS (Geographic Information System) maps have been widely used in current production operations and data analysis processes. Different map services may use different coordinate systems. In the integration of cross-system and cross-business scenarios, GIS data in different coordinate systems may be called. Therefore, coordinate conversion is required to convert GIS data in different coordinate systems into the same coordinate system for calculation and analysis.

[0003] In the prior art, mathematical methods of traditional geography are usually used to transform GIS data in different coordinate systems. Based on conditions such as data location collection method, map observation and drawing technology, this coordinate transformation method will produce large errors.

[0004] However, in some scenarios, the accuracy requirements for GIS data are high, and the current coordinate conversion method cannot meet the high-precision requirements. It can only rely on manual visual observation to accurately calibrate the position and measure the errors of the converted GIS data. This requires a lot of manpower and is inefficient, and it is impossible to accomplish the coordinate conversion task of large amounts of data. Summary of the invention

[0005] The present disclosure provides a coordinate conversion system, method, device, electronic device and storage medium to at least solve the problem that the coordinate conversion method in the related art cannot meet the high-precision requirements, can only rely on manual naked eye observation, requires a lot of manpower and is inefficient, and cannot achieve the coordinate conversion task of large amounts of data. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a coordinate conversion method, comprising:

[0007] Acquire an initial map image and a target map image, wherein the initial map image and the target map image respectively use different coordinate systems;

[0008] Based on a preset zoom ratio, a template image corresponding to a target point is intercepted from the initial map image, and a reference image corresponding to the target point is intercepted from the target map image, wherein the target point is located at a center point of the template image and the reference image, and a side length of the reference image is greater than a side length of the template image;

[0009] Based on the template image, performing adaptive single target matching detection on the reference image to determine a matching area in the reference image that matches the template image;

[0010] Based on the position information of the matching area in the reference image and the preset scaling ratio, the target coordinates of the target point in the corresponding coordinate system of the reference image are determined.

[0011] Optionally, the performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes:

[0012] Scaling the template image k times with different ratios to obtain k candidate images, where k is a natural number greater than 1;

[0013] In the reference image, performing image matching on the candidate image to determine a candidate area in the reference image corresponding to the candidate image;

[0014] The similarities between the candidate regions and the template image are calculated respectively, and the candidate region with the greatest similarity is used as the matching region.

[0015] Optionally, after determining the target coordinates of the target point in the coordinate system corresponding to the reference image based on the position information of the matching area in the reference image and the preset scaling ratio, the method further includes:

[0016] According to a preset conversion rule, the initial coordinates of the target point in the coordinate system corresponding to the template image are converted into reference coordinates in the coordinate system corresponding to the reference image;

[0017] A conversion error value is determined according to the target coordinates and the reference coordinates, where the conversion error value is used to indicate an error generated when the preset conversion rule is applied between the initial map image and the target map image.

[0018] Optionally, before performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image, the method further includes:

[0019] Performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image;

[0020] The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes:

[0021] Based on the repair template image, adaptive single target matching detection is performed on the repair reference image to determine a matching area in the repair reference image that matches the repair template image.

[0022] Optionally, performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image includes:

[0023] Taking the template image or the reference image as an original image, creating a grayscale image corresponding to the original image;

[0024] Performing edge detection on the grayscale image to obtain an edge image;

[0025] Performing a closing operation on the edge image to obtain a mask image;

[0026] Based on the original image, the mask image is interpolated and repaired to obtain a repaired image corresponding to the original image as a repair template image or a repair reference image.

[0027] Optionally, performing edge detection on the grayscale image to obtain an edge image includes:

[0028] Using a single-scale retinal cortex algorithm, Gaussian filtering and convolution smoothing are performed on the grayscale image to obtain a smoothed image;

[0029] Using a preset operator, performing an image gradient operation on the smoothed image to obtain an edge detection result;

[0030] Non-maximum suppression and double threshold processing are performed on the edge detection result to screen out false detections in the edge detection result and obtain an edge image.

[0031] Optionally, the position information of the matching area in the reference image includes the coordinates of the upper left corner and the lower right corner of the matching area in the reference image, and determining the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset scaling ratio includes:

[0032] Acquire the origin coordinates and current resolution of the reference image, wherein the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image;

[0033] Determine the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate;

[0034] The target coordinates of the target point in the coordinate system corresponding to the reference image are determined according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates.

[0035] Optionally, determining the abscissa distance and ordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinates and the lower right corner coordinates includes:

[0036] Determine the average of the abscissa of the upper left corner coordinate and the abscissa of the lower right corner coordinate as the abscissa distance between the center point of the matching area and the image origin;

[0037] Determine the average of the ordinate of the upper left corner coordinate and the ordinate of the lower right corner coordinate as the ordinate distance between the center point of the matching area and the origin of the image;

[0038] The step of determining the target coordinates of the target point in the coordinate system corresponding to the reference image according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates includes:

[0039] Determine a first product of the horizontal coordinate distance, the preset scaling ratio and a preset constant, and add the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the coordinate system corresponding to the reference image;

[0040] Determine a second product of the ordinate distance, the preset zoom ratio and a preset constant, add the second product to the ordinate of the origin coordinate as the ordinate of the target point in the coordinate system corresponding to the reference image, and obtain the target coordinate.

[0041] According to a second aspect of an embodiment of the present disclosure, there is provided a coordinate conversion device, comprising:

[0042] An acquisition module, used to acquire an initial map image and a target map image, wherein the initial map image and the target map image respectively use different coordinate systems;

[0043] A capture module, configured to capture a template image corresponding to a target point from the initial map image based on a preset zoom ratio, and capture a reference image corresponding to the target point from the target map image, wherein the target point is located at a center point of the template image and the reference image, and a side length of the reference image is greater than a side length of the template image;

[0044] A matching module, configured to perform adaptive single target matching detection on the reference image based on the template image, and determine a matching area in the reference image that matches the template image;

[0045] A determination module is used to determine the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset scaling ratio.

[0046] Optionally, the matching module is used to:

[0047] Scaling the template image k times with different ratios to obtain k candidate images, where k is a natural number greater than 1;

[0048] In the reference image, performing image matching on the candidate image to determine a candidate area in the reference image corresponding to the candidate image;

[0049] The similarities between the candidate regions and the template image are calculated respectively, and the candidate region with the greatest similarity is used as the matching region.

[0050] Optionally, the device further comprises an error detection module, configured to:

[0051] According to a preset conversion rule, the initial coordinates of the target point in the coordinate system corresponding to the template image are converted into reference coordinates in the coordinate system corresponding to the reference image;

[0052] A conversion error value is determined according to the target coordinates and the reference coordinates, where the conversion error value is used to indicate an error generated when the preset conversion rule is applied between the initial map image and the target map image.

[0053] Optionally, the device further comprises a preprocessing module, configured to:

[0054] Performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image;

[0055] The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes:

[0056] Based on the repair template image, adaptive single target matching detection is performed on the repair reference image to determine a matching area in the repair reference image that matches the repair template image.

[0057] Optionally, the preprocessing module is used to:

[0058] Taking the template image or the reference image as an original image, creating a grayscale image corresponding to the original image;

[0059] Performing edge detection on the grayscale image to obtain an edge image;

[0060] Performing a closing operation on the edge image to obtain a mask image;

[0061] Based on the original image, the mask image is interpolated and repaired to obtain a repaired image corresponding to the original image as a repair template image or a repair reference image.

[0062] Optionally, the preprocessing module is used to:

[0063] Using a single-scale retinal cortex algorithm, Gaussian filtering and convolution smoothing are performed on the grayscale image to obtain a smoothed image;

[0064] Using a preset operator, performing an image gradient operation on the smoothed image to obtain an edge detection result;

[0065] Non-maximum suppression and double threshold processing are performed on the edge detection result to screen out false detections in the edge detection result and obtain an edge image.

[0066] Optionally, the position information of the matching area in the reference image includes the coordinates of the upper left corner and the lower right corner of the matching area in the reference image, and the determining module is used to:

[0067] Acquire the origin coordinates and current resolution of the reference image, wherein the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image;

[0068] Determine the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate;

[0069] The target coordinates of the target point in the coordinate system corresponding to the reference image are determined according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates.

[0070] Optionally, the determining module is used to:

[0071] Determine the average of the abscissa of the upper left corner coordinate and the abscissa of the lower right corner coordinate as the abscissa distance between the center point of the matching area and the image origin;

[0072] Determine the average of the ordinate of the upper left corner coordinate and the ordinate of the lower right corner coordinate as the ordinate distance between the center point of the matching area and the origin of the image;

[0073] The step of determining the target coordinates of the target point in the coordinate system corresponding to the reference image according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates includes:

[0074] Determine a first product of the horizontal coordinate distance, the preset scaling ratio and a preset constant, and add the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the coordinate system corresponding to the reference image;

[0075] Determine a second product of the ordinate distance, the preset zoom ratio and a preset constant, add the second product to the ordinate of the origin coordinate as the ordinate of the target point in the coordinate system corresponding to the reference image, and obtain the target coordinate.

[0076] According to a third aspect of an embodiment of the present disclosure, there is provided a coordinate conversion electronic device, including:

[0077] processor;

[0078] a memory for storing instructions executable by the processor;

[0079] Wherein, the processor is configured to execute the instructions to implement any one of the coordinate conversion methods described above.

[0080] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a coordinate conversion electronic device, the coordinate conversion electronic device is enabled to perform any one of the coordinate conversion methods described above.

[0081] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the coordinate conversion method described in any one of the above is implemented.

[0082] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0083] An initial map image and a target map image are obtained, wherein the initial map image and the target map image use different coordinate systems respectively; based on a preset zoom ratio, a template image corresponding to the target point is intercepted from the initial map image, and a reference image corresponding to the target point is intercepted from the target map image, wherein the target point is located at the center point of the template image and the reference image, and the side length of the reference image is greater than the side length of the template image; based on the template image, an adaptive single target matching detection is performed on the reference image to determine a matching area in the reference image that matches the template image; based on the position information of the matching area in the reference image and the preset zoom ratio, the target coordinates of the target point in the coordinate system corresponding to the reference image are determined.

[0084] In this way, by intercepting the reference image and the template image from the initial map image and the target map image, adaptive single target matching detection is performed using the fields of computer vision and image recognition technology, and a new coordinate transformation model is established to determine the target coordinates of the target point in the coordinate system corresponding to the reference image. Compared with the mathematical methods of traditional geography, the coordinate transformation method of the present application has higher accuracy and can meet the needs of high-precision application scenarios. At the same time, it can reduce the dependence of the secondary calibration process on manual labor, improve the efficiency of coordinate transformation, and realize the coordinate transformation tasks of large amounts of data.

[0085] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0087] Figure 1 The figure is a flow chart of a coordinate conversion method according to an exemplary embodiment.

[0088] Figure 2 is a schematic diagram of a template image according to an exemplary embodiment.

[0089] Figure 3 is a schematic diagram of a reference image according to an exemplary embodiment.

[0090] Figure 4 It is a logical schematic diagram showing a coordinate conversion method according to an exemplary embodiment.

[0091] Figure 5 is a block diagram of a coordinate conversion device according to an exemplary embodiment.

[0092] Figure 6 It is a block diagram of an electronic device for coordinate conversion according to an exemplary embodiment.

[0093] Figure 7 It is a block diagram of a device for coordinate conversion according to an exemplary embodiment. DETAILED DESCRIPTION

[0094] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0095] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0096] Figure 1 is a flow chart of a coordinate conversion method according to an exemplary embodiment. Figure 1 As shown, the coordinate conversion method includes:

[0097] In step S11, an initial map image and a target map image are obtained, and the initial map image and the target map image respectively use different coordinate systems.

[0098] GIS maps have been widely used in current production operations and data analysis processes. Different map services may use different coordinate systems. In the integration of cross-system and cross-business scenarios, GIS data in different coordinate systems may be called. Therefore, coordinate conversion is required to convert GIS data in different coordinate systems into the same coordinate system.

[0099] In this application, the initial map image is the map where the GIS data that needs to be converted is located. Through coordinate conversion, the coordinates of the target point in the coordinate system corresponding to the initial map image are converted into coordinates in the coordinate system corresponding to the target map image. In this way, the GIS data in the initial map image can be displayed, calculated and analyzed in the target map image.

[0100] Among them, the coordinate systems used by the initial map image and the target map image can be WGS84 (World Geodetic System 1984, World Geodetic System 1984 version) coordinate system, GCJ02 (Guojia Cehui Ju 02, National Bureau of Surveying and Mapping Standard No. 02) coordinate system, BD09 (BaiDu09, Baidu standard) coordinate system and CGCS2000 (China Geodetic Coordinate System 2000, National Geodetic Coordinate System 2000 version) coordinate system, etc., without specific limitation.

[0101] In step S12, based on a preset zoom ratio, a template image corresponding to the target point is captured from the initial map image, and a reference image corresponding to the target point is captured from the target map image. The target point is located at the center point of the template image and the reference image, and the side length of the reference image is greater than the side length of the template image.

[0102] In this step, the initial map image and the target map image are displayed using the same preset zoom ratio, and then the template image and the reference image corresponding to the target point can be captured from the initial map image and the target map image, respectively, wherein when capturing, the target point is located at the center of the template image and the reference image, and the side length of the reference image is greater than the side length of the template image.

[0103] The zoom ratio is the scale of the map. For example, if the zoom ratio is 1:5000, 1 cm on the map is equivalent to 5000 cm in actual distance. In this step, the preset zoom ratio can be a preset fixed value, or a randomly selected value, or can be set according to the accuracy requirements of the current scene. There is no specific limitation, and it is only necessary to maintain the same preset zoom ratio for the initial map image and the target map image.

[0104] When capturing the template image and the reference image, the selenium (a browser automation testing framework) web page automation testing method can be used to implement image capture. Taking the target point as the center point, a square image with a length of La is captured from the initial map image as the template image, and a square image with a length of Lb is captured from the target map image as the reference image, where Lb is greater than La. The unit of image length can be pixels, millimeters or centimeters, without specific limitation.

[0105] For example, Figure 2 and Figure 3 As shown in the figure, they are schematic diagrams of the reference image and the template image, respectively, where Pa and Pb are the center points of the reference image and the template image, respectively, and represent the same target point. It can be seen that the side length L of the reference image b Greater than the side length L of the template image a , P 0 represents the image origin of the reference image.

[0106] In step S13, based on the template image, adaptive single target matching detection is performed on the reference image to determine a matching area in the reference image that matches the template image.

[0107] In this step, adaptive single target matching detection is performed on the reference image based on the template image. That is, after the template image and the reference image are cut out, the template image can be matched in the reference image to determine the area in the reference image that matches the template image as the matching area.

[0108] In the process of adaptive single target matching detection, multiple target matching can be performed on the reference image and the template image, and then the matching area with the highest similarity to the template image can be further determined from the multiple matching results. For example, different matching algorithms can be used, or the template image can be scaled multiple times and matched with the reference image multiple times, and then the matching area with the highest similarity to the template image can be further determined from the multiple matching results, and so on.

[0109] Among them, when further determining the matching area with the highest similarity to the template image from multiple matching results, it is necessary to perform similarity calculation. In this application, the normalized correlation coefficient, Jaccard similarity coefficient, cosine similarity or Pearson correlation coefficient, etc. can be used, without specific limitation.

[0110] In this way, by matching multiple targets and selecting the best one as the matching result, compared with a method of determining the matching area by matching only once, the accuracy of target matching can be improved, thereby improving the accuracy of subsequent coordinate conversion.

[0111] In one implementation, based on a template image, an adaptive single target matching detection is performed on a reference image to determine a matching area in the reference image that matches the template image, including: scaling the template image k times at different ratios to obtain k candidate images, where k is a natural number greater than 1; performing image matching on the candidate image in the reference image to determine a candidate area in the reference image that corresponds to the candidate image; and calculating the similarity between the candidate area and the template image respectively, and taking the candidate area with the greatest similarity as the matching area.

[0112] That is to say, the reference image and template image are used as inputs for target detection, and adaptive single target matching detection is performed. After loading the reference image and template image, k iterations are performed. In each iteration, the template image is proportionally enlarged or reduced. Each time the size of the template image is changed, a round of target matching calculation process is performed, and k candidate regions can be obtained. Then, the obtained k candidate regions are compared with the original template image that has not been proportionally enlarged or reduced, and the candidate region with the best similarity is selected, and the matching result is output.

[0113] The normalized correlation coefficient may be used to calculate the similarity between the candidate region and the template image. The closer the normalized correlation coefficient is to 1, the higher the similarity between the candidate region and the template image.

[0114] In one implementation, before performing adaptive single-target matching detection on a reference image based on a template image and determining a matching area in the reference image that matches the template image, it also includes: performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image; then, correspondingly, performing adaptive single-target matching detection on the reference image based on the template image and determining a matching area in the reference image that matches the template image includes: performing adaptive single-target matching detection on the repaired reference image based on the repaired template image and determining a matching area in the repaired reference image that matches the repaired template image.

[0115] In other words, it is necessary to pre-process the template image and the reference image through an image enhancement algorithm. It is understandable that there is still a lot of interference information in the template image and the reference image obtained by direct acquisition, including building names, road names, POI (Point of interesting) icons and POI names, etc., which will lead to a decrease in the performance of the final matching results. Image enhancement processing of the template image and the reference image can eliminate the interference element information in the template image and the reference image, while retaining the main map elements such as regional contours, building contours, and road contours, further improving the accuracy of target matching and subsequent coordinate conversion.

[0116] Among them, image enhancement processing is performed on the template image and the reference image respectively to obtain the repaired template image and the repaired reference image, including: taking the template image or the reference image as the original image to create a grayscale image corresponding to the original image; performing edge detection on the grayscale image to obtain an edge image; performing a closing operation on the edge image to obtain a mask image; based on the original image, interpolating and repairing the mask image to obtain a repaired image corresponding to the original image as the repaired template image or the repaired reference image.

[0117] Among them, the reference image and the template image can be read based on the RGB three-channel mode to create a grayscale image. It can be understood that the grayscale image can eliminate some interference information compared to the color image, and can reduce the amount of information in the calculation process and improve the calculation speed.

[0118] In the template image and the reference image, the edge part concentrates most of the information of the image. The edge structure and characteristics of an image are often important parts that determine the characteristics of the image. Therefore, the edge detection of the grayscale image is improved, and the main map elements such as the regional outline, building outline, and road outline can be retained in the edge image. Among them, the edge detection algorithm can adopt the differential method, differential edge detection algorithm, Laplace edge detection algorithm, Canny multi-level edge detection algorithm, etc., without specific limitation.

[0119] For example, in the Canny multi-level edge detection algorithm, edge detection is performed on a grayscale image to obtain an edge image, which may include: using a single-scale retinal cortex (Retinex) algorithm to perform Gaussian filtering and convolution smoothing on the grayscale image to obtain a smoothed image; using a preset operator to perform image gradient operations on the smoothed image to obtain an edge detection result; performing non-maximum suppression and double threshold processing on the edge detection result to screen out false detections in the edge detection result to obtain an edge image.

[0120] That is to say, firstly, a single-scale Retinex algorithm is used to perform Gaussian filtering and convolution smoothing on the grayscale image to obtain a smoothed image, in which the standard deviation of the Gaussian kernel function specifies a value of 0, and all zero elements in the grayscale image array are replaced with non-zero minimum elements. The grayscale image array is then normalized after taking the logarithm, a linear transformation is performed on each pixel, and the image channels are weightedly fused to further remove the noise in the grayscale image.

[0121] Then, the preset operator is used to perform image gradient operation on the smoothed image, the gradient magnitude and gradient direction of each pixel are calculated, and possible edges in the smoothed image are identified as edge detection results. The preset operator may be a Scharr operator, a Sobel operator, or a Roberts operator, etc., which are not specifically limited.

[0122] Furthermore, non-maximum suppression and double threshold processing are performed on the edge detection results. Non-maximum suppression is set to eliminate the stray effects of edge detection, and double thresholds are applied to determine the real and potential edges. The final edge detection is completed by suppressing weak edges, and false detections in the edge detection results are screened out to obtain an edge image.

[0123] After obtaining the edge image, a closing operation can be performed on the edge image to obtain a mask image, wherein the closing operation refers to using a morphological change method to first dilate and then erode the edge image, thereby eliminating image black holes and filling small cracks in foreground objects to achieve the effect of eliminating text. For example, the filter size can be set to 3x3, and the process of first dilating and then corroding is performed in the closing operation.

[0124] Then, based on the original image, the mask image is interpolated and repaired. For example, the fast marching algorithm can be used for interpolation and repair to achieve the effect of removing black spots and strokes in the image, eliminate interference elements in the original image, and obtain the repaired image corresponding to the original image as a repair template image or a repair reference image.

[0125] In step S14, based on the position information of the matching area in the reference image and the preset zoom ratio, the target coordinates of the target point in the corresponding coordinate system of the reference image are determined.

[0126] In this step, after determining the matching area in the reference image that matches the template image, a new type of coordinate transformation model can be established based on the position information of the matching area in the reference image and the preset scaling ratio to further determine the target coordinates of the target point in the coordinate system corresponding to the reference image. In other words, based on the position of the target point in the reference image and a known coordinate of the reference image, the target coordinates of the target point in the coordinate system corresponding to the reference image are calculated.

[0127] In one implementation, the position information of the matching area in the reference image includes the upper left corner coordinates and the lower right corner coordinates of the matching area in the reference image. Based on the position information of the matching area in the reference image and a preset zoom ratio, the target coordinates of the target point in the corresponding coordinate system of the reference image are determined, including:

[0128] Get the origin coordinates and current resolution of the reference image, where the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image; determine the horizontal and vertical distances between the center point of the matching area and the image origin based on the coordinates of the upper left corner and the lower right corner; determine the target coordinates of the target point in the coordinate system corresponding to the reference image based on the horizontal and vertical distances, the preset zoom ratio, the current resolution and the origin coordinates.

[0129] Among them, according to the coordinates of the upper left corner and the lower right corner, the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin are determined, including: determining the average of the horizontal coordinate of the upper left corner coordinate and the horizontal coordinate of the lower right corner coordinate as the horizontal coordinate distance between the center point of the matching area and the image origin; determining the average of the vertical coordinate of the upper left corner coordinate and the vertical coordinate of the lower right corner coordinate as the vertical coordinate distance between the center point of the matching area and the image origin; according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinate, determining the target coordinates of the target point in the corresponding coordinate system of the reference image, including: determining a first product of the horizontal coordinate distance, the preset zoom ratio and the preset constant, adding the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the corresponding coordinate system of the reference image; determining a second product of the vertical coordinate distance, the preset zoom ratio and the preset constant, adding the second product to the vertical coordinate of the origin coordinate as the vertical coordinate of the target point in the corresponding coordinate system of the reference image to obtain the target coordinates.

[0130] Specifically, the position information of the matching area in the reference image can be expressed as box = [P 1 ,P 2 ], where P 1 =(X 1 , Y 1 ) represents the coordinates of the upper left corner, P 2 =(X 2 , Y2 ) represents the coordinate of the lower right corner, then the horizontal coordinate distance between the center point of the matching area and the origin of the image can be expressed as The ordinate distance between the center point of the matching area and the image origin can be expressed as

[0131] Furthermore, the horizontal coordinate of the target point in the coordinate system corresponding to the reference image can be expressed as:

[0132]

[0133] The ordinate of the target point in the coordinate system corresponding to the reference image can be expressed as:

[0134]

[0135] Among them, zoom represents the preset zoom ratio, (X 0 , Y 0 ) represents the origin coordinates of the reference image, dpi represents the resolution, which is the number of pixels per inch. The current dpi resolution of the system can be obtained by calling the system interface, and C / 100 represents the preset constant, where the constant C can be taken as 2.54, because 1 inch is equal to 2.54 centimeters.

[0136] In one implementation, after determining the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset zoom ratio, it also includes: according to a preset conversion rule, converting the initial coordinates of the target point in the corresponding coordinate system of the template image into reference coordinates in the corresponding coordinate system of the reference image; determining a conversion error value based on the target coordinates and the reference coordinates, the conversion error value being used to indicate the error generated between the initial map image and the target map image when the preset conversion rule is applied.

[0137] Among them, the preset conversion rules can be any traditional coordinate conversion means, covering the current mainstream map coordinate systems commonly used by enterprises, including the conversion algorithms between WGS84, GCJ02, BD09, and CGCS2000 coordinates. For different coordinate systems, the coordinate conversion involves the calculation and conversion of latitude and longitude coordinates and metric coordinates. In this way, the coordinate point P based on the template image a =(X a , Y a ), the coordinates are transformed according to the preset transformation rules, and the reference coordinates P are output b =(X b , Y b ).

[0138] For example, taking the conversion between WGS84 and CGCS2000 coordinates, in the WGS84 coordinate system, the latitude and longitude projection graduation zone is a 6-degree zone, and the CGCS2000 coordinate system uses the meter coordinate Gauss Kruger projection. The coordinate difference of the same point in WGS84 and CGCS2000 mainly comes from the epoch, frame and accuracy. For example, the current WGS84 coordinates are the coordinates of the ITRF2008 (International Terrestrial Reference Frame 08) frame at the 2005.0 epoch, and the CGCS2000 coordinates are the coordinates of the ITRF97 (International Terrestrial Reference Frame 97) frame at the 2000.0 epoch. Therefore, it is necessary to convert the ITRF2008 and ITRF97 frames, and perform the coordinate conversion based on the conversion parameters and rates of the two frames.

[0139] Since the target coordinates and the reference coordinates are in the same metric coordinate system of the target map image, the conversion error value can be determined based on the target coordinates and the reference coordinates. For example, the conversion error value can be the distance between the target coordinates and the reference coordinates, and the calculation formula is:

[0140]

[0141] like Figure 4 As shown, it is a logical schematic diagram of an implementation method of the present application. Among them, Chengdu City, Sichuan Province is selected as the implementation area, and the coordinate conversion between the WGS84 coordinate system map and the CGCS2000 coordinate system map is realized. The initial map image is described as map A, and the target map image is described as map B. The specific implementation process includes: data point preparation, initial coordinate conversion module execution, image acquisition, key parameter extraction, image preprocessing, adaptive single target matching detection, key parameter mapping conversion, conversion result coordinate points and initial conversion error measurement.

[0142] During the data preparation process, the color rendering and information elements of different maps, such as buildings, roads, water systems, POIs, etc., have differences in size, thickness, and drawing methods. Therefore, data should be selected that are at the same scale for the two maps and have sufficient information element references in the area.

[0143] In this embodiment, the map zoom scale can be selected as 1:5000, the location is at the data point Pa of Liaoxin intersection in Xinchang Village, Chengdu City, and there are information elements such as rivers, three-way intersections, POIs, etc. around it to ensure the efficiency of image recognition in improving the accuracy of coordinate conversion.

[0144] In the initial coordinate conversion process, the coordinate point Pa in map A of the WGS84 coordinate system is used, and the coordinate point Pb in map B of the CGCS2000 coordinate system is obtained through the initial coordinate conversion module.

[0145] During the image acquisition process, selenium can be used to implement image capture of the map page window. For example, in this embodiment, an image with Pa as the center point and a size of 100 x 100 pixels can be captured for map A as a template image, and an image with Pb as the center point and a size of 800 x 800 pixels can be captured for map B as a reference image.

[0146] In the key parameter extraction process, the key parameters of this embodiment include: resolution dpi = 96, preset zoom ratio zoom = 1:5000, template image length La = 100, reference image length Lb = 800. In different embodiments, due to different terminal display resolutions, the converted maps A and B correspond differently, and the obtained key parameters also vary.

[0147] In the image preprocessing process, the template image and the reference image need to be preprocessed to eliminate the differences caused by interference information such as color rendering and text icons between different map images in order to improve computing performance. Specifically, after the template image and the reference image are gray-scaled, the single-scale Retinex algorithm is performed on the grayscale image, and the Gaussian filter is used to convolve with the image to achieve smoothing. The Canny multi-level edge detection algorithm is used to detect the edge of the smoothed image, and the noise points are removed by high-frequency noise reduction. The Scharr operator is used to perform image gradient operations. Then, the edge image is closed to obtain a mask image. Then, based on the original template image and the reference image, the mask image is interpolated and repaired, and the fast marching algorithm is used to remove image black spots and strokes, eliminate interference elements, and output the result image for adaptive single target matching detection.

[0148] In some embodiments, if there are too few information elements in the area of ​​the original map and the target map, the target matching similarity results may not be effectively calculated. Therefore, in some embodiments, if the differences in the key parameters zoom, La, and Lb are too large, the image preprocessing effects may be different, and it is necessary to iteratively calculate through adaptive target matching results.

[0149] In the process of adaptive single target matching, the process steps include: loading the reference image and the template image; performing k iterations, each iteration scaling up or down the template image in equal proportion, and performing a round of target matching calculation process with the reference image each time the template image size is changed; obtaining k candidate areas in the reference image; comparing the obtained candidate areas with the original template image for similarity; screening out the candidate areas with the best similarity; selecting a frame on the reference image, and outputting the matching result. In this embodiment, the similarity algorithm can use the normalized correlation coefficient.

[0150] In some embodiments, the size of the reference image should be appropriate so that the final matching result output can be completed in an effective iteration round. Therefore, if the reference image is too small, the target matching will not be able to output a valid matching area.

[0151] In the key parameter mapping conversion process, first, obtain the position information box = [P1, P2] of the matching area in the reference image, where P1 = (X1, Y1) represents the coordinates of the matching area in the upper left corner, and P2 = (X2, Y2) represents the coordinates of the matching area in the lower right corner. Then, the mapping conversion is performed again according to the global key parameters to obtain the coordinate conversion result. Among them, the key parameters may include: the coordinates of the origin of the reference image P0, the resolution dpi, the constant C, the preset zoom ratio zoom, then the target coordinates of the center point of the matching area, that is, the target point Pb* = (Xb*, Yb*), and the calculation formula is:

[0152]

[0153]

[0154] According to the coordinate conversion result, the initial coordinate conversion error can be determined. In this step, the initial conversion coordinate point Pa and the final conversion coordinate point Pb* on map B have been output through the above process. The last two coordinate points belong to the same metric coordinate system of map B, and the conversion error value of the initial conversion coordinate method can be output. For example, the conversion error value can be the target coordinate P b * and reference coordinates P b The distance between them is calculated as:

[0155]

[0156] It can be understood that the conversion error of the electronic map coordinate conversion method currently used in practical applications is approximately 50 to 200 meters, and the map conversion error of the industry GIS commercial software is 40 to 85 meters. This application uses computer vision and image recognition technology to further improve the coordinate conversion accuracy and can control the conversion error value to less than 25 meters. It has technological breakthroughs and versatility and can be widely used in different map scenarios.

[0157] Moreover, this application is based on the existing traditional coordinate system field conversion technology, combined with the key parameters of different coordinate system maps, including coordinate system parameters and terminal parameters, and uses computer vision image processing technology for data preprocessing. Then, a template adaptive single target matching detection algorithm model of image recognition technology is constructed to further improve the accuracy of the original traditional coordinate system conversion method. It can provide an automated technical means for measuring the error results of the traditional coordinate system conversion method, and solve the problem of manual secondary calibration required after map coordinate conversion in current high-precision enterprise GIS application scenarios.

[0158] From the above, it can be seen that the technical solution provided by the embodiments of the present disclosure, by intercepting the reference image and the template image from the initial map image and the target map image, uses the fields of computer vision and image recognition technology to perform adaptive single target matching detection, establishes a new coordinate transformation model, and determines the target coordinates of the target point in the coordinate system corresponding to the reference image. Compared with the mathematical methods of traditional geography, the coordinate transformation method of the present application has higher accuracy and can meet the high-precision application requirements. At the same time, it can reduce the dependence of the secondary calibration process on manual labor, improve the efficiency of coordinate transformation, and realize the coordinate transformation tasks of large amounts of data.

[0159] Figure 5 is a block diagram of a coordinate conversion device according to an exemplary embodiment, comprising:

[0160] An acquisition module 201 is used to acquire an initial map image and a target map image, wherein the initial map image and the target map image respectively use different coordinate systems;

[0161] The interception module 202 is used to intercept the template image corresponding to the target point from the initial map image based on a preset zoom ratio, and intercept the reference image corresponding to the target point from the target map image, wherein the target point is located at the center point of the template image and the reference image, and the side length of the reference image is greater than the side length of the template image;

[0162] A matching module 203 is used to perform adaptive single target matching detection on the reference image based on the template image, and determine a matching area in the reference image that matches the template image;

[0163] The determination module 204 is used to determine the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset scaling ratio.

[0164] Optionally, the matching module 203 is used to:

[0165] Scaling the template image k times with different ratios to obtain k candidate images, where k is a natural number greater than 1;

[0166] In the reference image, performing image matching on the candidate image to determine a candidate area in the reference image corresponding to the candidate image;

[0167] The similarities between the candidate regions and the template image are calculated respectively, and the candidate region with the greatest similarity is used as the matching region.

[0168] Optionally, the device further comprises an error detection module, configured to:

[0169] According to a preset conversion rule, the initial coordinates of the target point in the coordinate system corresponding to the template image are converted into reference coordinates in the coordinate system corresponding to the reference image;

[0170] A conversion error value is determined according to the target coordinates and the reference coordinates, where the conversion error value is used to indicate an error generated when the preset conversion rule is applied between the initial map image and the target map image.

[0171] Optionally, the device further comprises a preprocessing module, configured to:

[0172] Performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image;

[0173] The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes:

[0174] Based on the repair template image, adaptive single target matching detection is performed on the repair reference image to determine a matching area in the repair reference image that matches the repair template image.

[0175] Optionally, the preprocessing module is used to:

[0176] Taking the template image or the reference image as an original image, creating a grayscale image corresponding to the original image;

[0177] Performing edge detection on the grayscale image to obtain an edge image;

[0178] Performing a closing operation on the edge image to obtain a mask image;

[0179] Based on the original image, the mask image is interpolated and repaired to obtain a repaired image corresponding to the original image as a repair template image or a repair reference image.

[0180] Optionally, the preprocessing module is used to:

[0181] Using a single-scale retinal cortex algorithm, Gaussian filtering and convolution smoothing are performed on the grayscale image to obtain a smoothed image;

[0182] Using a preset operator, performing an image gradient operation on the smoothed image to obtain an edge detection result;

[0183] Non-maximum suppression and double threshold processing are performed on the edge detection result to screen out false detections in the edge detection result and obtain an edge image.

[0184] Optionally, the position information of the matching area in the reference image includes the coordinates of the upper left corner and the lower right corner of the matching area in the reference image, and the determination module 204 is used to:

[0185] Acquire the origin coordinates and current resolution of the reference image, wherein the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image;

[0186] Determine the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate;

[0187] The target coordinates of the target point in the coordinate system corresponding to the reference image are determined according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates.

[0188] Optionally, the determining module 204 is configured to:

[0189] Determine the average of the abscissa of the upper left corner coordinate and the abscissa of the lower right corner coordinate as the abscissa distance between the center point of the matching area and the image origin;

[0190] Determine the average of the ordinate of the upper left corner coordinate and the ordinate of the lower right corner coordinate as the ordinate distance between the center point of the matching area and the origin of the image;

[0191] The step of determining the target coordinates of the target point in the coordinate system corresponding to the reference image according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates includes:

[0192] Determine a first product of the horizontal coordinate distance, the preset scaling ratio and a preset constant, and add the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the coordinate system corresponding to the reference image;

[0193] Determine a second product of the ordinate distance, the preset zoom ratio and a preset constant, add the second product to the ordinate of the origin coordinate as the ordinate of the target point in the coordinate system corresponding to the reference image, and obtain the target coordinate.

[0194] From the above, it can be seen that the technical solution provided by the embodiments of the present disclosure, by intercepting the reference image and the template image from the initial map image and the target map image, uses the fields of computer vision and image recognition technology to perform adaptive single target matching detection, establishes a new coordinate transformation model, and determines the target coordinates of the target point in the coordinate system corresponding to the reference image. Compared with the mathematical methods of traditional geography, the coordinate transformation method of the present application has higher accuracy and can meet the high-precision application requirements. At the same time, it can reduce the dependence of the secondary calibration process on manual labor, improve the efficiency of coordinate transformation, and realize the coordinate transformation tasks of large amounts of data.

[0195] Figure 6 It is a block diagram of an electronic device for coordinate conversion according to an exemplary embodiment.

[0196] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by a processor of an electronic device to complete the method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0197] In an exemplary embodiment, a computer program product is also provided, which, when executed on a computer, enables the computer to implement the coordinate conversion method.

[0198] From the above, it can be seen that the technical solution provided by the embodiments of the present disclosure, by intercepting the reference image and the template image from the initial map image and the target map image, uses the fields of computer vision and image recognition technology to perform adaptive single target matching detection, establishes a new coordinate transformation model, and determines the target coordinates of the target point in the coordinate system corresponding to the reference image. Compared with the mathematical methods of traditional geography, the coordinate transformation method of the present application has higher accuracy and can meet the high-precision application requirements. At the same time, it can reduce the dependence of the secondary calibration process on manual labor, improve the efficiency of coordinate transformation, and realize the coordinate transformation tasks of large amounts of data.

[0199] Figure 7 is a block diagram of a device 800 for coordinate conversion according to an exemplary embodiment.

[0200] For example, apparatus 800 may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0201] Reference Figure 7 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0202] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the described method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0203] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0204] The power supply component 807 provides power to the various components of the device 800. The power supply component 807 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0205] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the account. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the account. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0206] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0207] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0208] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0209] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0210] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the methods described in the first and second aspects.

[0211] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to complete the method. Alternatively, for example, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0212] In an exemplary embodiment, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the coordinate conversion method described in any one of the embodiments.

[0213] From the above, it can be seen that the technical solution provided by the embodiments of the present disclosure, by intercepting the reference image and the template image from the initial map image and the target map image, uses the fields of computer vision and image recognition technology to perform adaptive single target matching detection, establishes a new coordinate transformation model, and determines the target coordinates of the target point in the coordinate system corresponding to the reference image. Compared with the mathematical methods of traditional geography, the coordinate transformation method of the present application has higher accuracy and can meet the high-precision application requirements. At the same time, it can reduce the dependence of the secondary calibration process on manual labor, improve the efficiency of coordinate transformation, and realize the coordinate transformation tasks of large amounts of data.

[0214] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0215] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A coordinate transformation method, It is characterized in that include: Acquire an initial map image and a target map image, wherein the initial map image and the target map image respectively use different coordinate systems; Based on a preset zoom ratio, a template image corresponding to a target point is intercepted from the initial map image, and a reference image corresponding to the target point is intercepted from the target map image, wherein the target point is located at a center point of the template image and the reference image, and a side length of the reference image is greater than a side length of the template image; Based on the template image, performing adaptive single target matching detection on the reference image to determine a matching area in the reference image that matches the template image; Determining the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset scaling ratio; The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes: Scaling the template image k times with different ratios to obtain k candidate images, where k is a natural number greater than 1; In the reference image, performing image matching on the candidate image to determine a candidate area in the reference image corresponding to the candidate image; The similarities between the candidate regions and the template image are calculated respectively, and the candidate region with the greatest similarity is used as the matching region.

2. The coordinate conversion method according to claim 1, It is characterized in that After determining the target coordinates of the target point in the coordinate system corresponding to the reference image based on the position information of the matching area in the reference image and the preset scaling ratio, the method further includes: According to a preset conversion rule, the initial coordinates of the target point in the coordinate system corresponding to the template image are converted into reference coordinates in the coordinate system corresponding to the reference image; A conversion error value is determined according to the target coordinates and the reference coordinates, where the conversion error value is used to indicate an error generated when the preset conversion rule is applied between the initial map image and the target map image.

3. The coordinate conversion method according to claim 1, It is characterized in that Before the step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image, the step further includes: Performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image; The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes: Based on the repair template image, adaptive single target matching detection is performed on the repair reference image to determine a matching area in the repair reference image that matches the repair template image.

4. The coordinate conversion method according to claim 3, It is characterized in that The performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image comprises: Taking the template image or the reference image as an original image, creating a grayscale image corresponding to the original image; Performing edge detection on the grayscale image to obtain an edge image; Performing a closing operation on the edge image to obtain a mask image; Based on the original image, the mask image is interpolated and repaired to obtain a repaired image corresponding to the original image as a repair template image or a repair reference image.

5. The coordinate conversion method according to claim 4, It is characterized in that The step of performing edge detection on the grayscale image to obtain an edge image includes: Using a single-scale retinal cortex algorithm, Gaussian filtering and convolution smoothing are performed on the grayscale image to obtain a smoothed image; Using a preset operator, performing an image gradient operation on the smoothed image to obtain an edge detection result; Non-maximum suppression and double threshold processing are performed on the edge detection result to screen out false detections in the edge detection result and obtain an edge image.

6. The coordinate conversion method according to claim 1, It is characterized in that The position information of the matching area in the reference image includes the coordinates of the upper left corner and the lower right corner of the matching area in the reference image, and determining the target coordinates of the target point in the corresponding coordinate system of the reference image based on the position information of the matching area in the reference image and the preset scaling ratio includes: Acquire the origin coordinates and current resolution of the reference image, wherein the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image; Determine the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate; The target coordinates of the target point in the coordinate system corresponding to the reference image are determined according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates.

7. The coordinate conversion method according to claim 6, It is characterized in that Determining the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate includes: Determine the average of the abscissa of the upper left corner coordinate and the abscissa of the lower right corner coordinate as the abscissa distance between the center point of the matching area and the image origin; Determine the average of the ordinate of the upper left corner coordinate and the ordinate of the lower right corner coordinate as the ordinate distance between the center point of the matching area and the origin of the image; The step of determining the target coordinates of the target point in the coordinate system corresponding to the reference image according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates includes: Determine a first product of the horizontal coordinate distance, the preset scaling ratio and a preset constant, and add the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the coordinate system corresponding to the reference image; Determine a second product of the ordinate distance, the preset zoom ratio and a preset constant, add the second product to the ordinate of the origin coordinate as the ordinate of the target point in the coordinate system corresponding to the reference image, and obtain the target coordinate.

8. A coordinate conversion device, It is characterized in that include: An acquisition module, used to acquire an initial map image and a target map image, wherein the initial map image and the target map image respectively use different coordinate systems; A capture module, configured to capture a template image corresponding to a target point from the initial map image based on a preset zoom ratio, and capture a reference image corresponding to the target point from the target map image, wherein the target point is located at a center point of the template image and the reference image, and a side length of the reference image is greater than a side length of the template image; A matching module, configured to perform adaptive single target matching detection on the reference image based on the template image, and determine a matching area in the reference image that matches the template image; A determination module, configured to determine the target coordinates of the target point in a coordinate system corresponding to the reference image based on the position information of the matching area in the reference image and the preset scaling ratio; Wherein, the matching module is specifically used for: Scaling the template image k times with different ratios to obtain k candidate images, where k is a natural number greater than 1; In the reference image, performing image matching on the candidate image to determine a candidate area in the reference image corresponding to the candidate image; The similarities between the candidate regions and the template image are calculated respectively, and the candidate region with the greatest similarity is used as the matching region.

9. The coordinate conversion device according to claim 8, It is characterized in that The device also includes an error detection module, which is used to: According to a preset conversion rule, the initial coordinates of the target point in the coordinate system corresponding to the template image are converted into reference coordinates in the coordinate system corresponding to the reference image; A conversion error value is determined according to the target coordinates and the reference coordinates, where the conversion error value is used to indicate an error generated when the preset conversion rule is applied between the initial map image and the target map image.

10. The coordinate conversion device according to claim 8, It is characterized in that The device also includes a pre-processing module, which is used to: Performing image enhancement processing on the template image and the reference image respectively to obtain a repaired template image and a repaired reference image; The step of performing adaptive single target matching detection on the reference image based on the template image to determine a matching area in the reference image that matches the template image includes: Based on the repair template image, adaptive single target matching detection is performed on the repair reference image to determine a matching area in the repair reference image that matches the repair template image.

11. The coordinate conversion device according to claim 10, It is characterized in that The preprocessing module is used to: Taking the template image or the reference image as an original image, creating a grayscale image corresponding to the original image; Performing edge detection on the grayscale image to obtain an edge image; Performing a closing operation on the edge image to obtain a mask image; Based on the original image, the mask image is interpolated and repaired to obtain a repaired image corresponding to the original image as a repair template image or a repair reference image.

12. The coordinate conversion device according to claim 11, It is characterized in that The preprocessing module is used to: Using a single-scale retinal cortex algorithm, Gaussian filtering and convolution smoothing are performed on the grayscale image to obtain a smoothed image; Using a preset operator, performing an image gradient operation on the smoothed image to obtain an edge detection result; Non-maximum suppression and double threshold processing are performed on the edge detection result to screen out false detections in the edge detection result and obtain an edge image.

13. The coordinate conversion device according to claim 8, It is characterized in that The position information of the matching area in the reference image includes the coordinates of the upper left corner and the lower right corner of the matching area in the reference image. The determining module is used to: Acquire the origin coordinates and current resolution of the reference image, wherein the origin coordinates are the coordinates of the image origin of the reference image in the coordinate system corresponding to the reference image; Determine the horizontal coordinate distance and the vertical coordinate distance between the center point of the matching area and the image origin according to the upper left corner coordinate and the lower right corner coordinate; The target coordinates of the target point in the coordinate system corresponding to the reference image are determined according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates.

14. The coordinate conversion device according to claim 13, It is characterized in that The determining module is used to: Determine the average of the abscissa of the upper left corner coordinate and the abscissa of the lower right corner coordinate as the abscissa distance between the center point of the matching area and the image origin; Determine the average of the ordinate of the upper left corner coordinate and the ordinate of the lower right corner coordinate as the ordinate distance between the center point of the matching area and the origin of the image; The step of determining the target coordinates of the target point in the coordinate system corresponding to the reference image according to the horizontal coordinate distance, the vertical coordinate distance, the preset zoom ratio, the current resolution and the origin coordinates includes: Determine a first product of the horizontal coordinate distance, the preset scaling ratio and a preset constant, and add the first product to the horizontal coordinate of the origin coordinate as the horizontal coordinate of the target point in the coordinate system corresponding to the reference image; Determine a second product of the ordinate distance, the preset zoom ratio and a preset constant, add the second product to the ordinate of the origin coordinate as the ordinate of the target point in the coordinate system corresponding to the reference image, and obtain the target coordinate.

15. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the coordinate conversion method according to any one of claims 1 to 7.

16. A computer-readable storage medium, It is characterized in that When the instructions in the computer-readable storage medium are executed by a processor of the coordinate conversion electronic device, the coordinate conversion electronic device is enabled to execute the coordinate conversion method as claimed in any one of claims 1 to 7.

17. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the coordinate conversion method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Control identification method, related device, equipment and storage medium

    CN112162930A

  • Target detection method based on long and short focus camera and millimeter wave radar fusion

    CN114089329A