CN106971400B - Method and device for repairing image dividing line - Google Patents

Method and device for repairing image dividing line Download PDF

Info

Publication number
CN106971400B
CN106971400B CN201710149441.1A CN201710149441A CN106971400B CN 106971400 B CN106971400 B CN 106971400B CN 201710149441 A CN201710149441 A CN 201710149441A CN 106971400 B CN106971400 B CN 106971400B
Authority
CN
China
Prior art keywords
dividing
segmentation
line
segment
repairing
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.)
Active
Application number
CN201710149441.1A
Other languages
Chinese (zh)
Other versions
CN106971400A (en
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.)
Luoyang Institute of Electro Optical Equipment AVIC
Original Assignee
Luoyang Institute of Electro Optical Equipment AVIC
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 Luoyang Institute of Electro Optical Equipment AVIC filed Critical Luoyang Institute of Electro Optical Equipment AVIC
Priority to CN201710149441.1A priority Critical patent/CN106971400B/en
Publication of CN106971400A publication Critical patent/CN106971400A/en
Application granted granted Critical
Publication of CN106971400B publication Critical patent/CN106971400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a method and a device for repairing an image dividing line. Dividing lines obtained by dividing the image are composed of discrete dividing points, and the dividing points are connected to form at least one dividing line segment through continuity analysis; setting a length threshold value or a length threshold value range according to the distance of the segmentation line, and regarding the segmentation line segment above the length threshold value or the length threshold value range as an effective segmentation line segment, and regarding the segmentation line segment below the length threshold value or the length threshold value range as an ineffective segmentation line segment; then, the effective segmentation line segments are reserved, and the break points between the effective segmentation line segments are repaired. The invention repairs the discontinuous area of the dividing line on the basis of keeping the correct dividing line of the image, overcomes the defects of the algorithm in the prior art, is simple and easy to realize, and improves the accuracy of repairing the dividing line.

Description

Method and device for repairing image dividing line
Technical Field
The invention relates to a method and a device for repairing an image segmentation line, belonging to the technical field of digital image segmentation.
Background
Image segmentation is a technique and process that divides an image into several specific regions with unique properties and proposes an object of interest. The classic algorithm for natural scene image segmentation comprises the following steps: boundary-based segmentation, feature-based Mean-shift method, energy function optimization-based segmentation, graph theory-based segmentation method, and the like. These algorithmic studies have made considerable progress in recent years and have found application in many areas.
The segmentation result of the scene image according to the above segmentation method is usually some discrete segmentation points, and the segmentation lines formed after the connection by some continuity analysis methods may have discontinuity and errors, which requires some post-segmentation processing algorithms to repair and correct the existing segmentation lines. Common methods include low-pass filtering, function fitting, least squares, etc., but these methods have their own limitations. The low-pass filtering method can only repair or correct a few points, the function fitting method needs to estimate a mathematical function of edge fitting, and the least square fitting method usually modifies the original accurately detected dividing line and cannot well solve the processing problem after the division.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides a method for repairing an image dividing line, solves the problem that the accuracy of repairing the dividing line is influenced due to the fact that an error dividing line segment is generated when discrete dividing points are connected, and also provides a device for repairing the image dividing line.
The invention is realized by the following scheme:
1. a method for repairing an image dividing line comprises the following steps:
step 1, dividing lines obtained by dividing an image are composed of discrete dividing points, and the dividing points are connected to form at least one dividing line segment through continuity analysis;
step 2, setting a length threshold value or a length threshold value range according to the distance of the segmentation line, and judging the validity of the segmentation line segment; segment segments above a length threshold or a length threshold range are regarded as valid segment segments, and segment segments below the length threshold or the length threshold range are regarded as invalid segment segments;
and 3, reserving the effective segmentation line segments, and repairing the break points among the effective segmentation line segments.
Further, in step 1, a distance-based method is adopted to judge the continuity between the segmentation points for analysis.
Further, in step 2, a length threshold or a length threshold range is determined by adopting a line segment length-based method or a line segment weighted length method.
Further, in step 2, for the segment between the length threshold ranges, the validity of the segment between the length threshold ranges is determined according to the valid ranges determined by the adjacent valid segments.
Further, the method for repairing the discontinuity point between the effective segment lines in step 3 is as follows: setting a boundary repair area range of adjacent effective line segments, searching a path of a maximum gradient value between break points of the adjacent effective line segments in the repair area range, and repairing the path; or repairing the break points between the segmentation line segments by adopting a linear interpolation method and a polynomial fitting method.
2. The device for repairing the image dividing line comprises a dividing point connecting module, an effective dividing line segment extracting module and a dividing line segment repairing module, and specifically comprises the following components:
1) a dividing point connecting module: dividing lines obtained by dividing the image are composed of discrete dividing points, and the dividing points are connected to form at least one dividing line segment through continuity analysis;
2) an effective segmentation line segment extracting module, which sets a length threshold value or a length threshold value range according to the distance of the segmentation line and is used for judging the effectiveness of the segmentation line segment; segment segments above a length threshold or a length threshold range are regarded as valid segment segments, and segment segments below the length threshold or the length threshold range are regarded as invalid segment segments;
3) and the segmented line repairing module is used for reserving the effective segmented line segments and repairing the discontinuous points among the effective segmented line segments.
Furthermore, the segmentation point connection module judges the continuity between the segmentation points by adopting a distance-based method for analysis.
Furthermore, a length threshold or a length threshold range is determined by adopting a line segment length-based method or a line segment weighted length method in the effective segmentation line segment extracting module.
Further, for the segment between the length threshold ranges in the effective segment extracting module, the validity of the segment between the length threshold ranges is judged according to the effective range determined by the adjacent effective segment.
Further, the method for repairing the break points between the effective segmentation line segments in the segmentation line segment repairing module is as follows: setting a boundary repair area range of adjacent effective line segments, searching a path of a maximum gradient value between break points of the adjacent effective line segments in the repair area range, and repairing the path; or repairing the break points between the segmentation line segments by adopting a linear interpolation method and a polynomial fitting method.
Compared with the prior art, the invention has the beneficial effects that:
the invention has proposed a method for mending the image cut line and its apparatus, through carrying on the continuity analysis to the discrete cut point that the image is formed because of cutting apart, make it form several cut line segments, and presume the threshold range of length to judge the significance of the cut line segment, keep its effective cut line segment; and then repairing the break points between the effective segmentation line segments. The invention eliminates the wrong part in the segmentation line segment formed by reconnection, and avoids misleading caused by repairing the segmentation line. The method repairs the discontinuous region of the dividing line on the basis of keeping the correct dividing line of the image, overcomes the defects of the algorithm in the prior art, is simple and easy to realize, and improves the accuracy of repairing the dividing line.
Drawings
FIG. 1 is an overall flow diagram of an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a segmentation line validity determination based on high and low thresholds;
FIG. 3 is a flowchart illustrating an embodiment of breakpoint repair for image partition lines;
fig. 4 is a schematic diagram illustrating a repairing principle of a break point of a segmentation line segment according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
A method for repairing image dividing line includes the following steps: analyzing continuity of the segmentation lines, judging effectiveness of the segmentation line segments and repairing break points among the segmentation line segments; the following is a detailed description of the steps of the method in sequence:
1. analyzing continuity of the dividing line;
the scene image obtained by the segmentation algorithm is usually composed of a series of discrete segmentation points, so that continuity analysis needs to be performed on the discrete points, that is, the segmentation points are connected to form a plurality of segmentation line segments. The segmentation points in the scene segmentation process are typically unidirectional, i.e. all segmentation points have and only one y value for the image coordinate x or have and only one x value for the image coordinate y. In this embodiment, taking the example that the division points have one y value and only one coordinate x, the distance between the division points is used to determine the continuity between the division points. And using the set of continuous points as a segmentation line segment, and storing the set of continuous points by using C language, vector, stack or a self-defined structure.
The method specifically comprises the steps of presetting a y-direction continuity threshold value, traversing all the segmentation points, and connecting the segmentation points of which the y-coordinate distance between the segmentation points is smaller than the continuity threshold value into a segmentation line segment. Wherein the continuity threshold is selected as an empirical value.
2. Segment segmentation validity judgment
The segmentation line segments formed by the method can be divided into two types of effective segmentation lines and ineffective segmentation lines according to the length; the effective segmentation line is the segmentation result of the scene image that needs to be preserved, and the ineffective segmentation line should be removed as noise. The specific judgment method is as follows:
as shown in fig. 2, the method based on the segment length sets a length threshold or threshold range. Then, the lengths of the obtained segmentation line segments are respectively counted. Then, a segment having a segment length equal to or larger than a threshold value or a threshold value range is defined as an effective segment, a segment length equal to or smaller than a threshold value or a threshold value range is defined as an ineffective segment, and a segment between the threshold value ranges can be defined as an undetermined segment. In this embodiment, the validity of the to-be-determined segment is determined by using a method of adjacent effective segments, that is, the effective range of the to-be-determined segment and the adjacent effective segment in the y direction of the boundary is calculated, where the effective range is the maximum value and the minimum value of all the segmentation points constituting the effective segment in the y direction. And calculating the average value of all the segmentation points forming the segment to be segmented in the y direction, and judging the segment to be segmented as an effective segmentation segment when the average value is in an effective range, otherwise, judging the segment to be segmented as an ineffective segmentation segment. The threshold or the threshold range is selected as an empirical value, in this embodiment, the threshold range is selected as a low threshold of image width/50, and the high threshold is selected as a low threshold of 3 times.
As another embodiment, the threshold range or threshold may be set by a method of weighting lengths of line segments.
3. Repair of segmentation line segment discontinuities
And removing the selected invalid segmentation line segments, and repairing the break points (or lines) between the adjacent effective line segments. In this embodiment, a class graph cut method is selected for repairing, as shown in fig. 3. First, the area of the boundary repair region of adjacent effective line segments is calculated, and the area in this embodiment is a rectangle. Then, a gradient image of the original scene image is calculated in the region, and in the embodiment, a Sobel operator is selected to calculate the image gradient. The segmentation line break point repairing problem is converted into a maximum flow problem in graph theory, as shown in fig. 4, the graph is illustrated as a 4 × 5 region to be repaired, wherein each dot T represents a pixel point, a shaded round point S represents two end points of two adjacent effective segmentation line segments, and the connection mode and the weight between the pixels are represented by a line segment R. The algorithm aims to find a feasible flow which connects two end points S and has the maximum weight, and pixel points contained in the path are repair points needed by the segmentation of line segments. In this embodiment, the weight R is a gradient value of pixels at the beginning or end of a line segment. The existing methods for solving the maximum flow problem include a Goldberg-Tarja method, a Ford-Fulkerson method and the like. As other embodiments, the Prewitt, Roberts operator calculation may be used in calculating the image gradient as well.
The method for repairing break points between segments of the partition line selected in this embodiment is a graph-like cutting method, and this method is only a preferred embodiment. In other embodiments, the repair point may be repaired by a polynomial fitting method or a linear interpolation method.
In the thought given by the present invention, the technical means in the above embodiments are changed, replaced, modified in a manner that is easily imaginable to those skilled in the art, and the functions are basically the same as the corresponding technical means in the present invention, and the purpose of the invention is basically the same, so that the technical scheme formed by fine tuning the above embodiments still falls into the protection scope of the present invention.

Claims (8)

1. A method for repairing an image dividing line is characterized by comprising the following steps:
step 1, dividing lines obtained by dividing an image are composed of discrete dividing points, and the dividing points are connected to form at least one dividing line segment through continuity analysis;
step 2, setting a length threshold value or a length threshold value range according to the distance of the segmentation line, and judging the validity of the segmentation line segment; segment segments above a length threshold or a length threshold range are regarded as valid segment segments, and segment segments below the length threshold or the length threshold range are regarded as invalid segment segments;
in step 2, for the segmentation line segments between the length threshold value ranges, judging the validity of the segmentation line segments between the length threshold value ranges according to the valid ranges determined by the adjacent valid segmentation line segments;
and 3, reserving the effective segmentation line segments, and repairing the break points among the effective segmentation line segments.
2. The method as claimed in claim 1, wherein the step 1 is performed by analyzing the continuity between the segmentation points by using a distance-based method.
3. The method for repairing image dividing line as claimed in claim 1, wherein the length threshold or the range of the length threshold is determined in step 2 by a method based on the length of the line segment or a method of weighting the length of the line segment.
4. The method for repairing image dividing lines according to claim 1, wherein the step 3 of repairing the discontinuities between the effective dividing line segments is as follows: setting a boundary repair area range of adjacent effective line segments, searching a path of a maximum gradient value between break points of the adjacent effective line segments in the repair area range, and repairing the path; or repairing the break points between the segmentation line segments by adopting a linear interpolation method and a polynomial fitting method.
5. The device for repairing the image dividing line is characterized by comprising a dividing point connecting module, an effective dividing line segment extracting module and a dividing line segment repairing module, and comprises the following specific components:
1) a dividing point connecting module: dividing lines obtained by dividing the image are composed of discrete dividing points, and the dividing points are connected to form at least one dividing line segment through continuity analysis;
2) an effective segmentation line segment extracting module, which sets a length threshold value or a length threshold value range according to the distance of the segmentation line and is used for judging the effectiveness of the segmentation line segment; segment segments above a length threshold or a length threshold range are regarded as valid segment segments, and segment segments below the length threshold or the length threshold range are regarded as invalid segment segments;
extracting the segmentation line segments between the length threshold value ranges in the effective segmentation line segment module, and judging the effectiveness of the segmentation line segments between the length threshold value ranges according to the effective ranges determined by the adjacent effective segmentation line segments;
3) and the segmented line repairing module is used for reserving the effective segmented line segments and repairing the discontinuous points among the effective segmented line segments.
6. The apparatus for repairing image dividing line as claimed in claim 5, wherein the dividing point connecting module determines continuity between the dividing points by using a distance-based method for analysis.
7. The apparatus for repairing image segmentation line as claimed in claim 5, wherein the module for extracting valid segmentation line determines the length threshold or the range of the length threshold by a method based on the length of the line segment or a method for weighting the length of the line segment.
8. The apparatus for repairing image segmentation lines according to claim 5, wherein the means for repairing segmentation line segments is configured to repair discontinuities between valid segmentation line segments by: setting a boundary repair area range of adjacent effective line segments, searching a path of a maximum gradient value between break points of the adjacent effective line segments in the repair area range, and repairing the path; or repairing the break points between the segmentation line segments by adopting a linear interpolation method and a polynomial fitting method.
CN201710149441.1A 2017-03-10 2017-03-10 Method and device for repairing image dividing line Active CN106971400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710149441.1A CN106971400B (en) 2017-03-10 2017-03-10 Method and device for repairing image dividing line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710149441.1A CN106971400B (en) 2017-03-10 2017-03-10 Method and device for repairing image dividing line

Publications (2)

Publication Number Publication Date
CN106971400A CN106971400A (en) 2017-07-21
CN106971400B true CN106971400B (en) 2020-11-10

Family

ID=59329317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710149441.1A Active CN106971400B (en) 2017-03-10 2017-03-10 Method and device for repairing image dividing line

Country Status (1)

Country Link
CN (1) CN106971400B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001076154A (en) * 1999-08-23 2001-03-23 Xerox Corp Method for segmenting digital image and digital image processor
WO2006005728A2 (en) * 2004-07-10 2006-01-19 Evotec Technologies Gmbh Method for detecting geometrical structures in images
CN102938066A (en) * 2012-12-07 2013-02-20 南京大学 Method for reconstructing outer outline polygon of building based on multivariate data
CN104021574A (en) * 2014-07-04 2014-09-03 武汉武大卓越科技有限责任公司 Method for automatically identifying pavement diseases
CN104751178A (en) * 2015-03-31 2015-07-01 上海理工大学 Pulmonary nodule detection device and method based on shape template matching and combining classifier
CN104933709A (en) * 2015-06-04 2015-09-23 西安理工大学 Automatic random-walk CT lung parenchyma image segmentation method based on prior information
CN105930800A (en) * 2016-04-21 2016-09-07 北京智芯原动科技有限公司 Lane line detection method and device
CN106373168A (en) * 2016-11-24 2017-02-01 北京三体高创科技有限公司 Medical image based segmentation and 3D reconstruction method and 3D printing system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001076154A (en) * 1999-08-23 2001-03-23 Xerox Corp Method for segmenting digital image and digital image processor
WO2006005728A2 (en) * 2004-07-10 2006-01-19 Evotec Technologies Gmbh Method for detecting geometrical structures in images
CN102938066A (en) * 2012-12-07 2013-02-20 南京大学 Method for reconstructing outer outline polygon of building based on multivariate data
CN104021574A (en) * 2014-07-04 2014-09-03 武汉武大卓越科技有限责任公司 Method for automatically identifying pavement diseases
CN104751178A (en) * 2015-03-31 2015-07-01 上海理工大学 Pulmonary nodule detection device and method based on shape template matching and combining classifier
CN104933709A (en) * 2015-06-04 2015-09-23 西安理工大学 Automatic random-walk CT lung parenchyma image segmentation method based on prior information
CN105930800A (en) * 2016-04-21 2016-09-07 北京智芯原动科技有限公司 Lane line detection method and device
CN106373168A (en) * 2016-11-24 2017-02-01 北京三体高创科技有限公司 Medical image based segmentation and 3D reconstruction method and 3D printing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种快速实用的直线检测算法;孙涵等;《计算机应用研究》;20061231;第256-260页 *

Also Published As

Publication number Publication date
CN106971400A (en) 2017-07-21

Similar Documents

Publication Publication Date Title
US10140529B2 (en) Method, apparatus and device for detecting lane lines
US9390343B2 (en) Estimating degree of deterioration of road surface
CN104408460B (en) A kind of lane detection and tracking detection method
Pan et al. Robust occlusion handling in object tracking
Anand et al. Flaw detection in radiographic weldment images using morphological watershed segmentation technique
CN106290388B (en) A kind of insulator breakdown automatic testing method
US8848978B2 (en) Fast obstacle detection
US8660349B2 (en) Screen area detection method and screen area detection system
US7262710B2 (en) Collision time estimation apparatus for vehicles, collision time estimation method for vehicles, collision alarm apparatus for vehicles, and collision alarm method for vehicles
KR101690981B1 (en) Form recognition method and device
Nieto et al. Stabilization of inverse perspective mapping images based on robust vanishing point estimation
JP6262176B2 (en) Detection and deletion of vertical and horizontal lines in document images
CN104331876B (en) Method for detecting straight line and processing image and related device
CN104462380A (en) Trademark retrieval method
CN104048969A (en) Tunnel defect recognition method
US7515764B2 (en) Image processing apparatus using morphology
CN104217427B (en) Lane line localization method in a kind of Traffic Surveillance Video
CN102782725B (en) Crosswalk detection device, crosswalk detection device method and program
CN103196372B (en) A kind of optical imagery detection method of electrification railway contact net supportive device
KR101609303B1 (en) Method to calibrate camera and apparatus therefor
CN105203552A (en) 360-degree tread image detecting system and method
US20130120125A1 (en) Method and system for lane departure warning
CN104318582A (en) Detection method for bad state of rotating double-lug component pin of high-speed rail contact network on basis of image invariance target positioning
KR101951034B1 (en) Method for improving processing speed of OS-CFAR detection
CN106934803B (en) method and device for detecting surface defects of electronic device

Legal Events

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