CN115661658A - Picture processing method, device, equipment and medium - Google Patents

Picture processing method, device, equipment and medium Download PDF

Info

Publication number
CN115661658A
CN115661658A CN202211382990.0A CN202211382990A CN115661658A CN 115661658 A CN115661658 A CN 115661658A CN 202211382990 A CN202211382990 A CN 202211382990A CN 115661658 A CN115661658 A CN 115661658A
Authority
CN
China
Prior art keywords
segmentation result
building
original
determining
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211382990.0A
Other languages
Chinese (zh)
Inventor
黄积晟
任宇鹏
李乾坤
崔婵婕
周宏宾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202211382990.0A priority Critical patent/CN115661658A/en
Publication of CN115661658A publication Critical patent/CN115661658A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present disclosure relates to a picture processing method, apparatus, device, and medium, the method comprising: extracting features of pictures to be processed including buildings to obtain original segmentation results of the buildings; aiming at the original segmentation result of each building, establishing a corresponding first segmentation result according to the size of the original segmentation result, determining target areas with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and taking the second segmentation result as the first segmentation result for iteration until an iteration ending condition is met; calculating an intersection ratio by using the original segmentation result and the second segmentation result, and determining the segmentation result of the building based on the relation between the intersection ratio and a set threshold value; based on the segmentation result of each building, a picture segmentation result is determined. The method and the device can segment the picture comprising the regular and/or irregular buildings, and improve the robustness of picture processing.

Description

Picture processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a medium for processing an image.
Background
In the field of remote sensing, building extraction has always been a hot direction. In the extraction of buildings, due to the problem of algorithm precision, the extracted contour of the building presents an irregular phenomenon. Therefore, optimizing the building contour and regulating the optimized contour are especially important in reconstructing the building. In the current state of research, most researches are focused on how to accurately extract the segmentation result of the building outline, so as to improve the IOU (Intersection over Union), but the research on the building regularization is less.
At present, most of schemes are that all buildings in a default remote sensing picture are rectangular, and for other more complex shapes, the scheme is still used for processing, and the higher robustness cannot be maintained.
Disclosure of Invention
The present disclosure provides a picture processing method, apparatus, device, and medium, which can segment a picture including regular and/or irregular buildings, thereby improving robustness of picture processing.
According to a first aspect of the embodiments of the present disclosure, there is provided a picture processing method, including:
performing feature extraction on a picture to be processed comprising buildings to obtain an original segmentation result of each building, wherein the original segmentation result comprises building part pixels marked as a first mark value and background part pixels marked as a second mark value;
aiming at the original segmentation result of each building, establishing a corresponding first segmentation result according to the size of the original segmentation result, determining a target area with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and performing iterative operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, wherein the first segmentation result comprises building part pixels marked as the first mark value;
calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relation between the intersection ratio and a set threshold value;
and determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
The method and the device have the advantages that the mark value in the first segmentation result is adjusted based on the original segmentation result of the building and the mark value in the first segmentation result, the obtained segmentation result is used as the first segmentation result to be subjected to iteration operation, the second segmentation result meeting the iteration end condition is obtained, and therefore the segmentation result of the building can be normalized. And the method determines the segmentation result of each building according to the relation between the intersection ratio between the original segmentation result and the second segmentation result and the set threshold value, and further obtains the picture segmentation result of the whole picture. Therefore, the present disclosure can segment a picture including regular and/or irregular buildings, thereby improving robustness of picture processing, and particularly can have higher robustness to a picture including buildings of non-right-angled polygons.
In one possible implementation manner, the determining a target region with a different label value in the original segmentation result and the first segmentation result includes:
if the current iteration number is singular, determining a first area marked as a second mark value in the original segmentation result and marked as a first mark value in the first segmentation result;
determining the maximum inscribed rectangle of the first area by using a maximum inscribed rectangle algorithm to obtain the target area;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the second mark value, and taking the marked first segmentation result as the second segmentation result.
According to the method, the original segmentation result and the first segmentation result are subjected to XOR operation repeatedly by iterative operation, the target area is determined by using a maximum inscribed rectangle algorithm, the target area in the first segmentation result is used as a background part, and the second segmentation result is obtained, so that the marking value in the second segmentation result can be adjusted continuously, the second segmentation result of the building is normalized, and the accuracy of the second segmentation result is improved.
In one possible implementation manner, the determining a target region with a different label value in the original segmentation result and the first segmentation result includes:
if the current iteration times are complex, determining a second area marked as a first mark value in the original segmentation result and marked as a second mark value in the first segmentation result;
determining a minimum circumscribed rectangle of the second region by using a minimum circumscribed rectangle algorithm, and taking the region of the minimum circumscribed rectangle as the target region;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the first mark value, and taking the marked first segmentation result as the second segmentation result.
According to the method, the XOR operation is repeatedly performed on the original segmentation result and the first segmentation result by using the iterative operation, the target area is determined by using the minimum circumscribed rectangle algorithm, the target area in the first segmentation result is used as the building part, and the second segmentation result is obtained, so that the mark value in the second segmentation result can be continuously adjusted, the second segmentation result of the building is normalized, and the accuracy of the second segmentation result is improved.
In one possible implementation, the iteration end condition includes:
the pixel value of the target area is smaller than a set pixel threshold value; and/or
And reaching the set iteration number.
In a possible implementation manner, before the establishing the corresponding first segmentation result according to the size of the original segmentation result, the method further includes:
building outline extraction is carried out on the original segmentation result by using a building edge extraction algorithm to obtain first pixel coordinates of each endpoint in the building outline;
determining the length of each edge in the building outline based on the first pixel coordinates of each endpoint;
determining a target side with the longest length based on the length of each side, and determining an angle between the target side and a straight line in the horizontal direction;
and rotating the original segmentation result according to the determined angle.
The angle between the longest edge in the building outline and the straight line in the horizontal direction is determined, and the original segmentation result is rotated based on the determined angle, so that the original segmentation result is ensured to be in the positive direction, and subsequent operation is simplified.
In one possible implementation, after the obtaining the second segmentation result, the method further includes:
and reversely rotating the second segmentation result according to the determined angle.
In a possible implementation manner, the determining a segmentation result of the building based on the relation between the intersection ratio and a set threshold includes:
if the intersection ratio is not greater than the threshold value, based on the first pixel coordinates of the end points, eliminating the pixel coordinates of the redundant end points in the building outline by using a Douglas pock algorithm;
and adjusting the marking value in the original segmentation result based on the first pixel coordinates of the eliminated endpoints to obtain the segmentation result of the building.
The method determines that the regularization degree of the second segmentation result is lower than that of the original segmentation result through the relation between the intersection ratio and the set threshold value, so that the original segmentation result is further regularized to obtain the segmentation result of the building, and the accuracy of the segmentation result of the building is improved.
In a possible implementation manner, the determining a segmentation result of the building based on the relation between the intersection ratio and a set threshold includes:
if the intersection ratio is larger than the threshold value, building edge extraction is carried out on the second segmentation result by using a building edge extraction algorithm to obtain second pixel coordinates of each end point of the building outline;
adjusting second pixel coordinates of each endpoint of the building outline by using a Gaussian Markov model or a Gaussian Hull-Mag model;
and adjusting the marking value in the second segmentation result based on the adjusted second pixel coordinate of each end point to obtain the segmentation result of the building.
The method determines that the regularization degree of the second segmentation result is higher than that of the original segmentation result through the relation between the intersection ratio and the set threshold value, so that the second segmentation result is further regularized to obtain the segmentation result of the building, and the accuracy of the segmentation result of the building is improved.
In a possible implementation manner, the determining, based on the segmentation result of each building, a picture segmentation result corresponding to the picture to be processed includes:
determining the position of the segmentation result of each building in the picture to be processed according to the segmentation result of each building and the size of the picture to be processed;
and obtaining an image processing result with the same size as the image to be processed according to the determined position and the segmentation result of each building.
The method and the device ensure the accuracy of the position of the segmentation result of the building in the picture processing result by determining the position of the segmentation result of each building in the picture to be processed.
According to a second aspect of the embodiments of the present disclosure, there is provided a picture processing apparatus including:
the system comprises an obtaining module, a calculating module and a processing module, wherein the obtaining module is used for extracting the characteristics of a picture to be processed comprising buildings and obtaining the original segmentation result of each building, and the original segmentation result comprises a building part pixel marked as a first mark value and a background part pixel marked as a second mark value;
an iteration module, configured to establish, for an original segmentation result of each building, a corresponding first segmentation result according to a size of the original segmentation result, determine a target area with a different label value in the original segmentation result and the first segmentation result, adjust a label value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and perform an iteration operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, where the first segmentation result includes a building part pixel labeled as a first label value;
the first determining module is used for calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relation between the intersection ratio and a set threshold value;
and the second determining module is used for determining the picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; the processor executes the executable instructions to realize the steps of the image processing method.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the above-mentioned picture processing method.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the description below are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings may be obtained according to the drawings without inventive labor.
FIG. 1 is a diagram illustrating an application scenario in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of picture processing in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram illustrating a method of determining an original segmentation result in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating an example split network in accordance with an illustrative embodiment;
FIG. 5 is a flow diagram illustrating a rotation of an original segmentation result in accordance with an illustrative embodiment;
FIG. 6 is a diagram illustrating a rotation of an original segmentation result in accordance with an illustrative embodiment;
FIG. 7 is a flow diagram illustrating one particular method of obtaining a second segmentation result in accordance with one illustrative embodiment;
FIG. 8 is a diagram illustrating a second segmentation result for a number of iterations of 1, according to an exemplary embodiment;
FIG. 9 is a diagram illustrating another example of a second segmentation result for a number of iterations of 1 in accordance with an illustrative embodiment;
FIG. 10 is a diagram illustrating a second segmentation result for a number of iterations 2, according to an exemplary embodiment;
FIG. 11 is a flow diagram illustrating a particular method of obtaining a result of a segmentation of a building in accordance with one illustrative embodiment;
FIG. 12 is a schematic diagram illustrating one approach to obtaining a result of a segmentation of a building in accordance with an exemplary embodiment;
FIG. 13 is a schematic diagram illustrating another result of segmenting a building in accordance with an exemplary embodiment;
FIG. 14 is a schematic illustration of one curve to be processed in a building outline shown in accordance with an exemplary embodiment;
FIG. 15 is a schematic diagram illustrating processing of a curve to be processed using the Douglas Pock algorithm in accordance with an exemplary embodiment;
FIG. 16 is a schematic diagram illustrating the resulting first and second curves according to an exemplary embodiment;
FIG. 17 is a diagram illustrating an expansion of a Gaussian Markov model formula in accordance with an exemplary embodiment;
FIG. 18 is a diagram illustrating a method for determining a result of a picture segmentation corresponding to a picture to be processed according to an exemplary embodiment;
FIG. 19 is a schematic diagram of a picture processing device according to an exemplary embodiment;
FIG. 20 is a schematic diagram of an electronic device illustrating a method of picture processing in accordance with an exemplary embodiment;
fig. 21 is a program product diagram illustrating a method of picture processing according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the scope of the present disclosure.
Some of the words that appear in the text are explained below:
1. the term "and/or" in the embodiments of the present disclosure describes an association relationship of associated objects, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
2. The terms "first," "second," and the like in the description and in the claims of the present disclosure and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein.
The application scenario described in the embodiment of the present disclosure is for more clearly illustrating the technical solution of the embodiment of the present disclosure, and does not form a limitation on the technical solution provided in the embodiment of the present disclosure, and as a person of ordinary skill in the art knows, with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present disclosure is also applicable to similar technical problems. In the description of the present disclosure, the term "plurality" means two or more unless otherwise specified.
In the field of remote sensing, building extraction has always been a hot direction. In the extraction of buildings, due to the problem of algorithm precision, the extracted contour of the building presents an irregular phenomenon. Therefore, optimizing the building contour and regulating the optimized contour are especially important in reconstructing the building. In the current research situation, most researches are focused on how to accurately extract the mask of the building outline to promote the IOU, but the researches on the building regularization are less. At present, most schemes are that all buildings in a default remote sensing picture are rectangular, and for other more complex shapes, the scheme is still used for processing, and the higher robustness cannot be kept.
Therefore, in order to solve the above problems, the present disclosure provides a picture processing method, apparatus, device, and medium, which can segment a picture including regular and/or irregular buildings, thereby improving robustness of picture processing.
Reference is first made to fig. 1, which is a schematic view of an application scenario of the embodiment of the present disclosure, and includes a collector 11 and a server 12. The collector 11 may be a camera, a remote sensing device, a camera of a mobile phone/computer, a video recorder, or the like, and is used for collecting pictures; server 12 is used to segment the buildings in the pictures collected by collector 11.
In the embodiment of the present disclosure, the server 12 performs feature extraction on the to-be-processed picture including the building, acquired by the collector 11, to obtain an original segmentation result of each building, where the original segmentation result includes a building part pixel labeled as a first marker value and a background part pixel labeled as a second marker value; aiming at the original segmentation result of each building, establishing a corresponding first segmentation result according to the size of the original segmentation result, determining a target area with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and performing iterative operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, wherein the first segmentation result comprises building part pixels marked as the first mark value; calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relation between the intersection ratio and a set threshold value; and determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
In some embodiments, the following describes a picture processing method provided by the present disclosure by using specific embodiments, as shown in fig. 2, including:
step 201, performing feature extraction on a picture to be processed including buildings to obtain an original segmentation result of each building;
the picture to be processed may be a high-resolution remote sensing picture, and the picture to be processed may include one building or a plurality of buildings. The original segmentation result includes a building portion pixel labeled as a first label value and a background portion pixel labeled as a second label value, e.g., the building portion pixel is labeled as 1 and the background portion pixel is labeled as 0.
In step 201, the to-be-processed picture may be input into an Instance Segmentation network for feature extraction, so as to obtain an original Segmentation result of each building output by the Instance Segmentation network, where the Instance Segmentation network may be a Mask R-CNN (an Instance Segmentation network), an FCIS (full volume Instance Segmentation), or other networks.
202, aiming at the original segmentation results of each building, establishing corresponding first segmentation results according to the sizes of the original segmentation results, determining target areas with different mark values in the original segmentation results and the first segmentation results, adjusting the mark value corresponding to the target area in the first segmentation results to obtain second segmentation results, and performing iterative operation on the second segmentation results as the first segmentation results until set iteration end conditions are met;
the first segmentation result includes building portion pixels labeled as a first marker value. The iteration end condition includes: the pixel value of the target area is smaller than a set pixel threshold value; and/or to a set number of iterations. The pixel threshold may be 100, the set number of iterations may be 10, or other values may be used.
Step 203, calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relationship between the intersection ratio and a set threshold value;
the set threshold may be 0.95 or other values.
The intersection ratio between the original segmentation result and the second segmentation result obtained after the iteration end condition is satisfied can be calculated by the following formula:
Figure BDA0003928751050000091
where A is the pixel value in the original segmentation result and B is the pixel value in the second segmentation result.
And 204, determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
The method and the device have the advantages that the mark value in the first segmentation result is adjusted based on the original segmentation result of the building and the mark value in the first segmentation result, the obtained segmentation result is used as the first segmentation result to be subjected to iteration operation, the second segmentation result meeting the iteration end condition is obtained, and therefore the segmentation result of the building can be normalized. And the method determines the segmentation result of each building according to the relation between the intersection ratio between the original segmentation result and the second segmentation result and the set threshold value, and further obtains the picture segmentation result of the whole picture. Therefore, the present disclosure can segment a picture including regular and/or irregular buildings, thereby improving robustness of picture processing, and particularly can have higher robustness to a picture including buildings of non-right-angled polygons.
The specific steps of the above-provided picture processing method will be described in detail below:
firstly, extracting features of pictures to be processed including buildings to obtain original segmentation results of the buildings;
as shown in fig. 3, taking a to-be-processed picture including two buildings as an example, where the two buildings are respectively a building a and a building B, inputting the to-be-processed picture into an example segmentation network for feature extraction, and obtaining an original segmentation result a of the building a and an original segmentation result B of the building B output by the example segmentation network.
In the present disclosure, in consideration of the situation that there are other buildings such as attics, group buildings, or dense buildings on the roof, and semantic Segmentation cannot be performed, instance Segmentation (Instance Segmentation) is used to perform single-body Segmentation of the building, as shown in fig. 4, a centrepask (center mask) may be used as a basic Instance Segmentation network framework, and an encoder portion in the centrepask may use VoVNetV2 (efficient object detection backbone network) and FPN (Feature Pyramid Networks) network structures as main Feature extraction Networks, and each time a pooling layer is passed through, one scale is reduced, and finally five Feature layers with different scales may be obtained. The Detection part extracts a Detection box by using an FCOS (fuzzy conditional One-Stage Object Detection) network; the semantic part is added into an SAG-Mask (Spatial Attention-Guided Mask) network structure, an original segmentation result of 28x28 size is predicted, and the segmentation result is scaled to the size corresponding to the detection box. The loss function involved in the training process of the example separation network is composed of four parts, namely target classification loss, center position loss, regression loss and mask loss. The specific training process of the example segmentation network is the prior art, and is not described herein again.
Secondly, establishing a corresponding first segmentation result according to the size of the original segmentation result aiming at the original segmentation result of each building, determining a target area with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and performing iterative operation on the second segmentation result as the first segmentation result until a set iteration end condition is met;
before the corresponding first segmentation result is established according to the size of the original segmentation result, in order to simplify a subsequent operation process, the original segmentation result needs to be rotated, as shown in fig. 5, which specifically includes:
step 501, performing building contour extraction on the original segmentation result by using a building edge extraction algorithm to obtain first pixel coordinates of each endpoint in the building contour;
the building edge extraction algorithm may be an OpenCV (Open Source Computer Vision Library) algorithm, or may be an edge extraction algorithm of other buildings. When the OpenCV algorithm is used, the building outline is retrieved from the original segmentation result by using the findcontours function in the OpenCV algorithm, and the first pixel coordinate of each endpoint is obtained.
Step 502, determining the length of each edge in the building outline based on the first pixel coordinate of each endpoint;
since the first pixel coordinates of each end point are determined and each edge is composed of two end points, the euclidean distance between the two end points is the length of the edge.
Step 503, determining a target edge with the longest length based on the length of each edge, and determining an angle between the target edge and a straight line in the horizontal direction;
the angle may be a cosine value between the target edge and a straight line in the horizontal direction.
Step 504, rotating the original segmentation result according to the determined angle.
For example, as shown in fig. 6, the building outline includes 5 end points, and the first pixel coordinates of each end point are a1, a2, a3, a4, and a5, respectively. Based on a1 and a2, determining the length of the first edge as d1; determining the length of the second side to be d2 based on a2 and a 3; determining the length of the third edge as d3 based on a3 and a 4; determining the length of the fourth side to be d4 based on a4 and a 5; based on a5 and a1, the length of the fifth side is determined to be d5. Since the length of the second edge is greater than the lengths of the other edges, the target edge is the second edge. And calculating an angle alpha between the second edge and the straight line in the horizontal direction, and rotating the original segmentation result by the angle alpha in the clockwise direction by taking the a2 as the center of the circle.
After the obtaining of the second segmentation result, the method further includes:
and reversely rotating the second segmentation result according to the determined angle.
When the iteration ending condition is that the set iteration number is reached, the specific process of the method for obtaining the second segmentation result through the iterative operation, as shown in fig. 7, includes:
step 701, determining the current iteration times;
step 702, judging whether the set iteration number is reached, if not, executing step 703, and if so, executing step 711;
step 703, judging whether the current iteration number is singular, if so, executing steps 704-706, otherwise, executing steps 707-709;
step 704, determining a first region labeled as a second label value in the original segmentation result and labeled as a first label value in the first segmentation result;
the first region is a region that does not belong to the building portion in the original segmentation result, but belongs to the building portion in the first segmentation result.
705, determining the maximum inscribed rectangle of the first area by using a maximum inscribed rectangle algorithm to obtain the target area;
the specific process of determining the maximum inscribed rectangle of the first region by using the maximum inscribed rectangle algorithm is the prior art, and is not described herein again.
Step 706, labeling the mark value corresponding to the target area in the first segmentation result as the second mark value, and taking the labeled first segmentation result as the second segmentation result;
for example, the current iteration number is 1, and as shown in fig. 8, a first region 1 labeled as the second label value in the original segmentation result 1 and labeled as the first label value in the first segmentation result 1 is determined. And determining the maximum inscribed rectangle of the first area 1 by using a maximum inscribed rectangle algorithm to obtain the target area 1. And marking the mark value corresponding to the target area 1 in the first segmentation result 1 as a second mark value, thereby obtaining a second segmentation result 1.
For example, when the current iteration number is 1, as shown in fig. 9, a first region 21 and a first region 22 labeled as the second label value in the original segmentation result 2 and labeled as the first label value in the first segmentation result 2 are determined. And determining the maximum inscribed rectangle of the first area 21 by using a maximum inscribed rectangle algorithm to obtain the target area 21, and determining the maximum inscribed rectangle of the first area 22 to obtain the target area 22. Labeling the mark values corresponding to the target area 21 and the target area 22 in the first segmentation result 2 as a second mark value, thereby obtaining a second segmentation result 2.
Step 707, determining a second region labeled as a first label value in the original segmentation result and labeled as a second label value in the first segmentation result;
the second region is a region that belongs to the building portion in the original segmentation result, but does not belong to the building portion in the first segmentation result.
Step 708, determining a minimum bounding rectangle of the second region by using a minimum bounding rectangle algorithm, and taking the region of the minimum bounding rectangle as the target region;
the specific process of determining the minimum bounding rectangle of the second region by using the minimum bounding rectangle algorithm is the prior art, and is not described herein again.
And 709, marking the mark value corresponding to the target area in the first segmentation result as the first mark value, and taking the marked first segmentation result as the second segmentation result.
For example, the current iteration number is 2, and as shown in fig. 10, the second region 3 labeled as the first label value in the original segmentation result 3 and labeled as the second label value in the first segmentation result 3 is determined. And determining the minimum circumscribed rectangle of the second area 3 by using a minimum circumscribed rectangle algorithm to obtain the target area 3. And marking the mark value corresponding to the target area 3 in the first segmentation result 3 as the first mark value, thereby obtaining a second segmentation result 3.
Step 710, taking the second segmentation result as the first segmentation result, and continuing to execute step 701;
step 711, obtain the second segmentation result.
Then, calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relationship between the intersection ratio and a set threshold value;
as shown in fig. 11, the specific steps of the method for determining the segmentation result of the building include:
step 1101, calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is satisfied;
step 1102, judging whether the intersection ratio is larger than the threshold value, if so, executing steps 1103-1105, otherwise, executing steps 1106-1107;
1103, performing building edge extraction on the second segmentation result by using a building edge extraction algorithm to obtain second pixel coordinates of each endpoint of the building outline;
the building edge extraction algorithm may be an OpenCV algorithm, or may be an extraction algorithm for other building edges.
1104, adjusting second pixel coordinates of each endpoint of the building outline by using a Gauss Markov model or a Gauss Hulmatt model to obtain the adjusted second pixel coordinates of each endpoint;
step 1105, adjusting the mark value in the second division result based on the adjusted second pixel coordinate of each end point to obtain the division result of the building;
for example, as shown in fig. 12, the second pixel coordinates of each end point of the building outline are h1, h2, h3, h4, and h5, and if the second pixel coordinates of each end point of the building outline are adjusted by using a gaussian markov model, the adjusted second pixel coordinates of each end point are h1', h2, h3, h4, and h5, respectively, an area in which a marker value needs to be adjusted is determined, and the marker value in the area is adjusted from the second marker value to the first marker value, thereby obtaining a segmentation result of the building.
For example, as shown in fig. 13, the second pixel coordinates of each end point of the building outline are g1, g2, g3, and g4, and the adjusted second pixel coordinates of each end point of the building outline are g1', g2, g3, and g4 by adjusting the second pixel coordinates of each end point using the gaussian markov model, an area where the marker value needs to be adjusted is determined, and the marker value in the area is adjusted from the first marker value to the second marker value, thereby obtaining the segmentation result of the building.
Step 1106, based on the first pixel coordinates of the endpoints, eliminating the pixel coordinates of the redundant endpoints in the building outline by using a douglas pock algorithm to obtain the first pixel coordinates of the endpoints after elimination;
the Douglas-Peucker Algorithm (Douglas-Peucker Algorithm) is an Algorithm for approximately representing a curve as a series of points and reducing the number of the points, and is an Algorithm for connecting the head and tail end points of the curve to be processed into a straight line in an imaginary way, calculating the distance from each contour vertex to the imaginary straight line, and comparing the maximum value with the line difference delta. If the maximum value is smaller than the line difference delta, the line segment is low in bending degree, and can be similar to a straight line, namely all the top points except the head and tail end points are deleted. If the maximum value is greater than the line difference δ, it indicates that the line segment is bent to a high degree. Dividing the original curve into two sections by using the maximum vertex boundary, repeating the steps until the original curve cannot be compressed, and finally obtaining the fitted building outline.
For example, if a pending curve in the outline of a building is shown in fig. 14, the pending curve includes 7 endpoints. If fig. 15 shows, a straight line is obtained by connecting endpoint 1 and endpoint 7, and the distance c1 from endpoint 2 to the straight line, the distance c2 from endpoint 3 to the straight line, the distance c3 from endpoint 4 to the straight line, the distance c4 from endpoint 5 to the straight line, and the distance c6 from endpoint 6 to the straight line are calculated. And determining that c3 is the longest, and if c3< delta, determining that the end points 2, 3, 4, 5 and 6 are redundant end points and eliminating the end points. If c3 is larger than δ, as shown in fig. 16, the endpoint 4 is used for demarcation, the endpoint 1 and the endpoint 4 are connected to obtain a first straight line, the endpoint 4 and the endpoint 7 are connected to obtain a second straight line, the steps are repeated until the curve cannot be compressed, and finally the fitted curve is obtained.
Step 1107, based on the first pixel coordinates of each endpoint after being eliminated, the marking value in the original segmentation result is adjusted to obtain the segmentation result of the building.
The above step 1104 is to adjust the pixel coordinates of each end point of the building outline by using a gaussian markov model.
The formula of the Gaussian Markov model is as follows:
Aβ=γ+e with E(e)=0,D(e)=σ 2 P -1
where A is the design matrix, β is the unknown, γ is the observed value, e is the systematic error, satisfies the expectation of 0, is homovariance and uncorrelated, P is -1 Is a unit of order nMatrix, σ 2 Is a constant value, defaults to 1.
Let X i =[x i ,y i ] T Where I =1, \8230, I is represented as a boundary point and the building may be represented as P j =P(X j ,Y j ) This can be taken as model β = [ P ] j ] T J =1, \ 8230, unknown quantities in J, where X represents the value of the X-axis of the point and Y represents the value of the Y-axis of the point.
Constructing an observation value gamma, wherein the observation value gamma consists of the following parts:
F d(i,j) =d 2 (i,j);
Figure BDA0003928751050000151
Figure BDA0003928751050000152
F Y(j) =Y j -Y j 0
wherein, F d(i,j) The distance from the ith endpoint to the jth building edge is expressed, and the formula for calculating d (i, j) is as follows:
Figure BDA0003928751050000153
wherein, F α(j) Expressed as the internal angle of the jth building edge, the internal angle is 90 deg. or 270 deg., i.e.
Figure BDA0003928751050000154
F X(j) F Y(j) The vector denoted as the jth endpoint, i.e., the offset of the jth endpoint with respect to the origin.
Combining the following Taylor first order expansion equation:
Figure BDA0003928751050000155
wherein, o [ (x-x) 0 ) 1 ]Is Peiyan nuoyu.
It can be seen that e is minimized, i.e., f (x) =0, resulting in:
Figure BDA0003928751050000156
thus, the design matrix A may be obtained
Figure BDA0003928751050000161
Based on the above formula, an expansion formula as shown in fig. 17 can be obtained, and the expansion formula is solved by using the least square method to obtain β as increments, and the increments are added to the pixel coordinates of each end point to obtain the adjusted pixel coordinates of each end point. The specific solution method using the least square method is the prior art, and is not described herein again. The method for adjusting the pixel coordinates of each endpoint of the building outline by using the gaussian hermitian model is similar to the method for adjusting the pixel coordinates of each endpoint of the building outline by using the gaussian markov model, and is not described herein again.
And finally, determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
Determining the position of the segmentation result of each building in the picture to be processed according to the segmentation result of each building and the size of the picture to be processed;
and obtaining an image processing result with the same size as the image to be processed according to the determined position and the segmentation result of each building.
For example, as shown in fig. 18, one to-be-processed picture may obtain two segmentation results, namely a segmentation result a and a segmentation result B, a position a of the segmentation result a in the to-be-processed picture is determined according to the segmentation result a and the size of the to-be-processed picture, and a position B of the segmentation result B in the to-be-processed picture is determined according to the segmentation result B and the size of the to-be-processed picture. And filling the picture processing result to the size same as the picture to be processed according to the determined position A, position B, segmentation result A and segmentation result B. The size of the segmentation result of the building is the same as that of the original segmentation result, and when the original segmentation result is determined, the position of the segmentation result of the building in the picture to be processed is recorded, and the position is the position of the segmentation result of the building in the picture to be processed. The position may be represented as (x, y, w, h), where (x, y) is the vertex coordinate of the upper left corner of the original segmentation result in the coordinate system of the picture to be processed, w is the width of the original segmentation result, and h is the height of the original segmentation result. The size of the picture to be processed can be obtained according to the attribute, so that the position of the segmentation result of the building in the picture to be processed can be calculated according to the segmentation result of the building. Therefore, the building portion pixel is labeled as 1, and the other background portion pixels are labeled as 0, and the picture processing result is obtained.
In some embodiments, based on the same inventive concept, the embodiments of the present disclosure further provide an image processing apparatus, and since the apparatus is an apparatus in the method in the embodiments of the present disclosure, and a principle of the apparatus to solve the problem is similar to that of the method, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described herein.
As shown in fig. 19, the above apparatus includes the following modules:
an obtaining module 191, configured to perform feature extraction on a to-be-processed picture including buildings to obtain an original segmentation result of each building, where the original segmentation result includes a building portion pixel labeled as a first tag value and a background portion pixel labeled as a second tag value;
an iteration module 192, configured to establish, for the original segmentation result of each building, a corresponding first segmentation result according to the size of the original segmentation result, determine a target area with a different label value in the original segmentation result and the first segmentation result, adjust a label value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and perform an iteration operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, where the first segmentation result includes a building part pixel labeled as a first label value;
a first determining module 193, configured to calculate an intersection ratio using the original segmentation result and a second segmentation result obtained after the iteration end condition is satisfied, and determine a segmentation result of the building based on a relationship between the intersection ratio and a set threshold;
the second determining module 194 is configured to determine, based on the segmentation result of each building, a picture segmentation result corresponding to the to-be-processed picture.
As an alternative implementation, the iteration module 192 is configured to:
if the current iteration number is singular, determining a first area marked as a second mark value in the original segmentation result and marked as a first mark value in the first segmentation result;
determining the maximum inscribed rectangle of the first area by using a maximum inscribed rectangle algorithm to obtain the target area;
the iteration module 192 is configured to:
and marking the mark value corresponding to the target area in the first segmentation result as the second mark value, and taking the marked first segmentation result as the second segmentation result.
As an alternative implementation, the iteration module 192 is configured to:
if the current iteration times are complex, determining a second area marked as a first mark value in the original segmentation result and marked as a second mark value in the first segmentation result;
determining a minimum circumscribed rectangle of the second region by using a minimum circumscribed rectangle algorithm, and taking the region of the minimum circumscribed rectangle as the target region;
the iteration module 192 is configured to:
and marking the mark value corresponding to the target area in the first segmentation result as the first mark value, and taking the marked first segmentation result as the second segmentation result.
As an optional implementation manner, the iteration end condition includes:
the pixel value of the target area is smaller than a set pixel threshold value; and/or
And reaching the set iteration number.
As an optional implementation manner, before the establishing the corresponding first segmentation result according to the size of the original segmentation result, the iteration module 192 is further configured to:
extracting the outline of the building from the original segmentation result by using a building edge extraction algorithm to obtain a first pixel coordinate of each endpoint in the outline of the building;
determining the length of each edge in the building outline based on the first pixel coordinate of each end point;
determining a target side with the longest length based on the length of each side, and determining an angle between the target side and a straight line in the horizontal direction;
and rotating the original segmentation result according to the determined angle.
As an optional implementation manner, after the obtaining the second segmentation result, the iteration module 192 is further configured to:
and reversely rotating the second segmentation result according to the determined angle.
As an optional implementation manner, the first determining module 193 is configured to:
if the intersection ratio is not greater than the threshold value, based on the first pixel coordinates of the end points, eliminating the pixel coordinates of the redundant end points in the building outline by using a Douglas pock algorithm;
and adjusting the marking value in the original segmentation result based on the first pixel coordinates of the eliminated endpoints to obtain the segmentation result of the building.
As an optional implementation, the first determining module 193 is configured to:
if the intersection ratio is larger than the threshold value, building edge extraction is carried out on the second segmentation result by using a building edge extraction algorithm to obtain second pixel coordinates of each end point of the building outline;
adjusting second pixel coordinates of each endpoint of the building outline by using a Gaussian Markov model or a Gaussian Hull Mark model;
and adjusting the mark value in the second segmentation result based on the adjusted second pixel coordinate of each end point to obtain the segmentation result of the building.
As an alternative implementation, the second module 194 is configured to:
determining the position of the segmentation result of each building in the picture to be processed according to the segmentation result of each building and the size of the picture to be processed;
and obtaining an image processing result with the same size as the image to be processed according to the determined position and the segmentation result of each building.
In some embodiments, based on the same inventive concept, there is also provided a picture processing apparatus in the disclosed embodiments, which may implement the picture processing function discussed in the foregoing, please refer to fig. 20, the apparatus includes a processor 21 and a memory 22, where the memory 22 is used for storing program instructions;
the processor 21 calls the program instructions stored in the memory, and by executing the program instructions, the following is realized:
performing feature extraction on a picture to be processed comprising buildings to obtain an original segmentation result of each building, wherein the original segmentation result comprises building part pixels marked as a first mark value and background part pixels marked as a second mark value;
aiming at the original segmentation result of each building, establishing a corresponding first segmentation result according to the size of the original segmentation result, determining a target area with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and performing iterative operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, wherein the first segmentation result comprises building part pixels marked as the first mark value;
calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining the segmentation result of the building based on the relation between the intersection ratio and a set threshold value;
and determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
As an optional implementation, the determining a target region with a different label value in the original segmentation result and the first segmentation result includes:
if the current iteration number is singular, determining a first area marked as a second mark value in the original segmentation result and marked as a first mark value in the first segmentation result;
determining the maximum inscribed rectangle of the first area by using a maximum inscribed rectangle algorithm to obtain the target area;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the second mark value, and taking the marked first segmentation result as the second segmentation result.
As an optional implementation, the determining a target region with a different label value in the original segmentation result and the first segmentation result includes:
if the current iteration number is a complex number, determining a second area marked as a first mark value in the original segmentation result and marked as a second mark value in the first segmentation result;
determining a minimum circumscribed rectangle of the second region by using a minimum circumscribed rectangle algorithm, and taking the region of the minimum circumscribed rectangle as the target region;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the first mark value, and taking the marked first segmentation result as the second segmentation result.
As an optional implementation manner, the iteration ending condition includes:
the pixel value of the target area is smaller than a set pixel threshold value; and/or
And reaching the set iteration number.
As an optional embodiment, before the establishing the corresponding first segmentation result according to the size of the original segmentation result, the processor further performs:
extracting the outline of the building from the original segmentation result by using a building edge extraction algorithm to obtain a first pixel coordinate of each endpoint in the outline of the building;
determining the length of each edge in the building outline based on the first pixel coordinates of each endpoint;
determining a target side with the longest length based on the length of each side, and determining an angle between the target side and a straight line in the horizontal direction;
and rotating the original segmentation result according to the determined angle.
As an optional embodiment, after obtaining the second segmentation result, the processor further performs:
and reversely rotating the second segmentation result according to the determined angle.
As an optional implementation, the determining the segmentation result of the building based on the relationship between the intersection ratio and the set threshold includes:
if the intersection ratio is not greater than the threshold value, based on the first pixel coordinates of the end points, eliminating the pixel coordinates of the redundant end points in the building outline by using a Douglas pock algorithm;
and adjusting the marking value in the original segmentation result based on the first pixel coordinates of the eliminated endpoints to obtain the segmentation result of the building.
As an optional implementation, the determining the segmentation result of the building based on the relationship between the intersection ratio and the set threshold includes:
if the intersection ratio is larger than the threshold value, building edge extraction is carried out on the second segmentation result by using a building edge extraction algorithm to obtain second pixel coordinates of each end point of the building outline;
adjusting second pixel coordinates of each endpoint of the building outline by using a Gaussian Markov model or a Gaussian Hull Mark model;
and adjusting the mark value in the second segmentation result based on the adjusted second pixel coordinate of each end point to obtain the segmentation result of the building.
As an optional implementation manner, the determining, based on the segmentation result of each building, a picture segmentation result corresponding to the picture to be processed includes:
determining the position of the segmentation result of each building in the picture to be processed according to the segmentation result of each building and the size of the picture to be processed;
and obtaining an image processing result with the same size as the image to be processed according to the determined position and the segmentation result of each building.
In some possible embodiments, the various aspects of the disclosure may also be implemented in the form of a program product, as shown in fig. 21, the computer program product 210 comprising computer program code which, when run on a computer, causes the computer to perform any of the picture processing methods as discussed in the foregoing. Because the principle of solving the problems of the computer program product is similar to that of the image processing method, the implementation of the computer program product can refer to the implementation of the method, and repeated details are not repeated.
As will be appreciated by one of skill in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A picture processing method is characterized by comprising the following steps:
performing feature extraction on a picture to be processed comprising buildings to obtain an original segmentation result of each building, wherein the original segmentation result comprises building part pixels marked as a first mark value and background part pixels marked as a second mark value;
aiming at the original segmentation result of each building, establishing a corresponding first segmentation result according to the size of the original segmentation result, determining a target area with different mark values in the original segmentation result and the first segmentation result, adjusting the mark value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and performing iterative operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, wherein the first segmentation result comprises building part pixels marked as the first mark values;
calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration end condition is met, and determining a segmentation result of the building based on the relationship between the intersection ratio and a set threshold value;
and determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
2. The method of claim 1, wherein the determining the target region with the different label value in the original segmentation result and the first segmentation result comprises:
if the current iteration number is singular, determining a first area marked as a second mark value in the original segmentation result and marked as a first mark value in the first segmentation result;
determining the maximum inscribed rectangle of the first area by using a maximum inscribed rectangle algorithm to obtain the target area;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the second mark value, and taking the marked first segmentation result as the second segmentation result.
3. The method of claim 1, wherein the determining the target region with the different label value in the original segmentation result and the first segmentation result comprises:
if the current iteration number is a complex number, determining a second area marked as a first mark value in the original segmentation result and marked as a second mark value in the first segmentation result;
determining a minimum circumscribed rectangle of the second region by using a minimum circumscribed rectangle algorithm, and taking the region of the minimum circumscribed rectangle as the target region;
the adjusting the marking value corresponding to the target area in the first segmentation result to obtain a second segmentation result includes:
and marking the mark value corresponding to the target area in the first segmentation result as the first mark value, and taking the marked first segmentation result as the second segmentation result.
4. A method according to any one of claims 1 to 3, wherein the iteration end condition comprises:
the pixel value of the target area is smaller than a set pixel threshold value; and/or
And reaching the set iteration number.
5. The method of claim 1, further comprising, before said establishing a corresponding first segmented result according to the size of said original segmented result:
building outline extraction is carried out on the original segmentation result by using a building edge extraction algorithm to obtain first pixel coordinates of each endpoint in the building outline;
determining the length of each edge in the building outline based on the first pixel coordinates of each endpoint;
determining a target side with the longest length based on the length of each side, and determining an angle between the target side and a straight line in the horizontal direction;
and rotating the original segmentation result according to the determined angle.
6. The method of claim 5, further comprising, after said obtaining the second segmentation result:
and reversely rotating the second segmentation result according to the determined angle.
7. The method according to claim 5, wherein the determining the segmentation result of the building based on the relation between the intersection ratio and the set threshold comprises:
if the intersection ratio is not greater than the threshold value, based on the first pixel coordinates of the end points, eliminating the pixel coordinates of the redundant end points in the building outline by using a Douglas pock algorithm;
and adjusting the marking value in the original segmentation result based on the first pixel coordinates of the eliminated endpoints to obtain the segmentation result of the building.
8. The method of claim 1, wherein determining the segmentation result of the building based on the intersection ratio in relation to a set threshold comprises:
if the intersection ratio is larger than the threshold value, building edge extraction is carried out on the second segmentation result by using a building edge extraction algorithm to obtain second pixel coordinates of each end point of the building outline;
adjusting second pixel coordinates of each endpoint of the building outline by using a Gaussian Markov model or a Gaussian Hull-Mag model;
and adjusting the mark value in the second segmentation result based on the adjusted second pixel coordinate of each end point to obtain the segmentation result of the building.
9. The method according to claim 1, wherein the determining a picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building comprises:
determining the position of the segmentation result of each building in the picture to be processed according to the segmentation result of each building and the size of the picture to be processed;
and obtaining an image processing result with the same size as the image to be processed according to the determined position and the segmentation result of each building.
10. A picture processing apparatus, comprising:
the system comprises an obtaining module, a calculating module and a processing module, wherein the obtaining module is used for extracting the characteristics of pictures to be processed including buildings and obtaining the original segmentation results of the buildings, and the original segmentation results comprise building part pixels marked as a first marking value and background part pixels marked as a second marking value;
an iteration module, configured to establish, for an original segmentation result of each building, a corresponding first segmentation result according to a size of the original segmentation result, determine a target area with a different label value in the original segmentation result and the first segmentation result, adjust a label value corresponding to the target area in the first segmentation result to obtain a second segmentation result, and perform an iteration operation on the second segmentation result as the first segmentation result until a set iteration end condition is met, where the first segmentation result includes a building part pixel labeled as a first label value;
the first determining module is used for calculating an intersection ratio by using the original segmentation result and a second segmentation result obtained after the iteration ending condition is met, and determining the segmentation result of the building based on the relationship between the intersection ratio and a set threshold value;
and the second determining module is used for determining the picture segmentation result corresponding to the picture to be processed based on the segmentation result of each building.
11. An electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method of any one of claims 1 to 9 by executing the executable instructions.
12. A computer readable and writable storage medium on which computer instructions are stored, characterized in that the instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
CN202211382990.0A 2022-11-07 2022-11-07 Picture processing method, device, equipment and medium Pending CN115661658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211382990.0A CN115661658A (en) 2022-11-07 2022-11-07 Picture processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211382990.0A CN115661658A (en) 2022-11-07 2022-11-07 Picture processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115661658A true CN115661658A (en) 2023-01-31

Family

ID=85016290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211382990.0A Pending CN115661658A (en) 2022-11-07 2022-11-07 Picture processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115661658A (en)

Similar Documents

Publication Publication Date Title
CN108764048B (en) Face key point detection method and device
US11488308B2 (en) Three-dimensional object detection method and system based on weighted channel features of a point cloud
CN108256394B (en) Target tracking method based on contour gradient
US10936911B2 (en) Logo detection
CN109543489B (en) Positioning method and device based on two-dimensional code and storage medium
CN111899334B (en) Visual synchronous positioning and map building method and device based on point-line characteristics
CN110688947B (en) Method for synchronously realizing human face three-dimensional point cloud feature point positioning and human face segmentation
CN110334762B (en) Feature matching method based on quad tree combined with ORB and SIFT
CN111353489A (en) Text image processing method and device, computer equipment and storage medium
CN110647795A (en) Form recognition method
CN103440667A (en) Automatic device for stably tracing moving targets under shielding states
CN106296587B (en) Splicing method of tire mold images
CN112183517B (en) Card edge detection method, device and storage medium
CN115471682A (en) Image matching method based on SIFT fusion ResNet50
CN112883795A (en) Rapid and automatic table extraction method based on deep neural network
Giang et al. TopicFM: Robust and interpretable topic-assisted feature matching
CN113077477B (en) Image vectorization method and device and terminal equipment
CN111914596A (en) Lane line detection method, device, system and storage medium
CN106056575B (en) A kind of image matching method based on like physical property proposed algorithm
CN113409353A (en) Motion foreground detection method and device, terminal equipment and storage medium
Ronee et al. Handwritten character recognition using piecewise linear two-dimensional warping
CN109785367B (en) Method and device for filtering foreign points in three-dimensional model tracking
CN102324043A (en) Image matching method based on DCT (Discrete Cosine Transformation) through feature description operator and optimization space quantization
CN109993695B (en) Image fragment splicing method and system for irregular graphic annotation
CN115661658A (en) Picture processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination