Aerial photography object extraction and storage method, device and electronic equipment
By acquiring aerial images, segmenting and adjusting the brightness threshold, randomly determining the center point for recursive traversal to generate boundary lines, solving the problem of low efficiency and poor accuracy of aerial image entry database in the prior art, and achieving efficient and accurate object boundary recognition and database entry.
Patent Information
- Application Number
- CN202111498949.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The prior art is inefficient and poorly accurate when entering databases through aerial images in urban management, and requires an efficient and accurate method.
By acquiring aerial images, segmenting the first image, adjusting the pixel light brightness threshold, extracting the original point information, randomly determining the center point, performing recursive traversal to generate boundary lines, and marking and entering the database according to the position information.
It realizes efficient and accurate automatic identification of object boundaries, improving the efficiency and accuracy of entry.
Smart Images

Figure CN114329014B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, and electronic device for extracting and storing aerial photography objects. Background Art
[0002] With the advancement of technology, the field of urban governance is increasingly inclined to combine technology to carry out urban management. When managing a city, it is necessary to first enter the relevant information of the city's management objects or reference objects into the database.
[0003] Currently, the industry usually adopts aerial photography to collect aerial images. Then the staff marks the objects to be managed based on the aerial images and enters them into the database in combination with the location information.
[0004] However, this method is time-consuming and labor-intensive, and has low efficiency. It is necessary to provide an efficient and accurate method. Summary of the Invention
[0005] The embodiments of this specification provide a method, device, and electronic device for extracting and storing aerial photography objects, so as to improve storage efficiency and accuracy.
[0006] The embodiment of this specification provides a method for extracting and storing aerial photography objects, including:
[0007] Acquire an aerial image, segment the aerial image to obtain a segmented first image, and determine position information of the first image;
[0008] configuring an object extraction rule, and adjusting a threshold in the object extraction rule according to the brightness of pixels in the first image;
[0009] Creating a temporary object container, extracting a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and entering the information into the temporary object container;
[0010] Classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, determine whether multiple adjacent original points are queried, and if multiple adjacent original points are queried, use the multiple adjacent original points queried as the center points of the next round and store them in the temporary object container to replace the center point of the current round, and recursively traverse each original point, and generate a boundary line based on the original points queried in the recursive process that meet the preset object boundary conditions;
[0011] The corresponding area in the aerial image is marked and stored in the database according to the position information of the first image and the generated object boundary.
[0012] Optionally, the object has a plurality of discontinuous parts, and each part has the same tilt direction;
[0013] The method further comprises:
[0014] A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
[0015] Optionally, the correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines includes:
[0016] The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
[0017] Optionally, it also includes:
[0018] Objects are redrawn in the corresponding area of the aerial image according to the boundary information.
[0019] Optionally, it also includes:
[0020] It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
[0021] Optionally, the step of correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines further includes:
[0022] A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
[0023] Optionally, adjusting the threshold in the object extraction rule according to the brightness of pixels in the first image includes:
[0024] Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules;
[0025] According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
[0026] The embodiment of this specification also provides a device for extracting and storing aerial photography objects, including:
[0027] an image segmentation module, which acquires an aerial image, segments the aerial image to obtain a segmented first image, and determines position information of the first image;
[0028] a threshold adaptation module, configured with object extraction rules, and adjusting the thresholds in the object extraction rules according to the brightness of pixels in the first image;
[0029] A temporary container module, which creates a temporary object container and extracts a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and enters the information into the temporary object container;
[0030] Classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, determine whether multiple adjacent original points are queried, and if multiple adjacent original points are queried, use the multiple adjacent original points queried as the center points of the next round and store them in the temporary object container to replace the center point of the current round, and recursively traverse each original point, and generate a boundary line based on the original points queried in the recursive process that meet the preset object boundary conditions;
[0031] The marking and warehousing module marks and stores the corresponding area in the aerial image according to the position information of the first image and the generated object boundary.
[0032] Optionally, the object has a plurality of discontinuous parts, and each part has the same tilt direction;
[0033] The device is also used for:
[0034] A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
[0035] Optionally, the correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines includes:
[0036] The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
[0037] Optionally, it also includes:
[0038] Objects are redrawn in the corresponding area of the aerial image according to the boundary information.
[0039] Optionally, it also includes:
[0040] It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
[0041] Optionally, the step of correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines further includes:
[0042] A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
[0043] Optionally, adjusting the threshold in the object extraction rule according to the brightness of pixels in the first image includes:
[0044] Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules;
[0045] According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
[0046] An embodiment of this specification further provides an electronic device, wherein the electronic device includes:
[0047] processor; and,
[0048] A memory storing computer executable instructions, which, when executed, cause the processor to perform any of the above methods.
[0049] An embodiment of this specification further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, any of the above methods is implemented.
[0050] The various technical solutions provided in the embodiments of this specification obtain an aerial image, segment a first image, adjust the object extraction rule threshold according to the brightness of the pixels therein, extract information of multiple original points and enter them into a temporary object container, classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, and if multiple adjacent points are found, store these multiple adjacent original points as the center points of the next round in the temporary object container to replace the center point of the current round, recursively traverse each original point, generate boundary lines based on the original points found in the recursive process that meet the preset object boundary conditions, and mark the corresponding area in the aerial image based on the position information of the first image and the generated object boundary and store them in the database. By judging the proximity and performing recursion, the boundary of the object can be accurately and automatically identified with high efficiency and good accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0052] Figure 1 A schematic diagram of the principle of a method for extracting and storing aerial photography objects provided in an embodiment of this specification;
[0053] Figure 2A schematic diagram of the structure of a device for extracting and storing aerial photography objects provided in an embodiment of this specification;
[0054] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification;
[0055] Figure 4 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of this specification. DETAILED DESCRIPTION
[0056] Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in various forms, and it should not be understood that the present invention is limited to the embodiments set forth herein. On the contrary, providing these exemplary embodiments enables the present invention to be more comprehensive and complete, making it easier to fully convey the inventive concept to those skilled in the art. In the figures, the same reference numerals represent the same or similar elements, components or parts, and thus their repeated description will be omitted.
[0057] Under the premise of being consistent with the technical concept of the present invention, the features, structures, characteristics or other details described in a specific embodiment do not exclude that they can be combined in one or more other embodiments in a suitable manner.
[0058] In the description of specific embodiments, the features, structures, characteristics, or other details of the present invention are described to enable those skilled in the art to fully understand the embodiments. However, this does not preclude those skilled in the art from practicing the technical solutions of the present invention without one or more of the specific features, structures, characteristics, or other details.
[0059] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0060] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0061] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.
[0062] Figure 1 The following is a schematic diagram of a method for extracting and storing aerial photography objects provided in an embodiment of this specification. The method may include:
[0063] S101: Acquire an aerial image, segment the aerial image to obtain a segmented first image, and determine position information of the first image.
[0064] In the embodiment of this specification, we can obtain a bird's-eye view of the city through aerial photography. The information contained in the bird's-eye view can reflect the shape and position of objects, and thus can be used for object analysis and storage.
[0065] Considering the scattered distribution characteristics of objects, we segment the aerial images to improve accuracy and processing efficiency.
[0066] At the same time, we can determine the location information of the first image based on the aerial image.
[0067] S102: Configuring object extraction rules, and adjusting thresholds in the object extraction rules according to the brightness of pixels in the first image.
[0068] In the embodiment of this specification, we can configure object extraction rules to extract the pixels that constitute the object and distinguish it from the background.
[0069] In the embodiment of this specification, the object is a zebra crossing.
[0070] Considering that in actual applications, the bright and dark areas of the zebra crossing may be identified as bright lines due to excessive brightness, and thus be misjudged as objects outside the zebra crossing. Therefore, in order to improve the accuracy and reduce the misjudgment rate, we can adjust the threshold based on the contrast.
[0071] Specifically, adjusting the threshold in the object extraction rule according to the brightness of the pixels in the first image may include:
[0072] Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules;
[0073] According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
[0074] Thus, in actual use, if the area ratio of bright lines to dark lines is 1:4 and the contrast is greater than 10 (the ratio of the brightness value of bright lines to the brightness value of dark lines), then, during extraction, the brightness threshold for extracting bright lines can be determined based on the pixel points in the first image with a contrast of 10 and a pixel number of 1:4, thereby accurately distinguishing and identifying bright lines from dark lines.
[0075] S103: Create a temporary object container, and extract a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and enter the information into the temporary object container.
[0076] The temporary object container may be a storage space.
[0077] The specific form can be a stack.
[0078] In the embodiment of this specification, the method may further include:
[0079] It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
[0080] In this way, the parts segmented into different images can be spliced together before object extraction, which improves the accuracy.
[0081] The specific method is to first pre-read all the images segmented in one round, obtain the position information, and sort them from top to bottom as the primary, and from left to right as the secondary, and read the images in sequence. Each time an image is read, determine whether the extraction point is at the rightmost or bottom of the screen. If so, find the image on the right or bottom side and determine whether there is an extraction point in the adjacent position on the upper or left side of the new image. If so, merge them into a large image of 2000 pixels by 1600 pixels. If an image on the right side is found and there is an extraction point at the bottom of the image, then determine the image at the lower right corner; if an image on the bottom side is found, the same process is applied. The original points of the processed single large or small image are used for the next calculation.
[0082] S104: Grouping consecutive original points into the same group, randomly determining an original point in each group as the initial center point, querying original points adjacent to the center point, and determining whether multiple adjacent original points are found. If multiple adjacent original points are found, the multiple adjacent original points found are used as the center points of the next round and stored in the temporary object container to replace the center point of the current round. Recursively traverse each original point, and generate a boundary line based on the original points found in the recursive process that meet the preset object boundary conditions.
[0083] Optionally, the object has a plurality of discontinuous parts, and each part has the same tilt direction;
[0084] Thus, the method may further comprise:
[0085] A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
[0086] In the embodiment of this specification, the step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines may include:
[0087] The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
[0088] S105: Marking the corresponding area in the aerial image according to the position information of the first image and the generated object boundary and storing the mark in the database.
[0089] The method acquires an aerial image, segments the first image, adjusts the object extraction rule threshold based on the pixel brightness, extracts multiple original point information and enters it into a temporary object container. Consecutive original points are grouped together, and one original point in each group is randomly determined as the initial center point. The original points adjacent to the center point are queried. If multiple adjacent points are found, these multiple adjacent original points are used as the center points of the next round and stored in the temporary object container, replacing the center point of the current round. The method then recursively traverses each original point, generating boundary lines based on the original points found during the recursive process that meet the preset object boundary conditions. The corresponding areas in the aerial image are marked and stored based on the position information of the first image and the generated object boundary. This method, through adjacent judgment and recursive derivation, can accurately and automatically identify the boundaries of objects with high efficiency and accuracy.
[0090] Optionally, the method further includes:
[0091] The object is redrawn in the corresponding area of the aerial image according to the boundary information.
[0092] Specifically, a clear and complete zebra crossing may be drawn in the corresponding area.
[0093] Optionally, the step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines may further include:
[0094] A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
[0095] In actual implementation, the red, green, and blue brightness values of the pixels in the first image obtained by segmentation can be read to generate a brightness matrix. After removing the low-brightness pixels of the zebra crossing, for the remaining pixels, the information of the pixels with brightness values located in the front (for example, 45%) is determined according to the area ratio range of the bright line and the dark line in the zebra crossing. The brightness threshold is set according to the brightness value of the bright line pixel. Pixels with brightness higher than this will be marked as original points in the subsequent zebra crossing fine extraction algorithm.
[0096] In specific implementation, adjacent original points can be grouped together, and all original points can be divided into several groups. If the number of points in a group is not greater than 6, they are discarded (the number of points is too small to form a single zebra crossing).
[0097] The algorithm works by creating a two-dimensional matrix of origin points with the same resolution as the original image. The value at the origin point is 1, and all other values are 0. Once an origin point is found through the matrix, a recursive operation begins to search for adjacent origin points around the point. If found, these are stored in a temporary group and the current origin point is deleted. The recursive operation then continues. Due to the large matrix size, the recursive operation caused a memory overflow. A stacking method was later used instead, which works similarly.
[0098] In the embodiments of this specification, any point can be selected, another point at the farthest distance can be found, and then a third point can be found to maximize the angle between the line connecting points 1 and 2 and the line connecting points 2 and 3, thereby obtaining the outer contour.
[0099] In the embodiment of the present specification, the object may also be divided into different parts according to the inclination directions of multiple boundary lines of the object.
[0100] To achieve uniformity across the zebra crossings, it's necessary to determine the overall slope, individual slopes, and lengths of the zebra crossings. Therefore, choosing the two optimal zebra crossings as a benchmark is crucial. The general principle is to keep the zebra crossings as far apart as possible while ensuring they are of sufficient length. This involves a number of step-by-step procedures, which I won't elaborate on here.
[0101] Based on the relatively complete zebra crossing recognition results obtained in the previous steps, we can obtain information such as the slope, length, and area size. We can also set the width of each zebra crossing to 45cm and the interval to 1m, so as to calculate and draw neat zebra crossings, and cut off the parts that exceed the calculated zebra crossings.
[0102] When storing, the location information of the first image may be used to name the image and the pixel distribution information extracted through identification may be stored.
[0103] The location information may be an image distance or an actual distance of the first image relative to the coordinates of the city origin in the aerial image.
[0104] Figure 2 This is a schematic diagram of the structure of a device for extracting and storing aerial photography objects provided in an embodiment of this specification. The device may include:
[0105] The image segmentation module 201 acquires an aerial image, segments the aerial image to obtain a segmented first image, and determines position information of the first image;
[0106] A threshold adaptation module 202 configures an object extraction rule and adjusts the threshold in the object extraction rule according to the brightness of pixels in the first image;
[0107] A temporary container module 203 is configured to create a temporary object container, and extract a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and enter the information into the temporary object container;
[0108] Classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, determine whether multiple adjacent original points are queried, and if multiple adjacent original points are queried, use the multiple adjacent original points queried as the center points of the next round and store them in the temporary object container to replace the center point of the current round, and recursively traverse each original point, and generate a boundary line based on the original points queried in the recursive process that meet the preset object boundary conditions;
[0109] The marking and warehousing module marks and stores the corresponding area in the aerial image according to the position information of the first image and the generated object boundary.
[0110] Optionally, the object has a plurality of discontinuous parts, and each part has the same tilt direction;
[0111] The device is also used for:
[0112] A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
[0113] Optionally, the correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines includes:
[0114] The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
[0115] Optionally, it also includes:
[0116] Objects are redrawn in the corresponding area of the aerial image according to the boundary information.
[0117] Optionally, it also includes:
[0118] It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
[0119] Optionally, the step of correcting the boundary line to be corrected according to a spatial distribution trend formed between the plurality of boundary lines further includes:
[0120] A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
[0121] Optionally, adjusting the threshold in the object extraction rule according to the brightness of pixels in the first image includes:
[0122] Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules;
[0123] According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
[0124] The device acquires an aerial image, segments a first image, adjusts the threshold of an object extraction rule based on the brightness of pixels therein, extracts information on multiple original points and enters them into a temporary object container. Continuous original points are grouped together, and one original point in each group is randomly determined as the initial center point. Original points adjacent to the center point are queried. If multiple adjacent points are found, these multiple adjacent original points are used as the center points of the next round and stored in the temporary object container, replacing the center point of the current round. The device recursively traverses each original point, generates boundary lines based on original points found during the recursive process that meet preset object boundary conditions, and marks and stores corresponding areas in the aerial image based on the position information of the first image and the generated object boundary. By using the adjacent judgment and recursive method, the boundary of the object can be accurately and automatically identified with high efficiency and good accuracy.
[0125] Based on the same inventive concept, an embodiment of this specification also provides an electronic device.
[0126] The following describes an electronic device embodiment of the present invention, which can be considered a specific physical implementation of the method and apparatus embodiments of the present invention described above. Details described in the electronic device embodiment of the present invention should be considered supplementary to the above-mentioned method or apparatus embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above-mentioned method or apparatus embodiments.
[0127] Figure 3 This is a schematic diagram of the structure of an electronic device provided in the embodiment of this specification. Figure 3 The electronic device 300 according to this embodiment of the present invention will be described. Figure 3 The electronic device 300 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0128] like Figure 3As shown, electronic device 300 is implemented as a general-purpose computing device. Components of electronic device 300 may include, but are not limited to, at least one processing unit 310, at least one storage unit 320, a bus 330 connecting various system components (including storage unit 320 and processing unit 310), a display unit 340, and the like.
[0129] The storage unit stores program codes that can be executed by the processing unit 310, so that the processing unit 310 performs the steps according to various exemplary embodiments of the present invention described in the above processing method section of this specification. For example, the processing unit 310 can perform the following steps: Figure 1 Steps shown.
[0130] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit 3202 , and may further include a read-only memory unit (ROM) 3203 .
[0131] The storage unit 320 may also include a program / utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0132] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0133] The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 300, and / or any device that enables the electronic device 300 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 350. Furthermore, the electronic device 300 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 through the bus 330. It should be understood that although Figure 3Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0134] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the present invention. When the computer program is executed by a data processing device, the computer-readable medium is enabled to implement the above method of the present invention, that is: Figure 1 The method shown.
[0135] Figure 4 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of this specification.
[0136] accomplish Figure 1 The computer program of the method shown can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0137] The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. The data signal propagated may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0138] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0139] In summary, the present invention can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that general data processing equipment such as a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing a part or all of the methods described herein. Such a program for implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0140] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
[0141] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0142] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for extracting and storing aerial photography objects, characterized in that: include: Acquire an aerial image, segment the aerial image to obtain a segmented first image, and determine position information of the first image; configuring an object extraction rule, and adjusting a threshold in the object extraction rule according to the brightness of pixels in the first image; Specifically, reading the red, green, and blue brightness values of pixels in the first image to generate a brightness matrix, removing low-brightness pixels in the first image, and then, for other pixel segments, determining information of pixels with brightness values located at the front according to an area ratio range of bright lines to dark lines, and setting a brightness threshold based on the brightness values; Creating a temporary object container, extracting a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and entering the information into the temporary object container; Classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, determine whether multiple adjacent original points are queried, and if multiple adjacent original points are queried, use the multiple adjacent original points queried as the center points of the next round and store them in the temporary object container to replace the center point of the current round, and recursively traverse each original point, and generate a boundary line based on the original points queried in the recursive process that meet the preset object boundary conditions; The corresponding area in the aerial image is marked and stored in the database according to the position information of the first image and the generated object boundary.
2. The method according to claim 1, characterized in that The object has a plurality of discontinuous parts, and each part has the same tilt direction; The method further comprises: A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
3. The method according to claim 2, characterized in that The step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines includes: The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
4. The method according to claim 1, wherein Also includes: Objects are redrawn in the corresponding area of the aerial image according to the boundary information.
5. The method according to claim 1, wherein Also includes: It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
6. The method according to claim 2, characterized in that The step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines further includes: A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
7. The method according to claim 2, characterized in that The adjusting the threshold in the object extraction rule according to the brightness of the pixels in the first image includes: Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules; According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
8. A device for extracting and storing aerial photography objects, characterized in that: include: an image segmentation module, which acquires an aerial image, segments the aerial image to obtain a segmented first image, and determines position information of the first image; a threshold adaptation module configured with object extraction rules and adjusting the thresholds in the object extraction rules based on the brightness of pixels in the first image; specifically, reading the red, green, and blue brightness values of pixels in the first image to generate a brightness matrix, removing low-brightness pixels in the first image, and then, for other pixel segments, determining information about pixels with brightness values located at the front based on the area ratio range of bright lines to dark lines, and setting a brightness threshold based on the brightness values; A temporary container module, which creates a temporary object container and extracts a plurality of original point information from the pixels in the first image based on the adjusted object extraction rule and enters the information into the temporary object container; Classify consecutive original points into the same group, randomly determine one original point in each group as the initial center point, query the original points adjacent to the center point, determine whether multiple adjacent original points are queried, and if multiple adjacent original points are queried, use the multiple adjacent original points queried as the center points of the next round and store them in the temporary object container to replace the center point of the current round, and recursively traverse each original point, and generate a boundary line based on the original points queried in the recursive process that meet the preset object boundary conditions; The marking and warehousing module marks and stores the corresponding area in the aerial image according to the position information of the first image and the generated object boundary.
9. The device according to claim 8, characterized in that The object has a plurality of discontinuous parts, and each part has the same tilt direction; The device is also used for: A boundary line to be corrected whose degree of deviation exceeds a threshold is identified from the generated multiple boundary lines, and the boundary line to be corrected is corrected according to a spatial distribution trend formed between the multiple boundary lines.
10. The device according to claim 9, characterized in that The step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines includes: The missing part of the boundary to be corrected is predicted according to the spatial distribution trend of multiple closed boundaries, and is filled.
11. The device according to claim 8, characterized in that Also includes: Objects are redrawn in the corresponding area of the aerial image according to the boundary information.
12. The device according to claim 8, characterized in that Also includes: It is determined whether the original point is located at the edge of the first image. If so, images adjacent to the first image are obtained and spliced together to form an image for extracting the original point.
13. The device according to claim 9, characterized in that The step of correcting the boundary line to be corrected according to the spatial distribution trend formed between the plurality of boundary lines further includes: A parallelogram is drawn according to the boundary lines of the plurality of parts as an overall boundary line of the object having the plurality of discontinuous parts.
14. The device according to claim 9, characterized in that The adjusting the threshold in the object extraction rule according to the brightness of the pixels in the first image includes: Configure the pixel level, pixel ratio between different levels, and brightness contrast in the object extraction rules; According to the ratio and contrast of the number of pixels in each level, the brightness range of each level is adjusted in combination with the brightness of the pixels in the first image.
15. An electronic device, wherein: The electronic device includes: processor; and, A memory storing computer executable instructions which, when executed, cause the processor to perform the method according to any one of claims 1 to 7.
16. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method of any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Threshold segmentation method based on quick iteration of two-dimensional Tsallis gray entropy
CN111553926A
Rural road boundary line automatic extraction method based on aerial photography images
CN112801075A