CN113705524A - Method and system for detecting vertical line in image - Google Patents

Method and system for detecting vertical line in image Download PDF

Info

Publication number
CN113705524A
CN113705524A CN202111040211.4A CN202111040211A CN113705524A CN 113705524 A CN113705524 A CN 113705524A CN 202111040211 A CN202111040211 A CN 202111040211A CN 113705524 A CN113705524 A CN 113705524A
Authority
CN
China
Prior art keywords
line
straight line
straight
lines
module
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
CN202111040211.4A
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.)
Shanghai Jingwu Intelligent Technology Co Ltd
Original Assignee
Shanghai Jingwu Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jingwu Intelligent Technology Co Ltd filed Critical Shanghai Jingwu Intelligent Technology Co Ltd
Priority to CN202111040211.4A priority Critical patent/CN113705524A/en
Publication of CN113705524A publication Critical patent/CN113705524A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Abstract

The invention provides a method and a system for detecting a vertical line in an image, which comprise the following steps: step S1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction; step S2: clustering the screened straight lines, and removing interference lines in the same category; step S3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation. The method extracts remarkable and complete vertical long lines from the image, screens out the lines with the same input edge from a disordered group of lines, and eliminates the interfered lines.

Description

Method and system for detecting vertical line in image
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a system for detecting a vertical line in an image.
Background
In image processing, it is necessary to detect and identify the content in an image. The line features exist in a large amount in the image, and the detection of the line features plays an important role in understanding and analyzing the image graph. The existing line detection method on the image detects straight lines on the image only according to gray level changes on the image.
Patent document CN105469027B (application No.: 201510621501.6) discloses horizontal and vertical line detection and removal for document images. The vertical and horizontal line detection method for a document image includes: generating a plurality of binary images from the input gray-scale document image based on the plurality of binarization threshold values; independently detecting horizontal and vertical lines in each of the plurality of binary images; and combining detection results from the plurality of binary images. The line detection processing for each binary image includes: applying an on operation using a vertical line or a horizontal line as a structural element; and removing connected components that are not vertical or horizontal lines based on the stroke width analysis. The boundaries of the detected lines are obtained using horizontal and vertical projections.
In the prior art, lines directly detected only according to gray scale information are usually discontinuous, and a large number of interference lines exist.
In view of the above-mentioned drawbacks of the prior art, the technical problems to be solved by the present invention are as follows: because the edge gray scale change of an object is not always obvious in an image, lines detected by a line detection algorithm in a traditional image are usually discontinuous; the lines detected by the line detection in the traditional image do not classify the edge lines belonging to the same object; the general line classification method has low accuracy and interference lines appear in the classification.
According to the invention, after the line features are preliminarily detected, the line features are screened out according to the vertical characteristics, and are aggregated, interfered and connected. In image detection, the method can be widely applied to edge detection of objects such as door frames, windows and the like.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and a system for detecting a vertical line in an image.
The invention provides a method for detecting a vertical line in an image, which comprises the following steps:
step S1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
step S2: clustering the screened straight lines, and removing interference lines in the same category;
step S3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
Preferably, the step S1 adopts:
step S1.1: detecting straight line characteristics in the image by using a FastLineDetector function in opencv;
step S1.2: and screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value or not.
Preferably, the step S2 adopts:
step S2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type;
step S2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
step S2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
step S2.4: and judging whether the adjacent lines in the line queue meet the interference condition, and if so, rejecting the current line from the queue.
Preferably, said step S2.1 employs:
step S2.1.1: screening out a straight line A and a straight line B, and triggering S2.1.2 when the included angle between the straight line A and the straight line B is smaller than a preset value; otherwise, finishing the clustering of the straight line A and the straight line B;
step S2.1.2: comparing the lengths of the straight line A and the straight line B, and triggering S2.1.3 when the length of the line A is greater than that of the line B; otherwise, triggering step S2.1.4;
step S2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
step S2.1.4: and calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, calculating the distance between the middle point of the straight line A and the projection point, and if the distance is smaller than a preset value, clustering the straight line A and the straight line B into one class, otherwise, finishing the clustering of the straight line A and the straight line B.
Preferably, the interference condition employs: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, and when the proportion of the Length 2/the Length1 is larger than a preset value, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the execution until the interference judgment of the current line queue is finished.
Preferably, the step S3 adopts:
step S3.1: accumulating all the line lengths in each category, and screening out the line categories with the accumulated sum being more than or equal to a preset value;
step S3.2: and fitting the screened line types into a linear equation by using a least square method.
Preferably, said step S3.2 employs:
step S3.2.1: sampling step length is step, sampling points of each line in the same category according to the sampling step length, and sampling the starting point and the end point of each line by default to obtain a point set of all sampling points;
step S3.2.2: fitting to a linear equation using a least squares method based on the set of points.
The invention provides a system for detecting a vertical line in an image, which comprises:
module M1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
module M2: clustering the screened straight lines, and removing interference lines in the same category;
module M3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
Preferably, the module M1 employs:
module M1.1: detecting straight line characteristics in the image by using a FastLineDetector function in opencv;
module M1.2: screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value or not;
the module M2 employs:
module M2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type;
module M2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
module M2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
module M2.4: judging whether adjacent lines in the line queue meet interference conditions or not, and if so, rejecting the current line from the queue;
the module M2.1 employs:
module M2.1.1: screening out a straight line A and a straight line B, and triggering a module M2.1.2 when the included angle between the straight line A and the straight line B is smaller than a preset value; otherwise, finishing the clustering of the straight line A and the straight line B;
module M2.1.2: comparing the lengths of the straight line a and the straight line B, and triggering M2.1.3 when the length of the line a is greater than the length of the line B; otherwise trigger block M2.1.4;
module M2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
module M2.1.4: calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, calculating the distance between the middle point of the straight line A and the projection point, when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
the interference condition is as follows: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, and when the proportion of the Length 2/the Length1 is larger than a preset value, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the execution until the interference judgment of the current line queue is finished.
Preferably, the module M3 employs:
module M3.1: accumulating all the line lengths in each category, and screening out the line categories with the accumulated sum being more than or equal to a preset value;
module M3.2: fitting the screened line categories into a linear equation by using a least square method;
the module M3.2 employs:
module M3.2.1: sampling step length is step, sampling points of each line in the same category according to the sampling step length, and sampling the starting point and the end point of each line by default to obtain a point set of all sampling points;
module M3.2.2: fitting to a linear equation using a least squares method based on the set of points.
Compared with the prior art, the invention has the following beneficial effects: in visual localization in indoor environments, line detection is very significant. A large number of man-made objects have obvious line features on the image, and objects such as door frames, table tops, cabinets, bookshelves and the like are arranged at the edges of the image and all appear as line features on the image. Meanwhile, due to environmental interference, such as the texture of the wall surface, the transformation of the relationship and the like, the features of the lines can also be presented, but the lines do not need to be detected usually. Meanwhile, due to the change of shielding and light, the originally complete edge lines show intermittent lines on the image. The algorithm has the advantages that remarkable complete vertical long lines are extracted from the image, lines with the same input edge are screened out from a disordered group of lines, and interference lines are removed.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart of the vertical line detection algorithm.
FIG. 2 is a graph of linear feature detection.
FIG. 3 is a line clustering and screening graph.
FIG. 4 is a line class fit straight line.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Example 1
According to the method for detecting the vertical line in the image, as shown in fig. 1, the method comprises the following steps:
step S1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
step S2: clustering the screened straight lines, and removing interference lines in the same category;
step S3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
Specifically, the step S1 employs:
step S1.1: detecting straight line features in the image by using a FastLineDetector function in opencv, as shown in FIG. 2;
step S1.2: screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value, for example: and setting the angle position to be 15 degrees, and screening out the lines with the included angle within 15 degrees with the vertical direction.
Specifically, the step S2 employs:
step S2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type; for example: the line a and the line B are of the same type, and the line B and the line C are of the same type, then the lines a, B, C are of the same type.
Step S2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
step S2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
step S2.4: and judging whether the adjacent lines in the line queue meet the interference condition, and if so, removing the current line from the queue, wherein the screened line types are shown in fig. 3.
Specifically, the step S2.1 employs:
setting an Angle threshold value as 5 degrees, setting a distance Dist as 3 pixels, and judging whether two line segments A and B are gathered into one type:
step S2.1.1: screening out a straight line A and a straight line B, and triggering S2.1.2 when the included Angle between the straight line A and the straight line B is smaller than Angle; otherwise, finishing the clustering of the straight line A and the straight line B;
step S2.1.2: comparing the lengths of the straight line A and the straight line B, and triggering S2.1.3 when the length of the line A is greater than that of the line B; otherwise, triggering step S2.1.4;
step S2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is less than Dist, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
step S2.1.4: and calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, and calculating the distance between the middle point of the straight line A and the projection point, wherein when the distance is less than Dist, the straight line A and the straight line B are gathered into one type, and otherwise, the clustering of the straight line A and the straight line B is finished.
Specifically, the interference condition employs: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, setting the Raito to be 0.4, and when the Length 2/the Length1 is greater than the Raito, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the operation until the interference judgment of the current line queue is finished.
Specifically, the step S3 employs:
step S3.1: and setting the minimum satisfied length of the line type as LL, accumulating all the line lengths in each type, and screening the line type if the accumulated sum is greater than LL.
Step S3.2: and fitting the screened line types into a linear equation by using a least square method.
Specifically, the step S3.2 employs:
step S3.2.1: and setting the sampling step length as step, and sampling all lines in the same category. The starting point and the end point of each line are sampled by default, and each line is sampled according to step. Finally, all sampling points of the lines of the same category form a set of points.
Step S3.2.2: fitting to a straight line equation using a least squares method based on a set of points is shown in fig. 4.
The invention provides a system for detecting a vertical line in an image, which comprises:
module M1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
module M2: clustering the screened straight lines, and removing interference lines in the same category;
module M3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
Specifically, the module M1 employs:
module M1.1: detecting straight line features in the image by using a FastLineDetector function in opencv, as shown in FIG. 2;
module M1.2: screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value, for example: and setting the angle position to be 15 degrees, and screening out the lines with the included angle within 15 degrees with the vertical direction.
Specifically, the module M2 employs:
module M2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type; for example: the line a and the line B are of the same type, and the line B and the line C are of the same type, then the lines a, B, C are of the same type.
Module M2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
module M2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
module M2.4: and judging whether the adjacent lines in the line queue meet the interference condition, and if so, removing the current line from the queue, wherein the screened line types are shown in fig. 3.
In particular, the module M2.1 employs:
setting an Angle threshold value as 5 degrees, setting a distance Dist as 3 pixels, and judging whether two line segments A and B are gathered into one type:
module M2.1.1: screening out a straight line A and a straight line B, and triggering a module M2.1.2 when the included Angle between the straight line A and the straight line B is smaller than Angle; otherwise, finishing the clustering of the straight line A and the straight line B;
module M2.1.2: comparing the lengths of the straight line a and the straight line B, and triggering M2.1.3 when the length of the line a is greater than the length of the line B; otherwise trigger block M2.1.4;
module M2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is less than Dist, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
module M2.1.4: and calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, and calculating the distance between the middle point of the straight line A and the projection point, wherein when the distance is less than Dist, the straight line A and the straight line B are gathered into one type, and otherwise, the clustering of the straight line A and the straight line B is finished.
Specifically, the interference condition employs: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, setting the Raito to be 0.4, and when the Length 2/the Length1 is greater than the Raito, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the operation until the interference judgment of the current line queue is finished.
Specifically, the module M3 employs:
module M3.1: and setting the minimum satisfied length of the line type as LL, accumulating all the line lengths in each type, and screening the line type if the accumulated sum is greater than LL.
Module M3.2: and fitting the screened line types into a linear equation by using a least square method.
In particular, the module M3.2 employs:
module M3.2.1: and setting the sampling step length as step, and sampling all lines in the same category. The starting point and the end point of each line are sampled by default, and each line is sampled according to step. Finally, all sampling points of the lines of the same category form a set of points.
Module M3.2.2: fitting to a straight line equation using a least squares method based on a set of points is shown in fig. 4.
Those skilled in the art will appreciate that, in addition to implementing the systems, apparatus, and various modules thereof provided by the present invention in purely computer readable program code, the same procedures can be implemented entirely by logically programming method steps such that the systems, apparatus, and various modules thereof are provided in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system, the device and the modules thereof provided by the present invention can be considered as a hardware component, and the modules included in the system, the device and the modules thereof for implementing various programs can also be considered as structures in the hardware component; modules for performing various functions may also be considered to be both software programs for performing the methods and structures within hardware components.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (10)

1. A method for detecting a vertical line in an image is characterized by comprising the following steps:
step S1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
step S2: clustering the screened straight lines, and removing interference lines in the same category;
step S3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
2. The method for detecting vertical lines in images according to claim 1, wherein said step S1 employs:
step S1.1: detecting straight line characteristics in the image by using a FastLineDetector function in opencv;
step S1.2: and screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value or not.
3. The method for detecting vertical lines in images according to claim 1, wherein said step S2 employs:
step S2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type;
step S2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
step S2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
step S2.4: and judging whether the adjacent lines in the line queue meet the interference condition, and if so, rejecting the current line from the queue.
4. The method for detecting vertical lines in images according to claim 3, wherein the step S2.1 adopts:
step S2.1.1: screening out a straight line A and a straight line B, and triggering S2.1.2 when the included angle between the straight line A and the straight line B is smaller than a preset value; otherwise, finishing the clustering of the straight line A and the straight line B;
step S2.1.2: comparing the lengths of the straight line A and the straight line B, and triggering S2.1.3 when the length of the line A is greater than that of the line B; otherwise, triggering step S2.1.4;
step S2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
step S2.1.4: and calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, calculating the distance between the middle point of the straight line A and the projection point, and if the distance is smaller than a preset value, clustering the straight line A and the straight line B into one class, otherwise, finishing the clustering of the straight line A and the straight line B.
5. The method according to claim 3, wherein the disturbance condition is: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, and when the proportion of the Length 2/the Length1 is larger than a preset value, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the execution until the interference judgment of the current line queue is finished.
6. The method for detecting vertical lines in images according to claim 1, wherein said step S3 employs:
step S3.1: accumulating all the line lengths in each category, and screening out the line categories with the accumulated sum being more than or equal to a preset value;
step S3.2: and fitting the screened line types into a linear equation by using a least square method.
7. The method for detecting vertical lines in images according to claim 6, wherein the step S3.2 adopts:
step S3.2.1: sampling step length is step, sampling points of each line in the same category according to the sampling step length, and sampling the starting point and the end point of each line by default to obtain a point set of all sampling points;
step S3.2.2: fitting to a linear equation using a least squares method based on the set of points.
8. A system for detecting a vertical line in an image, comprising:
module M1: detecting linear characteristics in the image, and screening the linear according to an included angle between the line and the vertical direction;
module M2: clustering the screened straight lines, and removing interference lines in the same category;
module M3: and selecting the line types meeting the preset length, and fitting the line types meeting the preset length into a linear equation.
9. The system for detecting vertical lines in images according to claim 8, wherein said module M1 employs:
module M1.1: detecting straight line characteristics in the image by using a FastLineDetector function in opencv;
module M1.2: screening straight lines according to whether the included angle between the line and the vertical direction is smaller than a preset value or not;
the module M2 employs:
module M2.1: comparing every two screened straight lines, and when a preset condition is met, gathering the two straight lines into one type;
module M2.2: when any two types of straight lines have the same straight line, performing union processing on the two types of straight lines;
module M2.3: sequencing all lines in each category from large to small to obtain a line queue with the length arranged from large to small;
module M2.4: judging whether adjacent lines in the line queue meet interference conditions or not, and if so, rejecting the current line from the queue;
the module M2.1 employs:
module M2.1.1: screening out a straight line A and a straight line B, and triggering a module M2.1.2 when the included angle between the straight line A and the straight line B is smaller than a preset value; otherwise, finishing the clustering of the straight line A and the straight line B;
module M2.1.2: comparing the lengths of the straight line a and the straight line B, and triggering M2.1.3 when the length of the line a is greater than the length of the line B; otherwise trigger block M2.1.4;
module M2.1.3: calculating the middle point of the straight line B, calculating the projection point of the middle point of the straight line B on the straight line A, and calculating the distance between the middle point of the straight line B and the projection point, wherein when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
module M2.1.4: calculating the middle point of the straight line A, calculating the projection point of the middle point of the straight line A on the straight line B, calculating the distance between the middle point of the straight line A and the projection point, when the distance is smaller than a preset value, the straight line A and the straight line B are gathered into one type, otherwise, the clustering of the straight line A and the straight line B is finished;
the interference condition is as follows: judging whether a line exists in front of the line L in the line queue, and if not, finishing the current interference judgment; if yes, taking the current line as A; projecting the line L onto the line A to obtain a projection line proL, and calculating the Length of the projection line proL to be Length 1; calculating the Length2 of the overlapping part of the projection line proL and the line A; and calculating the proportion of the Length 2/the Length1, and when the proportion of the Length 2/the Length1 is larger than a preset value, taking the line L as an interference line segment, removing the line L from the line queue, and repeating the execution until the interference judgment of the current line queue is finished.
10. The system for detecting vertical lines in images according to claim 8, wherein said module M3 employs:
module M3.1: accumulating all the line lengths in each category, and screening out the line categories with the accumulated sum being more than or equal to a preset value;
module M3.2: fitting the screened line categories into a linear equation by using a least square method;
the module M3.2 employs:
module M3.2.1: sampling step length is step, sampling points of each line in the same category according to the sampling step length, and sampling the starting point and the end point of each line by default to obtain a point set of all sampling points;
module M3.2.2: fitting to a linear equation using a least squares method based on the set of points.
CN202111040211.4A 2021-09-06 2021-09-06 Method and system for detecting vertical line in image Pending CN113705524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111040211.4A CN113705524A (en) 2021-09-06 2021-09-06 Method and system for detecting vertical line in image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111040211.4A CN113705524A (en) 2021-09-06 2021-09-06 Method and system for detecting vertical line in image

Publications (1)

Publication Number Publication Date
CN113705524A true CN113705524A (en) 2021-11-26

Family

ID=78660630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111040211.4A Pending CN113705524A (en) 2021-09-06 2021-09-06 Method and system for detecting vertical line in image

Country Status (1)

Country Link
CN (1) CN113705524A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115330826A (en) * 2022-08-11 2022-11-11 创新奇智(青岛)科技有限公司 Straight line detection method and device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110274353A1 (en) * 2010-05-07 2011-11-10 Hailong Yu Screen area detection method and screen area detection system
US20160092417A1 (en) * 2014-09-30 2016-03-31 Konica Minolta Laboratory U.S.A., Inc. Horizontal and vertical line detection and removal for document images
CN107463939A (en) * 2017-06-27 2017-12-12 浙江工业大学 A kind of image key line detection method
CN110189344A (en) * 2019-04-24 2019-08-30 河海大学常州校区 A kind of line segment extraction method in power knife switch image
CN111583098A (en) * 2020-02-21 2020-08-25 东南大学 Line segment clustering and fitting method and system based on sequence image
CN111597904A (en) * 2020-04-17 2020-08-28 许继集团有限公司 Identification method for inclination of tunnel cable support
CN111985436A (en) * 2020-08-29 2020-11-24 浙江工业大学 Workshop ground mark line identification fitting method based on LSD

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110274353A1 (en) * 2010-05-07 2011-11-10 Hailong Yu Screen area detection method and screen area detection system
US20160092417A1 (en) * 2014-09-30 2016-03-31 Konica Minolta Laboratory U.S.A., Inc. Horizontal and vertical line detection and removal for document images
CN107463939A (en) * 2017-06-27 2017-12-12 浙江工业大学 A kind of image key line detection method
CN110189344A (en) * 2019-04-24 2019-08-30 河海大学常州校区 A kind of line segment extraction method in power knife switch image
CN111583098A (en) * 2020-02-21 2020-08-25 东南大学 Line segment clustering and fitting method and system based on sequence image
CN111597904A (en) * 2020-04-17 2020-08-28 许继集团有限公司 Identification method for inclination of tunnel cable support
CN111985436A (en) * 2020-08-29 2020-11-24 浙江工业大学 Workshop ground mark line identification fitting method based on LSD

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
柳有权;苏仙鹤;: "线段的三步快速聚类算法", 电子测试, no. 11, pages 62 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115330826A (en) * 2022-08-11 2022-11-11 创新奇智(青岛)科技有限公司 Straight line detection method and device, electronic equipment and computer readable storage medium
CN115330826B (en) * 2022-08-11 2024-02-20 创新奇智(青岛)科技有限公司 Linear detection method, linear detection device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN107527009B (en) Remnant detection method based on YOLO target detection
US8019122B2 (en) Vehicle side image recognition method and apparatus
CN109446917B (en) Vanishing point detection method based on cascading Hough transform
CN104933710A (en) Intelligent analysis method of store people stream track on the basis of surveillance video
CN112052744B (en) Environment detection model training method, environment detection method and environment detection device
CN110298323B (en) Frame-fighting detection method, system and device based on video analysis
CN103258201A (en) Form line extraction method integrating global information and local information
CN103870824A (en) Method and device for capturing face in face detecting and tracking process
WO2023273011A1 (en) Method, apparatus and device for detecting object thrown from height, and computer storage medium
CN115311507B (en) Building board classification method based on data processing
CN116402863B (en) Intelligent analysis and early warning system for building construction monitoring data
CN113705524A (en) Method and system for detecting vertical line in image
CN103945089A (en) Dynamic target detection method based on brightness flicker correction and IP camera
CN101751669B (en) Static object detection method and device
CN111027370A (en) Multi-target tracking and behavior analysis detection method
CN113888446A (en) Intelligent detection method for bending line of sheet metal structural part
CN111488808A (en) Lane line detection method based on traffic violation image data
CN101625722B (en) Classification method of carrier recognition image
Furuya et al. Road intersection monitoring from video with large perspective deformation
CN106530273B (en) High-precision FPC (Flexible printed Circuit) linear line detection and defect positioning method
CN117079219B (en) Vehicle running condition monitoring method and device applied to trailer service
CN107832732B (en) Lane line detection method based on treble traversal
CN107729811B (en) Night flame detection method based on scene modeling
CN109978903A (en) A kind of identification point recognition methods, device, electronic equipment and storage medium
CN115661475A (en) Image foreign matter identification method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 311231 building 3, No. 477, Hongxing Road, Qiaonan block, economic and Technological Development Zone, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Jingwu Intelligent Technology Co.,Ltd.

Address before: Room 12, 3rd floor, No.2 Lane 1446, Yunguan Road, Lingang New District, Pudong New Area pilot Free Trade Zone, Shanghai, 201306

Applicant before: Shanghai Jingwu Intelligent Technology Co.,Ltd.