CN111105418A - High-precision image segmentation method for rectangular target in image - Google Patents

High-precision image segmentation method for rectangular target in image Download PDF

Info

Publication number
CN111105418A
CN111105418A CN201910238914.4A CN201910238914A CN111105418A CN 111105418 A CN111105418 A CN 111105418A CN 201910238914 A CN201910238914 A CN 201910238914A CN 111105418 A CN111105418 A CN 111105418A
Authority
CN
China
Prior art keywords
image
rectangular
carrying
perspective transformation
binary
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.)
Granted
Application number
CN201910238914.4A
Other languages
Chinese (zh)
Other versions
CN111105418B (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.)
Shanghai Hongpu Information Technology Co Ltd
Original Assignee
Shanghai Hongpu Information 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 Hongpu Information Technology Co Ltd filed Critical Shanghai Hongpu Information Technology Co Ltd
Priority to CN201910238914.4A priority Critical patent/CN111105418B/en
Publication of CN111105418A publication Critical patent/CN111105418A/en
Application granted granted Critical
Publication of CN111105418B publication Critical patent/CN111105418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • G06T5/80
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20036Morphological image processing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E10/00Energy generation through renewable energy sources
    • Y02E10/50Photovoltaic [PV] energy

Abstract

The invention provides a high-precision image segmentation method for a rectangular target in an image, which relates to the technical field of image processing, and comprises the following steps of 1: reading the image into a memory, and carrying out distortion correction on the image; step 2: determining four end points of the rectangular outline of the image after the distortion correction, and carrying out perspective transformation on the image; and step 3: and segmenting the image after perspective transformation to obtain a flat image. The rectangular outline area in the workpiece image is extracted by transforming and segmenting the rectangular workpiece image, and segmentation is carried out according to the internal grid of the rectangular workpiece image, so that the segmentation position is just positioned on the boundary of the matrix workpiece image or the grid boundary, and the accuracy of image segmentation is ensured.

Description

High-precision image segmentation method for rectangular target in image
Technical Field
The invention relates to the technical field of image processing, in particular to a high-precision image segmentation method for a rectangular target in an image.
Background
At present, the industrial defect detection is to detect the defects of the appearance and the interior of an industrial product by utilizing a deep learning technology or a digital image processing technology and judge whether the product quality is qualified or not.
Before the solar photovoltaic module leaves a factory, the solar photovoltaic module needs to be electrified and an infrared image is shot, the process is called Electroluminescence (EL), and through the shooting of an EL image, the photovoltaic module is difficult to find on the appearance, but defects (such as hidden cracks, cold solder and the like) existing inside the solar photovoltaic module are difficult to show. In the deep learning technology, an image is automatically distinguished, defects in the image can be found and located, EL image segmentation is a difficult and very important operation in the development of an automatic detection algorithm, but segmentation is the first step of detection, and if the segmentation effect is not ideal, the detection progress is inevitably reduced.
The EL image is a non-standard shot, and radial distortion, rotation, displacement, and the like are generated, and currently employed segmentation methods include an image segmentation method based on template matching and an image segmentation method based on depth learning. As shown in fig. 1, the image segmentation method based on module matching is implemented by using a module matching segmentation algorithm, and an EL image is matched with a standard EL template image, so as to segment a target region; as shown in fig. 2, the image segmentation method based on the deep learning image is implemented by a Mask rcnn algorithm based on a deep neural network, and the EL image is subjected to network recognition by the trained Mask rcnn, so as to segment a target region.
The image segmentation method based on template matching has the advantages of simple application, but has the disadvantages of poor matching effect, easy occurrence of segmentation failure and the like, and can not meet the requirement of segmentation accuracy higher than 99.9% in the industrial production process; the image segmentation method based on the deep learning has the advantages that the segmentation is stable, the problems of segmentation failure and the like are not easy to occur, but the segmentation boundary has large fluctuation and low segmentation speed, the requirement on the running time of a production line cannot be met, and the requirement on the segmentation accuracy of more than 99.9% in the production process cannot be met.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention aims to provide a high-precision image segmentation method for a rectangular object in an image, which transforms and segments a rectangular workpiece image, extracts a rectangular outline region in the workpiece image, and segments the rectangular outline region according to an internal grid of the rectangular workpiece image, so as to ensure that the segmentation position is just on the boundary of a matrix workpiece image or the grid boundary, and ensure the accuracy of image segmentation.
The invention provides a high-precision image segmentation method for a rectangular target in an image, which comprises the following steps of:
step 1: reading the image into a memory, and carrying out distortion correction on the image;
step 2: determining four end points of the rectangular outline of the image after the distortion correction, and carrying out perspective transformation on the image;
and step 3: and segmenting the image after perspective transformation to obtain a flat image.
Further, the step of performing distortion correction on the image is as follows:
step 1.1: reading an image generated by the solar photovoltaic module through EL shooting into a memory through Opencv software to form a single-channel digital image;
step 1.2: pre-training distortion parameters of the digital image, and performing distortion restoration on the digital image by using the distortion parameters to obtain a digital image with straight edges;
step 1.3: carrying out self-adaptive binary processing on the digital image to obtain a binary image;
step 1.4: and carrying out iterative opening operation on the binary image to obtain a standard binary image.
Further, the step of perspective transforming the image is as follows:
step 2.1: performing morphological processing on the binary image, searching an image edge contour, and acquiring an edge linked list of a minimum circumscribed polygon of the edge contour;
step 2.2: searching two points with the farthest distance in the edge chain table, namely the diagonal line of the rectangular outline area; connecting the diagonals and searching two points with the maximum distance between the positive area and the negative area of the diagonals, namely the other diagonals of the rectangular outline area, namely determining four end points of the rectangular outline area;
step 2.3: and carrying out perspective transformation on the binary image according to four points of the rectangular outline area, standardizing perspective distortion to form a standard rectangular outline area, and carrying out bilinear interpolation processing on all points which cannot be subjected to perspective transformation in the binary image.
Further, the specific steps of segmenting the image are as follows:
step 3.1: respectively averaging the two-value images subjected to perspective transformation according to the horizontal and vertical axis directions to obtain average one-dimensional signals in the horizontal and vertical axis directions, searching position coordinates of all local minimum values by applying an interval minimum value algorithm, and connecting the position coordinates to obtain a dividing line;
step 3.2: comparing the dividing line with the actual specification of the solar photovoltaic module, if the number of the dividing line is not in accordance with the actual specification of the solar photovoltaic module, adjusting the parameters to try again, and repairing; and if the number is consistent, segmenting the binary image to obtain a flat image.
As described above, the high-precision image segmentation method for the rectangular object in the image according to the present invention has the following beneficial effects:
1. the invention solves the problem of image distortion caused by the position of a camera, the shooting angle and the like, and can output a straight rectangular target object.
2. The invention provides a positioning method based on four endpoints, which converts the region matching of images into the endpoint matching and improves the speed and the accuracy of the image matching.
Drawings
FIG. 1 is a flow chart of a segmentation method based on module matching disclosed in the prior art;
FIG. 2 is a flowchart illustrating a method for image segmentation based on deep learning image disclosed in the prior art;
FIG. 3 is a flowchart of an image segmentation method disclosed in an embodiment of the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
As shown in fig. 3, the present invention provides a high precision image segmentation method for a rectangular object in an image, the method comprising the following steps:
step 1: reading the image into a memory, and carrying out distortion correction on the image;
the steps of correcting the distortion of the image are as follows:
step 1.1: reading an image generated by the solar photovoltaic module through EL shooting into a memory through Opencv software to form a single-channel digital image;
step 1.2: pre-training distortion parameters of the digital image, and repairing the distortion of the image by using the distortion parameters to obtain a digital image with straight edges;
step 1.3: performing self-adaptive binary processing on the digital image with straight edges to obtain a binary image;
step 1.4: and performing iterative opening operation on the binary image to obtain a standard binary image, and ensuring that the gray value of the solar photovoltaic module area is 255 and the gray value outside the solar photovoltaic module area is 0.
Step 2: determining four end points of the rectangular outline of the image after the distortion correction, and carrying out perspective transformation on the image;
the steps of perspective transforming the image are as follows:
step 2.1: performing morphological processing on the binary image, searching an image edge contour, and acquiring an edge linked list of a minimum circumscribed polygon of the edge contour;
step 2.2: two points with the farthest distance are searched in the edge chain table, namely the diagonal lines of the rectangular outline area; connecting the diagonals and searching two points with the maximum distance between the positive area and the negative area of the diagonals, namely the other diagonals of the rectangular outline area, so that four end points of the rectangular outline area are determined;
step 2.3: carrying out perspective transformation on the standard binary image according to four end points of the rectangular outline region, standardizing perspective distortion to form a standard rectangular outline region, and carrying out bilinear interpolation processing on all points which cannot be subjected to perspective transformation in the standard binary image;
and step 3: segmenting the image after perspective transformation to obtain a flat image;
the steps of perspective transforming the image are as follows:
step 3.1: respectively averaging the two-value images subjected to perspective transformation according to the horizontal and vertical axis directions to obtain average one-dimensional signals in the horizontal and vertical axis directions, searching position coordinates of all local minimum values by applying an interval minimum value algorithm, and connecting the position coordinates to obtain a dividing line;
step 3.2: comparing the dividing line with the actual specification of the solar photovoltaic module, and if the number of the dividing line is not in accordance with the actual specification of the solar photovoltaic module, adjusting the parameters to try again to repair the solar photovoltaic module; and if the number is consistent, segmenting the binary image to obtain a flat image.
In summary, the invention makes full use of the characteristic information of the rectangular target, automatically performs distortion correction on the camera, positions the target area through four end points of the rectangular outline area, calculates and transforms the rectangular outline area, can not only segment the rectangular target object, but also correct image distortion caused by the camera position, the shooting angle and the like in the shooting process of the camera, finally obtains a straight rectangular target, and provides input meeting the requirements for industrial defect detection. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (4)

1. A high-precision image segmentation method for a rectangular object in an image is characterized by comprising the following steps:
step 1: reading the image into a memory, and carrying out distortion correction on the image;
step 2: determining four end points of the rectangular outline of the image after the distortion correction, and carrying out perspective transformation on the image;
and step 3: and segmenting the image after perspective transformation to obtain a flat image.
2. A method for segmenting an image into rectangular objects with high precision according to claim 1, wherein the step of performing distortion correction on the image is as follows:
step 1.1: reading an image generated by the solar photovoltaic module through EL shooting into a memory through Opencv software to form a single-channel digital image;
step 1.2: pre-training distortion parameters of the digital image, and performing distortion restoration on the digital image by using the distortion parameters to obtain a digital image with straight edges;
step 1.3: carrying out self-adaptive binary processing on the digital image to obtain a binary image;
step 1.4: and carrying out iterative opening operation on the binary image to obtain a standard binary image.
3. A method for high-precision image segmentation of a rectangular object in an image according to claim 2, wherein the step of perspective transformation of the image is as follows:
step 2.1: performing morphological processing on the binary image, searching an image edge contour, and acquiring an edge linked list of a minimum circumscribed polygon of the edge contour;
step 2.2: searching two points with the farthest distance in the edge chain table, namely the diagonal line of the rectangular outline area; connecting the diagonals and searching two points with the maximum distance between the positive area and the negative area of the diagonals, namely the other diagonals of the rectangular outline area, namely determining four end points of the rectangular outline area;
step 2.3: and carrying out perspective transformation on the binary image according to four end points of the rectangular outline region, standardizing perspective distortion to form a standard rectangular outline region, and carrying out bilinear interpolation processing on all points which cannot be subjected to perspective transformation in the binary image.
4. A high-precision image segmentation method for rectangular objects in images according to claim 3, characterized in that the specific steps of segmenting the image are as follows:
step 3.1: respectively averaging the two-value images subjected to perspective transformation according to the horizontal and vertical axis directions to obtain average one-dimensional signals in the horizontal and vertical axis directions, searching position coordinates of all local minimum values by applying an interval minimum value algorithm, and connecting the position coordinates to obtain a dividing line;
step 3.2: comparing the dividing line with the actual specification of the solar photovoltaic module, if the number of the dividing line is not in accordance with the actual specification of the solar photovoltaic module, adjusting the parameters to try again, and repairing; and if the number is consistent, segmenting the binary image to obtain a flat image.
CN201910238914.4A 2019-03-27 2019-03-27 High-precision image segmentation method for rectangular targets in image Active CN111105418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910238914.4A CN111105418B (en) 2019-03-27 2019-03-27 High-precision image segmentation method for rectangular targets in image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910238914.4A CN111105418B (en) 2019-03-27 2019-03-27 High-precision image segmentation method for rectangular targets in image

Publications (2)

Publication Number Publication Date
CN111105418A true CN111105418A (en) 2020-05-05
CN111105418B CN111105418B (en) 2023-07-11

Family

ID=70420383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910238914.4A Active CN111105418B (en) 2019-03-27 2019-03-27 High-precision image segmentation method for rectangular targets in image

Country Status (1)

Country Link
CN (1) CN111105418B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111805533A (en) * 2020-05-27 2020-10-23 扬州哈工科创机器人研究院有限公司 Device for workpiece blanking and workpiece blanking method based on visual positioning

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5768413A (en) * 1995-10-04 1998-06-16 Arch Development Corp. Method and apparatus for segmenting images using stochastically deformable contours
IL146978A0 (en) * 1999-06-11 2002-08-14 Pulsent Corp Method and apparatus for digital image segmentation
US20060039605A1 (en) * 2004-08-20 2006-02-23 Masashi Koga Method and apparatus for recognition of character string in scene image
CN104297254A (en) * 2014-10-08 2015-01-21 华南理工大学 Mixing-method-based method and system applied to defect detection of printed circuit board
US20150109474A1 (en) * 2013-10-23 2015-04-23 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN106056117A (en) * 2016-06-20 2016-10-26 北京小米移动软件有限公司 Image processing method and device for rectangular object
JP2017069877A (en) * 2015-10-01 2017-04-06 京セラドキュメントソリューションズ株式会社 Image processing apparatus
CN107154050A (en) * 2017-05-03 2017-09-12 魏玉震 A kind of automatic obtaining method of the stone material geometric parameter based on machine vision
CN107169494A (en) * 2017-06-01 2017-09-15 中国人民解放军国防科学技术大学 License plate image segmentation bearing calibration based on handheld terminal
CN107256556A (en) * 2017-06-08 2017-10-17 福州大学 A kind of solar cell module unit partioning method based on Gray Level Jump thought
CN108022243A (en) * 2017-11-23 2018-05-11 浙江清华长三角研究院 Method for detecting paper in a kind of image based on deep learning
CN108053376A (en) * 2017-12-08 2018-05-18 长沙全度影像科技有限公司 A kind of semantic segmentation information guiding deep learning fisheye image correcting method
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5768413A (en) * 1995-10-04 1998-06-16 Arch Development Corp. Method and apparatus for segmenting images using stochastically deformable contours
IL146978A0 (en) * 1999-06-11 2002-08-14 Pulsent Corp Method and apparatus for digital image segmentation
US20060039605A1 (en) * 2004-08-20 2006-02-23 Masashi Koga Method and apparatus for recognition of character string in scene image
US20150109474A1 (en) * 2013-10-23 2015-04-23 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN104297254A (en) * 2014-10-08 2015-01-21 华南理工大学 Mixing-method-based method and system applied to defect detection of printed circuit board
JP2017069877A (en) * 2015-10-01 2017-04-06 京セラドキュメントソリューションズ株式会社 Image processing apparatus
CN106056117A (en) * 2016-06-20 2016-10-26 北京小米移动软件有限公司 Image processing method and device for rectangular object
CN107154050A (en) * 2017-05-03 2017-09-12 魏玉震 A kind of automatic obtaining method of the stone material geometric parameter based on machine vision
CN107169494A (en) * 2017-06-01 2017-09-15 中国人民解放军国防科学技术大学 License plate image segmentation bearing calibration based on handheld terminal
CN107256556A (en) * 2017-06-08 2017-10-17 福州大学 A kind of solar cell module unit partioning method based on Gray Level Jump thought
CN108022243A (en) * 2017-11-23 2018-05-11 浙江清华长三角研究院 Method for detecting paper in a kind of image based on deep learning
CN108053376A (en) * 2017-12-08 2018-05-18 长沙全度影像科技有限公司 A kind of semantic segmentation information guiding deep learning fisheye image correcting method
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111805533A (en) * 2020-05-27 2020-10-23 扬州哈工科创机器人研究院有限公司 Device for workpiece blanking and workpiece blanking method based on visual positioning
CN111805533B (en) * 2020-05-27 2022-05-03 扬州哈工科创机器人研究院有限公司 Device for workpiece blanking and workpiece blanking method based on visual positioning

Also Published As

Publication number Publication date
CN111105418B (en) 2023-07-11

Similar Documents

Publication Publication Date Title
CN110543878B (en) Pointer instrument reading identification method based on neural network
CN105913415B (en) A kind of image sub-pixel edge extracting method with extensive adaptability
CN109767463B (en) Automatic registration method for three-dimensional point cloud
CN111260731B (en) Self-adaptive detection method for checkerboard sub-pixel level corner points
CN107610111B (en) deep learning-based welding spot image detection method
CN108898147B (en) Two-dimensional image edge flattening method and device based on angular point detection
CN111191546A (en) Intelligent product assembling method based on machine vision recognition
CN115018846B (en) AI intelligent camera-based multi-target crack defect detection method and device
CN108985337A (en) A kind of product surface scratch detection method based on picture depth study
CN111311618A (en) Circular arc workpiece matching and positioning method based on high-precision geometric primitive extraction
CN106936964A (en) A kind of mobile phone screen angular-point detection method based on Hough transformation template matches
CN109993154A (en) The lithium sulfur type instrument intelligent identification Method of substation's simple pointer formula
CN109724988B (en) PCB defect positioning method based on multi-template matching
Niu et al. Data augmentation on defect detection of sanitary ceramics
CN116258722A (en) Intelligent bridge building detection method based on image processing
CN109671084B (en) Method for measuring shape of workpiece
CN111105418A (en) High-precision image segmentation method for rectangular target in image
CN107328371A (en) Sub-pix contours extract based on Gaussian and the optimization using Softmax recurrence in the case where metal plate detects scene
CN113705564A (en) Pointer type instrument identification reading method
CN117058182A (en) Target detection frame optimization method for visual ranging
CN114943710B (en) Method for positioning circle center of thin-wall circular tube type part by utilizing improved least square fitting
CN107330436B (en) Scale criterion-based panoramic image SIFT optimization method
CN115184362A (en) Rapid defect detection method based on structured light projection
CN106780425B (en) Positioning method of vortex detection system of heat transfer tube of VVER steam generator
CN113989793A (en) Graphite electrode embossed seal character recognition method

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
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A high-precision image segmentation method for rectangular targets in images

Effective date of registration: 20240103

Granted publication date: 20230711

Pledgee: Shanghai Rural Commercial Bank Co.,Ltd. Jiading sub branch

Pledgor: Shanghai HONGPU Information Technology Co.,Ltd.

Registration number: Y2024310000006