CN114241338A - Building measuring method, device, equipment and storage medium based on image recognition - Google Patents

Building measuring method, device, equipment and storage medium based on image recognition Download PDF

Info

Publication number
CN114241338A
CN114241338A CN202210135087.8A CN202210135087A CN114241338A CN 114241338 A CN114241338 A CN 114241338A CN 202210135087 A CN202210135087 A CN 202210135087A CN 114241338 A CN114241338 A CN 114241338A
Authority
CN
China
Prior art keywords
building
remote sensing
sensing image
size
image
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
CN202210135087.8A
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.)
Zhonghang Construction Engineering Co ltd
Original Assignee
Zhonghang Construction Engineering 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 Zhonghang Construction Engineering Co ltd filed Critical Zhonghang Construction Engineering Co ltd
Priority to CN202210135087.8A priority Critical patent/CN114241338A/en
Publication of CN114241338A publication Critical patent/CN114241338A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10032Satellite or aerial image; Remote sensing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Geometry (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses a building measuring method based on image recognition, which comprises the following steps: calculating the confidence of each pixel point in the remote sensing image of the building; collecting pixel points with confidence degrees larger than a preset threshold value as building pixels, and constructing a pixel coordinate system by taking a central pixel point as an original point; determining edge pixel point coordinates of building pixels according to a pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates; calculating according to the shooting height of the remote sensing image to obtain the building size; acquiring the shooting time and the climate condition of the remote sensing image, and inquiring the ambient light angle and the air refractive index when the remote sensing image is shot according to the shooting time and the climate condition; and correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size. The invention also provides a building measuring device, equipment and a medium based on the image recognition. The invention can improve the accuracy of building size measurement.

Description

Building measuring method, device, equipment and storage medium based on image recognition
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a building measuring method and device based on image recognition, electronic equipment and a computer readable storage medium.
Background
With the rise of modern building level, more and more large buildings appear in people's lives. Due to the requirements of safety, insurance and the like, the size measurement of large buildings becomes a difficult problem to be solved urgently.
Most of the existing building measurement methods are used for shooting remote sensing images of buildings, and the measurement of the sizes of the buildings is realized by means of the equal-scale amplification of the shooting heights and the sizes of the buildings in the images to the buildings. However, in the method, the size of the building in the image is calculated only depending on the shooting height, and the image imaged by other factors in the environment during shooting is ignored, so that the size of the building calculated only according to the shooting height is not accurate enough, and especially when the building is too large, a very small error can cause a very large deviation of a finally measured result, so how to improve the accuracy of building size measurement becomes a difficult problem to be solved urgently.
Disclosure of Invention
The invention provides a building measuring method and device based on image recognition and a computer readable storage medium, and mainly aims to solve the problem of low accuracy of building size measurement.
In order to achieve the above object, the present invention provides a building measuring method based on image recognition, including:
obtaining a remote sensing image of a target building, and carrying out building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image;
collecting the pixel points with the confidence degrees larger than a preset threshold value as building pixels, selecting the central pixel points of the building pixel points, and constructing a pixel coordinate system by taking the central pixel points as original points;
determining edge pixel point coordinates of the building pixels according to the pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates;
acquiring the shooting height of the remote sensing image, and performing size reduction on the image size according to the shooting height to obtain the building size;
acquiring the shooting time and the climate condition of the remote sensing image, inquiring the ambient light angle when the remote sensing image is shot according to the shooting time, and inquiring the air refractive index when the remote sensing image is shot according to the climate condition;
and correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
Optionally, the performing size reduction on the image size according to the shooting height to obtain a building size includes:
acquiring a shooting focal length of the remote sensing image, and obtaining a zoom factor according to the image size and the shooting focal length;
and obtaining the building size according to the zooming coefficient and the shooting height.
Optionally, the querying an ambient light angle when the remote sensing image is shot according to the shooting time includes:
acquiring an illumination angle time comparison table, and constructing an index of the illumination angle time comparison table by taking time as target data;
compiling the time retrieval statement according to the shooting time;
and searching in the index by using the moment searching statement to obtain the ambient light angle corresponding to the shooting time.
Optionally, the modifying the building size according to the ambient light angle and the air refractive index to obtain a real building size includes:
calculating the product of the ambient light angle and a preset first weight coefficient to obtain a first influence parameter;
calculating the product of the air refractive index and a preset second weight coefficient to obtain a second influence parameter;
and scaling the building size according to the sum of the first influence parameter and the second influence parameter to obtain the real building size.
Optionally, the selecting a center pixel point of the building pixel point, and constructing a pixel coordinate system with the center pixel point as an origin includes:
selecting the outermost pixel points in the building pixel points as contour pixel points;
selecting pixels except the contour pixels from the building pixels one by one as target pixels;
respectively calculating the distance value between the target pixel point and each contour pixel point;
calculating the mean square error of the distance values, and determining a target pixel point with the minimum mean square error as a central pixel point of the building pixel point;
and constructing a pixel coordinate system by taking the central pixel point as an origin and the height of the unit pixel as the unit length.
Optionally, the performing, by the remote sensing image, building pixel detection to obtain a confidence of each pixel point in the remote sensing image includes:
counting pixel values of all pixel points in the remote sensing image to obtain a pixel matrix of the remote sensing image;
and carrying out convolution, pooling and activation processing on the pixel matrix by using a pre-trained building identification model to obtain the confidence coefficient of each pixel point in the remote sensing image.
Optionally, the performing, by the remote sensing image, building pixel detection to obtain a confidence of each pixel point in the remote sensing image includes:
carrying out feature extraction on the remote sensing image by utilizing a pre-constructed segmentation network to obtain multiple image features of the remote sensing image;
selecting a segmentation block diagram corresponding to the multiple image features from preset segmentation block diagrams;
framing the remote sensing image for multiple times according to the segmentation block diagram, and taking different images obtained by framing as multiple sub-images;
compressing the remote sensing image and the multiple subgraphs into a preset size to obtain multiple compressed images, and graying the multiple compressed images;
and calculating the confidence coefficient of each pixel point in the plurality of compressed images to obtain the confidence coefficient of each pixel point in the remote sensing image.
In order to solve the above problems, the present invention further provides a building surveying device based on image recognition, the device comprising:
the image processing module is used for acquiring a remote sensing image of a target building, carrying out building pixel detection on the remote sensing image to obtain the confidence coefficient of each pixel point in the remote sensing image, collecting the pixel points with the confidence coefficient larger than a preset threshold value as building pixels, selecting the central pixel point of the building pixel point, and constructing a pixel coordinate system by taking the central pixel point as an origin;
the first size calculation module is used for determining the edge pixel point coordinates of the building pixels according to the pixel coordinate system and calculating the image size of the target building according to the edge pixel point coordinates;
the second size calculation module is used for acquiring the shooting height of the remote sensing image and carrying out size reduction on the image size according to the shooting height to obtain the building size;
the parameter query module is used for acquiring the shooting time and the climate condition of the remote sensing image, querying the ambient light angle when the remote sensing image is shot according to the shooting time, and querying the air refractive index when the remote sensing image is shot according to the climate condition;
and the third size calculation module is used for correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image recognition based building surveying method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the building measuring method based on image recognition.
The embodiment of the invention preliminarily obtains the building size of the target building by analyzing the remote sensing image of the target building, and meanwhile, the remote sensing image is inquired according to the shooting height, the shooting time and the climate condition during shooting to obtain the ambient light angle and the air refractive index during shooting the remote sensing image, so that the building size obtained by original calculation is further corrected, the accuracy of the finally calculated real building size is improved, and the multi-side environmental factors during shooting the remote sensing image are considered. Therefore, the building measurement method, the building measurement device, the electronic equipment and the computer readable storage medium based on image recognition can solve the problem of low accuracy of building size measurement.
Drawings
Fig. 1 is a schematic flowchart of a building measurement method based on image recognition according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of constructing a pixel coordinate system according to an embodiment of the present invention;
FIG. 3 is a schematic view of a process for correcting the building size according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a building surveying device based on image recognition according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the building measurement method based on image recognition according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a building measuring method based on image identification. The execution subject of the building measurement method based on image recognition includes, but is not limited to, at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the building measuring method based on image recognition may be performed by software or hardware installed in a terminal device or a server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a building measurement method based on image recognition according to an embodiment of the present invention. In this embodiment, the building measurement method based on image recognition includes:
s1, obtaining a remote sensing image of the target building, and carrying out building pixel detection on the remote sensing image by using a pre-constructed building identification model to obtain the confidence of each pixel point in the remote sensing image.
In the embodiment of the invention, the target building comprises any building arrangement with a certain outline, such as an office building, a residential building, a factory building and the like.
In detail, a remote sensing image of the target building may be captured using a remote sensing device with image capturing capabilities, including but not limited to a satellite, a drone, an aerial camera, and the like.
In one practical application scenario of the invention, because the remote sensing image may contain more background pictures, in order to realize accurate measurement of the size of the target building, the remote sensing image can be analyzed by using a pre-constructed model, so that pixels of the target building can be identified from the remote sensing image in the following process.
In the embodiment of the present invention, the performing building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image includes:
counting pixel values of all pixel points in the remote sensing image to obtain a pixel matrix of the remote sensing image;
and carrying out convolution, pooling and activation processing on the pixel matrix by using a pre-trained building identification model to obtain the confidence coefficient of each pixel point in the remote sensing image.
In detail, the confidence degree refers to a probability value that the pixel point belongs to the target building.
In the embodiment of the invention, the building identification model can be a UNet neural network, the UNet neural network adopts a full convolution neural network, and the left convolution network is a feature extraction network: using convolution (conv) and pooling (pooling), the right convolutional network is a feature fusion network: the right convolution network uses the feature map generated by the up-sampling to carry out the layer jump connection (closure) operation with the feature map obtained by the convolution of the left convolution network, and the network is favorable for improving the image processing speed and better retaining the image features.
Specifically, the UNet neural network is used for constructing the equipment identification network, so that the data processing time after complicated anchor point and non-maximum value suppression (NMS) is avoided, the method is quick and efficient, the recall rate is high, and the false detection rate is low.
In detail, the remote sensing image is analyzed by using the building identification model, so that the accuracy of identifying each pixel point can be improved, and the accuracy of measuring the size of the target building subsequently can be improved.
In another embodiment of the present invention, the performing the building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image includes:
carrying out feature extraction on the remote sensing image by utilizing a pre-constructed segmentation network to obtain multiple image features of the remote sensing image;
selecting a segmentation block diagram corresponding to the multiple image features from preset segmentation block diagrams;
framing the remote sensing image for multiple times according to the segmentation block diagram, and taking different images obtained by framing as multiple sub-images;
compressing the remote sensing image and the multiple subgraphs into a preset size to obtain multiple compressed images, and graying the multiple compressed images;
and calculating the confidence coefficient of each pixel point in the plurality of compressed images to obtain the confidence coefficient of each pixel point in the remote sensing image.
In the embodiment of the invention, the segmentation network can adopt a convolutional neural network with a feature extraction function, such as a Segnet network, an E-net network, a V-net network, a ResNet50 network and the like.
In an embodiment of the invention, the segmentation network adopts a ResNet50 network, and an FPN characteristic pyramid structure is added in the segmentation network, so that multiple characteristic extraction of the remote sensing image is realized, and multiple image characteristics corresponding to the remote sensing image are obtained.
For example, if the multiple image features are image features of five sizes, corresponding segmentation block diagrams are respectively selected from preset segmentation block diagrams according to the image features of the five sizes, and the corresponding segmentation block diagrams are used for frame selection one by one in the remote sensing image, so that sub-images with the selected frames are obtained.
In the embodiment of the invention, the remote sensing image is subjected to multiple feature extraction, so that the image features of various scales can be obtained, and the accuracy of the sub-image obtained by segmentation is improved.
In the embodiment of the invention, the confidence coefficient can be a gray difference value, a gray average value and the like; if the confidence coefficient is a gray level difference value, calculating the gray level difference value of adjacent pixel points in the compressed image, processing the difference value to obtain a gray level difference value, and analyzing the gray level difference value (such as a positive number or 0 is recorded as 1, and a negative number is recorded as 0) to obtain the confidence coefficient of each pixel point in the remote sensing image and the multiple sub-images; and if the confidence coefficient is the gray average value, calculating the average value of the gray values of all the pixel points in the compressed image, namely the gray average value, analyzing according to the gray average value (if the confidence coefficient is greater than or equal to the gray average value and is recorded as 1, and if the confidence coefficient is less than the gray average value and is recorded as 0), and obtaining the confidence coefficient of each pixel point in the interactive page and the multiple sub-images.
In the embodiment of the invention, the remote sensing image is refined, blocked and subjected to multiple feature extraction, so that the accuracy of the confidence degree of the pixel points obtained by calculation is improved, and the accuracy of subsequent measurement on the size of the target building is improved.
And S2, collecting the pixels with the confidence coefficient larger than a preset threshold value as building pixels, selecting the central pixel of the building pixels, and constructing a pixel coordinate system by taking the central pixel as an origin.
In the embodiment of the invention, the pixel points with the confidence level greater than the preset threshold value in the remote sensing image can be selected as the building pixel points of the target building.
Furthermore, in order to realize the measurement of the size of the target building, the numerical marking of each building pixel point in the remote sensing image can be realized according to the determined building pixel point framework coordinate system, so that the subsequent calculation and measurement of the size of the target building are facilitated.
In the embodiment of the present invention, referring to fig. 2, the selecting a center pixel point of the building pixel point and constructing a pixel coordinate system with the center pixel point as an origin includes:
s21, selecting the outermost pixel point of the building pixel points as a contour pixel point;
s22, selecting pixel points except the contour pixel points as target pixel points from the building pixel points one by one;
s23, respectively calculating the distance value between the target pixel point and each contour pixel point;
s24, calculating the mean square error of the distance values, and determining a target pixel point with the minimum mean square error as a central pixel point of the building pixel point;
and S25, constructing a pixel coordinate system by taking the central pixel point as an origin and the height of the unit pixel as the unit length.
In detail, the distance values between the target pixel points and each contour pixel point in the circle can be respectively obtained by thinking in a silent manner according to the principle of the pythagorean theorem, the mean square error of each pixel point among all the distance values is further calculated, and the target pixel point with the minimum mean square error is determined to be the central pixel point of the building pixel point.
Specifically, when the central pixel point is determined according to the mean square error of the distance value from the target pixel point to each contour pixel point, each contour pixel point is referred to, so that the accuracy of the determined central pixel point is improved, and the accuracy of subsequent measurement and calculation of the size of the target building is improved.
And S3, determining the edge pixel point coordinates of the building pixels according to the pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates.
In the embodiment of the invention, after the pixel coordinate system is constructed by the central pixel point, the coordinate of each edge pixel point can be determined according to the position of the edge pixel in the building pixel in the pixel coordinate system, and the image size of the target building in the remote sensing image can be obtained according to the coordinate measurement, wherein the image size refers to the size of the target building in the remote sensing image.
And S4, acquiring the shooting height of the remote sensing image, and performing size reduction on the image size according to the shooting height to obtain the building size.
In one practical application scene of the invention, the remote sensing image is obtained by shooting in high altitude through the camera equipment, so that the image size of the target building in the remote sensing image has a certain proportional relation with the actual size of the target building.
In detail, the shooting height of the remote sensing image is obtained, the scaling ratio between the target building in the remote sensing image and the actual size of the target building is calculated according to the shooting height, and the image size is restored according to the scaling ratio to obtain the building size.
In an embodiment of the present invention, the performing size reduction on the image size according to the shooting height to obtain a building size includes:
acquiring a shooting focal length of the remote sensing image, and obtaining a zoom factor according to the image size and the shooting focal length;
and obtaining the building size according to the zooming coefficient and the shooting height.
In detail, the shooting focal length is the focal length of the equipment for shooting the remote sensing image, the image size can be divided by the shooting focal length to obtain a zoom factor, and then the building size of the product of the zoom factor and the shooting height is calculated, so that the target building is restored to the real building size from the image size.
S5, acquiring the shooting time and the climate condition of the remote sensing image, inquiring the ambient light angle when the remote sensing image is shot according to the shooting time, and inquiring the air refractive index when the remote sensing image is shot according to the climate condition.
In one practical application scenario of the present invention, when the remote sensing image is generated by shooting the target construction machine, the remote sensing image is generated by the camera device according to the optical imaging principle, but when light propagates in a medium (here, air), the remote sensing image receives climate conditions such as air pressure and air density at that time, and images with different sunlight irradiation angles at different times, so that the remote sensing image obtained by shooting may have distortion to a certain extent.
In the embodiment of the invention, in order to realize accurate measurement of the size of the target building, the shooting time and the climate condition of the remote sensing image can be obtained, and then the shooting time and the climate condition are combined for analysis so as to adjust and correct the calculated building size, thereby improving the accuracy of the building size.
In an embodiment of the present invention, the querying an ambient light angle when the remote sensing image is shot according to the shooting time includes:
acquiring an illumination angle time comparison table, and constructing an index of the illumination angle time comparison table by taking time as target data;
compiling the time retrieval statement according to the shooting time;
and searching in the index by using the moment searching statement to obtain the ambient light angle corresponding to the shooting time.
In detail, the illumination angle time comparison table is a data table acquired in advance, and a plurality of different illumination angles and time corresponding to each illumination angle are recorded in the illumination angle time comparison table.
Specifically, an INDEX of the illumination angle time comparison table can be constructed by using a CREAR INDEX function in SQL and taking time as target data in the illumination angle time comparison table, and then an ambient light angle corresponding to the shooting time can be retrieved from the illumination angle time comparison table by using a time retrieval statement obtained by compiling the shooting time.
Further, the air refractive index refers to a refractive index of light of air in an environment when the remote sensing image is shot, the step of querying the air refractive index when the remote sensing image is shot according to the climate conditions is consistent with the step of querying the ambient light angle when the remote sensing image is shot according to the shooting time, namely the air refractive index corresponding to the climate conditions can be obtained by querying a data table which is obtained in advance and contains a plurality of climate conditions and the air refractive index corresponding to each climate condition according to the step of querying the ambient light angle when the remote sensing image is shot according to the shooting time, and details are not repeated here.
And S6, correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
In the embodiment of the present invention, the building size calculated in step S4 may be corrected by using the ambient light angle and the air refractive index, so as to improve the accuracy of the final output real building size.
In an embodiment of the present invention, referring to fig. 3, the modifying the building size according to the ambient light angle and the air refractive index to obtain a real building size includes:
s31, calculating the product of the ambient light angle and a preset first weight coefficient to obtain a first influence parameter;
s32, calculating the product of the air refractive index and a preset second weight coefficient to obtain a second influence parameter;
s33, scaling the building size according to the sum of the first influence parameter and the second influence parameter to obtain the real building size.
In detail, the first weight coefficient and the second weight coefficient are preset empirical constants, and may be obtained through statistical statistics.
Specifically, the sum of the first weight coefficient and the second weight coefficient may be obtained, and the building size may be scaled by using the sum of the first weight coefficient and the second weight coefficient as a scaling factor, that is, the real building size may be calculated.
The embodiment of the invention preliminarily obtains the building size of the target building by analyzing the remote sensing image of the target building, and meanwhile, the remote sensing image is inquired according to the shooting height, the shooting time and the climate condition during shooting to obtain the ambient light angle and the air refractive index during shooting the remote sensing image, so that the building size obtained by original calculation is further corrected, the accuracy of the finally calculated real building size is improved, and the multi-side environmental factors during shooting the remote sensing image are considered. Therefore, the building measurement method, the building measurement device, the electronic equipment and the computer readable storage medium based on image recognition can solve the problem of low accuracy of building size measurement.
Fig. 4 is a functional block diagram of a building surveying device based on image recognition according to an embodiment of the present invention.
The building measuring device 100 based on image recognition according to the present invention can be installed in an electronic device. According to the implemented functions, the building measuring device 100 based on image recognition may include an image processing module 101, a first size calculating module 102, a second size calculating module 103, a parameter querying module 104, and a third size calculating module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the image processing module 101 is configured to obtain a remote sensing image of a target building, perform building pixel detection on the remote sensing image to obtain a confidence level of each pixel point in the remote sensing image, collect the pixel points with the confidence levels larger than a preset threshold as building pixels, select a center pixel point of the building pixel points, and construct a pixel coordinate system with the center pixel point as an origin;
the first size calculation module 102 is configured to determine edge pixel coordinates of the building pixels according to the pixel coordinate system, and calculate an image size of the target building according to the edge pixel coordinates;
the second size calculation module 103 is configured to obtain a shooting height of the remote sensing image, and perform size reduction on the image size according to the shooting height to obtain a building size;
the parameter query module 104 is configured to obtain a shooting time and a climate condition of the remote sensing image, query an ambient light angle when the remote sensing image is shot according to the shooting time, and query an air refractive index when the remote sensing image is shot according to the climate condition;
the third size calculation module 105 is configured to correct the building size according to the ambient light angle and the air refractive index, so as to obtain a real building size.
In detail, when the building measuring device 100 based on image recognition according to the embodiment of the present invention is used, the same technical means as the building measuring method based on image recognition described in fig. 1 to 3 is adopted, and the same technical effects can be produced, which is not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a building measurement method based on image recognition according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as a building measurement program based on image recognition, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by operating or executing programs or modules stored in the memory 11 (for example, executing a building measuring program based on image recognition, etc.) and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used to store not only application software installed in the electronic device and various types of data, such as codes of a building measuring program based on image recognition, but also data that has been output or is to be output temporarily.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The image recognition based building measurement program stored in the memory 11 of the electronic device 1 is a combination of instructions, which when executed in the processor 10, can implement:
obtaining a remote sensing image of a target building, and carrying out building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image;
collecting the pixel points with the confidence degrees larger than a preset threshold value as building pixels, selecting the central pixel points of the building pixel points, and constructing a pixel coordinate system by taking the central pixel points as original points;
determining edge pixel point coordinates of the building pixels according to the pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates;
acquiring the shooting height of the remote sensing image, and performing size reduction on the image size according to the shooting height to obtain the building size;
acquiring the shooting time and the climate condition of the remote sensing image, inquiring the ambient light angle when the remote sensing image is shot according to the shooting time, and inquiring the air refractive index when the remote sensing image is shot according to the climate condition;
and correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
obtaining a remote sensing image of a target building, and carrying out building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image;
collecting the pixel points with the confidence degrees larger than a preset threshold value as building pixels, selecting the central pixel points of the building pixel points, and constructing a pixel coordinate system by taking the central pixel points as original points;
determining edge pixel point coordinates of the building pixels according to the pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates;
acquiring the shooting height of the remote sensing image, and performing size reduction on the image size according to the shooting height to obtain the building size;
acquiring the shooting time and the climate condition of the remote sensing image, inquiring the ambient light angle when the remote sensing image is shot according to the shooting time, and inquiring the air refractive index when the remote sensing image is shot according to the climate condition;
and correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A building measurement method based on image recognition is characterized by comprising the following steps:
obtaining a remote sensing image of a target building, and carrying out building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image;
collecting the pixel points with the confidence degrees larger than a preset threshold value as building pixels, selecting the central pixel points of the building pixel points, and constructing a pixel coordinate system by taking the central pixel points as original points;
determining edge pixel point coordinates of the building pixels according to the pixel coordinate system, and calculating the image size of the target building according to the edge pixel point coordinates;
acquiring the shooting height of the remote sensing image, and performing size reduction on the image size according to the shooting height to obtain the building size;
acquiring the shooting time and the climate condition of the remote sensing image, inquiring the ambient light angle when the remote sensing image is shot according to the shooting time, and inquiring the air refractive index when the remote sensing image is shot according to the climate condition;
and correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
2. The building measurement method based on image recognition as claimed in claim 1, wherein the performing size reduction on the image size according to the shooting height to obtain the building size comprises:
acquiring a shooting focal length of the remote sensing image, and obtaining a zoom factor according to the image size and the shooting focal length;
and obtaining the building size according to the zooming coefficient and the shooting height.
3. The image recognition-based building measurement method according to claim 1, wherein the inquiring of the ambient light angle at the time of the remote sensing image photographing according to the photographing time comprises:
acquiring an illumination angle time comparison table, and constructing an index of the illumination angle time comparison table by taking time as target data;
compiling the time retrieval statement according to the shooting time;
and searching in the index by using the moment searching statement to obtain the ambient light angle corresponding to the shooting time.
4. The image recognition-based building measurement method of claim 1, wherein the correcting the building size according to the ambient light angle and the air refractive index to obtain a real building size comprises:
calculating the product of the ambient light angle and a preset first weight coefficient to obtain a first influence parameter;
calculating the product of the air refractive index and a preset second weight coefficient to obtain a second influence parameter;
and scaling the building size according to the sum of the first influence parameter and the second influence parameter to obtain the real building size.
5. The building measuring method based on image recognition as claimed in claim 1, wherein the selecting a center pixel point of the building pixel point and constructing a pixel coordinate system with the center pixel point as an origin comprises:
selecting the outermost pixel points in the building pixel points as contour pixel points;
selecting pixels except the contour pixels from the building pixels one by one as target pixels;
respectively calculating the distance value between the target pixel point and each contour pixel point;
calculating the mean square error of the distance values, and determining a target pixel point with the minimum mean square error as a central pixel point of the building pixel point;
and constructing a pixel coordinate system by taking the central pixel point as an origin and the height of the unit pixel as the unit length.
6. The image recognition-based building measurement method according to any one of claims 1 to 5, wherein the building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image comprises:
counting pixel values of all pixel points in the remote sensing image to obtain a pixel matrix of the remote sensing image;
and carrying out convolution, pooling and activation processing on the pixel matrix by using a pre-trained building identification model to obtain the confidence coefficient of each pixel point in the remote sensing image.
7. The image recognition-based building measurement method according to any one of claims 1 to 5, wherein the building pixel detection on the remote sensing image to obtain the confidence of each pixel point in the remote sensing image comprises:
carrying out feature extraction on the remote sensing image by utilizing a pre-constructed segmentation network to obtain multiple image features of the remote sensing image;
selecting a segmentation block diagram corresponding to the multiple image features from preset segmentation block diagrams;
framing the remote sensing image for multiple times according to the segmentation block diagram, and taking different images obtained by framing as multiple sub-images;
compressing the remote sensing image and the multiple subgraphs into a preset size to obtain multiple compressed images, and graying the multiple compressed images;
and calculating the confidence coefficient of each pixel point in the plurality of compressed images to obtain the confidence coefficient of each pixel point in the remote sensing image.
8. An image recognition-based building surveying device, the device comprising:
the image processing module is used for acquiring a remote sensing image of a target building, carrying out building pixel detection on the remote sensing image to obtain the confidence coefficient of each pixel point in the remote sensing image, collecting the pixel points with the confidence coefficient larger than a preset threshold value as building pixels, selecting the central pixel point of the building pixel point, and constructing a pixel coordinate system by taking the central pixel point as an origin;
the first size calculation module is used for determining the edge pixel point coordinates of the building pixels according to the pixel coordinate system and calculating the image size of the target building according to the edge pixel point coordinates;
the second size calculation module is used for acquiring the shooting height of the remote sensing image and carrying out size reduction on the image size according to the shooting height to obtain the building size;
the parameter query module is used for acquiring the shooting time and the climate condition of the remote sensing image, querying the ambient light angle when the remote sensing image is shot according to the shooting time, and querying the air refractive index when the remote sensing image is shot according to the climate condition;
and the third size calculation module is used for correcting the building size according to the ambient light angle and the air refractive index to obtain the real building size.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image recognition based building surveying method of any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the image recognition-based building surveying method according to any one of claims 1 to 7.
CN202210135087.8A 2022-02-15 2022-02-15 Building measuring method, device, equipment and storage medium based on image recognition Pending CN114241338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210135087.8A CN114241338A (en) 2022-02-15 2022-02-15 Building measuring method, device, equipment and storage medium based on image recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210135087.8A CN114241338A (en) 2022-02-15 2022-02-15 Building measuring method, device, equipment and storage medium based on image recognition

Publications (1)

Publication Number Publication Date
CN114241338A true CN114241338A (en) 2022-03-25

Family

ID=80747698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210135087.8A Pending CN114241338A (en) 2022-02-15 2022-02-15 Building measuring method, device, equipment and storage medium based on image recognition

Country Status (1)

Country Link
CN (1) CN114241338A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114708230A (en) * 2022-04-07 2022-07-05 深圳市精明检测设备有限公司 Vehicle frame quality detection method, device, equipment and medium based on image analysis
CN115100536A (en) * 2022-06-01 2022-09-23 中科星睿科技(北京)有限公司 Building identification method, building identification device, electronic equipment and computer readable medium
CN115620169A (en) * 2022-12-15 2023-01-17 北京数慧时空信息技术有限公司 Building main angle correction method based on regional consistency

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114708230A (en) * 2022-04-07 2022-07-05 深圳市精明检测设备有限公司 Vehicle frame quality detection method, device, equipment and medium based on image analysis
CN115100536A (en) * 2022-06-01 2022-09-23 中科星睿科技(北京)有限公司 Building identification method, building identification device, electronic equipment and computer readable medium
CN115100536B (en) * 2022-06-01 2023-03-28 中科星睿科技(北京)有限公司 Building identification method and device, electronic equipment and computer readable medium
CN115620169A (en) * 2022-12-15 2023-01-17 北京数慧时空信息技术有限公司 Building main angle correction method based on regional consistency

Similar Documents

Publication Publication Date Title
CN114241338A (en) Building measuring method, device, equipment and storage medium based on image recognition
CN112446919B (en) Object pose estimation method and device, electronic equipment and computer storage medium
CN116229007B (en) Four-dimensional digital image construction method, device, equipment and medium using BIM modeling
CN114758249B (en) Target object monitoring method, device, equipment and medium based on field night environment
CN114049568A (en) Object shape change detection method, device, equipment and medium based on image comparison
CN112348885A (en) Visual feature library construction method, visual positioning method, device and storage medium
CN115457451B (en) Constant temperature and humidity test box monitoring method and device based on Internet of things
CN113705461A (en) Face definition detection method, device, equipment and storage medium
CN114511661A (en) Image rendering method and device, electronic equipment and storage medium
CN114565916A (en) Target detection model training method, target detection method and electronic equipment
CN117197388A (en) Live-action three-dimensional virtual reality scene construction method and system based on generation of antagonistic neural network and oblique photography
CN115690615A (en) Deep learning target identification method and system for video stream
CN113887384B (en) Pedestrian track analysis method, device, equipment and medium based on multi-track fusion
CN115760990A (en) Identification and positioning method of pineapple pistil, electronic equipment and storage medium
CN115880448A (en) Three-dimensional measurement method, device and equipment based on binocular imaging and storage medium
CN115601684A (en) Emergency early warning method and device, electronic equipment and storage medium
CN113177975B (en) Depth calculation method and three-dimensional modeling method based on spherical screen camera and laser radar
CN114463685A (en) Behavior recognition method and device, electronic equipment and storage medium
CN113869269A (en) Activity site congestion degree detection method and device, electronic equipment and storage medium
CN113792671A (en) Method and device for detecting face synthetic image, electronic equipment and medium
CN113901898A (en) Image stable sampling method, device, equipment and medium in face recognition scene
CN112541436A (en) Concentration degree analysis method and device, electronic equipment and computer storage medium
CN114240924A (en) Power grid equipment quality evaluation method based on digitization technology
CN113888086A (en) Article signing method, device and equipment based on image recognition and storage medium
CN113869385A (en) Poster comparison method, device and equipment based on target detection and storage 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