[go: up one dir, main page]

CN106127211A - Whiteboard detection method and device - Google Patents

Whiteboard detection method and device Download PDF

Info

Publication number
CN106127211A
CN106127211A CN201610460991.0A CN201610460991A CN106127211A CN 106127211 A CN106127211 A CN 106127211A CN 201610460991 A CN201610460991 A CN 201610460991A CN 106127211 A CN106127211 A CN 106127211A
Authority
CN
China
Prior art keywords
area
straight line
whiteboard
line segment
preset
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
CN201610460991.0A
Other languages
Chinese (zh)
Inventor
龙飞
汪平仄
陈志军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610460991.0A priority Critical patent/CN106127211A/en
Publication of CN106127211A publication Critical patent/CN106127211A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The disclosure is directed to a kind of blank detection method and device, belong to image identification technical field.Wherein, blank detection method, including: obtain image to be detected;Determine the length of image cathetus section, and determine the edge of whiteboard area in image according to the length of straightway.Position in the picture, whiteboard area can be detected exactly, provide data support for follow-up whiteboard area is further processed.

Description

白板检测方法和装置Whiteboard detection method and device

技术领域technical field

本公开涉及图像识别技术领域,尤其涉及一种白板检测方法和装置。The present disclosure relates to the technical field of image recognition, in particular to a whiteboard detection method and device.

背景技术Background technique

随着科技的高速发展,越来越多的人习惯使用智能手机来处理文档。首先,用户可先对白板进行拍照。其中,白板可以是黑板、白板、证件、银行卡、演示文稿PPT等包含文字等信息的矩形区域。然后对拍照获得的图片进行检测,检测出图片中白板区域的边缘,最后对白板区域内的文字信息进行识别,从而实现文档处理。而如何准确地识别出白板区域的边缘,已成为重点研究的课题。With the rapid development of technology, more and more people are accustomed to using smartphones to process documents. First, the user can take a photo of the whiteboard. Wherein, the whiteboard may be a rectangular area containing information such as text, such as a blackboard, a whiteboard, a certificate, a bank card, or a presentation PPT. Then detect the picture obtained by taking pictures, detect the edge of the whiteboard area in the picture, and finally recognize the text information in the whiteboard area, so as to realize document processing. How to accurately identify the edge of the whiteboard area has become a key research topic.

发明内容Contents of the invention

为克服相关技术中存在的问题,本公开提供一种白板检测方法和装置。In order to overcome the problems existing in the related art, the present disclosure provides a whiteboard detection method and device.

根据本公开实施例的第一方面,提供一种白板检测方法,包括:According to a first aspect of an embodiment of the present disclosure, a whiteboard detection method is provided, including:

获取待检测的图像;Obtain the image to be detected;

确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。Determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment.

如上所述的白板检测方法,还包括:The whiteboard detection method as described above also includes:

获取所述图像中的预设区域;Acquiring a preset area in the image;

基于最小显著差异算法LSD检测所述预设区域中包含的线段;Detecting the line segments contained in the preset area based on the least significant difference algorithm LSD;

对所述预设区域中的所述线段进行聚类,并根据所述预设区域中的线段确定预设区域中的直线段。Clustering the line segments in the preset area, and determining a straight line segment in the preset area according to the line segments in the preset area.

如上所述的白板检测方法,所述根据所述预设区域中的线段确定预设区域中的直线段,包括:According to the whiteboard detection method described above, determining the straight line segment in the preset area according to the line segment in the preset area includes:

获得所述预设区域中的线段的直线方程;Obtain the straight line equation of the line segment in the preset area;

根据所述直线方程计算每两条所述线段之间的斜率差和每两条所述线段之间的截距差;Calculate the slope difference between every two described line segments and the intercept difference between every two described line segments according to the straight line equation;

当存在至少两条线段之间的所述斜率差小于第一阈值且所述至少两条线段之间的所述截距差小于第二阈值时,对所述至少两条线段进行聚类,生成第一线段;When the slope difference between at least two line segments is less than a first threshold and the intercept difference between the at least two line segments is less than a second threshold, the at least two line segments are clustered to generate first line segment;

将所述第一线段确定为所述直线段。The first line segment is determined as the straight line segment.

如上所述的白板检测方法,所述根据所述直线段的长度确定所述图像中的白板区域的边缘包括:In the whiteboard detection method described above, the determining the edge of the whiteboard area in the image according to the length of the straight line segment includes:

当所述直线段的长度大于预设长度时,确定所述直线段为所述白板区域对应的边缘。When the length of the straight line segment is greater than a preset length, it is determined that the straight line segment is an edge corresponding to the whiteboard area.

如上所述的白板检测方法,所述预设区域包括上区域、下区域、左区域、右区域以及图像本身中的至少一种。In the whiteboard detection method described above, the preset area includes at least one of an upper area, a lower area, a left area, a right area, and the image itself.

如上所述的白板检测方法,确定所述直线段为所述白板区域对应的边缘,包括:According to the whiteboard detection method described above, determining that the straight line segment is the edge corresponding to the whiteboard area includes:

当大于预设长度的所述直线段为多个时,确定长度最长的直线段为所述白板区域对应的边缘。When there are multiple straight line segments greater than the preset length, the straight line segment with the longest length is determined as the corresponding edge of the whiteboard area.

如上所述的白板检测方法,当大于预设长度的所述直线段为多个时,确定所述白板区域的边缘,包括:In the whiteboard detection method described above, when there are multiple straight line segments greater than a preset length, determining the edge of the whiteboard area includes:

当所述预设区域为上区域时,在多个所述直线段的下侧截取相同大小的区域块;When the preset area is the upper area, intercept area blocks of the same size on the lower side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于预设阈值时,确定位于上端的直线段为所述白板区域的上边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the upper end is the upper edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于下端的直线段为所述白板区域的上边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the lower end is the upper edge of the whiteboard area.

如上所述的白板检测方法,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:In the whiteboard detection method described above, when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area includes:

当所述预设区域为下区域时,在多个所述直线段的上侧截取相同大小的区域块;When the preset area is the lower area, intercept area blocks of the same size on the upper side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于所述预设阈值时,确定位于下端的直线段为所述白板区域的下边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the lower end is the lower edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于上端的直线段为所述白板区域的下边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the upper end is the lower edge of the whiteboard area.

如上所述的白板检测方法,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:In the whiteboard detection method described above, when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area includes:

当所述预设区域为左区域时,在多个所述直线段的右侧截取相同大小的区域块;When the preset area is the left area, intercept area blocks of the same size on the right side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于所述预设阈值时,确定位于左端的直线段为所述白板区域的左边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the left end is the left edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于右端的直线段为所述白板区域的左边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the right end is the left edge of the whiteboard area.

如上所述的白板检测方法,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:In the whiteboard detection method described above, when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area includes:

当所述预设区域为右区域时,在多个所述直线段的左侧截取相同大小的区域块;When the preset area is the right area, intercept area blocks of the same size on the left side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于预设阈值时,确定位于右端的直线段为所述白板区域的右边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the right end is the right edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于左端的直线段为所述白板区域的右边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the left end is the right edge of the whiteboard area.

根据本公开实施例的第二方面,提供一种白板检测装置,包括:According to a second aspect of an embodiment of the present disclosure, a whiteboard detection device is provided, including:

第一获取模块,用于获取待检测的图像;The first acquisition module is used to acquire the image to be detected;

第一确定模块,用于确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。The first determination module is configured to determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment.

如上所述的白板检测装置,所述装置还包括:The whiteboard detection device as described above, the device also includes:

第二获取模块,用于获取所述图像中的预设区域;a second acquiring module, configured to acquire a preset area in the image;

检测模块,用于基于最小显著差异算法LSD检测所述预设区域中包含的线段;A detection module, configured to detect the line segments contained in the preset area based on the least significant difference algorithm LSD;

第二确定模块,用于对所述预设区域中的所述线段进行聚类,并根据所述预设区域中的线段确定预设区域中的直线段。The second determination module is configured to cluster the line segments in the preset area, and determine the straight line segments in the preset area according to the line segments in the preset area.

如上所述的白板检测装置,所述第二确定模块,用于:The whiteboard detection device as described above, the second determination module is used for:

获得所述预设区域中的线段的直线方程;Obtain the straight line equation of the line segment in the preset area;

根据所述直线方程计算每两条所述线段之间的斜率差和每两条所述线段之间的截距差;Calculate the slope difference between every two described line segments and the intercept difference between every two described line segments according to the straight line equation;

当存在至少两条线段之间的所述斜率差小于第一阈值且所述至少两条线段之间的所述截距差小于第二阈值时,对所述至少两条线段进行聚类,生成第一线段;When the slope difference between at least two line segments is less than a first threshold and the intercept difference between the at least two line segments is less than a second threshold, the at least two line segments are clustered to generate first line segment;

将所述第一线段确定为所述直线段。The first line segment is determined as the straight line segment.

如上所述的白板检测装置,所述第一确定模块,用于:According to the above-mentioned whiteboard detection device, the first determination module is used for:

当所述直线段的长度大于预设长度,确定所述直线段为所述白板区域对应的边缘。When the length of the straight line segment is greater than the preset length, it is determined that the straight line segment is an edge corresponding to the whiteboard area.

如上所述的白板检测装置,所述预设区域包括上区域、下区域、左区域、右区域以及图像本身中的至少一种。In the whiteboard detection device described above, the preset area includes at least one of an upper area, a lower area, a left area, a right area, and the image itself.

如上所述的白板检测装置,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:In the above-mentioned whiteboard detection device, when there are multiple straight line segments greater than a preset length, the first determination module is configured to:

当所述预设区域为上区域时,在多个所述直线段的下侧截取相同大小的区域块;When the preset area is the upper area, intercept area blocks of the same size on the lower side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于预设阈值时,确定位于上端的直线段为所述白板区域的上边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the upper end is the upper edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于下端的直线段作为所述白板区域的上边缘。When the gray value difference is greater than the preset threshold, the straight line segment at the lower end is determined as the upper edge of the whiteboard area.

如上所述的白板检测装置,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:In the above-mentioned whiteboard detection device, when there are multiple straight line segments greater than a preset length, the first determination module is configured to:

当所述预设区域为下区域时,在多个所述直线段的上侧截取相同大小的区域块;When the preset area is the lower area, intercept area blocks of the same size on the upper side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于所述预设阈值时,确定位于下端的直线段为所述白板区域的下边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the lower end is the lower edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于上端的直线段为所述白板区域的下边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the upper end is the lower edge of the whiteboard area.

如上所述的白板检测装置,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:In the above-mentioned whiteboard detection device, when there are multiple straight line segments greater than a preset length, the first determination module is configured to:

当所述预设区域为左区域时,在多个所述直线段的右侧截取相同大小的区域块;When the preset area is the left area, intercept area blocks of the same size on the right side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于所述预设阈值时,确定位于左端的直线段为所述白板区域的左边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the left end is the left edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于右端的直线段为所述白板区域的左边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the right end is the left edge of the whiteboard area.

如上所述的白板检测装置,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:In the above-mentioned whiteboard detection device, when there are multiple straight line segments greater than a preset length, the first determination module is configured to:

当所述预设区域为右区域时,在多个所述直线段的左侧截取相同大小的区域块;When the preset area is the right area, intercept area blocks of the same size on the left side of the plurality of straight line segments;

计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks;

在所述灰度值之差小于预设阈值时,确定位于右端的直线段为所述白板区域的右边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the right end is the right edge of the whiteboard area;

在所述灰度值之差大于所述预设阈值时,确定位于左端的直线段为所述白板区域的右边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the left end is the right edge of the whiteboard area.

根据本公开实施例的第三方面,提供一种白板检测装置,包括:According to a third aspect of an embodiment of the present disclosure, a whiteboard detection device is provided, including:

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,所述处理器被配置为:Wherein, the processor is configured as:

获取待检测的图像;Obtain the image to be detected;

确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。Determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment.

本公开的实施例提供的技术方案可以包括以下有益效果:通过获取待检测的图像,确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘,能够准确地检测出白板区域在图像中的位置,为后续对白板区域进行进一步地处理提供了数据支持。The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by acquiring the image to be detected, determining the length of the straight line segment in the image, and determining the edge of the whiteboard area in the image according to the length of the straight line segment, it is possible to accurately detect The position of the whiteboard area in the image provides data support for subsequent further processing of the whiteboard area.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

图1是根据一示例性实施例示出的一种白板检测方法的流程图;Fig. 1 is a flow chart of a whiteboard detection method shown according to an exemplary embodiment;

图2是确定图像中的直线段的流程图;Fig. 2 is a flowchart of determining a straight line segment in an image;

图3是将图像切分为四个区域的效果示意图;Figure 3 is a schematic diagram of the effect of dividing an image into four regions;

图4是确定白板区域的右边缘的效果示意图;Fig. 4 is a schematic diagram of the effect of determining the right edge of the whiteboard area;

图5是根据一示例性实施例示出的一种白板检测装置框图;Fig. 5 is a block diagram of a whiteboard detection device according to an exemplary embodiment;

图6是根据一示例性实施例示出的一种白板检测装置600的框图。Fig. 6 is a block diagram of a whiteboard detection device 600 according to an exemplary embodiment.

具体实施方式detailed description

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.

图1是根据一示例性实施例示出的一种白板检测方法的流程图,如图1所示,白板检测方法,包括以下步骤;Fig. 1 is a flowchart of a whiteboard detection method according to an exemplary embodiment. As shown in Fig. 1, the whiteboard detection method includes the following steps;

在步骤S101中,获取待检测的图像。In step S101, an image to be detected is acquired.

举例来说,图像可以是通过移动终端进行拍照而获得的包含演示文稿的照片,也可以是通过扫描仪扫描而获得的包含身份证的图片。在本实施例中,演示文稿、身份证所占的区域即白板区域。如何准确地检测出白板区域,即本公开的发明目的。For example, the image may be a photo including a presentation obtained by taking a photo of the mobile terminal, or may be a picture including an ID card scanned by a scanner. In this embodiment, the area occupied by the presentation and the ID card is the whiteboard area. How to accurately detect the whiteboard area is the purpose of the present invention.

在步骤S102中,确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘。In step S102, the length of the straight line segment in the image is determined, and the edge of the whiteboard area in the image is determined according to the length of the straight line segment.

在确定图像中的直线段的长度之前,需要先确定出图像中的直线段。在一实施例中,如图2所示,确定图像中的直线段可包括以下几个步骤:Before determining the length of the straight line segment in the image, it is necessary to determine the straight line segment in the image. In one embodiment, as shown in FIG. 2, determining a straight line segment in an image may include the following steps:

S103,获取图像中的预设区域。S103. Acquire a preset area in the image.

示例地,预设区域可包括上区域、下区域、左区域、右区域以及图像本身中的至少一种。位于图像上侧的部分为上区域,例如从图像的上边缘往下移动一定距离形成的约占总面积20%-50%的区域为上区域;同理,从图像的下边缘往上移动一定距离形成的约占总面积20%-50%的区域为下区域。从图像的左边缘往右移动一定距离形成的约占总面积20%-50%的区域为左区域。从图像的右边缘往左移动一定距离形成的约占总面积20%-50%的区域为右区域。Exemplarily, the preset area may include at least one of an upper area, a lower area, a left area, a right area, and the image itself. The part located on the upper side of the image is the upper area, for example, the area formed by moving down from the upper edge of the image for a certain distance and accounting for about 20%-50% of the total area is the upper area; similarly, moving up from the lower edge of the image for a certain distance The area formed by the distance and accounting for about 20%-50% of the total area is the lower area. The area formed by moving a certain distance from the left edge of the image to the right and occupying about 20%-50% of the total area is the left area. The right area is the area formed by moving a certain distance from the right edge of the image to the left and accounting for about 20%-50% of the total area.

如图3所示,在一实施例中,图像可被划分为左上区域、右上区域、左下区域和右下区域四个区域。在本实施例中,左上区域和右上区域组合为上区域,左下区域和右下区域组合为下区域,右上区域和右下区域组合为右区域,左上区域和左下区域组合为左区域。As shown in FIG. 3 , in an embodiment, the image can be divided into four areas: an upper left area, an upper right area, a lower left area, and a lower right area. In this embodiment, the upper left area and the upper right area are combined into the upper area, the lower left area and the lower right area are combined into the lower area, the upper right area and the lower right area are combined into the right area, and the upper left area and the lower left area are combined into the left area.

S104,基于最小显著差异算法LSD检测预设区域中包含的线段。S104. Detect the line segments contained in the preset area based on the least significant difference algorithm LSD.

S105,对预设区域中的线段进行聚类,并根据预设区域中的线段确定预设区域中的直线段。S105. Cluster the line segments in the preset area, and determine the straight line segments in the preset area according to the line segments in the preset area.

在一实施例中,可获得预设区域中的线段的直线方程,然后根据直线方程计算每两条线段之间的斜率差和每两条线段之间的截距差。当存在至少两条线段之间的斜率差小于第一阈值且至少两条线段之间的截距差小于第二阈值时,可对至少两条线段进行聚类,生成第一线段,再将第一线段确定为直线段。In one embodiment, the straight line equation of the line segment in the preset area can be obtained, and then the slope difference between every two line segments and the intercept difference between every two line segments can be calculated according to the straight line equation. When the slope difference between at least two line segments is less than the first threshold and the intercept difference between at least two line segments is less than the second threshold, at least two line segments can be clustered to generate the first line segment, and then The first line segment is determined as a straight line segment.

举例来说,由于光照等因素的影响,白板区域的边缘可能并不连续,可能会被检测成为多条线段。因此,需要判断多条线段是否属于同一条直线。具体地,获得这些线段的斜率,计算每两条线段的斜率差。然后计算相邻的线段之间的距离,即截距差。如果两条线段的斜率差小于预设角度如1度,且这两条线段之间的距离小于预设距离5毫米,则可确定这两条线段属于同一条直线。然后对这两条线段进行聚类,形成第一线段。该第一线段为直线段。For example, due to factors such as lighting, the edges of the whiteboard area may not be continuous, and may be detected as multiple line segments. Therefore, it is necessary to judge whether multiple line segments belong to the same straight line. Specifically, the slopes of these line segments are obtained, and the slope difference between every two line segments is calculated. Then calculate the distance between adjacent line segments, which is the intercept difference. If the slope difference between the two line segments is less than a preset angle such as 1 degree, and the distance between the two line segments is less than a preset distance of 5mm, it can be determined that the two line segments belong to the same straight line. The two line segments are then clustered to form the first line segment. The first line segment is a straight line segment.

在确定图像中的直线段之后,可确定图像中直线段的长度,再根据直线段的长度确定图像中白板区域的边缘。具体地,当大于预设长度的直线段为多个时,可确定长度最长的直线段为白板区域对应的边缘。例如:在图像的上区域中,假设有三条直线段的长度分别为11厘米、12厘米和15厘米,均大于预设长度10厘米,则可确定长度为15厘米的直线段为白板区域对应的上边缘。同理,采用相同的方法确定下区域对应的白板区域的下边缘,右区域对应的白板区域的右边缘,左区域对应的白板区域的左边缘。After the straight line segment in the image is determined, the length of the straight line segment in the image can be determined, and then the edge of the whiteboard area in the image can be determined according to the length of the straight line segment. Specifically, when there are multiple straight line segments longer than the preset length, it may be determined that the straight line segment with the longest length is the edge corresponding to the whiteboard area. For example: in the upper area of the image, assuming that there are three straight line segments with lengths of 11 cm, 12 cm and 15 cm respectively, all of which are greater than the preset length of 10 cm, it can be determined that the straight line segment with a length of 15 cm corresponds to the whiteboard area. upper edge. Similarly, use the same method to determine the lower edge of the whiteboard area corresponding to the lower area, the right edge of the whiteboard area corresponding to the right area, and the left edge of the whiteboard area corresponding to the left area.

当然,为了进一步提高检测的准确性,还可通过以下方法来确定白板区域的边缘。具体地,当在图像的上区域中检测出多个直线段时,可在多个直线段的下侧截取相同大小的区域块,然后计算每两个区域块的灰度值之差。若灰度值之差小于预设阈值,则说明这两个区域块均属于白板区域,那么可将位于上端的直线段作为白板区域的上边缘。若灰度值之差大于预设阈值,则说明这两个区域块不属于同一区域,那么可将位于下端的直线段作为白板区域的上边缘。Of course, in order to further improve the detection accuracy, the edge of the whiteboard area can also be determined by the following method. Specifically, when multiple straight line segments are detected in the upper area of the image, area blocks of the same size may be intercepted on the lower side of the multiple line segments, and then the gray value difference between each two area blocks may be calculated. If the gray value difference is smaller than the preset threshold, it means that the two area blocks belong to the whiteboard area, and the straight line segment at the upper end can be used as the upper edge of the whiteboard area. If the gray value difference is greater than the preset threshold, it means that the two area blocks do not belong to the same area, so the straight line segment at the lower end can be used as the upper edge of the whiteboard area.

同理,当在图像的下区域中检测出多个直线段时,可在多个直线段的上侧截取相同大小的区域块,计算每两个区域块的灰度值之差。若灰度值之差小于预设阈值,则将位于下端的直线段作为白板区域的下边缘。若灰度值之差大于预设阈值,则将位于上端的直线段作为白板区域的下边缘。Similarly, when multiple straight line segments are detected in the lower area of the image, regional blocks of the same size can be intercepted on the upper side of the multiple straight line segments, and the difference between the gray values of each two regional blocks can be calculated. If the gray value difference is smaller than the preset threshold, the straight line segment at the lower end is used as the lower edge of the whiteboard area. If the gray value difference is greater than the preset threshold, the straight line segment at the upper end is used as the lower edge of the whiteboard area.

同理,当在图像的左区域中检测出多个直线段时,可在多个直线段的右侧截取相同大小的区域块,计算每两个区域块的灰度值之差。若灰度值之差小于预设阈值,则将位于左端的直线段作为白板区域的左边缘。若灰度值之差大于预设阈值,则将位于右端的直线段作为白板区域的左边缘。Similarly, when multiple straight line segments are detected in the left area of the image, area blocks of the same size can be intercepted on the right side of the multiple straight line segments, and the gray value difference between each two area blocks can be calculated. If the gray value difference is smaller than the preset threshold, the straight line segment at the left end is used as the left edge of the whiteboard area. If the gray value difference is greater than the preset threshold, the straight line segment at the right end is used as the left edge of the whiteboard area.

同理,当在图像的右区域中检测出多个直线段时,可在多个直线段的左侧截取相同大小的区域块,计算每两个区域块的灰度值之差。若灰度值之差小于预设阈值,则将位于右端的直线段作为白板区域的右边缘。若灰度值之差大于预设阈值,则将位于左端的直线段作为白板区域的右边缘。Similarly, when multiple straight line segments are detected in the right area of the image, area blocks of the same size can be intercepted on the left side of the multiple straight line segments, and the difference between the gray values of each two area blocks can be calculated. If the gray value difference is smaller than the preset threshold, the straight line segment at the right end is used as the right edge of the whiteboard area. If the gray value difference is greater than the preset threshold, the straight line segment at the left end is used as the right edge of the whiteboard area.

下面以确定白板区域的右边缘为例,进行详细说明。如图4所示,图像的右区域中具有两条大于预设长度的线段:线段301和线段302。其中,线段301位于线段302的左侧。然后,可在线段301的左侧中间位置选取第一区域块303;在线段302的左侧、线段301的右侧中间位置选取同样大小的第二区域块304。分别计算两个区域块的灰度值,然后获得这两块区域块的灰度值的差。如果灰度值的差小于预设阈值,则说明这两个区域块均位于白板区域内,那么可确定线段302为白板区域的右边缘,线段301可能为白板区域内某个窗口的边缘。如果灰度值的差大于预设阈值,则说明第一区域块303位于白板区域内,第二区域块304位于白板区域外,如图4所示,那么可确定线段301为白板区域的右边缘。The following takes determining the right edge of the whiteboard area as an example to describe in detail. As shown in FIG. 4 , there are two line segments longer than a preset length in the right area of the image: line segment 301 and line segment 302 . Wherein, the line segment 301 is located on the left side of the line segment 302 . Then, the first area block 303 can be selected at the left middle position of the line segment 301 ; the second area block 304 of the same size can be selected at the left side of the line segment 302 and the right middle position of the line segment 301 . The gray values of the two area blocks are calculated respectively, and then the difference between the gray values of the two area blocks is obtained. If the gray value difference is less than the preset threshold, it means that the two blocks are located in the whiteboard area, then it can be determined that the line segment 302 is the right edge of the whiteboard area, and the line segment 301 may be the edge of a certain window in the whiteboard area. If the gray value difference is greater than the preset threshold, it means that the first area block 303 is located in the whiteboard area, and the second area block 304 is located outside the whiteboard area, as shown in Figure 4, then it can be determined that the line segment 301 is the right edge of the whiteboard area .

在确定白板区域的边缘之后,可根据边缘提取白板区域,以供后续对白板区域进行进一步地处理。After the edge of the whiteboard area is determined, the whiteboard area can be extracted according to the edge for subsequent further processing of the whiteboard area.

综上,本实施例提供的白板检测方法,通过获取待检测的图像,确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘,能够准确地检测出白板区域在图像中的位置,为后续对白板区域进行进一步地处理提供了数据支持。To sum up, the whiteboard detection method provided in this embodiment can accurately detect the whiteboard region in The position in the image provides data support for subsequent further processing of the whiteboard area.

图5是根据一示例性实施例示出的一种白板检测装置框图,该白板检测装置可以通过软件、硬件或者两者的结合实现。如图5所示,该白板检测装置包括第一获取模块11和第一确定模块12。Fig. 5 is a block diagram of a whiteboard detection device according to an exemplary embodiment. The whiteboard detection device can be implemented by software, hardware or a combination of both. As shown in FIG. 5 , the whiteboard detection device includes a first acquisition module 11 and a first determination module 12 .

第一获取模块11被配置为获取待检测的图像。The first acquiring module 11 is configured to acquire an image to be detected.

第一确定模块12被配置为确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘。The first determination module 12 is configured to determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment.

具体地,第一确定模块12被配置为当直线段的长度大于预设长度时,确定直线段为白板区域对应的边缘。Specifically, the first determining module 12 is configured to determine that the straight line segment is an edge corresponding to the whiteboard area when the length of the straight line segment is greater than a preset length.

更具体地,第一确定模块12被配置为当大于预设长度的直线段为多个时,确定长度最长的直线段为白板区域对应的边缘。More specifically, the first determining module 12 is configured to determine that the longest straight line segment is the edge corresponding to the whiteboard area when there are multiple straight line segments longer than the preset length.

更具体地,第一确定模块12被配置为当预设区域为上区域时,在多个直线段的下侧截取相同大小的区域块;计算每两个区域块的灰度值之差;在灰度值之差小于预设阈值时,确定位于上端的直线段为白板区域的上边缘;在灰度值之差大于预设阈值时,确定位于下端的直线段作为白板区域的上边缘。More specifically, the first determination module 12 is configured to intercept area blocks of the same size on the lower side of multiple straight line segments when the preset area is an upper area; calculate the difference between the gray values of every two area blocks; When the grayscale value difference is less than the preset threshold, determine the upper straight line segment as the upper edge of the whiteboard area; when the grayscale value difference is greater than the preset threshold, determine the lower straight line segment as the upper edge of the whiteboard area.

第一确定模块12被配置为当预设区域为下区域时,在多个直线段的上侧截取相同大小的区域块;计算每两个区域块的灰度值之差;在灰度值之差小于预设阈值时,确定位于下端的直线段为白板区域的下边缘;在灰度值之差大于预设阈值时,确定位于上端的直线段为白板区域的下边缘。The first determination module 12 is configured to intercept the area blocks of the same size on the upper side of multiple straight line segments when the preset area is the lower area; calculate the difference between the gray values of every two area blocks; When the difference is smaller than the preset threshold, it is determined that the straight line segment at the lower end is the lower edge of the whiteboard area; when the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the upper end is the lower edge of the whiteboard area.

第一确定模块12被配置为当预设区域为左区域时,在多个直线段的右侧截取相同大小的区域块;计算每两个区域块的灰度值之差;在灰度值之差小于预设阈值时,确定位于左端的直线段为白板区域的左边缘;在灰度值之差大于预设阈值时,确定位于右端的直线段为白板区域的左边缘。The first determination module 12 is configured to intercept the area blocks of the same size on the right side of multiple straight line segments when the preset area is the left area; calculate the difference between the gray values of every two area blocks; When the difference is smaller than the preset threshold, it is determined that the straight line segment at the left end is the left edge of the whiteboard area; when the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the right end is the left edge of the whiteboard area.

第一确定模块12被配置为当预设区域为右区域时,在多个直线段的左侧截取相同大小的区域块;计算每两个区域块的灰度值之差;在灰度值之差小于预设阈值时,确定位于右端的直线段为白板区域的右边缘;在灰度值之差大于预设阈值时,确定位于左端的直线段为白板区域的右边缘。The first determination module 12 is configured to intercept the area blocks of the same size on the left side of multiple straight line segments when the preset area is the right area; calculate the difference between the gray values of every two area blocks; When the difference is smaller than the preset threshold, it is determined that the straight line segment at the right end is the right edge of the whiteboard area; when the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the left end is the right edge of the whiteboard area.

此外,该白板检测装置还可包括第二获取模块13、检测模块14和第二确定模块15。In addition, the whiteboard detection device may further include a second acquisition module 13 , a detection module 14 and a second determination module 15 .

第二获取模块13被配置为获取图像中的预设区域。The second acquisition module 13 is configured to acquire a preset area in the image.

检测模块14被配置为基于最小显著差异算法LSD检测预设区域中包含的线段。The detection module 14 is configured to detect the line segments included in the preset area based on the least significant difference algorithm LSD.

第二确定模块15被配置为对预设区域中的线段进行聚类,并根据预设区域中的线段确定预设区域中的直线段。The second determining module 15 is configured to cluster the line segments in the preset area, and determine the straight line segments in the preset area according to the line segments in the preset area.

具体地,第二确定模块15被配置为获得预设区域中的线段的直线方程;根据直线方程计算每两条线段之间的斜率差和每两条线段之间的截距差;当存在至少两条线段之间的斜率差小于第一阈值且至少两条线段之间的截距差小于第二阈值时,对至少两条线段进行聚类,生成第一线段;将第一线段确定为直线段。Specifically, the second determination module 15 is configured to obtain the straight line equation of the line segment in the preset area; calculate the slope difference between every two line segments and the intercept difference between every two line segments according to the straight line equation; when there is at least When the slope difference between the two line segments is less than the first threshold and the intercept difference between the at least two line segments is less than the second threshold, at least two line segments are clustered to generate the first line segment; the first line segment is determined is a straight line segment.

关于上述实施例中的白板检测装置,其中各个模块执行操作的具体方式已经在有关该白板检测方法的实施例中进行了详细描述,此处将不做详细阐述说明。With regard to the whiteboard detection device in the above embodiment, the specific manner of performing operations of each module has been described in detail in the embodiment of the whiteboard detection method, and will not be described in detail here.

综上,本实施例提供的白板检测装置,通过获取待检测的图像,确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘,能够准确地检测出白板区域在图像中的位置,为后续对白板区域进行进一步地处理提供了数据支持。To sum up, the whiteboard detection device provided in this embodiment can accurately detect the whiteboard region in The position in the image provides data support for subsequent further processing of the whiteboard area.

图6是根据一示例性实施例示出的一种白板检测装置600的框图。Fig. 6 is a block diagram of a whiteboard detection device 600 according to an exemplary embodiment.

如图6所示,装置600可以包括以下一个或多个组件:处理组件602,存储器604,电力组件606,传感器组件608,以及通信组件660。As shown in FIG. 6 , apparatus 600 may include one or more of the following components: processing component 602 , memory 604 , power component 606 , sensor component 608 , and communication component 660 .

处理组件602通常控制白板检测装置600的整体操作,诸如与显示,数据通信,记录操作相关联的操作。处理组件602可以包括一个或多个处理器620来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件602可以包括一个或多个模块,便于处理组件602和其他组件之间的交互。The processing component 602 generally controls the overall operations of the whiteboard detection apparatus 600, such as operations associated with display, data communication, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 602 may include one or more modules that facilitate interaction between processing component 602 and other components.

存储器604被配置为存储各种类型的数据以支持在白板检测装置600的操作。这些数据的示例包括用于在白板检测装置600上操作的任何应用程序或方法的指令。存储器604可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 604 is configured to store various types of data to support the operation of the whiteboard inspection device 600 . Examples of such data include instructions for any application or method operating on whiteboard detection device 600 . The memory 604 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电力组件606为白板检测装置600的各种组件提供电力。电力组件606可以包括电源管理系统,一个或多个电源,及其他与为白板检测装置600生成、管理和分配电力相关联的组件。The power component 606 provides power to various components of the whiteboard inspection device 600 . Power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for whiteboard inspection device 600 .

传感器组件608包括一个或多个传感器,用于为白板检测装置600提供各个方面的状态评估。传感器组件608可以包括加速度传感器、压力传感器,被配置用来检测加速度和压力值。Sensor assembly 608 includes one or more sensors for providing various aspects of status assessment for whiteboard detection device 600 . The sensor component 608 may include an acceleration sensor and a pressure sensor configured to detect acceleration and pressure values.

通信组件660被配置为便于白板检测装置600和其他设备之间有线或无线方式的通信。白板检测装置600可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件660经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。The communication component 660 is configured to facilitate wired or wireless communication between the whiteboard detection apparatus 600 and other devices. The whiteboard detection device 600 can access a wireless network based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 660 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.

在示例性实施例中,白板检测装置600可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the whiteboard detection device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field A Programmable Gate Array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器604,上述指令可由白板检测装置600的处理器620执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as the memory 604 including instructions, which can be executed by the processor 620 of the whiteboard detection device 600 to complete the above method. For example, the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

一种非临时性计算机可读存储介质,当存储介质中的指令由白板检测装置的处理器执行时,使得白板检测装置能够执行一种白板检测方法,白板检测方法包括:A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the whiteboard detection device, the whiteboard detection device can execute a whiteboard detection method, the whiteboard detection method includes:

获取待检测的图像;Obtain the image to be detected;

确定图像中直线段的长度,并根据直线段的长度确定图像中的白板区域的边缘。Determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image based on the length of the straight line segment.

关于上述实施例中的白板检测装置,其中处理器执行操作的具体方式已经在有关该白板检测方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the whiteboard detection device in the above embodiments, the specific manner in which the processor executes operations has been described in detail in the embodiment of the whiteboard detection method, and will not be described in detail here.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, and these modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (21)

1.一种白板检测方法,其特征在于,包括以下步骤:1. A whiteboard detection method, is characterized in that, comprises the following steps: 获取待检测的图像;Obtain the image to be detected; 确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。Determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment. 2.如权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising: 获取所述图像中的预设区域;Acquiring a preset area in the image; 基于最小显著差异算法LSD检测所述预设区域中包含的线段;Detecting the line segments contained in the preset area based on the least significant difference algorithm LSD; 对所述预设区域中的所述线段进行聚类,并根据所述预设区域中的线段确定预设区域中的直线段。Clustering the line segments in the preset area, and determining a straight line segment in the preset area according to the line segments in the preset area. 3.如权利要求2所述的方法,其特征在于,所述根据所述预设区域中的线段确定预设区域中的直线段,包括:3. The method according to claim 2, wherein said determining the straight line segment in the preset area according to the line segment in the preset area comprises: 获得所述预设区域中的线段的直线方程;Obtain the straight line equation of the line segment in the preset area; 根据所述直线方程计算每两条所述线段之间的斜率差和每两条所述线段之间的截距差;Calculate the slope difference between every two described line segments and the intercept difference between every two described line segments according to the straight line equation; 当存在至少两条线段之间的所述斜率差小于第一阈值且所述至少两条线段之间的所述截距差小于第二阈值时,对所述至少两条线段进行聚类,生成第一线段;When the slope difference between at least two line segments is less than a first threshold and the intercept difference between the at least two line segments is less than a second threshold, the at least two line segments are clustered to generate first line segment; 将所述第一线段确定为所述直线段。The first line segment is determined as the straight line segment. 4.如权利要求1-3任一项所述的方法,其特征在于,所述根据所述直线段的长度确定所述图像中的白板区域的边缘包括:4. The method according to any one of claims 1-3, wherein the determining the edge of the whiteboard area in the image according to the length of the straight line segment comprises: 当所述直线段的长度大于预设长度时,确定所述直线段为所述白板区域对应的边缘。When the length of the straight line segment is greater than a preset length, it is determined that the straight line segment is an edge corresponding to the whiteboard area. 5.如权利要求1-3任一项所述的方法,其特征在于,所述预设区域包括上区域、下区域、左区域、右区域以及图像本身中的至少一种。5. The method according to any one of claims 1-3, wherein the preset area includes at least one of an upper area, a lower area, a left area, a right area and the image itself. 6.如权利要求4所述的方法,其特征在于,确定所述直线段为所述白板区域对应的边缘,包括:6. The method according to claim 4, wherein determining that the straight line segment is an edge corresponding to the whiteboard area comprises: 当大于预设长度的所述直线段为多个时,确定长度最长的直线段为所述白板区域对应的边缘。When there are multiple straight line segments greater than the preset length, the straight line segment with the longest length is determined as the corresponding edge of the whiteboard area. 7.如权利要求4所述的方法,其特征在于,当大于预设长度的所述直线段为多个时,确定所述白板区域的边缘,包括:7. The method according to claim 4, wherein when there are multiple straight line segments greater than a preset length, determining the edge of the whiteboard area comprises: 当所述预设区域为上区域时,在多个所述直线段的下侧截取相同大小的区域块;When the preset area is the upper area, intercept area blocks of the same size on the lower side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于预设阈值时,确定位于上端的直线段为所述白板区域的上边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the upper end is the upper edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于下端的直线段为所述白板区域的上边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the lower end is the upper edge of the whiteboard area. 8.如权利要求4所述的方法,其特征在于,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:8. The method according to claim 4, wherein when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area comprises: 当所述预设区域为下区域时,在多个所述直线段的上侧截取相同大小的区域块;When the preset area is the lower area, intercept area blocks of the same size on the upper side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于所述预设阈值时,确定位于下端的直线段为所述白板区域的下边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the lower end is the lower edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于上端的直线段为所述白板区域的下边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the upper end is the lower edge of the whiteboard area. 9.如权利要求4所述的方法,其特征在于,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:9. The method according to claim 4, wherein when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area comprises: 当所述预设区域为左区域时,在多个所述直线段的右侧截取相同大小的区域块;When the preset area is the left area, intercept area blocks of the same size on the right side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于所述预设阈值时,确定位于左端的直线段为所述白板区域的左边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the left end is the left edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于右端的直线段为所述白板区域的左边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the right end is the left edge of the whiteboard area. 10.如权利要求4所述的方法,其特征在于,当大于预设长度的所述直线段为多个时,生成所述白板区域对应的边缘,包括:10. The method according to claim 4, wherein when there are multiple straight line segments greater than a preset length, generating the corresponding edge of the whiteboard area comprises: 当所述预设区域为右区域时,在多个所述直线段的左侧截取相同大小的区域块;When the preset area is the right area, intercept area blocks of the same size on the left side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于预设阈值时,确定位于右端的直线段为所述白板区域的右边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the right end is the right edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于左端的直线段为所述白板区域的右边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the left end is the right edge of the whiteboard area. 11.一种白板检测装置,其特征在于,包括:11. A whiteboard detection device, characterized in that it comprises: 第一获取模块,用于获取待检测的图像;The first acquisition module is used to acquire the image to be detected; 第一确定模块,用于确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。The first determination module is configured to determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment. 12.如权利要求11所述的装置,其特征在于,所述装置还包括:12. The device of claim 11, further comprising: 第二获取模块,用于获取所述图像中的预设区域;a second acquiring module, configured to acquire a preset area in the image; 检测模块,用于基于最小显著差异算法LSD检测所述预设区域中包含的线段;A detection module, configured to detect the line segments contained in the preset area based on the least significant difference algorithm LSD; 第二确定模块,用于对所述预设区域中的所述线段进行聚类,并根据所述预设区域中的线段确定预设区域中的直线段。The second determination module is configured to cluster the line segments in the preset area, and determine the straight line segments in the preset area according to the line segments in the preset area. 13.如权利要求12所述的装置,其特征在于,所述第二确定模块,用于:13. The device according to claim 12, wherein the second determination module is configured to: 获得所述预设区域中的线段的直线方程;Obtain the straight line equation of the line segment in the preset area; 根据所述直线方程计算每两条所述线段之间的斜率差和每两条所述线段之间的截距差;Calculate the slope difference between every two described line segments and the intercept difference between every two described line segments according to the straight line equation; 当存在至少两条线段之间的所述斜率差小于第一阈值且所述至少两条线段之间的所述截距差小于第二阈值时,对所述至少两条线段进行聚类,生成第一线段;When the slope difference between at least two line segments is less than a first threshold and the intercept difference between the at least two line segments is less than a second threshold, the at least two line segments are clustered to generate first line segment; 将所述第一线段确定为所述直线段。The first line segment is determined as the straight line segment. 14.如权利要求11-13任一项所述的装置,其特征在于,所述第一确定模块,用于:14. The device according to any one of claims 11-13, wherein the first determining module is configured to: 当所述直线段的长度大于预设长度时,确定所述直线段为所述白板区域对应的边缘。When the length of the straight line segment is greater than a preset length, it is determined that the straight line segment is an edge corresponding to the whiteboard area. 15.如权利要求11-13任一项所述的装置,其特征在于,所述预设区域包括上区域、下区域、左区域、右区域以及图像本身中的至少一种。15. The device according to any one of claims 11-13, wherein the preset area includes at least one of an upper area, a lower area, a left area, a right area, and the image itself. 16.如权利要求14所述的装置,其特征在于,所述第一确定模块,用于:16. The device according to claim 14, wherein the first determining module is configured to: 当大于预设长度的所述直线段为多个时,确定长度最长的直线段为所述白板区域对应的边缘。When there are multiple straight line segments greater than the preset length, the straight line segment with the longest length is determined as the corresponding edge of the whiteboard area. 17.如权利要求14所述的装置,其特征在于,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:17. The device according to claim 14, wherein when there are multiple straight line segments greater than a preset length, the first determination module is configured to: 当所述预设区域为上区域时,在多个所述直线段的下侧截取相同大小的区域块;When the preset area is the upper area, intercept area blocks of the same size on the lower side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于预设阈值时,确定位于上端的直线段为所述白板区域的上边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the upper end is the upper edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于下端的直线段作为所述白板区域的上边缘。When the gray value difference is greater than the preset threshold, the straight line segment at the lower end is determined as the upper edge of the whiteboard area. 18.如权利要求14所述的装置,其特征在于,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:18. The device according to claim 14, wherein when there are multiple straight line segments greater than a preset length, the first determination module is configured to: 当所述预设区域为下区域时,在多个所述直线段的上侧截取相同大小的区域块;When the preset area is the lower area, intercept area blocks of the same size on the upper side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于所述预设阈值时,确定位于下端的直线段为所述白板区域的下边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the lower end is the lower edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于上端的直线段为所述白板区域的下边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the upper end is the lower edge of the whiteboard area. 19.如权利要求14所述的装置,其特征在于,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:19. The device according to claim 14, wherein when there are multiple straight line segments greater than a preset length, the first determination module is configured to: 当所述预设区域为左区域时,在多个所述直线段的右侧截取相同大小的区域块;When the preset area is the left area, intercept area blocks of the same size on the right side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于所述预设阈值时,确定位于左端的直线段为所述白板区域的左边缘;When the gray value difference is less than the preset threshold, determine that the straight line segment at the left end is the left edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于右端的直线段为所述白板区域的左边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the right end is the left edge of the whiteboard area. 20.如权利要求14所述的装置,其特征在于,当大于预设长度的所述直线段为多个时,所述第一确定模块,用于:20. The device according to claim 14, wherein when there are multiple straight line segments greater than a preset length, the first determination module is configured to: 当所述预设区域为右区域时,在多个所述直线段的左侧截取相同大小的区域块;When the preset area is the right area, intercept area blocks of the same size on the left side of the plurality of straight line segments; 计算每两个区域块的灰度值之差;Calculate the difference between the gray value of each two area blocks; 在所述灰度值之差小于预设阈值时,确定位于右端的直线段为所述白板区域的右边缘;When the gray value difference is less than a preset threshold, determine that the straight line segment at the right end is the right edge of the whiteboard area; 在所述灰度值之差大于所述预设阈值时,确定位于左端的直线段为所述白板区域的右边缘。When the gray value difference is greater than the preset threshold, it is determined that the straight line segment at the left end is the right edge of the whiteboard area. 21.一种白板检测装置,其特征在于,包括:21. A whiteboard detection device, characterized in that it comprises: 处理器;processor; 用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions; 其中,所述处理器被配置为:Wherein, the processor is configured as: 获取待检测的图像;Obtain the image to be detected; 确定所述图像中直线段的长度,并根据所述直线段的长度确定所述图像中的白板区域的边缘。Determine the length of the straight line segment in the image, and determine the edge of the whiteboard area in the image according to the length of the straight line segment.
CN201610460991.0A 2016-06-22 2016-06-22 Whiteboard detection method and device Pending CN106127211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610460991.0A CN106127211A (en) 2016-06-22 2016-06-22 Whiteboard detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610460991.0A CN106127211A (en) 2016-06-22 2016-06-22 Whiteboard detection method and device

Publications (1)

Publication Number Publication Date
CN106127211A true CN106127211A (en) 2016-11-16

Family

ID=57267943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610460991.0A Pending CN106127211A (en) 2016-06-22 2016-06-22 Whiteboard detection method and device

Country Status (1)

Country Link
CN (1) CN106127211A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960184A (en) * 2017-03-08 2017-07-18 南昌航空大学 A kind of image position method of books frame
CN107944425A (en) * 2017-12-12 2018-04-20 北京小米移动软件有限公司 The recognition methods of road sign and device
CN109711415A (en) * 2018-11-13 2019-05-03 平安科技(深圳)有限公司 Document profile determination method, device, storage medium, and server
CN110136156A (en) * 2018-02-02 2019-08-16 北京三快在线科技有限公司 A kind of polygonal region detection method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813050A (en) * 2012-11-02 2014-05-21 富士施乐株式会社 Image processing apparatus, and image processing method
CN105117680A (en) * 2015-05-04 2015-12-02 小米科技有限责任公司 Method and device for recognizing information of information card

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813050A (en) * 2012-11-02 2014-05-21 富士施乐株式会社 Image processing apparatus, and image processing method
CN105117680A (en) * 2015-05-04 2015-12-02 小米科技有限责任公司 Method and device for recognizing information of information card

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈镇龙 等: "大幅面扫描图纸直线跟踪的矢量化新方法", 《电子设计工程》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960184A (en) * 2017-03-08 2017-07-18 南昌航空大学 A kind of image position method of books frame
CN106960184B (en) * 2017-03-08 2020-03-31 南昌航空大学 Image positioning method for book frame
CN107944425A (en) * 2017-12-12 2018-04-20 北京小米移动软件有限公司 The recognition methods of road sign and device
CN110136156A (en) * 2018-02-02 2019-08-16 北京三快在线科技有限公司 A kind of polygonal region detection method and device
CN110136156B (en) * 2018-02-02 2020-12-01 北京三快在线科技有限公司 Polygonal area detection method and device
US11308710B2 (en) 2018-02-02 2022-04-19 Beijing Sankuai Online Technology Co., Ltd Polygonal region detection
CN109711415A (en) * 2018-11-13 2019-05-03 平安科技(深圳)有限公司 Document profile determination method, device, storage medium, and server

Similar Documents

Publication Publication Date Title
US11227153B2 (en) Automated systems and methods for identifying fields and regions of interest within a document image
US10074171B1 (en) System and method for automatically measuring the dimensions of and identifying the type of exterior siding
US10127471B2 (en) Method, device, and computer-readable storage medium for area extraction
CN111144400B (en) Identification method, device, terminal equipment and storage medium for ID card information
US11210507B2 (en) Automated systems and methods for identifying fields and regions of interest within a document image
US20180018512A1 (en) Method, apparatus, system, and storage medium for detecting information card in image
WO2021082922A1 (en) Method and device for detecting screen display disconnection
US10694098B2 (en) Apparatus displaying guide for imaging document, storage medium, and information processing method
US9418446B2 (en) Method and apparatus for determining a building location based on a building image
WO2016127736A1 (en) Computing method for area of fingerprint overlapping area and electronic apparatus
WO2017071065A1 (en) Area recognition method and apparatus
CN103488984A (en) Method and device for identifying second-generation identity cards based on intelligent mobile equipment
US11017552B2 (en) Measurement method and apparatus
CN103679129A (en) Method and device for identifying object in image
CN106127211A (en) Whiteboard detection method and device
US9824267B2 (en) Writing board detection and correction
JP2016162420A (en) Attention area detection device, attention area detection method and program
CN107679442A (en) Method, apparatus, computer equipment and the storage medium of document Data Enter
US20130002602A1 (en) Systems And Methods For Touch Screen Image Capture And Display
US9483834B1 (en) Object boundary detection in an image
CN110740315B (en) Camera correction method and device, electronic equipment and storage medium
CN111652144A (en) Item segmentation method, device, equipment and medium based on target region fusion
RU2015102525A (en) PICTURE SEGMENTATION FOR DATA VERIFICATION
CN104424472A (en) An image recognition method and user terminal
JP6311354B2 (en) Information processing apparatus, binarization threshold value determination method, and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161116