WO2021003824A1 - 基于图像识别的违章建筑识别方法、装置 - Google Patents

基于图像识别的违章建筑识别方法、装置 Download PDF

Info

Publication number
WO2021003824A1
WO2021003824A1 PCT/CN2019/103526 CN2019103526W WO2021003824A1 WO 2021003824 A1 WO2021003824 A1 WO 2021003824A1 CN 2019103526 W CN2019103526 W CN 2019103526W WO 2021003824 A1 WO2021003824 A1 WO 2021003824A1
Authority
WO
WIPO (PCT)
Prior art keywords
building
identified
edge
picture
pixel
Prior art date
Application number
PCT/CN2019/103526
Other languages
English (en)
French (fr)
Inventor
雷晨雨
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021003824A1 publication Critical patent/WO2021003824A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering

Definitions

  • This application relates to the field of image processing technology, in particular to a method and device for identifying illegal buildings based on image recognition.
  • the present application provides a method and device for identifying illegal buildings based on image recognition, which helps to improve the accuracy of identifying illegal buildings.
  • a method for identifying illegal buildings based on image recognition including:
  • a device for identifying illegal buildings based on image recognition including:
  • the image acquisition module to be identified is used to acquire the image of the building to be identified corresponding to the building to be identified;
  • a grayscale module configured to perform grayscale processing on the picture of the building to be identified to obtain a grayscale image corresponding to the picture of the building to be identified;
  • An edge detection module configured to perform edge detection on the grayscale image to obtain an edge image corresponding to the building image to be identified
  • a contour extraction module for extracting the contour map of the building to be recognized from the edge picture
  • the violation judgment module is used for judging whether the building to be identified is an illegal building according to the matching situation between the outline drawing of the building to be identified and the outline drawing of the standard building.
  • a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, a method for identifying illegal buildings based on image recognition is provided, including:
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer
  • the method for identifying illegal buildings based on image recognition when reading instructions includes:
  • this application provides a method and device for identifying illegal buildings based on image recognition.
  • the image of the building to be identified is grayed out, and the processed gray image is used for edge detection to obtain the corresponding building to be identified.
  • the contour map of the building to be recognized is extracted from the edge picture, and the contour map of the building to be recognized is compared with the standard building contour map to analyze whether the building to be recognized is an illegal building.
  • This application analyzes whether the building to be identified is in violation of regulations based on the matching situation of the outline map of the building to be identified and the outline map of the standard building. Compared with the manual identification method in the prior art, the accuracy and efficiency of identifying illegal buildings are improved. .
  • Fig. 1 shows a schematic flowchart of a method for identifying illegal buildings based on image recognition provided by an embodiment of the present application
  • FIG. 2 shows a schematic flowchart of another method for identifying illegal buildings based on image recognition provided by an embodiment of the present application
  • Fig. 3 shows a schematic structural diagram of a device for identifying illegal buildings based on image recognition provided by an embodiment of the present application
  • Fig. 4 shows a schematic structural diagram of another device for identifying illegal buildings based on image recognition provided by an embodiment of the present application.
  • a method for identifying illegal buildings based on image recognition includes:
  • Step 101 Obtain a picture of a building to be identified corresponding to the building to be identified.
  • the method for identifying illegal buildings provided by the embodiments of this application compares and recognizes the pictures of the same building at different time points, so as to determine whether the building to be identified has illegal phenomena in a certain period of time. Therefore, before the identification, it is necessary to obtain the Recognize the image of the building to be recognized corresponding to the building, and scale it to a preset size for subsequent image processing and recognition. Due to the high height of most buildings, the embodiment of the present application adopts drone aerial photography to collect building pictures.
  • Step 102 Perform grayscale processing on the picture of the building to be recognized to obtain a grayscale image corresponding to the picture of the building to be recognized.
  • the embodiment of the present application provides two gray-scale processing methods.
  • the maximum value method take the maximum value of the RGB three-component brightness of each pixel in the building image to be identified as the gray value of the corresponding pixel to obtain the gray image corresponding to the building image to be identified;
  • Average value method The average value of the RGB three-component brightness of each pixel in the building image to be identified is used as the gray value of the corresponding pixel to obtain the gray image corresponding to the building image to be identified.
  • the embodiments of the present application may also adopt other gray-scale processing methods, which are not limited herein.
  • Step 103 Perform edge detection on the grayscale image to obtain an edge image corresponding to the building image to be identified.
  • the edge detection method find out the edge points in the grayscale image of the building to be identified, so as to obtain the edge image corresponding to the image of the building to be identified.
  • the edge image can reflect the edge information of the building to be identified, such as walls and windows .
  • Step 104 Extract the contour map of the building to be identified from the edge image.
  • the contour map of the building to be recognized is extracted from the edge picture, and the contour map can reflect the contour characteristics of the building, such as the window contour of the building, the top contour of the building, and so on.
  • Step 105 Determine whether the building to be identified is an illegal building according to the matching situation between the outline drawing of the building to be identified and the outline drawing of the standard building.
  • the image of the building to be identified is grayed out, the processed gray image is used for edge detection to obtain the edge image corresponding to the building to be identified, and the building to be identified is extracted from the edge image
  • the contour map of the object is used to compare the contour map of the building to be identified with the contour map of the standard building to analyze whether the building to be identified is an illegal building.
  • This application analyzes whether the building to be identified is in violation of regulations based on the matching situation of the outline map of the building to be identified and the outline map of the standard building. Compared with the manual identification method in the prior art, the accuracy and efficiency of identifying illegal buildings are improved. .
  • the method includes :
  • Step 201 Obtain a picture of the building to be identified corresponding to the building to be identified.
  • Step 202 Perform grayscale processing on the picture of the building to be identified to obtain a grayscale image corresponding to the picture of the building to be identified.
  • the acquired image of the building to be identified is grayed out to obtain a gray image corresponding to the image of the building to be identified.
  • Step 203 Perform Gaussian filtering processing on the grayscale image to obtain a filtered grayscale image.
  • step 203 of the embodiment of the present application specifically, according to a preset Gaussian weight value, the gray value of each pixel in the grayscale image and the gray value corresponding to the neighboring pixels of each pixel are weighted. Sum, get the Gaussian blur value of each pixel, and determine the Gaussian blur value as the new gray value of each pixel in the grayscale image. According to the new gray value of each pixel, the filtered gray image can be determined.
  • the weighted summation of the gray value of a certain pixel and the gray value corresponding to the neighboring pixels of the pixel refers to the weighted summation of Q ⁇ Q pixels with a certain pixel as the center.
  • the neighborhood pixel of a certain pixel refers to all the pixels except for a certain pixel among the Q ⁇ Q pixels formed with a certain pixel as the center.
  • Preset Gaussian weight value according to the formula Calculation, where the coordinate point (x, y) is used to represent any pixel point, and a 3 ⁇ 3 neighborhood is formed with the pixel point as the center.
  • the coordinates of the center point are (0, 0), and the coordinates of adjacent points are
  • the variance ⁇ 2 is set to 0.64 (this value is not limited and is only an example), and the Gaussian weight value calculated according to the above formula is
  • the above Gaussian weight value is normalized to obtain the standard Gaussian weight value
  • the above-mentioned standard Gaussian weight value is used as the preset Gaussian weight value of the embodiment of the present application.
  • the Gaussian weight value performs a weighted summation of the gray values of these 9 pixels, and takes the weighted sum result as the Gaussian blur value of the center pixel, and uses the Gaussian blur value of each pixel as the gray value of this pixel to get The filtered grayscale image.
  • the gray value of 9 pixels in a 3 ⁇ 3 neighborhood is
  • the Gaussian blur value of the center point can be obtained by summing the above weighted gray values of 93.31.
  • Step 204 Calculate the gradient intensity and gradient direction of each pixel in the grayscale image respectively.
  • the gradient strength and the gradient direction are calculated according to the preset gradient strength calculation formula and the preset gradient direction calculation formula, where the preset gradient strength calculation formula is
  • the preset gradient direction calculation formula is
  • Gx and Gy respectively represent the first-order derivative value in the horizontal direction and the first-order derivative value in the vertical direction of the gray value of any pixel G.
  • Step 205 Obtain a direction interval where the gradient direction of any pixel is located.
  • Step 206 Determine whether the gradient intensity of any pixel is greater than or equal to the gradient intensity of a neighboring pixel of any pixel in the direction interval.
  • Step 207 if it is greater than or equal to, determine any pixel as an edge pixel.
  • the gradient direction of each pixel is calculated by the above gradient direction calculation formula, and the direction interval corresponding to each pixel is determined according to the preset direction interval.
  • the direction interval corresponding to each pixel is determined according to the preset direction interval.
  • Step 208 If the gradient intensity corresponding to any edge pixel is greater than the preset strong edge threshold, mark any edge pixel as a strong edge pixel.
  • the edge pixels are determined through steps 205 to 207, in order to further improve the accuracy of the edge pixels, it is necessary to compare the gradient intensity of the edge pixels with the preset strong edge point threshold. If the gradient intensity of the edge pixels is greater than the preset The strong edge point threshold indicates that the pixel is a relatively obvious edge contour point of the building, and the low pixel is marked as a strong edge pixel.
  • Step 209 If the gradient intensity corresponding to any edge pixel is greater than or equal to the preset weak edge threshold, mark any edge pixel as a weak edge pixel.
  • step 210 if the neighboring pixels of the weak edge pixel include strong edge pixels, the mark of any edge pixel is changed from the weak edge pixel to the strong edge pixel.
  • the gradient intensity of any edge pixel is less than the preset strong edge threshold and greater than or equal to the preset weak edge threshold, it means that the pixel may be an edge contour point of a building, or it may be misjudged as an edge contour point , Then mark the pixel as a weak-edge pixel, and further determine the weak-edge pixel. Specifically, if the neighboring pixel of the weak-edge pixel includes a strong-edge pixel, it means that there is a pixel in the neighborhood For building edge contour points, the mark of this pixel point is changed to a strong edge pixel point to determine the real and potential edge points.
  • any edge pixel is less than the preset weak edge point threshold, it means that the point may be misjudged as an edge pixel, and it will be discarded directly.
  • the neighbor of the weak edge pixel is The strong edge pixels are not included in the pixels, and the weak edge pixels are directly discarded.
  • Step 211 Determine the edge picture according to the strong edge pixels.
  • the edge picture corresponding to the building to be recognized determines the edge picture corresponding to the building to be recognized, and the edge picture can reflect the edge contour of the building to be recognized.
  • Step 212 Extract the contour map of the building to be identified from the edge image.
  • the edge image is input into the find Contours toolkit, and the find Contours toolkit is used to extract the contour image of the building to be identified from the edge image.
  • the contour map of the building to be recognized includes multiple contours of the building to be recognized
  • the standard building contour map includes multiple standard building contours.
  • the drone aerial photography technology is used to take pictures of the building to be identified at the same location at two specific time points.
  • the corresponding building to be identified is obtained. Before building pictures, it also includes: obtaining a standard building picture of the building to be identified at the preset first time, where the standard building picture is at the same shooting position as the building picture to be identified; extracting the standard corresponding to the standard building picture Building outline drawing.
  • the method of extracting the standard building contour map corresponding to the standard building picture is consistent with the above-mentioned method of extracting the contour map of the building to be identified, and will not be repeated here.
  • the embodiment of the application can also directly use the FCN semantic segmentation network model or the instance segmentation network MaskR-CNN to implement contour extraction, and directly input the image of the building to be identified or the standard building image into the model to obtain the corresponding contour Figure.
  • step 201 should be: acquiring a picture of the building to be identified at the preset second time.
  • Step 213 Match the outlines of multiple buildings to be identified with multiple standard building outlines; if any one of the building outlines to be identified does not meet the preset matching conditions, the building to be identified is an illegal building, where the preset matching Condition is
  • xi and xj respectively represent the center point coordinates of any standard building outline i and any to-be-identified building outline j on the x-axis
  • yi and yj respectively represent any standard building outline i and any to-be-identified building outline j
  • si and sj respectively represent the number of pixels contained in any standard building contour i and any to-be-identified building contour j.
  • F1, F2, and F3 are the preset first violation thresholds, The preset second violation threshold and the preset third violation threshold.
  • the standard building outline map and the building outline map to be identified respectively contain multiple outlines.
  • the identification process of the illegal building is essentially based on identifying the outlines of the standard building, and judging the structure of the building to be identified Whether the outline has changed significantly, if there is a significant change, it means that the building to be identified may have illegal construction; if there is no obvious change, it means that there is no illegal construction of the building to be identified.
  • the specific criterion for judging whether the outline of the building to be identified has changed is the aforementioned preset matching condition.
  • the specific judgment steps can be: S1, respectively, compare each contour information Mi in the contour map of the building to be recognized with each contour information Nj in the standard building contour map; S2, for any of the contour maps of the building to be recognized For a contour Mi, if there is any Nj, the absolute value of xi-xj is less than F1, the absolute value of yi-yj is less than F2, and the absolute value of si-sj is less than F3, then there is no building to be identified during this period Illegal building is generated; S3, otherwise, if there is any Nj, the absolute value of xi-xj is greater than or equal to F1, the absolute value of yi-yj is greater than or equal to F2, and the absolute value of si-sj is greater than or equal to F3. Any one or more of the 3 conditions, the building to be identified has already produced an illegal building during this period.
  • the image of the building to be identified is grayed out, and the processed gray image is used to perform Gaussian filtering to smooth the image and filter out noise. Then, according to the gradient intensity of each pixel and The gradient direction determines the edge pixels, and uses non-maximum value suppression and double threshold detection to eliminate the spurious response caused by edge detection, isolates weak edges to determine the real and potential edges, and obtains the contour map of the building to be identified , Use the outline map of the building to be identified and the outline map of the standard building to perform multi-dimensional comparison, analyze whether the building to be identified is an illegal building, and finally improve the accuracy of identifying the illegal building.
  • an embodiment of the present application provides a device for identifying illegal buildings based on image recognition.
  • the device includes: a picture acquisition module 31 to be identified and a grayscale module 32 , Edge detection module 33, contour extraction module 34, violation judgment module 35.
  • the to-be-identified picture acquisition module 31 is used to acquire the to-be-identified building picture corresponding to the to-be-identified building;
  • the gray-scale module 32 is used to perform gray-scale processing on the picture of the building to be recognized to obtain a gray-scale image corresponding to the picture of the building to be recognized;
  • the edge detection module 33 is configured to perform edge detection on the grayscale image to obtain an edge image corresponding to the image of the building to be identified;
  • the contour extraction module 34 is used to extract the contour map of the building to be recognized from the edge picture;
  • the violation judgment module 35 is used for judging whether the building to be identified is an illegal building according to the matching situation between the outline drawing of the building to be identified and the outline drawing of the standard building.
  • the edge detection module 33 specifically includes: a filtering unit 331, a calculation unit 332, an edge point determination unit 333, and an edge picture determination unit 334.
  • the filtering unit 331 is configured to perform Gaussian filtering processing on the gray image to obtain a filtered gray image
  • the calculation unit 332 is configured to calculate the gradient intensity and the gradient direction of each pixel in the grayscale image respectively;
  • the edge point determining unit 333 is configured to determine edge pixel points according to the gradient direction and the gradient direction;
  • the edge picture determining unit 334 is configured to determine the edge picture corresponding to the building picture to be recognized according to the edge pixels.
  • the calculation unit 332 is specifically configured to calculate the gradient strength and the gradient direction according to the preset gradient strength calculation formula and the preset gradient direction calculation formula, where the preset gradient strength calculation formula is
  • the preset gradient direction calculation formula is
  • Gx and Gy respectively represent the first-order derivative value in the horizontal direction and the first-order derivative value in the vertical direction of the gray value of any pixel G.
  • the edge point determining unit 333 specifically includes: a direction interval obtaining subunit 3331, a determining subunit 3332, and an edge point determining subunit 3333.
  • the direction interval obtaining subunit 3331 is configured to obtain the direction interval in which the gradient direction of any pixel is located;
  • the judging subunit 3332 is used to judge whether the gradient intensity of any pixel is greater than or equal to the gradient intensity of a neighboring pixel of any pixel in the direction interval;
  • the edge point determining sub-unit 3333 is used to determine any pixel point as an edge pixel point if it is greater than or equal to.
  • the edge picture determining unit 334 specifically includes: a strong edge point marking subunit 3341, a weak edge point marking subunit 3342, a marking update subunit 3343, and an edge picture determining subunit 3344. Not shown in the figure.
  • the strong edge point marking subunit 3341 is configured to mark any edge pixel as a strong edge pixel if the gradient intensity corresponding to any edge pixel is greater than the preset strong edge point threshold;
  • the weak edge point marking subunit 3342 is configured to mark any edge pixel as a weak edge pixel if the gradient intensity corresponding to any edge pixel is greater than or equal to the preset weak edge point threshold;
  • the label update subunit 3343 is used to change the label of any edge pixel from a weak edge pixel to a strong edge pixel if the neighboring pixels of the weak edge pixel point contain strong edge pixels;
  • the edge picture determination subunit 3344 is used to determine the edge picture according to the strong edge pixels.
  • the outline of the building to be identified includes multiple outlines of the building to be identified, and the outline of the standard building contains multiple outlines of the standard building;
  • the violation judgment module 35 specifically includes: a contour matching unit 351 and a violation judgment unit 352.
  • the contour matching unit 351 is configured to match the contours of multiple buildings to be identified with multiple standard building contours
  • the violation judgment unit 352 is configured to, if any of the outlines of the building to be identified does not meet the preset matching condition, the building to be identified is an illegal building, wherein the preset matching condition is
  • xi and xj respectively represent the center point coordinates of any standard building outline i and any to-be-identified building outline j on the x-axis
  • yi and yj respectively represent any standard building outline i and any to-be-identified building outline j
  • si and sj respectively represent the number of pixels contained in any standard building contour i and any to-be-identified building contour j.
  • F1, F2, and F3 are the preset first violation thresholds, The preset second violation threshold and the preset third violation threshold.
  • the device further includes: a standard picture acquisition module 36 and a standard contour extraction module 37.
  • the standard picture obtaining module 36 is used to obtain the standard building picture of the building to be recognized at a preset first time before obtaining the picture of the building to be recognized corresponding to the building to be recognized, where the standard building picture and the building to be recognized The shooting position of the pictures is the same;
  • the standard contour extraction module 37 is used to extract the standard building contour map corresponding to the standard building picture
  • the to-be-identified picture acquisition module 31 is specifically configured to acquire a picture of the to-be-identified building at a preset second time.
  • an embodiment of the present application also provides a computer-readable storage medium on which computer-readable instructions are stored.
  • the program is executed by a processor, the following steps are implemented: A picture of a building to be recognized corresponding to a building; graying processing is performed on the building picture to be recognized to obtain a gray image corresponding to the building picture to be recognized; edge detection is performed on the gray image to obtain the The edge picture corresponding to the picture of the building to be identified; extract the outline of the building to be identified from the edge picture; determine the outline of the building to be identified according to the matching situation of the outline of the building to be identified and the standard building outline Whether the building is illegal.
  • an embodiment of the present application also provides a physical structure diagram of a computer device.
  • the computer device includes: The processor 41, the memory 42, and computer-readable instructions that are stored on the memory 42 and can run on the processor, where the memory 42 and the processor 41 are both set on the bus 43, and the processor 41 executes the program.
  • the following steps Obtain the picture of the building to be recognized corresponding to the building to be recognized; Perform gray-scale processing on the picture of the building to be recognized to obtain the gray image corresponding to the picture of the building to be recognized; Edge detection to obtain the edge picture corresponding to the picture of the building to be recognized; extract the contour picture of the building to be recognized from the edge picture; according to the matching situation of the contour picture of the building to be recognized and the standard building contour picture To determine whether the building to be identified is an illegal building.
  • the present application it is possible to perform grayscale processing on the image of the building to be identified, use the processed gray image for edge detection to obtain the edge image corresponding to the building to be identified, and extract the building to be identified from the edge image
  • the contour map of the building to be recognized is compared with the contour map of the standard building to analyze whether the building to be recognized is an illegal building.
  • This application analyzes whether the building to be identified is in violation of regulations based on the matching situation of the outline map of the building to be identified and the outline map of the standard building. Compared with the manual identification method in the prior art, the accuracy and efficiency of identifying illegal buildings are improved. .
  • modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.

Abstract

一种基于图像识别的违章建筑识别方法、装置,该方法包括:获取待识别建筑对应的待识别建筑物图片(101);对待识别建筑物图片进行灰度化处理,得到待识别建筑物图片对应的灰度图(102);对灰度图进行边缘检测,得到待识别建筑物图片对应的边缘图片(103);从边缘图片中提取待识别建筑物轮廓图(104);根据待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断待识别建筑是否为违章建筑(105)。根据待识别建筑物的轮廓图和标准建筑物的轮廓图的匹配情况分析待识别建筑物是否违章,相比于现有技术中的人工识别方式,提升了违章建筑识别的准确性和效率。

Description

基于图像识别的违章建筑识别方法、装置
本申请要求与2019年7月11日提交中国专利局、申请号为2019106249311、申请名称为“违章建筑识别方法及装置、存储介质、计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及图像处理技术领域,尤其是涉及到一种基于图像识别的违章建筑识别方法、装置。
背景技术
城市是各地区的政治、经济和文化中心,在国民经济和社会发展进程中发挥着重要作用。随着社会经济的发展和各种利益的驱动,各式各样的违法建设行为层出不穷,严重地制约着城市化的发展。违章建筑对城市建设和发展具有很大的危害性,一直是困扰城市发展前进的棘手问题。因此,对违章建筑进行识别,尽早发现违章建筑具有重要意义。
现有技术中在实际的项目建设中,通过设置监控点,由人工值守查看海量的视频或者抓拍图像信息,随着监控点的数量迅速增多,监察人员难免后疏忽遗漏重要的信息,视觉疲劳会使识别效果不如人意,严重影响识别效率。
发明内容
有鉴于此,本申请提供了一种基于图像识别的违章建筑识别方法、装置,有助于提高违章建筑的识别精度。
根据本申请的一个方面,提供了一种基于图像识别的违章建筑识别方法,包括:
获取待识别建筑对应的待识别建筑物图片;
对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
从所述边缘图片中提取所述待识别建筑物轮廓图;
根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
根据本申请的另一方面,提供了一种基于图像识别的违章建筑识别装置,包括:
待识别图片获取模块,用于获取待识别建筑对应的待识别建筑物图片;
灰度化模块,用于对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
边缘检测模块,用于对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
轮廓提取模块,用于从所述边缘图片中提取所述待识别建筑物轮廓图;
违章判断模块,用于根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
依据本申请又一个方面,提供了一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现基于图像识别的违章建筑识别方法,包括:
获取待识别建筑对应的待识别建筑物图片;
对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
从所述边缘图片中提取所述待识别建筑物轮廓图;
根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
依据本申请再一个方面,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现基于图像识别的违章建筑识别方法,包括:
获取待识别建筑对应的待识别建筑物图片;
对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
从所述边缘图片中提取所述待识别建筑物轮廓图;
根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
借由上述技术方案,本申请提供的一种基于图像识别的违章建筑识别方法、装置,对待识别建筑物图片进行灰度化处理,利用处理后的灰度图进行边缘检测得到待识别建筑物对应的边缘图片,并从边缘图片中提取出待识别建筑物的轮廓图,从而利用待识别建筑物轮廓图与标准建筑物轮廓图进行比对,分析待识别建筑物是否为违章建筑。本申请根据待识别建筑物的轮廓图和标准建筑物的轮廓图的匹配情况分析待识别建筑物是否违章,相比 于现有技术中的人工识别方式,提升了违章建筑识别的准确性和效率。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种基于图像识别的违章建筑识别方法的流程示意图;
图2示出了本申请实施例提供的另一种基于图像识别的违章建筑识别方法的流程示意图;
图3示出了本申请实施例提供的一种基于图像识别的违章建筑识别装置的结构示意图;
图4示出了本申请实施例提供的另一种基于图像识别的违章建筑识别装置的结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
在本实施例中提供了一种基于图像识别的违章建筑识别方法,如图1所示,该方法包括:
步骤101,获取待识别建筑对应的待识别建筑物图片。
本申请实施例提供的违章建筑识别方法,对同一建筑物在不同时间点的图片进行对比识别,从而判断待识别建筑在一定时间段内是否产生违章现象,因此,在进行识别之前,需要获取待识别建筑对应的待识别建筑物图片,并将其缩放至预设尺寸以便进行后续的图像处理和识别。由于大多建筑物高度较高,本申请实施例采用无人机航拍的方式进行建筑物图片采集。
步骤102,对待识别建筑物图片进行灰度化处理,得到待识别建筑物图片对应的灰度图。
获取到待识别建筑物图片后,将其进行灰度化处理,使彩色的图片变为灰度图,方便进行下一步的图像处理和识别。本申请实施例提供了两种灰度化处理方法。第一,最大值法:将待识别建筑物图片中每个像素点的RGB三分量亮度中的最大值作为对应像素点的灰度值,得到待识别建筑物图片对应的灰度图;第二,平均值法:将待识别建筑物图片中每个像素点的RGB三分量亮度的平均值作为对应像素点的灰度值,得到待识别建筑物图片对应的灰度图。本申请实施例也可以采用其他的灰度处理方法,在此不做限定。
步骤103,对灰度图进行边缘检测,得到待识别建筑物图片对应的边缘图片。
通过边缘检测方法,找出待识别建筑物灰度图中的边缘点,从而得到待识别建筑物图片对应的边缘图片,例如边缘图片可以反映出待识别建筑物的墙体、窗体等边缘信息。
步骤104,从边缘图片中提取待识别建筑物轮廓图。
从边缘图片中提取出待识别建筑物的轮廓图,轮廓图可以反映出建筑物的轮廓特性,如建筑物的窗体轮廓,建筑物的顶部轮廓等等。
步骤105,根据待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断待识别建筑是否为违章建筑。
利用同一待识别建筑物的标准建筑物轮廓图与待识别建筑物轮廓图进行匹配,判断待识别建筑物的轮廓是否发生变化,若轮廓发生变化,则说明待识别建筑物发生了改变,可能产生了违章建筑,若轮廓未发生变化,即待识别建筑物轮廓图的轮廓与标准建筑物轮廓图的轮廓相匹配,则说明待识别建筑物未发生改变,没有产生违章建筑。
通过应用本实施例的技术方案,对待识别建筑物图片进行灰度化处理,利用处理后的灰度图进行边缘检测得到待识别建筑物对应的边缘图片,并从边缘图片中提取出待识别建筑物的轮廓图,从而利用待识别建筑物轮廓图与标准建筑物轮廓图进行比对,分析待识别建筑物是否为违章建筑。本申请根据待识别建筑物的轮廓图和标准建筑物的轮廓图的匹配情况分析待识别建筑物是否违章,相比于现有技术中的人工识别方式,提升了违章建筑识别的准确性和效率。
进一步的,作为上述实施例具体实施方式的细化和扩展,为了完整说明本实施例的具体实施过程,提供了另一种基于图像识别的违章建筑识别方法,如图2所示,该方法包括:
步骤201,获取待识别建筑对应的待识别建筑物图片。
步骤202,对待识别建筑物图片进行灰度化处理,得到待识别建筑物图片对应的灰度图。
在本申请实施例中,对获取到的待识别建筑物图片进行灰度化,得到待识别建筑物图片对应的灰度图。
步骤203,对灰度图进行高斯滤波处理,得到滤波后的灰度图。
在本申请实施例步骤203中,具体来说,根据预设高斯权重值,对灰度图中每个像素点的灰度值以及每个像素点的邻域像素点对应的灰度值进行加权求和,得到每个像素点的高斯模糊值,将高斯模糊值确定为灰度图中每个像素点的新的灰度值。根据每个像素点的新的灰度值,即可确定滤波后的灰度图。其中,对某一像素点的灰度值以及该像素点的邻域像素点对应的灰度值进行加权求和是指对以某一像素点为中心构成的Q×Q个像素点加权求和,即某一像素点的邻域像素点是指以某一像素点为中心构成的Q×Q个像素点中除某一像素点外的全部像素点。
预设高斯权重值根据公式
Figure PCTCN2019103526-appb-000001
计算,其中,用坐标点(x,y)表示任一像素点,以该像素点为中心构成一个3×3的邻域,中心点的坐标为(0,0),相邻点坐标为
(-1,-1) (0,-1) (1,-1)
(-1,0) (0,0) (1,0)
(-1,1) (0,1) (1,1)
本申请实施例中设定方差σ 2为0.64(该值不做限定,在此仅为举例),则根据上述公式计算得到的高斯权重值为
0.052 0.114 0.052
0.114 0.249 0.114
0.052 0.114 0.052
将上述高斯权重值进行归一化处理,得到标准高斯权重值为
0.057 0.125 0.057
0.125 0.272 0.125
0.057 0.125 0.057
将上述的标准高斯权重值作为本申请实施例的预设高斯权重值,对于每个像素点来说,取以该像素点为中心的3×3邻域的9个像素点,分别按照预设高斯权重值对这9个像素点的灰度值进行加权求和,将加权求和结果作为中心像素点的高斯模糊值,将每个像素点的高斯模糊值作为这个像素点的灰度值得到滤波后的灰度图。
例如一个3×3邻域的9个像素点的灰度值为
82 100 89
86 98 92
87 97 89
分别对每个像素点的灰度值进行加权后,每个像素点的灰度值为
82x0.057 100x0.125 89x0.057
86x0.125 98x0.272 92x0.125
87x0.057 97x0.125 89x0.057
将上述各个加权灰度值进行求和可得到中心点的高斯模糊值为93.31。
步骤204,分别计算灰度图中每个像素点的梯度强度和梯度方向。
在本申请实施例中,具体来说,按照预设梯度强度计算公式以及预设梯度方向计算公式,计算梯度强度和梯度方向,其中,预设梯度强度计算公式为
Figure PCTCN2019103526-appb-000002
预设梯度方向计算公式为
θ=arctan(G y/G x),
Gx、Gy分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
步骤205,获取任一像素点的梯度方向所在的方向区间。
步骤206,判断任一像素点的梯度强度是否大于或等于在方向区间上的任一像素点的邻域像素点的梯度强度。
步骤207,若大于或等于,则将任一像素点确定为边缘像素点。
为了找到待识别建筑物的灰度图中的建筑边缘,通过上述的梯度方向计算公式计算出每个像素点的梯度方向后,按照预设的方向区间,分别确定每个像素点对应的方向区间,进而对于任意一个像素点来说,分别获取该像素点的梯度强度,以及该像素点为中心的3×3的邻域中与该中心像素点的方向区间相同的像素点对应的梯度强度,判断该中心像素点的梯度强度是否为邻域像素点中在对应的方向区间上的最大梯度强度,若是,说明这个点可能是建筑物的边缘位置,则将该中心像素点确定为边缘像素点,以消除边缘检测带来的杂散响应。
例如划分0°~45°、45°~90°、0°~-45°、-45°~-90°为4个方向区间,分别将每个像素点的梯度方向对应到其中的一个方向区间中,假设某一像素点的梯度方向在0° ~45°方向区间中,那么以该像素点为中心像素点,获取中心像素点3×3邻域的各个像素点的梯度方向,并在邻域的各个像素点的梯度方向在0°~45°方向区间中时获取对应的梯度强度,分析中心像素点的梯度强度是否大于或等于在0°~45°方向区间中的邻域的各个像素点的梯度强度,若大于或等于,则将该中心像素点记为边缘像素点。
步骤208,若任一边缘像素点对应的梯度强度大于预设强边缘点阈值,则将任一边缘像素点标记为强边缘像素点。
通过步骤205至步骤207确定边缘像素点后,为了进一步提升边缘像素点的准确性,需要对边缘像素点的梯度强度与预设强边缘点阈值进行比较,若边缘像素点的梯度强度大于预设强边缘点阈值,说明该像素点是较为明显的建筑物边缘轮廓点,则将该像素低标记为强边缘像素点。
步骤209,若任一边缘像素点对应的梯度强度大于或等于预设弱边缘点阈值,则将任一边缘像素点标记为弱边缘像素点。
步骤210,若弱边缘像素点的邻域像素点中包含强边缘像素点,则将任一边缘像素点的标记从弱边缘像素点改为强边缘像素点。
而若任一边缘像素点的梯度强度小于预设强边缘点阈值大于或等于预设弱边缘点阈值,说明该像素点可能是建筑物的边缘轮廓点,也可能是被误判为边缘轮廓点,则将该像素点标记为弱边缘像素点,并对弱边缘像素点进行进一步判断,具体若弱边缘像素点的邻域像素点中包括强边缘像素点,说明该像素点的邻域中存在建筑物边缘轮廓点,则将该像素点的标记更改为强边缘像素点,从而确定真实的和潜在的边缘点。
需要说明的是,若任一边缘像素点的梯度强度小于预设弱边缘点阈值,说明该点可能被误判为边缘像素点,则直接将其丢弃,另外,若弱边缘像素点的邻域像素点中不包括强边缘像素点,也直接将该弱边缘像素点丢弃。
步骤211,根据强边缘像素点,确定边缘图片。
利用全部的强边缘像素点,确定待识别建筑物对应的边缘图片,该边缘图片能够反应出待识别建筑物的边缘轮廓情况。
步骤212,从边缘图片中提取待识别建筑物轮廓图。
本申请实施例中,将边缘图片输入至find Contours工具包中,利用find Contours工具包从边缘图片中,提取出待识别建筑物的轮廓图。其中,待识别建筑物轮廓图包含多个待识别建筑物轮廓,标准建筑物轮廓图包含多个标准建筑物轮廓。
另外,在本申请实施例中,利用无人机航拍技术,分别在特定的两个时间点,在相同的位置处拍摄待识别建筑物的图片,在步骤201,获取待识别建筑对应的待识别建筑物图 片之前,还包括:获取待识别建筑物在预设第一时间的标准建筑物图片,其中,标准建筑物图片与待识别建筑物图片的拍摄位置相同;提取标准建筑物图片对应的标准建筑物轮廓图。其中,提取标准建筑物图片对应的标准建筑物轮廓图的方法与上述提取待识别建筑物轮廓图的方法一致,在此不再赘述。本申请实施例也可以直接利用FCN语义分割网络模型或实例分割网络MaskR-CNN等模型实现轮廓提取,将待识别建筑物图片或标准建筑物图片直接输入至模型中,即可得出相应的轮廓图。
另外,基于上述的说明,步骤201应为:获取待识别建筑物在预设第二时间的待识别建筑物图片。
步骤213,将多个待识别建筑物轮廓与多个标准建筑物轮廓进行匹配;若任意一个待识别建筑物轮廓不满足预设匹配条件,则待识别建筑物为违章建筑,其中,预设匹配条件为
|x i-x j|<F 1,|y i-y j|<F 2,|s i-s j|<F 3
xi和xj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在x轴的中心点坐标,yi和yj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在y轴的中心点坐标,si和sj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j包含的像素点的数量,F1,F2,F3分别为预设第一违章阈值、预设第二违章阈值和预设第三违章阈值。
在本申请实施例中,标准建筑物轮廓图和待识别建筑物轮廓图分别包含有多个轮廓,对违章建筑的识别过程实质上是基于识别标准建筑物的各个轮廓,判断待识别建筑物的轮廓是否发生了较为明显的变化,若发生了明显变化,说明待识别建筑物可能产生了违章搭建,若未发生明显变化,说明待识别建筑物未产生违章搭建。具体的判断待识别建筑物的轮廓是否发生变化的评判标准即为上述的预设匹配条件。
具体判断步骤可以为:S1,分别将待识别建筑物轮廓图中的每一个轮廓信息Mi与标准建筑物轮廓图中的每一个轮廓信息Nj比较;S2,对于待识别建筑物轮廓图中的任意一个轮廓Mi来说,如果存在任意一个Nj,满足xi-xj的绝对值小于F1,yi-yj的绝对值小于F2,si-sj的绝对值小于F3,则这段时间内待识别建筑物没有违章建筑产生;S3,否则,即如果存在任意一个Nj,满足xi-xj的绝对值大于或等于F1,yi-yj的绝对值大于或等于F2,si-sj的绝对值大于或等于F3,这3个条件中的任意一个或多个,则这段时间内待识别建筑物已产生了违章建筑。
通过应用本实施例的技术方案,对待识别建筑物图片进行灰度化处理,利用处理后的灰度图进行高斯滤波处理,以平滑图像,滤除噪声,进而根据每个像素点的梯度强度和梯度方向确定边缘像素点,并采用非极大值抑制和双阈值检测的方式消除边缘检测带来的杂 散响应,孤立弱边缘确定真实的和潜在的边缘,从而得到待识别建筑物的轮廓图,利用待识别建筑物轮廓图与标准建筑物轮廓图进行多维比对,分析待识别建筑物是否为违章建筑,最终提高了违章建筑的识别精度。
进一步的,作为图1方法的具体实现,本申请实施例提供了一种基于图像识别的违章建筑识别装置,如图3所示,该装置包括:待识别图片获取模块31、灰度化模块32、边缘检测模块33、轮廓提取模块34、违章判断模块35。
待识别图片获取模块31,用于获取待识别建筑对应的待识别建筑物图片;
灰度化模块32,用于对待识别建筑物图片进行灰度化处理,得到待识别建筑物图片对应的灰度图;
边缘检测模块33,用于对灰度图进行边缘检测,得到待识别建筑物图片对应的边缘图片;
轮廓提取模块34,用于从边缘图片中提取待识别建筑物轮廓图;
违章判断模块35,用于根据待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断待识别建筑是否为违章建筑。
在本申请实施例中,具体地,如图4所示,边缘检测模块33,具体包括:滤波单元331、计算单元332、边缘点确定单元333、边缘图片确定单元334。
滤波单元331,用于对灰度图进行高斯滤波处理,得到滤波后的灰度图;
计算单元332,用于分别计算灰度图中每个像素点的梯度强度和梯度方向;
边缘点确定单元333,用于根据梯度方向和梯度方向,确定边缘像素点;
边缘图片确定单元334,用于根据边缘像素点,确定待识别建筑物图片对应的边缘图片。
在本申请实施例中,具体地,计算单元332,具体用于按照预设梯度强度计算公式以及预设梯度方向计算公式,计算梯度强度和梯度方向,其中,预设梯度强度计算公式为
Figure PCTCN2019103526-appb-000003
预设梯度方向计算公式为
θ=arctan(G y/G x),
Gx、Gy分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
在本申请实施例中,具体地,边缘点确定单元333,具体包括:方向区间获取子单元3331、判断子单元3332、边缘点确定子单元3333。
方向区间获取子单元3331,用于获取任一像素点的梯度方向所在的方向区间;
判断子单元3332,用于判断任一像素点的梯度强度是否大于或等于在方向区间上的任一像素点的邻域像素点的梯度强度;
边缘点确定子单元3333,用于若大于或等于,则将任一像素点确定为边缘像素点。
在本申请实施例中,具体地,边缘图片确定单元334,具体包括:强边缘点标记子单元3341、弱边缘点标记子单元3342、标记更新子单元3343、边缘图片确定子单元3344。图中未示出。
强边缘点标记子单元3341,用于若任一边缘像素点对应的梯度强度大于预设强边缘点阈值,则将任一边缘像素点标记为强边缘像素点;
弱边缘点标记子单元3342,用于若任一边缘像素点对应的梯度强度大于或等于预设弱边缘点阈值,则将任一边缘像素点标记为弱边缘像素点;
标记更新子单元3343,用于若弱边缘像素点的邻域像素点中包含强边缘像素点,则将任一边缘像素点的标记从弱边缘像素点改为强边缘像素点;
边缘图片确定子单元3344,用于根据强边缘像素点,确定边缘图片。
在本申请实施例中,具体地,待识别建筑物轮廓图包含多个待识别建筑物轮廓,标准建筑物轮廓图包含多个标准建筑物轮廓;
违章判断模块35,具体包括:轮廓匹配单元351、违章判断单元352。
轮廓匹配单元351,用于将多个待识别建筑物轮廓与多个标准建筑物轮廓进行匹配;
违章判断单元352,用于若任意一个待识别建筑物轮廓不满足预设匹配条件,则待识别建筑物为违章建筑,其中,预设匹配条件为
|x i-x j|<F 1,|y i-y j|<F 2,|s i-s j|<F 3
xi和xj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在x轴的中心点坐标,yi和yj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在y轴的中心点坐标,si和sj分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j包含的像素点的数量,F1,F2,F3分别为预设第一违章阈值、预设第二违章阈值和预设第三违章阈值。
在本申请实施例中,具体地,装置还包括:标准图片获取模块36、标准轮廓提取模块37。
标准图片获取模块36,用于在获取待识别建筑对应的待识别建筑物图片之前,获取待识别建筑物在预设第一时间的标准建筑物图片,其中,标准建筑物图片与待识别建筑物图片的拍摄位置相同;
标准轮廓提取模块37,用于提取标准建筑物图片对应的标准建筑物轮廓图;
待识别图片获取模块31,具体用于获取待识别建筑物在预设第二时间的待识别建筑物图片。
需要说明的是,本申请实施例提供的一种违章建筑识别装置所涉及各功能单元的其他相应描述,可以参考图1和图2中的对应描述,在此不再赘述。
基于上述如图1所示方法,相应的,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机可读指令,该程序被处理器执行时实现以下步骤:获取待识别建筑对应的待识别建筑物图片;对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;从所述边缘图片中提取所述待识别建筑物轮廓图;根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
基于上述如图1所示方法和如图3所示应用组件构建打包装置的实施例,本申请实施例还提供了一种计算机设备的实体结构图,如图5所示,该计算机设备包括:处理器41、存储器42、及存储在存储器42上并可在处理器上运行的计算机可读指令,其中存储器42和处理器41均设置在总线43上所述处理器41执行所述程序时实现以下步骤:获取待识别建筑对应的待识别建筑物图片;对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;从所述边缘图片中提取所述待识别建筑物轮廓图;根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
通过本申请的技术方案,能够对待识别建筑物图片进行灰度化处理,利用处理后的灰度图进行边缘检测得到待识别建筑物对应的边缘图片,并从边缘图片中提取出待识别建筑物的轮廓图,从而利用待识别建筑物轮廓图与标准建筑物轮廓图进行比对,分析待识别建筑物是否为违章建筑。本申请根据待识别建筑物的轮廓图和标准建筑物的轮廓图的匹配情况分析待识别建筑物是否违章,相比于现有技术中的人工识别方式,提升了违章建筑识别的准确性和效率。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (20)

  1. 一种基于图像识别的违章建筑识别方法,其特征在于,包括:
    获取待识别建筑对应的待识别建筑物图片;
    对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
    对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
    从所述边缘图片中提取所述待识别建筑物轮廓图;
    根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
  2. 根据权利要求1所述的方法,其特征在于,所述对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片,具体包括:
    对所述灰度图进行高斯滤波处理,得到滤波后的所述灰度图;
    分别计算所述灰度图中每个像素点的梯度强度和梯度方向;
    根据所述梯度方向和所述梯度方向,确定边缘像素点;
    根据所述边缘像素点,确定所述待识别建筑物图片对应的边缘图片。
  3. 根据权利要求2所述的方法,其特征在于,所述分别计算滤波后的所述灰度图中每个像素点的梯度强度和梯度方向,具体包括:
    按照预设梯度强度计算公式以及预设梯度方向计算公式,计算所述梯度强度和所述梯度方向,其中,所述预设梯度强度计算公式为
    Figure PCTCN2019103526-appb-100001
    所述预设梯度方向计算公式为
    θ=arctan(G y/G x),
    G x、G y分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述梯度方向和所述梯度方向,确定边缘像素点,具体包括:
    获取任一像素点的所述梯度方向所在的方向区间;
    判断所述任一像素点的所述梯度强度是否大于或等于在所述方向区间上的所述任一像素点的邻域像素点的梯度强度;
    若大于或等于,则将所述任一像素点确定为边缘像素点。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述边缘像素点,确定所述待识别建筑物图片对应的边缘图片,具体包括:
    若任一所述边缘像素点对应的梯度强度大于预设强边缘点阈值,则将任一所述边缘像素点标记为强边缘像素点;
    若任一所述边缘像素点对应的梯度强度大于或等于预设弱边缘点阈值,则将任一所述边缘像素点标记为弱边缘像素点;
    若所述弱边缘像素点的邻域像素点中包含所述强边缘像素点,则将任一所述边缘像素点的标记从所述弱边缘像素点改为所述强边缘像素点;
    根据所述强边缘像素点,确定所述边缘图片。
  6. 根据权利要求1所述的方法,其特征在于,所述待识别建筑物轮廓图包含多个待识别建筑物轮廓,所述标准建筑物轮廓图包含多个标准建筑物轮廓;
    所述根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑,具体包括:
    将多个所述待识别建筑物轮廓与多个所述标准建筑物轮廓进行匹配;
    若任意一个所述待识别建筑物轮廓不满足预设匹配条件,则所述待识别建筑物为所述违章建筑,其中,所述预设匹配条件为
    |x i-x j|<F 1,|y i-y j|<F 2,|s i-s j|<F 3
    x i和x j分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在x轴的中心点坐标,y i和y j分别表示任一所述标准建筑物轮廓i与任一所述待识别建筑物轮廓j在y轴的中心点坐标,s i和s j分别表示任一所述标准建筑物轮廓i与任一所述待识别建筑物轮廓j包含的像素点的数量,F 1,F 2,F 3分别为预设第一违章阈值、预设第二违章阈值和预设第三违章阈值。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述获取待识别建筑对应的待识别建筑物图片之前,所述方法还包括:
    获取所述待识别建筑物在预设第一时间的标准建筑物图片,其中,所述标准建筑物图片与所述待识别建筑物图片的拍摄位置相同;
    提取所述标准建筑物图片对应的所述标准建筑物轮廓图;
    所述获取待识别建筑对应的待识别建筑物图片,具体包括:
    获取所述待识别建筑物在预设第二时间的所述待识别建筑物图片。
  8. 一种基于图像识别的违章建筑识别装置,其特征在于,包括:
    待识别图片获取模块,用于获取待识别建筑对应的待识别建筑物图片;
    灰度化模块,用于对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
    边缘检测模块,用于对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
    轮廓提取模块,用于从所述边缘图片中提取所述待识别建筑物轮廓图;
    违章判断模块,用于根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
  9. 根据权利要求8所述的装置,其特征在于,所述边缘检测模块,具体包括:
    滤波单元,用于对所述灰度图进行高斯滤波处理,得到滤波后的所述灰度图;
    计算单元,用于分别计算所述灰度图中每个像素点的梯度强度和梯度方向;
    边缘点确定单元,用于根据所述梯度方向和所述梯度方向,确定边缘像素点;
    边缘图片确定单元,用于根据所述边缘像素点,确定所述待识别建筑物图片对应的边缘图片。
  10. 根据权利要求9所述的装置,其特征在于,所述计算单元,具体用于:
    按照预设梯度强度计算公式以及预设梯度方向计算公式,计算所述梯度强度和所述梯度方向,其中,所述预设梯度强度计算公式为
    Figure PCTCN2019103526-appb-100002
    所述预设梯度方向计算公式为
    θ=arctan(G y/G x),
    G x、G y分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
  11. 根据权利要求10所述的装置,其特征在于,所述边缘点确定单元,具体包括:
    方向区间获取子单元,用于获取任一像素点的所述梯度方向所在的方向区间;
    判断子单元,用于判断所述任一像素点的所述梯度强度是否大于或等于在所述方向区间上的所述任一像素点的邻域像素点的梯度强度;
    边缘点确定子单元,用于若大于或等于,则将所述任一像素点确定为边缘像素点。
  12. 根据权利要求11所述的装置,其特征在于,所述边缘图片确定单元,具体包括:
    强边缘点标记子单元,用于若任一所述边缘像素点对应的梯度强度大于预设强边缘点阈值,则将任一所述边缘像素点标记为强边缘像素点;
    弱边缘点标记子单元,用于若任一所述边缘像素点对应的梯度强度大于或等于预设弱边缘点阈值,则将任一所述边缘像素点标记为弱边缘像素点;
    标记更新子单元,用于若所述弱边缘像素点的邻域像素点中包含所述强边缘像素点,则将任一所述边缘像素点的标记从所述弱边缘像素点改为所述强边缘像素点;
    边缘图片确定子单元,用于根据所述强边缘像素点,确定所述边缘图片。
  13. 根据权利要求8所述的装置,其特征在于,所述待识别建筑物轮廓图包含多个待识别建筑物轮廓,所述标准建筑物轮廓图包含多个标准建筑物轮廓;
    所述违章判断模块,具体包括:
    轮廓匹配单元,用于将多个所述待识别建筑物轮廓与多个所述标准建筑物轮廓进行匹配;
    违章判断单元,用于若任意一个所述待识别建筑物轮廓不满足预设匹配条件,则所述待识别建筑物为所述违章建筑,其中,所述预设匹配条件为
    |x i-x j|<F 1,|y i-y j|<F 2,|s i-s j|<F 3
    x i和x j分别表示任一标准建筑物轮廓i与任一待识别建筑物轮廓j在x轴的中心点坐标,y i和y j分别表示任一所述标准建筑物轮廓i与任一所述待识别建筑物轮廓j在y轴的中心点坐标,s i和s j分别表示任一所述标准建筑物轮廓i与任一所述待识别建筑物轮廓j包含的像素点的数量,F 1,F 2,F 3分别为预设第一违章阈值、预设第二违章阈值和预设第三违章阈值。
  14. 根据权利要求8至13中任一项所述的装置,其特征在于,所述装置还包括:
    标准图片获取模块,用于在所述获取待识别建筑对应的待识别建筑物图片之前,获取所述待识别建筑物在预设第一时间的标准建筑物图片,其中,所述标准建筑物图片与所述待识别建筑物图片的拍摄位置相同;
    标准轮廓提取模块,用于提取所述标准建筑物图片对应的所述标准建筑物轮廓图;
    所述待识别图片获取模块,具体用于获取所述待识别建筑物在预设第二时间的所述待识别建筑物图片。
  15. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现基于图像识别的违章建筑识别方法,包括:
    获取待识别建筑对应的待识别建筑物图片;
    对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
    对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
    从所述边缘图片中提取所述待识别建筑物轮廓图;
    根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片,具体包括:
    对所述灰度图进行高斯滤波处理,得到滤波后的所述灰度图;
    分别计算所述灰度图中每个像素点的梯度强度和梯度方向;
    根据所述梯度方向和所述梯度方向,确定边缘像素点;
    根据所述边缘像素点,确定所述待识别建筑物图片对应的边缘图片。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述分别计算滤波后的所述灰度图中每个像素点的梯度强度和梯度方向,具体包括:
    按照预设梯度强度计算公式以及预设梯度方向计算公式,计算所述梯度强度和所述梯度方向,其中,所述预设梯度强度计算公式为
    Figure PCTCN2019103526-appb-100003
    所述预设梯度方向计算公式为
    θ=arctan(G y/G x),
    G x、G y分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
  18. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现基于图像识别的违章建筑识别方法,包括:
    获取待识别建筑对应的待识别建筑物图片;
    对所述待识别建筑物图片进行灰度化处理,得到所述待识别建筑物图片对应的灰度图;
    对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片;
    从所述边缘图片中提取所述待识别建筑物轮廓图;
    根据所述待识别建筑物轮廓图与标准建筑物轮廓图的匹配情况,判断所述待识别建筑是否为违章建筑。
  19. 根据权利要求18所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述对所述灰度图进行边缘检测,得到所述待识别建筑物图片对应的边缘图片,具体包括:
    对所述灰度图进行高斯滤波处理,得到滤波后的所述灰度图;
    分别计算所述灰度图中每个像素点的梯度强度和梯度方向;
    根据所述梯度方向和所述梯度方向,确定边缘像素点;
    根据所述边缘像素点,确定所述待识别建筑物图片对应的边缘图片。
  20. 根据权利要求19所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述分别计算滤波后的所述灰度图中每个像素点的梯度强度和梯度方向,具体包括:
    按照预设梯度强度计算公式以及预设梯度方向计算公式,计算所述梯度强度和所述梯度方向,其中,所述预设梯度强度计算公式为
    Figure PCTCN2019103526-appb-100004
    所述预设梯度方向计算公式为
    θ=arctan(G y/G x),
    G x、G y分别表示任一像素点G的灰度值在水平方向的一阶导数值以及在垂直方向的一阶导数值。
PCT/CN2019/103526 2019-07-11 2019-08-30 基于图像识别的违章建筑识别方法、装置 WO2021003824A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910624931.1 2019-07-11
CN201910624931.1A CN110503108A (zh) 2019-07-11 2019-07-11 违章建筑识别方法及装置、存储介质、计算机设备

Publications (1)

Publication Number Publication Date
WO2021003824A1 true WO2021003824A1 (zh) 2021-01-14

Family

ID=68585277

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103526 WO2021003824A1 (zh) 2019-07-11 2019-08-30 基于图像识别的违章建筑识别方法、装置

Country Status (2)

Country Link
CN (1) CN110503108A (zh)
WO (1) WO2021003824A1 (zh)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784835A (zh) * 2021-01-21 2021-05-11 恒安嘉新(北京)科技股份公司 圆形印章的真实性识别方法、装置、电子设备及存储介质
CN113160255A (zh) * 2021-02-24 2021-07-23 国网福建省电力有限公司检修分公司 一种运行线路走廊环境因子变化监控方法
CN113313006A (zh) * 2021-05-25 2021-08-27 哈工智慧(武汉)科技有限公司 基于无人机的城市违建监管方法、系统和存储介质
CN113378642A (zh) * 2021-05-12 2021-09-10 三峡大学 一种对农村违法占地建筑物进行检测的方法
CN113505643A (zh) * 2021-06-07 2021-10-15 浙江大华技术股份有限公司 违章目标物检测方法及相关装置
CN115760884A (zh) * 2023-01-06 2023-03-07 山东恩信特种车辆制造有限公司 基于图像处理的半挂车表面焊渣优化分割方法
CN115797775A (zh) * 2022-12-14 2023-03-14 中国铁塔股份有限公司重庆市分公司 基于近地视频图像的违章建筑智能识别方法及系统
CN116075148A (zh) * 2023-03-14 2023-05-05 四川易景智能终端有限公司 一种基于人工智能的pcba板生产线智能监管系统
CN116342591A (zh) * 2023-05-25 2023-06-27 兴润建设集团有限公司 一种建筑物参数的视觉解析方法
CN116580419A (zh) * 2023-07-13 2023-08-11 江西慧航工程咨询有限公司 一种基于ai的建筑模型测试方法
CN116703903A (zh) * 2023-08-04 2023-09-05 山东济宁运河煤矿有限责任公司 一种基于机器视觉的锚杆修复质量检测方法
CN116703931A (zh) * 2023-08-09 2023-09-05 山东津庭名企建材有限公司 一种用于建筑高分子材料的表面银纹检测方法
CN116993740A (zh) * 2023-09-28 2023-11-03 山东万世机械科技有限公司 基于图像数据的混凝土结构表面缺陷检测方法
CN117252877A (zh) * 2023-11-17 2023-12-19 济南界龙科技有限公司 基于图像特征的二极体导线架质量检测方法
CN117333803A (zh) * 2023-10-09 2024-01-02 广东科驭科技有限公司 一种基于图像识别的照明运维方法及系统
CN117649566A (zh) * 2024-01-30 2024-03-05 四川省机场集团有限公司成都天府国际机场分公司 一种基于图像处理的机场行李大小分类方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340811B (zh) * 2020-02-19 2023-08-11 浙江大华技术股份有限公司 违章合成图的拆分方法、设备及计算机存储介质
CN111523391B (zh) * 2020-03-26 2021-11-05 上海刻羽信息科技有限公司 建筑物的识别方法、系统、电子设备及可读存储介质
CN114387500A (zh) * 2020-10-16 2022-04-22 苏州科瓴精密机械科技有限公司 应用于自行走设备的图像识别方法、系统、自行走设备及可读存储介质
CN112954226B (zh) * 2021-05-11 2021-08-03 江苏瞭望神州大数据科技有限公司 一种识别在建工地的监测方法及系统
CN117253195B (zh) * 2023-11-13 2024-02-27 广东申立信息工程股份有限公司 一种ipc安全监测方法、监测系统、计算机设备和可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605978A (zh) * 2013-11-28 2014-02-26 中国科学院深圳先进技术研究院 基于三维实景数据的城市违章建筑识别系统及方法
US20150199585A1 (en) * 2014-01-14 2015-07-16 Samsung Techwin Co., Ltd. Method of sampling feature points, image matching method using the same, and image matching apparatus
CN108805864A (zh) * 2018-05-07 2018-11-13 广东省电信规划设计院有限公司 基于图像数据的违章建筑物的获取方法以及装置
CN108875780A (zh) * 2018-05-07 2018-11-23 广东省电信规划设计院有限公司 基于图像数据的图像间差异对象的获取方法以及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514448A (zh) * 2013-10-24 2014-01-15 北京国基科技股份有限公司 船形识别方法和系统
CN108537782B (zh) * 2018-04-02 2021-08-31 东北大学 一种基于轮廓提取的建筑物图像匹配与融合的方法
CN109784344B (zh) * 2019-01-24 2020-09-29 中南大学 一种用于地平面标识识别的图像非目标滤除方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605978A (zh) * 2013-11-28 2014-02-26 中国科学院深圳先进技术研究院 基于三维实景数据的城市违章建筑识别系统及方法
US20150199585A1 (en) * 2014-01-14 2015-07-16 Samsung Techwin Co., Ltd. Method of sampling feature points, image matching method using the same, and image matching apparatus
CN108805864A (zh) * 2018-05-07 2018-11-13 广东省电信规划设计院有限公司 基于图像数据的违章建筑物的获取方法以及装置
CN108875780A (zh) * 2018-05-07 2018-11-23 广东省电信规划设计院有限公司 基于图像数据的图像间差异对象的获取方法以及装置

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784835B (zh) * 2021-01-21 2024-04-12 恒安嘉新(北京)科技股份公司 圆形印章的真实性识别方法、装置、电子设备及存储介质
CN112784835A (zh) * 2021-01-21 2021-05-11 恒安嘉新(北京)科技股份公司 圆形印章的真实性识别方法、装置、电子设备及存储介质
CN113160255A (zh) * 2021-02-24 2021-07-23 国网福建省电力有限公司检修分公司 一种运行线路走廊环境因子变化监控方法
CN113378642A (zh) * 2021-05-12 2021-09-10 三峡大学 一种对农村违法占地建筑物进行检测的方法
CN113313006B (zh) * 2021-05-25 2023-08-22 哈工智慧(武汉)科技有限公司 基于无人机的城市违建监管方法、系统和存储介质
CN113313006A (zh) * 2021-05-25 2021-08-27 哈工智慧(武汉)科技有限公司 基于无人机的城市违建监管方法、系统和存储介质
CN113505643A (zh) * 2021-06-07 2021-10-15 浙江大华技术股份有限公司 违章目标物检测方法及相关装置
CN115797775A (zh) * 2022-12-14 2023-03-14 中国铁塔股份有限公司重庆市分公司 基于近地视频图像的违章建筑智能识别方法及系统
CN115797775B (zh) * 2022-12-14 2024-04-26 中国铁塔股份有限公司重庆市分公司 基于近地视频图像的违章建筑智能识别方法及系统
CN115760884A (zh) * 2023-01-06 2023-03-07 山东恩信特种车辆制造有限公司 基于图像处理的半挂车表面焊渣优化分割方法
CN115760884B (zh) * 2023-01-06 2023-04-14 山东恩信特种车辆制造有限公司 基于图像处理的半挂车表面焊渣优化分割方法
CN116075148A (zh) * 2023-03-14 2023-05-05 四川易景智能终端有限公司 一种基于人工智能的pcba板生产线智能监管系统
CN116342591A (zh) * 2023-05-25 2023-06-27 兴润建设集团有限公司 一种建筑物参数的视觉解析方法
CN116342591B (zh) * 2023-05-25 2023-07-28 兴润建设集团有限公司 一种建筑物参数的视觉解析方法
CN116580419A (zh) * 2023-07-13 2023-08-11 江西慧航工程咨询有限公司 一种基于ai的建筑模型测试方法
CN116703903A (zh) * 2023-08-04 2023-09-05 山东济宁运河煤矿有限责任公司 一种基于机器视觉的锚杆修复质量检测方法
CN116703903B (zh) * 2023-08-04 2023-10-20 山东济宁运河煤矿有限责任公司 一种基于机器视觉的锚杆修复质量检测方法
CN116703931B (zh) * 2023-08-09 2023-10-24 山东津庭名企建材有限公司 一种用于建筑高分子材料的表面银纹检测方法
CN116703931A (zh) * 2023-08-09 2023-09-05 山东津庭名企建材有限公司 一种用于建筑高分子材料的表面银纹检测方法
CN116993740A (zh) * 2023-09-28 2023-11-03 山东万世机械科技有限公司 基于图像数据的混凝土结构表面缺陷检测方法
CN117333803A (zh) * 2023-10-09 2024-01-02 广东科驭科技有限公司 一种基于图像识别的照明运维方法及系统
CN117333803B (zh) * 2023-10-09 2024-03-12 广东科驭科技有限公司 一种基于图像识别的照明运维方法及系统
CN117252877A (zh) * 2023-11-17 2023-12-19 济南界龙科技有限公司 基于图像特征的二极体导线架质量检测方法
CN117252877B (zh) * 2023-11-17 2024-02-02 济南界龙科技有限公司 基于图像特征的二极体导线架质量检测方法
CN117649566A (zh) * 2024-01-30 2024-03-05 四川省机场集团有限公司成都天府国际机场分公司 一种基于图像处理的机场行李大小分类方法
CN117649566B (zh) * 2024-01-30 2024-04-09 四川省机场集团有限公司成都天府国际机场分公司 一种基于图像处理的机场行李大小分类方法

Also Published As

Publication number Publication date
CN110503108A (zh) 2019-11-26

Similar Documents

Publication Publication Date Title
WO2021003824A1 (zh) 基于图像识别的违章建筑识别方法、装置
WO2020151489A1 (zh) 基于面部识别的活体检测的方法、电子设备和存储介质
JP6719457B2 (ja) 画像の主要被写体を抽出する方法とシステム
CN104063722B (zh) 一种融合hog人体目标检测和svm分类器的安全帽识别方法
WO2017054314A1 (zh) 一种建筑物高度计算方法、装置和存储介质
CN110287889A (zh) 一种身份识别的方法及装置
CN107808161B (zh) 一种基于光视觉的水下目标识别方法
CN105405142A (zh) 一种玻璃面板的边缺陷检测方法及系统
CN109918971B (zh) 监控视频中人数检测方法及装置
CN104992148A (zh) 基于随机森林的atm终端部分遮挡人脸关键点检测方法
CN106446862A (zh) 一种人脸检测方法及系统
CN109919002B (zh) 黄色禁停线识别方法、装置、计算机设备及存储介质
CN104408707A (zh) 一种快速数字成像模糊鉴别与复原图像质量评估方法
Thalji et al. Iris Recognition using robust algorithm for eyelid, eyelash and shadow avoiding
CN104966054B (zh) 无人机可见光图像中的弱小目标检测方法
CN111144337B (zh) 火灾检测方法、装置及终端设备
CN110287862B (zh) 基于深度学习的防偷拍检测方法
CN109858438B (zh) 一种基于模型拟合的车道线检测方法
CN105046218A (zh) 一种基于串并行处理的多特征交通视频烟雾检测方法
CN106447673A (zh) 一种非均匀光照条件下的芯片引脚提取方法
CN105631405B (zh) 基于多级分块的交通视频智能识别背景建模方法
CN103390151A (zh) 人脸检测方法及装置
CN111027534A (zh) 一种紧凑双车牌检测方法及装置
CN107527356B (zh) 一种基于懒交互方式的视频跟踪方法
WO2014205787A1 (zh) 一种基于混合图像模板的车辆检测方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19937091

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19937091

Country of ref document: EP

Kind code of ref document: A1