Picture-based power grid facility ledger extraction method and system capable of defining range
By cropping and registering meteorological pictures, defining the polygonal area to extract pixel coordinates and converting them to latitude and longitude, the problem of how to quickly extract grid facility information in the absence of high-precision meteorological data is solved, and efficient and economical grid disaster loss prediction is achieved.
Patent Information
- Application Number
- CN202510236586.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-13
AI Technical Summary
With only non-raster meteorological pictures in JPG, PNG and other formats, how to quickly and accurately extract various power grid facilities information in custom areas has become an urgent problem in power grid disaster prediction.
By cropping the image boundary of the weather pictures and registering it with the map geographical coordinate system, a latitude and longitude-pixel registration dictionary is formed. Then, the polygonal area is drawn on the meteorological picture to specify the range for extracting the grid facility information, and the determination area is determined by drawing the polygon vertices, so as to extract the pixel coordinates within the custom polygon range in the meteorological picture, and convert it into the actual latitude and longitude, and finally extract and summarize the power grid facility information based on the actual latitude and longitude.
It realizes the rapid and accurate extraction of power grid facilities information in custom areas from meteorological pictures, reduces the dependence on high-precision grid-based meteorological data, and improves the efficiency and economicality of power grid disaster loss prediction.
Smart Images

Figure CN120147380A_ABST
Abstract
Description
Background Art
[0002] Power grid enterprises have an urgent need for power grid disaster loss prediction and urgently need to predict in advance the areas and power grid facilities that may be affected by extreme weather by combining meteorological forecast pictures. With the intensification of climate change, extreme weather events such as typhoons, heavy rains, hailstorms, and wildfires are characterized by increased frequency, increased intensity, and abnormal spatio-temporal distribution. Traditional methods for extracting power grid facility information often rely on on-site manual inspections or satellite remote sensing data: the former requires professional inspection teams to carry equipment deep into disaster-prone areas, with a daily inspection efficiency of less than 10 kilometers under complex terrain conditions; the latter can obtain large-scale images, but is restricted by the satellite overpass cycle (usually 6 - 12 hours per time), cloud cover (the average effective image acquisition rate is less than 40%), and the time-consuming professional interpretation (it takes 3 - 5 hours to interpret a single scene image), resulting in the response timeliness being difficult to meet the emergency requirements. According to the statistics of a provincial power company of the State Grid, the average cost of disaster loss assessment per thousand square kilometers of traditional methods is as high as 850,000 yuan, and there is a response delay of more than 48 hours, with problems such as low efficiency, high cost, and untimely updates.
[0003] In recent years, registering through multi-scale resolution gridded meteorological data files and power grid facility ledgers has become a relatively advanced disaster loss prediction solution. This technical route relies on meteorological numerical forecast products with an accuracy of 0.01°×0.01° (about 1km×1.1km), combined with a ledger database in the power grid GIS system that contains elements such as tower coordinates (accuracy ±3 meters), line routes, and substation locations, to achieve a disaster risk heat map updated hourly. However, in engineering practice, the amount of meteorological data of models such as WRF processed per day can reach 2 - 5TB, and a GPU acceleration cluster needs to be configured to meet the real-time processing requirements, which poses a severe challenge to the computing resources of local power supply companies. More critically, high-precision gridded meteorological data involves the core parameters of numerical model operations, and the customized service fees provided by commercial institutions are as high as 3 - 5 million yuan per year, and there are technical barriers such as incompatible data interface protocols and cumulative coordinate system conversion errors.
[0004] Therefore, in order to improve the efficiency of power grid disaster loss prediction and take economy into account at the same time, considering the condition of lacking high-precision gridded meteorological forecast data NC (Network Common Data Format) files, how to quickly and accurately extract various power grid facility information within a customized area only using non-raster meteorological pictures in formats such as JPG and PNG publicly released by the China Meteorological Administration has become an urgent problem to be solved in the current power emergency field.
[0005] Such publicly available meteorological images have three major technical characteristics: First, the spatial resolutions are uneven. The resolution of the national precipitation forecast map released by the Central Meteorological Observatory is usually 2803×2371 pixels, while the local warning map released by provincial meteorological observatories can reach 4000×3000 pixels. Second, the information carriers are diverse, including various information expression methods such as contour lines (such as rainfall contour lines), color scale legends (coloring of wind force levels), and symbol annotations (typhoon path markings). Third, the coordinate system has non-linear deformation. Under different map projection methods such as Mercator projection and Lambert projection, the geometric distortion rate of the image can reach 3% - 8%.
[0006] The main problems of the traditional SIFT algorithm include two points. First, some feature points after coordinate transformation will have deviations, and the error range is uncontrollable. Sometimes the deviation can be very large, even hundreds of kilometers. Second, when the information carriers contained in the picture are relatively complex, it is even impossible to perform effective conversion of pixel coordinates. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method and system for extracting the grid facility ledger within a definable range based on pictures in view of the above deficiencies in the prior art. It can be used to extract the grid facility information ledger within any area in the map from non-raster meteorological map pictures in formats such as JPG and PNG, so as to solve the technical problem of how to quickly and accurately extract various grid facility information within a user-defined area under the input condition of only one meteorological picture in formats such as JPG and PNG.
[0008] The present invention adopts the following technical solutions: A method for extracting the grid facility ledger within a definable range based on pictures includes the following steps: Crop the boundary of the meteorological picture. Then register the meteorological picture after cropping the picture boundary with the map geographic coordinate system to form a longitude-latitude - pixel registration dictionary. By defining and drawing a polygon area on the meteorological picture registered with the map geographic coordinate system to specify the range for extracting grid facility information, determine the judgment area by depicting the polygon vertices, and realize the extraction of pixel coordinates within the user-defined polygon range in the meteorological picture. Convert the pixel coordinates within the user-defined polygon range in the extracted meteorological picture into corresponding actual longitude and latitude through the longitude-latitude - pixel registration dictionary. Extract and summarize the grid facility information within the range set by the geographical coordinates according to the actual longitude and latitude to form an exported grid facility information ledger.
[0009] Preferably, registering the meteorological picture with the map geographic coordinate system to form a longitude-latitude - pixel registration dictionary specifically is: Construct a Lambert conformal conic projection coordinate system that matches the meteorological map. By overlaying the cropped input meteorological image and adjusting the projection area, align the boundaries of the map and the meteorological image; Convert the longitude and latitude of the map display area into Lambert conformal conic projection coordinates. By using the forward and inverse transformation formulas of the Lambert conformal conic projection and combining with a visualization drawing tool, set the drawing size of the map image to generate the corresponding projected plane image, and obtain the screen display coordinates corresponding to the projected coordinates of this projected plane image; Through equal comparison alignment and interpolation processing of the pixels of the map image and the meteorological image, obtain the correct pixel coordinates of the conversion points on the meteorological image, thereby realizing the registration of longitude and latitude geographical coordinates and image pixel coordinates, and forming a longitude-latitude - pixel registration dictionary.
[0010] Preferably, the correct pixel coordinates of the conversion points on the meteorological image are:
[0011] where, is the pixel coordinate of the map image converted to the pixel coordinate system, is the height of the screen display, is the width of the screen display, is the width of the resolution of the meteorological image, is the height of the resolution of the meteorological image.
[0012] Preferably, the extraction of the pixel coordinates within a custom polygon in the meteorological image is specifically as follows: Define any pixel point on the meteorological image and a polygon with a defined range, where, is composed of pixel vertices connected in a clockwise order; Let , indicating that the pixel point is initially considered to be outside the polygon; let , indicating the last vertex of the polygon; Traverse each side of the defined polygon. When the judgment condition is met, calculate the coordinates of the intersection point of the right - hand ray and the current polygon side. If this side of the current polygon is vertical, or the right - hand ray intersects the side of the polygon, update ; Update the coordinates of the previous vertex of the defined polygon; Return the of the current pixel point. If is , then the pixel point is considered to be inside the polygon; otherwise, the pixel point is outside the polygon; the coordinates of the pixel point inside the polygon are output to realize the extraction of the pixel coordinates within the custom polygon range in the image.
[0013] Preferably, traverse each edge of the polygon, and for the Strip edge, arrive ,make , the judgment conditions are as follows: Judgment condition 1: Use the following formula to check the pixel Is it on the side arrive Above or horizontally:
[0014] Judgment condition 2: Use the following formula to check the pixel Is it on the side arrive Below or horizontally above:
[0015] Judgment condition 3: Use the following formula to check the pixel Is it on the side arrive Maximum To the left of or in the same position as a value: .
[0017] Preferably, the intersection of the right ray and the current polygon edge The coordinate value of The calculation is as follows: .
[0019] Preferably, the power grid facility information within the set range of the geographic coordinates is extracted and summarized according to the actual longitude and latitude as follows: Construct a grid point distribution list of power grid facility information expressed in longitude and latitude, divide the original map into grids according to equal longitude and latitude, that is, the longitude and latitude are arranged and distributed according to an arithmetic progression with equal tolerance, and each longitude and latitude is associated with the longitude and latitude of each power grid facility within its corresponding range, forming a grid point expressed in longitude and latitude containing the corresponding power grid facility information; Using the similar longitude and latitude registration method, compare the actual longitude and latitude corresponding to the pixel point coordinates extracted inside the polygon with the longitude and latitude of the grid points in the grid point distribution list of power grid facility information to obtain the longitude and latitude of the grid point with the highest similarity. According to the obtained longitude and latitude of the grid points of the power grid facility information, associate it with the power grid facility information under the corresponding grid point, filter out the grid points with the same longitude and latitude in the output, and extract and export the power grid facility information ledger.
[0020] Preferably, obtaining the longitude and latitude of the grid point with the highest similarity is specifically as follows: Let the actual longitude and latitude corresponding to the input pixel point coordinates be , according to the longitude and latitude distribution of the power grid facility grid points arranged in equal longitude and latitude, obtain the common difference ; Solve the quotient of the common differences of the actual longitude and latitude and respectively; Use the rounding algorithm to calculate the integers and closest to the quotient of the common differences and ; Multiply the integers and closest to the quotient of the common differences by the common difference to obtain the longitude and latitude of the grid points of the corresponding power grid facility information in the arithmetic progression of longitude and latitude closest to the given number ; According to the obtained longitude and latitude of the grid points of the power grid facility information , associate it with the power grid facility information under the corresponding grid point.
[0021] Preferably, the quotient of the common differences of the actual longitude and latitude and is calculated as follows:
[0022] .
[0024] Preferably, the integers and closest to the quotient of the common differences and are calculated as follows:
[0025]
[0026] Among them, means that after adding 0.5 to , and then rounding down, Indicates that by adding to 0.5 and then rounding down.
[0027] In a second aspect, an embodiment of the present invention provides a definable range power grid facility ledger extraction system based on pictures, including: A cropping module that crops the boundaries of the meteorological picture; A registration module that registers the meteorological picture after cropping the picture boundaries with the map geographic coordinate system to form a longitude-latitude-pixel registration dictionary; An extraction module that defines and draws a polygon area on the meteorological picture registered with the map geographic coordinate system to specify the range for extracting power grid facility information, and determines the judgment area by depicting the polygon vertices, so as to realize the extraction of pixel coordinates within the custom polygon range in the meteorological picture; A conversion module that converts the pixel coordinates within the custom polygon range in the extracted meteorological picture into corresponding actual longitude and latitude through the longitude-latitude-pixel registration dictionary; An output module that extracts and summarizes the power grid facility information within the set range of the geographic coordinates according to the actual longitude and latitude to form an exported power grid facility information ledger.
[0028] Preferably, registering the meteorological picture with the map geographic coordinate system to form a longitude-latitude-pixel registration dictionary specifically is: Construct a Lambert conformal conic projection coordinate system that matches the meteorological map. By superimposing the input cropped meteorological picture and adjusting the projection area, the alignment of the map and the meteorological picture boundaries is completed; Convert the longitude and latitude of the map display area into Lambert conformal conic projection coordinates. By using the forward and inverse transformation formulas of Lambert conformal conic projection and combining with a visualization drawing tool, set the drawing size of the map image, generate a corresponding projected plane image, and obtain the screen display coordinates corresponding to the projected coordinates of the projected plane image; Through equal comparison alignment and interpolation processing of the pixels of the map image and the meteorological picture, obtain the correct pixel coordinates of the conversion points on the meteorological picture, so as to realize the registration of longitude-latitude geographic coordinates and picture pixel coordinates and form a longitude-latitude-pixel registration dictionary.
[0029] Preferably, realizing the extraction of pixel coordinates within the custom polygon range in the meteorological picture specifically is: Define any pixel point on the meteorological picture and a polygon with a defined range , where is composed of pixel vertices connected in clockwise order; Let , indicating that the pixel point is initially considered to be outside the polygon; Let , representing the last vertex of the polygon; Traverse each side of the defined polygon. When the judgment condition is met, calculate the intersection point of the rightward ray and the current polygon side coordinate value , if this side of the current polygon is vertical, or the rightward ray intersects with the side of the polygon, update ; Update the coordinates of the previous vertex that defines the polygon; Return the of the current pixel point. If is , then it is considered that this pixel point is inside the polygon; otherwise, this pixel point is outside the polygon; Output the coordinates of the pixel points inside the polygon to achieve the extraction of the pixel coordinates within the custom polygon range in the picture.
[0030] Preferably, the extraction and summary of the power grid facility information within the set range of this geographical coordinate according to the actual longitude and latitude are specifically as follows: Construct a grid point distribution list of power grid facility information represented by longitude and latitude. Divide the original map into grids according to equal longitude and latitude, that is, the longitude and latitude are respectively arranged and distributed according to an arithmetic progression with an equal common difference. Each longitude and latitude is associated with the longitudes and latitudes of each power grid facility within its corresponding range to form grid points containing the corresponding power grid facility information represented by longitude and latitude; Adopt a similar longitude and latitude registration method to compare the actual longitude and latitude corresponding to the pixel point coordinates extracted inside the polygon with the longitude and latitude of the grid points in the grid point distribution list of power grid facility information, obtain the grid point longitude and latitude with the highest similarity, and according to the obtained grid point longitude and latitude of the power grid facility information, associate it with the power grid facility information under the corresponding grid point, filter out the same longitude and latitude grid points in the output, and extract and export the power grid facility information ledger.
[0031] Preferably, the specific method for obtaining the grid point longitude and latitude with the highest similarity is as follows: Let the actual longitude and latitude corresponding to the input pixel point coordinates be , according to the longitude and latitude distribution of the power grid facility grid points arranged by equal longitude and latitude, obtain the common difference of its corresponding longitude and latitude arithmetic progression; Solve the tolerance quotients and of the actual longitude and latitude respectively; Adopt the rounding algorithm to calculate the integers and closest to the tolerance quotients and ; The integers and Multiply by the tolerance respectively to obtain the grid point longitude and latitude of the corresponding power grid facility information in the arithmetic progression of longitude and latitude closest to the given number ; According to the grid point longitude and latitude of the obtained power grid facility information , associate with the power grid facility information under the corresponding grid point.
[0032] In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for extracting the power grid facility ledger with a definable range based on pictures are implemented.
[0033] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for extracting the power grid facility ledger with a definable range based on pictures are implemented.
[0034] In a fifth aspect, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for extracting the power grid facility ledger with a definable range based on pictures are implemented.
[0035] In a sixth aspect, an embodiment of the present invention provides an electronic device, including a computer program, and when the computer program is executed by the electronic device, the steps of the above-mentioned method for extracting the power grid facility ledger with a definable range based on pictures are implemented.
[0036] Compared with the prior art, the present invention has at least the following beneficial effects: A method for extracting the ledger of power grid facilities with a definable range based on pictures realizes the dynamic spatial extraction of the power grid facility ledger by establishing an intelligent association between meteorological pictures and the geographic coordinate system; the meteorological pictures are cropped at the picture boundary to match the map area. Pixel-level cropping is used to establish a standard geographic reference target area, solving the problem of spatial normalization, eliminating redundant information at the edges of meteorological pictures, and ensuring the accuracy of subsequent coordinate registration; then the meteorological pictures are registered with the map geographic coordinate system to form a longitude-latitude-pixel registration dictionary. The problem of how to construct the mapping relationship between pixels and geographic coordinates is solved, and the rapid conversion between the geographic coordinate system and the image pixel coordinate system is realized; by defining and drawing a polygon area on the meteorological picture to specify the range for extracting power grid facility information, the determination area is determined by depicting the polygon vertices, and the pixel coordinates within the custom polygon range in the meteorological picture are extracted. The custom point-drawing method is adopted to support the selection of irregular areas, realizing flexible spatial range selection, and improving the adaptability of the selected area compared with the traditional rectangular box selection; the pixel coordinates within the custom polygon range in the extracted meteorological picture are converted into the corresponding actual longitude and latitude through the longitude-latitude-pixel registration dictionary. By using the established mapping between the physical quantity space and the information space, the rapid positioning and extraction of power grid facilities in the selected custom area range are realized; the power grid facility information within the set range of the geographic coordinates is extracted and summarized according to the actual longitude and latitude to form an exported power grid facility information ledger. The traditional facility query and matching are converted into grid area query and matching, effectively reducing the data calculation amount and realizing the efficient query of millions of power grid facility records; through the establishment of a three-layer mapping system of "image space - geographic space - facility space", the visualization, intelligence, and spatialization of power grid facility management are realized, providing an important technical support for the rapid and accurate prediction of power grid disaster losses.
[0037] Furthermore, by aligning the meteorological pictures with the geographic coordinate system and establishing a longitude-latitude-pixel mapping dictionary, the problem of fuzzy spatial positioning in traditional image processing is solved; this precise coordinate conversion mechanism ensures that the longitude and latitude data of the power grid facilities extracted subsequently have a very small error from the actual geographical location. Especially when dealing with emergencies such as natural disasters, it can quickly lock the fault point and avoid repair delays caused by coordinate deviations; automatically remove irrelevant areas (such as drawing borders, blank noise) in the meteorological pictures, focus on the core map area, and reduce the interference of redundant data.
[0038] Furthermore, it realizes the extraction of pixel coordinates within a custom polygon in meteorological images, solving the problems of flexible target area positioning and improved data processing efficiency. In meteorological images, power grid facilities may be distributed at different geographical locations, and the distribution range of these facilities is sometimes irregular. By customizing different polygon ranges, it can adapt to various complex scenarios, accurately frame the area where the power grid facilities to be extracted are located, and avoid including pixel points in irrelevant areas in the analysis and calculation, thereby improving the accuracy and pertinence of coordinate extraction. In addition, traditional methods may need to traverse and analyze the entire meteorological image, while this method only processes the pixel points within the custom polygon range, which will greatly reduce the amount of data to be processed and improve the data processing efficiency. Especially when processing high-resolution meteorological images, the advantage is more obvious.
[0039] Furthermore, the judgment conditions can quickly filter out the pixel points intersecting with the polygon edges, reducing unnecessary calculations and improving the judgment efficiency and accuracy. Through Judgment Conditions 1 and 2, it can quickly determine whether a pixel point is within the vertical range (upper and lower range) of the polygon edge. If the pixel point is not within the vertical range of the edge, the further judgment of this edge can be directly skipped, thereby reducing unnecessary calculations and quickly filtering out irrelevant edges; through Judgment Condition 3, the position of the pixel point can be further restricted to ensure that the pixel point is within the horizontal range (left and right range) of the edge. This reduces the number of edges for which intersection calculations need to be performed, thereby reducing the computational complexity; through the three judgment conditions, it can accurately determine whether a pixel point is within the range of the polygon edge. Only when the pixel point meets all three conditions will the intersection of the rightward ray and the edge be further calculated, thereby ensuring the accuracy of the judgment; by restricting the position of the pixel point, it can avoid misjudgments caused by abnormal pixel point positions (such as exceeding the edge range), improving the reliability of the judgment result.
[0040] Furthermore, according to the actual longitude and latitude, the power grid facility information within the set range of this geographical coordinate is extracted and summarized. By constructing steps such as a grid distribution list of power grid facility information, a similar longitude and latitude registration method, and filtering and summarization, the problem of efficient extraction and summarization of power grid facility information within a specific geographical coordinate range is solved. This method not only improves the accuracy of geographical positioning and the efficiency of data retrieval through grid division and similarity matching, but also ensures the accuracy of data association and the clarity of power grid facility information summarization, facilitating subsequent analysis and decision-making.
[0041] Furthermore, by obtaining the grid point longitude and latitude with the highest similarity, calculating the similarity between the actual longitude and latitude and the grid point longitude and latitude of the power grid facilities, and finding the closest grid point, the matching accuracy and calculation efficiency can be improved, ensuring that the power grid facility information extracted from the grid points is highly consistent with the actual location. By using the rounding algorithm, the actual longitude and latitude are converted into the closest grid point longitude and latitude, simplifying the calculation process, reducing the algorithm complexity, and improving the calculation efficiency. Especially when dealing with a large amount of data, the processing time can be significantly shortened.
[0042] It can be understood that the beneficial effects of the above second to sixth aspects can be referred to the relevant descriptions in the first aspect above, and will not be elaborated here.
[0043] In summary, the method of the present invention combines the application program for extracting the power grid facility ledger based on the back-end Python model service and the front-end Web page to comprehensively apply, achieving the goal of quickly and accurately extracting the power grid facility information ledger within the custom area from the meteorological pictures.
[0044] Next, through the drawings and embodiments, the technical solutions of the present invention will be further described in detail. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 For extracting and exporting some result example diagrams of the power grid facility information ledger; Figure 2 Flowchart of the method of the present invention; Figure 3 Schematic diagram of a computer device provided by an embodiment of the present invention; Figure 4 Block diagram of an electronic device provided by an embodiment of the present invention.
[0047] Among them, 60. Computer device; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access storage unit; 6202. Cache storage unit; 6203. Read-only storage unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] The present invention provides a method for extracting the ledger of power grid facilities within a definable range based on pictures, which can extract the power grid facility information within the definable area from a meteorological picture in formats such as JPG and PNG. It is possible to perform polygon contour marking on different areas marked in the picture that are affected by heavy rainfall, strong convection, strong winds, etc., and quickly extract the main power grid facilities (including substations, main grid and distribution network lines, etc.) within this area that may be affected by extreme weather or disasters. It no longer depends on professional meteorological NC files or rasterized meteorological grid data, thereby effectively reducing the usage cost and computing power cost brought by using meteorological NC files or rasterized meteorological grid data, and providing key and rapid prediction data support for power grid disaster loss prediction and emergency command auxiliary decision-making work.
[0049] The principle of a method for extracting the ledger of power grid facilities within a definable range based on pictures according to the present invention is as follows: Based on meteorological pictures in formats such as JPG and PNG, by using image processing and geographic information system technologies, it is possible to automatically extract the power grid facility information such as substations and main and distribution network lines contained within the polygon area defined by the user. The present invention first constructs a Lambert conformal conic projection (normal axis conformal double standard parallel conic projection) coordinate system that matches the meteorological map, further registers the pixel coordinates of each point in the input meteorological picture with the actual longitude and latitude of this point, that is, the geographic coordinates, to form a "longitude and latitude - pixel" registration dictionary. Then, the user makes a custom annotation on the meteorological picture to form a closed polygon area, and uses an image pixel coordinate determination algorithm based on the right-ray method to extract all the pixel coordinates within the polygon area. Combining with the "longitude and latitude - pixel" registration dictionary, all the pixel coordinates within the determined area are converted into the corresponding actual longitude and latitude. Finally, according to the actual longitude and latitude, the power grid facility information within a certain range of this geographic coordinate is extracted and summarized to form an exported power grid facility information ledger.
[0050] The method for registering the pixel coordinates of the meteorological picture with the actual longitude and latitude is a key link in the present invention, which directly affects the accuracy and reliability of subsequent power grid facility information extraction. Since meteorological maps are usually generated by using a Lambert conformal conic projection coordinate system with non-uniform longitude and latitude display, to achieve the registration of the pixel coordinates of the meteorological picture with the actual longitude and latitude, continuous conversion and precise registration of longitude and latitude geographic coordinates, Lambert conformal conic projection coordinates, and pixel coordinates are required, so as to ensure that the longitude and latitude extracted and converted from the meteorological picture match the actual geographical location where the power grid facility information is located.
[0051] Embodiment 1 Please refer to Figure 2 , a method for extracting the ledger of power grid facilities within a definable range based on pictures according to the present invention, includes the following steps: S1. Upload and crop the meteorological picture; The user uploads meteorological images in formats such as JPG and PNG through the browser's Web interface, and performs image boundary cropping to match the map area.
[0052] By constructing a program that uses a backend Python framework and a frontend JavaScript framework, functions such as uploading meteorological images in formats such as JPG and PNG, cropping the boundary range, drawing custom polygon areas, and extracting the ledger of power grid equipment and facilities within the area are realized on the Web page. The key of the present invention lies in the method of registering the meteorological image with the map geographic coordinate system, and the method of automatically extracting power grid facility information according to the polygon area defined by the user.
[0053] S2. Register the meteorological image with the map geographic coordinate system; S201. Construct a Lambert conformal conic projection coordinate system that matches the meteorological map. By overlaying the input cropped meteorological image and adjusting the projection area, the alignment of the map and image boundaries is completed; S202. Convert the longitude and latitude of the map display area into Lambert conformal conic projection coordinates. By using the forward and inverse transformation formulas of the Lambert conformal conic projection and combining visualization drawing tools such as Matploblib, set the drawing size of the map image, generate the corresponding projection plane image, and obtain the screen display coordinates corresponding to the projection coordinates of the image; Define the major semi - axis of an ellipse as and the minor semi - axis as Calculate the flattening and the first eccentricity respectively as:
[0054]
[0055] Define the latitude of a conversion point as and the longitude as The converted projection coordinates are where is the false northing ordinate of the conversion point, is the false easting abscissa of the conversion point, the origin latitude is the origin longitude is the projection coordinates are the first standard parallel is the second standard parallel is Calculate the relevant intermediate parameters as follows:
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062] Among them, is the value at the origin latitude, and are the and values at the standard latitudes respectively. The projected coordinate values of the conversion point can be obtained as follows: and are the and values at the standard latitudes respectively. The projected coordinate values of the conversion point can be obtained as follows:
[0063]
[0064] According to the inverse transformation of the above formula, define the projected coordinates of the conversion point as , the converted latitude as , and the longitude as . Calculate the relevant intermediate parameters , and respectively and derive the solution formula for the inverse transformation as shown below:
[0065] The symbol is the same as
[0066]
[0067]
[0068] When the projected coordinate values of the conversion point are obtained, that is, by using visualization drawing tools such as Matploblib, set the drawing size of the map image, generate the corresponding projected plane image, and obtain the screen display coordinates corresponding to the projected coordinates of the image. The screen display coordinates are in a coordinate system with the lower left as the origin. It is necessary to convert the screen display coordinate system to a pixel coordinate system with the upper left as the origin, so as to obtain the pixel coordinates of the conversion point.
[0069] Define the screen display coordinates corresponding to the image projection coordinates as , where is the horizontal coordinate, is the vertical coordinate. The height of the screen display is pixels, and the width is pixels.
[0070] S203. By performing equal ratio alignment and interpolation processing on the pixels of the map image and the meteorological picture, obtain the correct pixel coordinates of the conversion point on the meteorological picture, thereby realizing the registration of the longitude and latitude geographical coordinates and the picture pixel coordinates, and forming a "longitude and latitude - pixel" registration dictionary.
[0071] The pixel coordinates of the map image converted to the pixel coordinate system are calculated by the following formula:
[0072] Since the boundary alignment of the map image and the meteorological picture has been completed by superimposing the input - cropped meteorological picture before, but considering that the pixel resolutions of the map image and each input meteorological picture may not be exactly the same, it is necessary to perform equal ratio alignment and interpolation processing on the pixels of the map image and the meteorological picture to obtain the correct pixel coordinates of the conversion point on the meteorological picture , thereby realizing the matching of the longitude and latitude of the conversion point and the picture pixel coordinates. Define the high resolution of the meteorological picture as pixels, and the width as pixels. The calculation formula for the correct pixel coordinates on the meteorological picture is as follows:
[0073] By adopting the above - mentioned method, the alignment of the longitude and latitude of a single conversion point and the pixel coordinates of the meteorological picture is realized. Generalize the above - mentioned method to multiple conversion points, and the pixel coordinates of each point of the input meteorological picture can be registered with the actual longitude and latitude of this point, that is, the geographical coordinates. In this embodiment, when the pixel resolution of the input meteorological picture is 2800×2330, the finally formed "longitude and latitude - pixel" registration dictionary is as shown in the following table. For input meteorological pictures with other pixel resolutions, the corresponding "longitude and latitude - pixel" registration dictionary can be formed by referring to the following table: Table 1 "Longitude and Latitude - Pixel" Registration Dictionary
[0074] S3. Custom polygon area drawing; The user defines and draws a polygonal area on the picture to specify the range for extracting power grid facility information, determines the judgment area by depicting the polygon vertices, and realizes the extraction of pixel coordinates within the custom polygon range in the picture through the pixel coordinate extraction method within the polygonal area in the picture.
[0075] This pixel coordinate extraction method within the polygonal area in the picture adopts an image pixel coordinate judgment algorithm based on the right - hand ray method to determine whether a certain pixel point in the picture is inside the defined polygon.
[0076] The basic idea of the right - hand ray method is to emit a ray from the pixel point to be judged in the positive right direction, and then calculate the number of intersections of this ray with each side of the defined polygon. If the number of intersections is odd, it is judged that the pixel point is inside the polygon; if the number of intersections is even, it is judged that the pixel point is outside the polygon.
[0077] First, define any pixel point on the meteorological picture and a polygon with a defined range , where, is composed of pixel vertices connected in clockwise order: S301. Algorithm initialization Let , indicating that the pixel point is initially considered to be outside the polygon.
[0078] Let , representing the last vertex of the polygon for loop iteration processing by the algorithm.
[0079] S302. Traverse each side of the defined polygon For the th side, from to .
[0080] Judgment condition 1: Use the following formula to check whether the pixel point is above or on the horizontal line of the side to :
[0081] Judgment condition 2: Use the following formula to check whether the pixel point is below or on the horizontal line of the side to :
[0082] Judgment condition 3: Check the pixel using the following formula whether it is on the side to the maximum value on the left side or at the same position:
[0083] If all of the above three conditions are met, calculate the intersection coordinates of the rightward ray and the current polygon side using the following formula of the coordinate values :
[0084] If this side of the current polygon is vertical, i.e., , or the rightward ray intersects the side of the polygon, i.e., , then update according to the following formula :
[0085] S303. Update the coordinates of the previous vertex defining the polygon Let , to prepare for the next iteration.
[0086] S304. Return the pixel determination result.
[0087] Return the of the current pixel. If is , then it is considered that the pixel is inside the polygon; otherwise, the pixel is outside the polygon.
[0088] Output the coordinates of the pixels inside the polygon, and the extraction of the pixel coordinates within the custom polygon range in the picture can be achieved.
[0089] S4. Pixel coordinate and geographic coordinate conversion; The coordinates of the pixels inside the output polygon are further combined with the "longitude and latitude - pixel" registration dictionary to match and convert all the pixel coordinates within the determination area into the corresponding actual longitude and latitude. That is, the coordinates of the pixels inside the output polygon are retrieved and matched one by one according to the "longitude and latitude - pixel" registration dictionary to achieve the extraction of the actual longitude and latitude corresponding to the pixel coordinates.
[0090] S5. Extraction of the power grid facility information ledger.
[0091] Extract and summarize the power grid facility information within a certain range of this geographic coordinate according to the actual longitude and latitude, including the names, affiliated units, voltage levels, and other detailed information of substations and main and distribution network line facilities, and form an exported power grid facility information ledger.
[0092] S501. Construct a list of grid point distributions of power grid facility information represented by longitude and latitude. The original map is divided into grids according to equal longitude and latitude, that is, the longitude and latitude are arranged and distributed in an arithmetic progression with an equal common difference respectively. Each longitude and latitude is associated with the longitudes and latitudes of each power grid facility within its corresponding range, forming a grid point containing the corresponding power grid facility information represented by longitude and latitude. Among them, the corresponding range refers to a quadrilateral area bounded by half of the common difference before and after each longitude and latitude.
[0093] S502. Adopt the method of similar longitude and latitude registration to compare the actual longitude and latitude corresponding to the pixel point coordinates extracted from the above polygon with the longitude and latitude of the grid points in the list of grid point distributions of power grid facility information, obtain the longitude and latitude of the grid point with the highest similarity, and quickly associate to the power grid facility information under this grid point according to the obtained longitude and latitude of the grid point of the power grid facility information, filter out the grid points with the same longitude and latitude in the output, and realize the extraction and export of the power grid facility information ledger.
[0094] Let the actual longitude and latitude corresponding to the input pixel point coordinates be , given the longitude and latitude distribution of the power grid facility grid points arranged according to equal longitude and latitude, obtain the common difference of its corresponding arithmetic progression of longitude and latitude.
[0095] S5021. Calculate the tolerance quotient of the given longitude and latitude; Use the following formula to solve the tolerance quotient and of the actual longitude and latitude respectively:
[0096]
[0097] S5022. Calculate the integer closest to the tolerance quotient; Use the rounding algorithm to calculate the integers and closest to the tolerance quotient and , as shown in the following formula:
[0098]
[0099] Among them, The formula represents rounding down, that is, taking the largest integer not greater than , represents that after adding 0.5 to , then rounding down, Similarly.
[0100] S5023. Calculate the longitude and latitude of the grid point closest to the power grid facility.
[0101] The integer closest to the tolerance quotient and are respectively multiplied by the tolerance to obtain the longitude and latitude of the grid point corresponding to the power grid facility information in the arithmetic progression of longitude and latitude closest to the given number as shown in the following formula:
[0102]
[0103] According to the longitude and latitude of the grid point of the obtained power grid facility information, quickly associate with the power grid facility information under this grid point.
[0104] Repeat the above steps to calculate the actual longitude and latitude corresponding to all input pixel point coordinates, filter out the same longitude and latitude grid points in the output, and extract and export the power grid facility information ledger, as Figure 1 shown.
[0105] Those skilled in the art of the present technology can understand that various aspects of the present invention can be implemented as a system, method, or program product. Therefore, various aspects of the present invention can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "platform" here.
[0106] Embodiment 2 The present invention provides a system for extracting a power grid facility ledger with a definable range based on a picture, which can be used to implement the above method for extracting a power grid facility ledger with a definable range based on a picture. Specifically, the system for extracting a power grid facility ledger with a definable range based on a picture includes a cropping module, a registration module, an extraction module, a conversion module, and an output module.
[0107] Among them, the cropping module crops the picture boundary of the meteorological picture; The registration module registers the meteorological picture after cropping the picture boundary with the map geographic coordinate system to form a longitude-latitude - pixel registration dictionary; The extraction module defines and draws a polygon area on the meteorological picture registered with the map geographic coordinate system to specify the range for extracting power grid facility information, and determines the judgment area by depicting the polygon vertices, so as to realize the extraction of pixel coordinates within the custom polygon range in the meteorological picture; The conversion module converts the pixel coordinates within the custom polygon range in the extracted meteorological picture into corresponding actual longitude and latitude through the longitude-latitude - pixel registration dictionary; Output module, which extracts and summarizes the power grid facility information within the set range of the geographical coordinates according to the actual longitude and latitude, and forms an export ledger of power grid facility information.
[0108] Embodiment 3 The present invention provides a terminal device, which includes a processor and a memory. The memory is used to store a computer program, and the computer program includes program instructions. The processor is used to execute the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Graphics Processing Unit (GPU), Tensor Processing Unit (TPU), Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function. The processor described in the embodiment of the present invention can be used for the operation of the method for extracting the power grid facility ledger with a definable range based on pictures, including: Performing picture boundary clipping on the meteorological picture; then registering the meteorological picture after picture boundary clipping with the map geographical coordinate system to form a longitude-latitude-pixel registration dictionary; defining and drawing a polygon area on the meteorological picture registered with the map geographical coordinate system to specify the range for extracting power grid facility information, and determining the judgment area by depicting the polygon vertices to achieve the extraction of pixel coordinates within the custom polygon range in the meteorological picture; converting the pixel coordinates within the custom polygon range in the extracted meteorological picture into corresponding actual longitude and latitude through the longitude-latitude-pixel registration dictionary; extracting and summarizing the power grid facility information within the set range of the geographical coordinates according to the actual longitude and latitude, and forming an export ledger of power grid facility information.
[0109] Please refer to Figure 3, the terminal device is a computer device. The computer device 60 in this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, it implements the method for extracting the picture-based definable range power grid facility ledger in the embodiment. To avoid repetition, it will not be elaborated here one by one. Alternatively, when the computer program 63 is executed by the processor 61, it implements the functions of each model / unit in the picture-based definable range power grid facility ledger extraction system in the embodiment. To avoid repetition, it will not be elaborated here one by one.
[0110] The computer device 60 can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art can understand that Figure 3 This is only an example of the computer device 60 and does not constitute a limitation on the computer device 60. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0111] The so-called processor 61 may be a central processing unit (CPU), or may also be other general-purpose processors, a graphics processing unit (GPU), a tensor processing unit (TPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0112] The memory 62 may be an internal storage unit of the computer device 60, such as the hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk equipped on the computer device 60, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.
[0113] Further, the memory 62 may also include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0114] Please refer to Figure 4 , the terminal device is the electronic device 600, and the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0115] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present invention described in the above method part of this specification. For example, the processing unit 610 can execute steps as shown in Figure 2 .
[0116] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and / or a cache storage unit 6202, and may further include a read-only storage unit (ROM) 6203.
[0117] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205. Such program modules 6205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0118] The bus 630 may represent one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0119] The electronic device 600 may also communicate with one or more external devices 700 (such as a keyboard, a pointing device, a Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or may communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (such as a router, a modem). Such communication may be carried out through the input / output interface 650. Moreover, the electronic device 600 may also communicate with one or more networks (such as a local area network, a wide area network, and / or a public network, such as the Internet) through the network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 through the bus 630. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0120] Embodiment 4 The present invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device and is used to store programs and data. It can be understood that the computer-readable storage medium here may include both the built-in storage medium in the terminal device and, of course, the extended storage medium supported by the terminal device. It may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. And, in this storage space, one or more instructions suitable for being loaded and executed by a processor are also stored, and these instructions may be one or more computer programs (including program codes). It should be noted that more specific examples of the computer-readable storage medium here include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0121] The computer-readable storage medium also includes a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium other than the readable storage medium, and this readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination of the above.
[0122] The program code for performing the operations of the present invention can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages such as Python, Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network or a wide area network, or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).
[0123] One or more instructions stored in the computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the method for extracting the ledger of grid facilities with a definable range based on pictures in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor to perform the following steps: Perform picture boundary cropping on the meteorological picture; then register the meteorological picture after picture boundary cropping with the map geographic coordinate system to form a longitude-latitude - pixel registration dictionary; by defining and drawing a polygon area on the meteorological picture registered with the map geographic coordinate system to specify the range for extracting grid facility information, determine the determination area by depicting the polygon vertices, and implement the extraction of pixel coordinates within the custom polygon range in the meteorological picture; convert the pixel coordinates within the custom polygon range in the extracted meteorological picture into corresponding actual longitude and latitude through the longitude-latitude - pixel registration dictionary; extract and summarize the grid facility information within the set range of the geographic coordinates according to the actual longitude and latitude to form an exported ledger of grid facility information.
[0124] In each of the embodiments provided in the present application, the database involved may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., and is not limited thereto. In each of the embodiments provided in the present application, the processor involved may be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., and is not limited thereto.
[0125] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Generally, the components described and shown in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0126] Embodiment 5 Based on the application program of the backend Python model service and the frontend Web page, users can upload meteorological pictures through the browser Web page, sequentially perform meteorological picture boundary cropping according to the provisions of the invention content, complete the "latitude and longitude - pixel" registration, select custom points in the picture, construct a polygon area, feedback the area vertices to the algorithm model, and calculate and obtain the grid facility information ledger within the area. This application program can be deployed on the server to provide grid facility information ledger extraction services for multiple users through the Web page.
[0127] I. System Architecture Design Hardware Environment: CPU: Intel(R) Xeon(R) W-3175X and above GPU: NVIDIA RTX 3060 and above Memory: 32 GB and above Hard Disk: 500 G and above Operating System: Windows10 64-bit and above operating system Software Running Support Environment: Python 3.9 PyCharm 2022.2.2 Vue.js 2.0 Operation Process 1) Enter the Windows command-line tool, Terminal, or PyCharm compiler, switch to the directory where the backend main program app.py is located, then enter python app.py and press Enter to run the main program file; or directly execute the app.py file in the file directory. Open the web page http: / / 127.0.0.1:5000 / . (Or modify the configuration file to change the ID). 2) Click the Select File button on the page to upload the meteorological forecast and early warning picture. 3) Drag the mouse on the page to draw a cropping rectangle along the four farthest points of the map in the four directions of east, south, west, and north. Click Image Cropping to complete the registration of the input picture. 4) On the cropped picture, click on the area where the power grid information ledger needs to be extracted. Click multiple times to form a closed polygon. When the Finish Drawing button appears on the page, the operation is correct. Otherwise, click the Redraw button to re-select and draw the area. 5) When the Finish Drawing button is clicked, the software will perform background calculations on the selected polygon area and give a dynamic percentage progress of the calculation process. At this time, other multiple custom areas can be drawn continuously, and the background will calculate them in turn until all areas are calculated. It takes about 1 minute for the program to automatically run for each area calculation, and a corresponding completion prompt will appear. 6) When all defined areas are calculated, you can click on each drawn area on the current page to view and check the integrity of each previously drawn area. The selected area is marked in dark red on the page, and other areas are in dark green. 7) Click the Return to Historical Analysis button on the previous page to enter the historical analysis page. On the right side of the page are the meteorological forecast and early warning pictures uploaded each time, as well as the various drawn areas. By clicking the different area number buttons, you can view the main power grid facility information ledger (provincial company to which it belongs, subordinate unit, equipment type, number of equipment at different voltage levels) included in the current area. Click "Substation Download", "Main Grid Line Download", or "Distribution Grid Line Download" in the Equipment Ledger Download to download the corresponding power grid facility information ledger.csv file.
[0128] II. Performance Indicators
[0129] Through the deep integration of machine learning algorithms and spatial computing technologies, while ensuring the accuracy of equipment extraction, the disaster damage prediction response speed is increased to the minute level, which can effectively support the emergency command and decision-making of the provincial power grid.
[0130] In summary, for the method and system for extracting the grid facility ledger based on pictures according to the present invention, compared with the use of huge gridded meteorological NC files with a size of several GB as raster data input when associating meteorological data and grid information models in the past, the present invention only needs to provide a meteorological picture in the format of JPG or PNG with a size of more than a dozen MB or even dozens of KB as input, and can realize the rapid extraction of the grid facility ledger information within a user-defined range on the basis of ensuring kilometer-level accuracy, reducing the cost and time for extracting the grid facility ledger information in the past and effectively improving the extraction efficiency of the grid facility information ledger. At the same time, the present invention also provides a user-friendly graphical visualization operation interface, which is convenient for users to customize and upload and crop meteorological pictures, and at the same time mark any polygon area of the meteorological map in the selected picture for extracting and exporting the grid facility ledger information.
[0131] The above content is only to illustrate the technical idea of the present invention, and the protection scope of the present invention cannot be limited thereby. Any changes made on the basis of the technical solution according to the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for extracting power grid facility records with a definable range based on images, characterized in that: The following steps are involved: Crop the image boundaries of meteorological images; The meteorological image after the image boundary is cropped is registered with the map geographic coordinate system to form a longitude and latitude-pixel registration dictionary; By defining and drawing a polygonal area on the meteorological picture aligned with the map geographic coordinate system to specify the range for extracting power grid facility information, and by depicting the vertices of the polygon to determine the determination area, the pixel coordinates within the custom polygonal range in the meteorological picture can be extracted; The pixel coordinates within the custom polygon range in the extracted meteorological image are converted to the corresponding actual longitude and latitude through the longitude and latitude-pixel registration dictionary; The power grid facility information within the set range of the geographic coordinates is extracted and summarized according to the actual longitude and latitude to form an exported power grid facility information ledger.
2. The method for extracting power grid facility records with a definable range based on images according to claim 1, characterized in that: The meteorological image is aligned with the map's geographic coordinate system to form a latitude and longitude-pixel alignment dictionary: Construct a Lambert Conformal Conic Projection coordinate system that matches the weather map, and adjust the projection area by superimposing the cropped weather image on the input to align the map with the weather image boundary. The longitude and latitude of the map display area are converted into Lambert conformal conic projection coordinates, and the forward transformation and inverse transformation formulas of Lambert conformal conic projection are used, combined with a visual drawing tool, and the map image drawing size is set to generate a corresponding projection plane image, and the screen display coordinates corresponding to the projection coordinates of the projection plane image are obtained; By geometrically aligning and interpolating the pixels of the map image and the meteorological image, the correct pixel coordinates of the conversion point on the meteorological image are obtained, thereby realizing the registration of the longitude and latitude geographic coordinates and the image pixel coordinates, and forming a longitude and latitude-pixel registration dictionary.
3. The method for extracting power grid facility records with a definable range based on pictures according to claim 2, characterized in that: The correct pixel coordinates of the conversion points on the weather image for: in, To convert the map image pixel coordinates into the pixel coordinate system, is the height of the screen display, is the width of the screen display, is the resolution width of the weather image, The resolution of weather pictures is high.
4. The method for extracting power grid facility records with a definable range based on images according to claim 1, characterized in that: The specific method to extract pixel coordinates within the custom polygon range in the meteorological image is as follows: Define any pixel on the weather image and a polygon with a defined extent ,in, Is Pixel Vertices Connect in clockwise order; make , indicating that the pixel is initially considered to be outside the polygon; let , represents the last vertex of the polygon; Traverse each edge of the defined polygon, and when the judgment condition is met, calculate the intersection point of the right ray and the current polygon edge The coordinate value of , if the edge of the current polygon is vertical, or the right ray intersects the edge of the polygon, update ; Update the coordinates of the previous vertex that defines the polygon; Returns the current pixel ,if for , then the pixel point is considered to be inside the polygon; otherwise, the pixel point is outside the polygon; the coordinates of the pixel point inside the polygon are output to realize the extraction of the pixel coordinates within the custom polygon range in the image.
5. The method for extracting power grid facility records with a definable range based on pictures according to claim 4, characterized in that: Traverse each edge of the polygon, and for the Strip edge, arrive ,make , the judgment conditions are as follows: Judgment condition 1: Use the following formula to check the pixel Is it on the edge arrive Above or horizontally: Judgment condition 2: Use the following formula to check the pixel Is it on the edge arrive Below or horizontally above: Judgment condition 3: Use the following formula to check the pixel Is it on the edge arrive Maximum To the left of or in the same position as a value: 。 6. The method for extracting power grid facility records with a definable range based on images according to claim 5, characterized in that: The intersection point of the right ray and the current polygon edge The coordinate value of The calculation is as follows: 。 7. The method for extracting power grid facility records with a definable range based on images according to claim 1, characterized in that: The power grid facility information within the set range of the geographic coordinates is extracted and summarized according to the actual latitude and longitude as follows: Construct a grid point distribution list of power grid facility information expressed in longitude and latitude, divide the original map into grids according to equal longitude and latitude, that is, the longitude and latitude are arranged and distributed according to an arithmetic progression with equal tolerance, and each longitude and latitude is associated with the longitude and latitude of each power grid facility within its corresponding range, forming a grid point expressed in longitude and latitude containing the corresponding power grid facility information; A similar longitude and latitude registration method is used to compare the actual longitude and latitude corresponding to the coordinates of the pixel points extracted inside the polygon with the grid longitude and latitude in the grid distribution list of the power grid facility information to obtain the grid longitude and longitude with the highest similarity. The grid facility information under the corresponding grid is associated with the obtained grid longitude and longitude of the power grid facility information, and the output grid points with the same longitude and latitude are filtered out to extract and export the power grid facility information ledger.
8. The method for extracting power grid facility records with a definable range based on images according to claim 7, characterized in that: The latitude and longitude of the grid point with the highest similarity are: Suppose the actual longitude and latitude corresponding to the input pixel coordinates are , according to the longitude and latitude distribution of the grid points of the power grid facilities arranged at equal longitude and latitude, obtain the tolerance of the corresponding longitude and latitude arithmetic series ; The tolerance quotient of the actual longitude and latitude respectively and To solve; The tolerance quotient is calculated using rounding algorithm. and The nearest integer and ; Round the tolerance quotient to the nearest integer and Multiply by the tolerance , get the grid longitude and latitude of the corresponding power grid facility information in the arithmetic progression of longitude and latitude closest to the given number ; According to the grid longitude and latitude of the obtained power grid facility information , associated with the power grid facility information under the corresponding grid point.
9. The method for extracting power grid facility records with a definable range based on images according to claim 8, characterized in that: Tolerance quotient of actual longitude and latitude and The calculation is as follows: 。 10. The method for extracting power grid facility records with a definable range based on images according to claim 8, characterized in that: Tolerance and The nearest integer and The calculation is as follows: in, Indicates that by After adding 0.5, round down. Indicates that by Add 0.5 and round down.
11. A system for extracting power grid facility records with a definable range based on images, characterized in that: include: The cropping module crops the boundary of the meteorological image; A registration module, which registers the meteorological image after the image boundary is cropped with the map geographic coordinate system to form a latitude and longitude-pixel registration dictionary; An extraction module, which defines and draws a polygonal area on the meteorological picture after being aligned with the map geographic coordinate system to specify the range for extracting power grid facility information, and determines the determination area by depicting the vertices of the polygon, thereby realizing the extraction of pixel coordinates within the custom polygonal range in the meteorological picture; The conversion module converts the pixel coordinates within the custom polygon range in the extracted meteorological image into the corresponding actual longitude and latitude through the longitude and latitude-pixel registration dictionary; The output module extracts and summarizes the power grid facility information within the set range of the geographic coordinates according to the actual longitude and latitude, and forms an exported power grid facility information ledger.
12. The image-based definable range power grid facility account extraction system according to claim 11, characterized in that: The meteorological image is aligned with the map's geographic coordinate system to form a latitude and longitude-pixel alignment dictionary: Construct a Lambert Conformal Conic Projection coordinate system that matches the weather map, and adjust the projection area by superimposing the cropped weather image on the input to align the map with the weather image boundary. The longitude and latitude of the map display area are converted into Lambert conformal conic projection coordinates, and the forward transformation and inverse transformation formulas of Lambert conformal conic projection are used, combined with a visual drawing tool, and the map image drawing size is set to generate a corresponding projection plane image, and the screen display coordinates corresponding to the projection coordinates of the projection plane image are obtained; By geometrically aligning and interpolating the pixels of the map image and the meteorological image, the correct pixel coordinates of the conversion point on the meteorological image are obtained, thereby realizing the registration of the longitude and latitude geographic coordinates and the image pixel coordinates, and forming a longitude and latitude-pixel registration dictionary.
13. The image-based definable range power grid facility account extraction system according to claim 11, characterized in that: The specific method to extract pixel coordinates within the custom polygon range in the meteorological image is as follows: Define any pixel on the weather image and a polygon with a defined extent ,in, Is Pixel Vertices Connect in clockwise order; make , indicating that the pixel is initially considered to be outside the polygon; let , represents the last vertex of the polygon; Traverse each edge of the defined polygon, and when the judgment condition is met, calculate the intersection point of the right ray and the current polygon edge The coordinate value of , if the edge of the current polygon is vertical, or the right ray intersects the edge of the polygon, update ; Update the coordinates of the previous vertex that defines the polygon; Returns the current pixel ,if for , then the pixel point is considered to be inside the polygon; otherwise, the pixel point is outside the polygon; the coordinates of the pixel point inside the polygon are output to realize the extraction of the pixel coordinates within the custom polygon range in the image.
14. The image-based definable range power grid facility account extraction system according to claim 11, characterized in that: The power grid facility information within the set range of the geographic coordinates is extracted and summarized according to the actual latitude and longitude as follows: Construct a grid point distribution list of power grid facility information expressed in longitude and latitude, divide the original map into grids according to equal longitude and latitude, that is, the longitude and latitude are arranged and distributed according to an arithmetic progression with equal tolerance, and each longitude and latitude is associated with the longitude and latitude of each power grid facility within its corresponding range, forming a grid point expressed in longitude and latitude containing the corresponding power grid facility information; A similar longitude and latitude registration method is used to compare the actual longitude and latitude corresponding to the coordinates of the pixel points extracted inside the polygon with the grid longitude and latitude in the grid distribution list of the power grid facility information to obtain the grid longitude and longitude with the highest similarity. The grid facility information under the corresponding grid is associated with the obtained grid longitude and longitude of the power grid facility information, and the output grid points with the same longitude and latitude are filtered out to extract and export the power grid facility information ledger.
15. The image-based definable range power grid facility account extraction system according to claim 14, characterized in that: The latitude and longitude of the grid point with the highest similarity are: Suppose the actual longitude and latitude corresponding to the input pixel coordinates are , according to the longitude and latitude distribution of the grid points of the power grid facilities arranged at equal longitude and latitude, obtain the tolerance of the corresponding longitude and latitude arithmetic series ; The tolerance quotient of the actual longitude and latitude respectively and To solve; The tolerance quotient is calculated using rounding algorithm. and The nearest integer and ; Round the tolerance quotient to the nearest integer and Multiply by the tolerance , get the grid longitude and latitude of the corresponding power grid facility information in the arithmetic progression of longitude and latitude closest to the given number ; According to the grid longitude and latitude of the obtained power grid facility information , associated with the power grid facility information under the corresponding grid point.
16. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 10.
17. A computing device, characterized in that include: One or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for executing the method according to any one of claims 1 to 10.
Citation Information
Cited By
FPGA-based endoscope image real-time distortion correction acceleration method
CN120765515A
FPGA-based endoscope image real-time distortion correction acceleration method
CN120765515B
