CN108876784B - Image processing method and device for removing connecting part of planar workpiece - Google Patents

Image processing method and device for removing connecting part of planar workpiece Download PDF

Info

Publication number
CN108876784B
CN108876784B CN201810681017.6A CN201810681017A CN108876784B CN 108876784 B CN108876784 B CN 108876784B CN 201810681017 A CN201810681017 A CN 201810681017A CN 108876784 B CN108876784 B CN 108876784B
Authority
CN
China
Prior art keywords
image
workpiece
connecting part
connected region
processing
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
CN201810681017.6A
Other languages
Chinese (zh)
Other versions
CN108876784A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201810681017.6A priority Critical patent/CN108876784B/en
Publication of CN108876784A publication Critical patent/CN108876784A/en
Application granted granted Critical
Publication of CN108876784B publication Critical patent/CN108876784B/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/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Abstract

An image processing method, a device system and a computer readable storage medium for removing a connecting part of a plane workpiece, wherein the method uses morphological basic corrosion and expansion operation to remove the connecting part of a suspended workpiece, firstly, an input image is preprocessed: filling the image hole area; next, image morphology processing is performed: the preprocessed image needs to be subjected to corrosion and expansion for multiple times; then, image connection member region determination is performed: judging whether the connected region is a connected component region or not in a mode of solving intersection of each connected region and the characteristic image; finally, the connecting part of the suspended workpiece is removed to obtain an effective image: and (4) making a difference between the preprocessed image and the connecting part area, and removing the filled hole area to obtain the image of the workpiece with the connecting part removed. By the method, the information of the connecting part in the image can be effectively removed, and the edge contour of the workpiece image can be well reserved.

Description

Image processing method and device for removing connecting part of planar workpiece
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method, an image processing apparatus, an image processing system, and a computer-readable storage medium for removing a connecting component of a planar workpiece.
Background
With the development of science and technology and the expansion of social requirements, particularly the rapid development of high and new technology, the continuous progress of the automatic pipeline technology is promoted. The assembly line is also called as an assembly line, and can be generally divided into the following steps according to the conveying mode of the assembly line: seven types of assembly lines, namely a belt assembly line, a plate chain line, a speed doubling chain, a plug-in line, a mesh belt line, a suspension line and a roller assembly line. The suspension assembly line for automatic production has the working mode that: a camera or a light curtain and other sensors collect image information of a workpiece hung on a production line; preprocessing the acquired image information; the processed workpiece image information is sent to an upper computer; and the upper computer performs track planning and other subsequent calculation processing according to the workpiece image information. At the time of image information acquisition, a connecting member for suspending the workpiece is also acquired in the image. If the information of the connecting parts contained in the image cannot be removed in advance, the upper computer performs processing such as trajectory planning on the connecting parts in the subsequent calculation process, which causes waste and even possibly causes system failure. Errors may also occur if damage is done to the area of the workpiece itself during the removal of the attachment member. Therefore, the nondestructive removal of the workpiece connecting part has important practical application value.
As shown in fig. 1, the input original image is shown, and the connecting component is a hinge, and the image characteristics are as follows: (1) the input image is a binary two-dimensional image; (2) the hinge is connected to the workpiece by the upper boundary of the image, and only the hinge is possible in a region with a fixed width (the specific width can be set) near the upper boundary of the image; (3) the image information of the hinge has certain characteristics: the width is not necessarily uniform and may even be broken or hollowed out.
The commonly used image processing method: (1) watershed segmentation algorithm: as shown in fig. 2, the image processed by the watershed segmentation algorithm has an over-segmentation phenomenon, and the segmentation effect is not ideal. (2) Separation algorithm based on extreme corrosion: since the width of the hinge is not uniform, and even disconnection or hollow-out may occur, it is difficult to find the division point after the image is corroded to the limit, as shown in fig. 3. Therefore, the image processing method in the prior art has a problem that it is difficult to remove the workpiece connecting part without damaging the contour of the workpiece or completely remove the connecting part irrelevant to the workpiece.
Disclosure of Invention
In order to solve the problems, the invention provides an image processing method, an image processing system and a computer-readable storage medium for removing a plane workpiece connecting part without damage, the method can effectively remove connecting part information in an image under the condition of not damaging the contour of a workpiece, and has the characteristics of strong robustness and less calculation amount.
To achieve the above object, a first aspect of the present invention provides an image processing method of removing a connecting member of a flat workpiece, comprising the steps of:
image input: inputting a binary planar workpiece image comprising a connecting part;
image preprocessing: filling the hole area of the plane workpiece image to obtain a preprocessed image;
image morphology processing: performing corrosion and expansion processing on the preprocessed image for multiple times to obtain a planar workpiece image which is subjected to morphological processing and is used for removing the connecting part;
connecting component image extraction: performing difference operation on the preprocessed image and the morphologically processed image to obtain a connecting component image;
connection member region determination and removal in connection member image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region;
and removing the filled hole area to obtain an image of the plane workpiece with the connecting part removed.
In some embodiments, the image morphology processing comprises the steps of:
carrying out corrosion treatment on the preprocessed image, and removing a connecting part region in the image;
expanding the image subjected to the corrosion treatment, and restoring to the workpiece image of the connecting part area removed;
and performing re-expansion processing on the image subjected to the expansion processing, so that the boundary of the workpiece in the image of the workpiece subjected to the re-expansion processing is larger than the boundary of the workpiece in the image subjected to the pre-processing.
In some embodiments, the etching process comprises the steps of:
scanning each pixel of the image with a structuring element;
carrying out AND operation on the structural elements and pixel values of pixels at corresponding positions of the images covered by the structural elements;
if all 1, the pixel value of the pixel in the image after corrosion is 1, otherwise 0.
In some embodiments, the expansion process comprises the steps of:
scanning each pixel of the image with a structuring element;
carrying out AND operation on the pixel values of the structural elements and the positions corresponding to the covered images;
if all 0, the pixel value of the pixel in the expanded image is 0, otherwise 1.
In some embodiments, the determining of the connected component region in the connected component image includes:
performing expansion processing on the connecting part images to enable the areas belonging to the same connecting part to be communicated to obtain a communicated area;
searching all connected areas in the image, and extracting the outer contour of each connected area;
generating a characteristic image;
and solving the intersection of the characteristic image and the outer contour of each connected region, and if the intersection exists, performing difference operation on the preprocessed image and the connected region to remove the connected region.
In some embodiments, the feature image is a fixed width region near the upper boundary of the input planar workpiece image.
In some embodiments, the method further comprises the step of identifying the attachment member area and the attachment location of the attachment member to the workpiece.
A second aspect of the present invention provides an image processing apparatus that removes a connecting member of a planar workpiece, comprising:
an image input module: the device comprises a plane workpiece image used for inputting binaryzation and comprising a connecting part;
an image preprocessing module: the hole area used for filling the plane workpiece image obtains a preprocessed image;
an image morphology processing module: the device is used for carrying out corrosion and expansion processing on the preprocessed image for multiple times to obtain a planar workpiece image which is subjected to morphological processing and is used for removing the connecting part;
connecting the component image extraction module: the image processing device is used for carrying out difference operation on the preprocessed image and the morphologically processed image to obtain a connecting component image;
a connecting member region judging and removing module in a connecting member image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region;
and the filled hole area removing module is used for obtaining an image of the plane workpiece after the connecting part is removed.
A third aspect of the invention provides an image processing system for removing a planar workpiece connection component, the system comprising:
a memory and one or more processors;
wherein the memory is communicatively coupled to the one or more processors and has stored therein instructions executable by the one or more processors to cause the one or more processors to perform the method as previously described.
A fourth aspect of the invention provides a computer-readable storage medium having stored thereon computer-executable instructions operable, when executed by a computing device, to perform a method as previously described.
In summary, the present invention provides an image processing method, apparatus, system and computer readable storage medium for removing a connecting component of a planar workpiece. The method uses morphological basic corrosion and expansion operation to remove a connecting part of a suspended workpiece, and firstly, an input image is preprocessed: filling the image hole area; next, image morphology processing is performed: the preprocessed image needs to be subjected to corrosion and expansion for multiple times; then, image connection member region determination is performed: judging whether the connected region is a connected component region or not in a mode of solving intersection of each connected region and the characteristic image; finally, the connecting part of the suspended workpiece is removed to obtain an effective image: and (4) making a difference between the preprocessed image and the connecting part area, and removing the filled hole area to obtain the image of the workpiece with the connecting part removed. By the method, the information of the connecting part in the image can be effectively removed, and the edge contour of the workpiece image can be well reserved. In addition, the processing mode has the characteristics of strong robustness and small calculation amount.
Drawings
FIG. 1 is an input original image;
FIG. 2 is an over-segmented image obtained using a watershed algorithm;
FIG. 3 is an erosion image obtained using extreme erosion;
FIG. 4 is a flow chart of an image processing method of removing a planar workpiece attachment component in accordance with the present invention;
FIG. 5 is an input narrow frame workpiece image;
FIG. 6 shows the direct corrosion results of a narrow-framed workpiece;
FIG. 7 is a fill image of a narrow-framed workpiece;
FIG. 8 shows the result of etching after filling the hole area with a narrow-sided workpiece;
FIG. 9 is a flow chart of a method of image morphology processing;
FIG. 10 is the image expansion result;
FIG. 11 shows the result of image re-expansion;
FIG. 12 is a schematic view of image erosion;
FIG. 13 is a schematic view of image dilation;
FIG. 14 is a flowchart of a method for determining a link component region in a link component image;
FIG. 15 shows the difference between the filled image and the re-expanded image of a narrow-framed workpiece;
FIG. 16 is an image of the hinge area after expansion;
FIG. 17 is an outer contour view of a first communication area;
FIG. 18 is an outer contour view of a second communication region;
FIG. 19 is a feature image;
FIG. 20 is the intersection of the outline of the first connected region and the feature image;
FIG. 21 is a first communication zone (hinge zone);
FIG. 22 is a graph of the difference between the preprocessed image and the first connected component (hinge component);
FIG. 23 is an image of a workpiece obtained using the present invention;
FIG. 24 is the location of the hinge region in the original image;
FIG. 25 shows the attachment location of the workpiece to the hinge in the original image.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention will be described in further detail with reference to the accompanying drawings and embodiments. The embodiment of the invention adopts the hinge as a specific connecting part.
As shown in FIG. 4, the present invention provides an image processing method 400 for removing a planar workpiece attachment component, comprising the steps of:
step 410, image input: a binarized planar workpiece image including a joining member is input as shown in fig. 5.
Step 420, image preprocessing: filling the hole area of the planar workpiece image results in a preprocessed image (Img _ holes). The image hole area is filled to prevent the narrow border of the workpiece from corroding. The narrow-framed workpiece of FIG. 5 has been directly etched to leave sporadic regions, as shown in FIG. 6; and the narrow frame workpiece is firstly filled in the hole area and then corroded, so that the area of the workpiece is well reserved, as shown in fig. 7 and 8. Therefore, to ensure that the image workpiece region is not eroded, it is necessary to fill the internal void region of the workpiece prior to the image erosion process.
Step 430, image morphology processing: and performing multiple corrosion and expansion treatments on the preprocessed image to obtain a planar workpiece image which is subjected to morphological treatment and is used for removing the connecting part.
In a specific embodiment, the image morphology processing method flow 900 includes the following steps, as shown in fig. 9:
and step 910, performing corrosion treatment on the preprocessed image, and removing a connecting part, namely a hinge area, in the image.
The etching process is to eliminate the image hinge area, as shown in fig. 8. Image erosion is a process of eliminating image boundary points and shrinking the image boundaries inward, and can be used to eliminate small and meaningless objects. As shown in FIG. 12, the erosion of A by B can be represented as A theta B, and after the image A is eroded by the structural element B, the image A is shrunk by one circle, and the erosion width is determined by the structural element. The structural element SE is determined by two parameters, namely shape parameter shape, which can be any shape such as rectangle, circle, etc., and parameters, which control the size direction of the shape parameter shape, and usually the structural element is smaller than the image to be processed. A two-dimensional structure element is understood to be a two-dimensional matrix, the matrix elements having a value of 0 or 1.
The image erosion treatment can comprise the following specific steps:
scanning each pixel of the image with a structuring element;
performing AND operation on the structural element and the pixel value of the pixel at the corresponding position of the image covered by the structural element (dot multiplication of the pixel value at the corresponding position);
if all 1, the pixel value of the pixel in the image after corrosion is 1, otherwise 0.
Let a matrix SE with a structural element of 3 × 3 be [1,1, 1; 1,1, 1; 1,1,1], a certain pixel point on the binary image is P, and surrounding pixel points are P0, P1, P2, P3, P4, P5, P6 and P7, and form a matrix M ═ P0, P1 and P2; p3, P4; p5, P6, P7 ]. Dot multiplication of the matrix SE and the matrix M yields a matrix Q ═ P0, P1, P2; p3, P4; p5, P6, P7 ]. The point P is 1 when all elements in the matrix Q are 1, otherwise it is 0.
Step 920, performing expansion processing on the corroded image to restore the corroded image to the workpiece image of the connecting part removed area;
specifically, the expansion processing is performed on the image in order to restore the image to the hinge region removed, as shown in fig. 10. Dilation is the process of merging all background points in contact with an object into the object, expanding the boundary outward. As shown in FIG. 13, the expansion of B versus A can be expressed as
Figure BDA0001710912740000071
After the image A is expanded by the structural element B, the image A is expanded by one circle, and the expansion width of the image A is determined by the structural element.
The specific steps of the expansion treatment comprise:
scanning each pixel of the image with a structuring element;
the structural element and the pixel value of the corresponding position of the image covered by the structural element are subjected to AND operation (pixel value point multiplication of the corresponding position);
if all 0, the pixel value of the pixel in the expanded image is 0, otherwise 1.
Let a matrix SE with a structural element of 3 × 3 be [1,1, 1; 1,1, 1; 1,1,1], a certain pixel point on the binary image is P, and surrounding pixel points are P0, P1, P2, P3, P4, P5, P6 and P7, and form a matrix M ═ P0, P1 and P2; p3, P4; p5, P6, P7 ]. Dot multiplication of the matrix SE and the matrix M yields a matrix Q ═ P0, P1, P2; p3, P4; p5, P6, P7 ]. The point P is 0 when all elements in the matrix Q are 0, otherwise it is 1.
In the image morphology processing step, the image is subjected to processing of erosion before expansion, which is also called image opening operation, and the image morphology processing step has the following functions: for eliminating small objects, separating objects at fine points, smoothing the boundaries of larger objects without significantly changing their area. Although the hinge region can be eliminated by the opening operation, the edge profile of the workpiece region has a certain distortion.
Step 930, re-dilation processing is performed on the dilated image so that the boundary of the workpiece in the re-dilated image is larger than the boundary of the workpiece in the pre-processed image. The result of the image re-expansion is shown in fig. 11.
After the image morphological processing step, an image is obtained in which the connecting part, i.e., the hinge, is removed and only the workpiece remains.
Step 440, connecting component image extraction: the difference operation is performed between the preprocessed image obtained in step 420 and the morphologically processed image obtained in step 430, and as a result, only the hinge region remains, and no unnecessary sporadic regions remain in the workpiece region, and an image of the link member hinge is obtained as shown in fig. 15.
Step 450, judging and removing the connecting part area in the connecting part image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region;
specifically, the method flow 1400 for determining the connection component area in the connection component image includes the following steps, as shown in fig. 14:
and step 1410, performing expansion processing on the connecting part images to enable the areas belonging to the same connecting part to be communicated to obtain the communicated areas.
Specifically, the hinge regions that may be broken are expanded so that the regions belonging to the same hinge are connected to constitute connected regions, and fig. 16 is an image (Img) after the hinge regions are expanded. In an image, there are 8 adjacent pixels around each pixel, and there are 2 common adjacent relations: 4 contiguous with 8 contiguous. If the pixel points A and B are adjacent, the pixel points A and B are called to be communicated; the set of all connected points is called a connected region.
And step 1420, searching all the connected areas in the image, and extracting the outline of each connected area.
Specifically, all connected regions in the image Img are searched, and the outer contour of each connected region is extracted, as shown in fig. 17 and 18. Finding all connected regions in the image Img: firstly, traversing all pixel points of an image, and recording a cluster formed by continuous pixel points in each row (or column) and an equivalent pair of a mark; then, the original image is marked again through the equivalence pair; and finally, obtaining an L matrix with the same size as the image Img, wherein the L matrix marks the class label of each connected region in the image Img, and the values of the labels are 1,2 and num (the number of the connected regions). The algorithm for searching the connected region in the image is an algorithm used in a connected region marking function bwleabel in matlab.
And then detecting the outer contour of each connected region by a sobel operator. The sobel operator contains two convolution kernels Gx and Gy of 3x3, where Gx [ -1,0, 1; -2,0, 2; -1,0,1], Gy ═ 1,2, 1; 0,0, 0; -1, -2, -1], performing convolution operation on each pixel point in the image and the two convolution kernels, and taking the maximum value to output to obtain the outer contour of each connected region.
Step 1430, generate the feature image.
Specifically, a feature image (Rect) is generated. Since only a hinge may exist in a region having a fixed width (a specific width can be set) near the upper boundary of the input image, filling the fixed width region into a rectangular region, and then calculating an intersection with the outer contour of each connected region, it can be determined whether the connected region is a hinge region, as shown in fig. 19.
Step 1440, remove the hinge area in the image. And solving the intersection of the characteristic image and the outer contour of each connected region, and if the intersection exists, performing difference operation on the preprocessed image and the connected region to remove the connected region.
Specifically, whether the connected region is a hinge region is judged by a way of solving intersection between the outer contour of each connected region and the characteristic image. If the two are intersected, the connected region is a hinge region, and the hinge can be removed by subtracting the preprocessed image (Pre _ img) from the connected region, as shown in FIGS. 20, 21 and 22; otherwise, the connected region is a part of the workpiece and is not processed. And (3) setting the number of the connected regions as N, representing each connected region as Con1, Con2, … and ConN, representing the outer contour of each corresponding connected region as S1, S2, … and SN, sequentially judging whether the SN is intersected with the characteristic image Rect or not at S1, S2 and …, and if the SN is intersected with the characteristic image Rect, subtracting the preprocessed image (Pre _ img) from the connected region to remove the hinge. Assuming that there is an intersection between S1 and Rect, it indicates that Con1 is a hinge area, and the difference between the preprocessed image (Pre _ img) and the connected area Con1 can remove the hinge, resulting in an image of only the remaining workpiece area.
And 460, removing the filled hole area from the image of the workpiece area to obtain an image of the planar workpiece with the connecting part hinge removed.
Specifically, the hole region filled in the preprocessing is removed, and the image of the workpiece with the hinge removed is obtained, as shown in fig. 23. And subtracting the hole area (Img _ holes) filled in the preprocessing from the image after the hinge is removed, so as to obtain the image of the workpiece after the hinge is removed.
Further, the method also comprises the step of marking the hinge area and the connecting position of the hinge and the workpiece, as shown in fig. 24 and 25. The outer contour of the workpiece is intersected with the hinge to obtain the connecting position of the workpiece and the hinge. The hinge area can be marked by calculating the minimum bounding rectangle of the hinge. The minimum circumscribed rectangle of the hinge is calculated by using an equal interval rotation searching method: and rotating the hinge at equal intervals within the range of 90 degrees, recording the parameters of the circumscribed rectangle of the outline in the direction of the coordinate system each time, and calculating the area of the circumscribed rectangle to obtain the minimum circumscribed rectangle. Marking the hinge area and the connecting position of the hinge and the workpiece in the step is to predict the position of the hinge area when the upper computer plans the subsequent track, so that the running track is adjusted before the hinge area is reached, and the hinge is prevented from being touched.
A second aspect of the present invention provides an image processing apparatus for removing a connecting member of a flat workpiece corresponding to the above method, comprising:
an image input module: the device comprises a plane workpiece image used for inputting binaryzation and comprising a connecting part;
an image preprocessing module: the hole area used for filling the plane workpiece image obtains a preprocessed image;
an image morphology processing module: the device is used for carrying out corrosion and expansion processing on the preprocessed image for multiple times to obtain a planar workpiece image which is subjected to morphological processing and is used for removing the connecting part;
connecting the component image extraction module: the image processing device is used for carrying out difference operation on the preprocessed image and the morphologically processed image to obtain a connecting component image;
a connecting member region judging and removing module in a connecting member image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region;
and the filled hole area removing module is used for obtaining an image of the plane workpiece after the connecting part is removed.
A third aspect of the invention provides an image processing system for removing a planar workpiece connection component, the system comprising: a memory and one or more processors; wherein the memory is communicatively coupled to the one or more processors and has stored therein instructions executable by the one or more processors to cause the one or more processors to perform the method as previously described.
A fourth aspect of the invention provides a computer-readable storage medium having stored thereon computer-executable instructions operable, when executed by a computing device, to perform a method as previously described.
In summary, the present invention provides an image processing method, apparatus, system and computer readable storage medium for removing a connecting component of a planar workpiece. The method uses morphological basic corrosion and expansion operation to remove a connecting part of a suspended workpiece, and firstly, an input image is preprocessed: filling the image hole area; next, image morphology processing is performed: the preprocessed image needs to be subjected to corrosion and expansion for multiple times; then, image connection member region determination is performed: judging whether the connected region is a connected component region or not in a mode of solving intersection of each connected region and the characteristic image; finally, the connecting part of the suspended workpiece is removed to obtain an effective image: and (4) making a difference between the preprocessed image and the connecting part area, and removing the filled hole area to obtain the image of the workpiece with the connecting part removed. By the method, the information of the connecting part in the image can be effectively removed, and the edge contour of the workpiece image can be well reserved. In addition, the processing mode has the characteristics of strong robustness and small calculation amount.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.

Claims (8)

1. An image processing method for removing a connecting member of a flat workpiece, comprising the steps of:
image input: inputting a binary planar workpiece image comprising a connecting part;
image preprocessing: filling the hole area of the plane workpiece image to obtain a preprocessed image;
image morphology processing: performing corrosion and expansion processing on the preprocessed image for multiple times to obtain a planar workpiece image which is subjected to morphological processing and is used for removing the connecting part;
connecting component image extraction: performing difference operation on the preprocessed image and the morphologically processed image to obtain a connecting component image;
connection member region determination and removal in connection member image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region; the characteristic image is a fixed width area near the upper boundary of the input plane workpiece image;
removing the filled hole area to obtain an image of the plane workpiece with the connecting part removed;
the image morphology processing comprises the following steps:
carrying out corrosion treatment on the preprocessed image, and removing a connecting part region in the image;
expanding the image subjected to the corrosion treatment, and restoring to the workpiece image of the connecting part area removed;
and performing re-expansion processing on the image subjected to the expansion processing, so that the boundary of the workpiece in the image of the workpiece subjected to the re-expansion processing is larger than the boundary of the workpiece in the image subjected to the pre-processing.
2. An image processing method of removing a connecting member of a flat workpiece according to claim 1, characterized in that: the corrosion treatment comprises the following steps:
scanning each pixel of the image with a structuring element;
carrying out AND operation on the structural elements and pixel values of pixels at corresponding positions of the images covered by the structural elements;
if all 1, the pixel value of the pixel in the image after corrosion is 1, otherwise 0.
3. An image processing method of removing a connecting member of a flat workpiece according to claim 1, characterized in that: the expansion treatment comprises the following steps:
scanning each pixel of the image with a structuring element;
carrying out AND operation on the pixel values of the structural elements and the positions corresponding to the covered images;
if all 0, the pixel value of the pixel in the expanded image is 0, otherwise 1.
4. An image processing method of removing a connecting member of a flat workpiece according to claim 1, characterized in that: the method for judging the connecting part area in the connecting part image comprises the following steps:
performing expansion processing on the connecting part images to enable the areas belonging to the same connecting part to be communicated to obtain a communicated area;
searching all connected areas in the image, and extracting the outer contour of each connected area;
generating a characteristic image;
and solving the intersection of the characteristic image and the outer contour of each connected region, and if the intersection exists, performing difference operation on the preprocessed image and the connected region to remove the connected region.
5. An image processing method of removing a connecting member of a planar workpiece according to claim 1, further comprising the step of marking the connecting member area and the connecting position of the connecting member to the workpiece.
6. An image processing apparatus that removes a connecting member of a flat workpiece, comprising:
an image input module: the device comprises a plane workpiece image used for inputting binaryzation and comprising a connecting part;
an image preprocessing module: the hole area used for filling the plane workpiece image obtains a preprocessed image;
an image morphology processing module: the device is used for carrying out corrosion and expansion processing on the preprocessed image for multiple times to obtain a planar workpiece image which is subjected to morphological processing and is used for removing the connecting part; the image morphology processing module executes the following steps:
carrying out corrosion treatment on the preprocessed image, and removing a connecting part region in the image;
expanding the image subjected to the corrosion treatment, and restoring to the workpiece image of the connecting part area removed;
performing re-expansion processing on the image subjected to the expansion processing to enable the boundary of the workpiece in the image of the workpiece subjected to the re-expansion processing to be larger than the boundary of the workpiece in the image subjected to the pre-processing;
connecting the component image extraction module: the image processing device is used for carrying out difference operation on the preprocessed image and the morphologically processed image to obtain a connecting component image;
a connecting member region judging and removing module in a connecting member image: judging whether the connected region is a connected region or not by solving the intersection of each connected region and the characteristic image, and if the connected region is the connected region, performing difference operation on the preprocessed image and the connected region to remove the connected region; the characteristic image is a fixed width area near the upper boundary of the input plane workpiece image;
and the filled hole area removing module is used for obtaining an image of the plane workpiece after the connecting part is removed.
7. An image processing system for removing a connecting component from a planar workpiece, the system comprising:
a memory and one or more processors;
wherein the memory is communicatively coupled to the one or more processors and has stored therein instructions executable by the one or more processors to cause the one or more processors to perform the method of any of claims 1-5.
8. A computer-readable storage medium having stored thereon computer-executable instructions operable to perform the method of any of claims 1-5 when executed by a computing device.
CN201810681017.6A 2018-06-27 2018-06-27 Image processing method and device for removing connecting part of planar workpiece Active CN108876784B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810681017.6A CN108876784B (en) 2018-06-27 2018-06-27 Image processing method and device for removing connecting part of planar workpiece

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810681017.6A CN108876784B (en) 2018-06-27 2018-06-27 Image processing method and device for removing connecting part of planar workpiece

Publications (2)

Publication Number Publication Date
CN108876784A CN108876784A (en) 2018-11-23
CN108876784B true CN108876784B (en) 2021-07-30

Family

ID=64295900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810681017.6A Active CN108876784B (en) 2018-06-27 2018-06-27 Image processing method and device for removing connecting part of planar workpiece

Country Status (1)

Country Link
CN (1) CN108876784B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160162B (en) * 2021-04-14 2022-02-18 深圳远荣智能制造股份有限公司 Hole recognition method and device applied to workpiece and hole processing equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5379347A (en) * 1991-12-13 1995-01-03 Honda Giken Kogyo Kabushiki Kaisha Method of inspecting the surface of a workpiece
CN104599270A (en) * 2015-01-18 2015-05-06 北京工业大学 Breast neoplasms ultrasonic image segmentation method based on improved level set algorithm
CN105205823A (en) * 2015-09-23 2015-12-30 成都融创智谷科技有限公司 Image segmentation method based on morphology
CN107085707A (en) * 2017-04-14 2017-08-22 河海大学 A kind of license plate locating method based on Traffic Surveillance Video
CN107154034A (en) * 2016-03-03 2017-09-12 成都交大光芒科技股份有限公司 The condition detection method and system of a kind of high ferro contact net lateral conductor location hook

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5379347A (en) * 1991-12-13 1995-01-03 Honda Giken Kogyo Kabushiki Kaisha Method of inspecting the surface of a workpiece
CN104599270A (en) * 2015-01-18 2015-05-06 北京工业大学 Breast neoplasms ultrasonic image segmentation method based on improved level set algorithm
CN105205823A (en) * 2015-09-23 2015-12-30 成都融创智谷科技有限公司 Image segmentation method based on morphology
CN107154034A (en) * 2016-03-03 2017-09-12 成都交大光芒科技股份有限公司 The condition detection method and system of a kind of high ferro contact net lateral conductor location hook
CN107085707A (en) * 2017-04-14 2017-08-22 河海大学 A kind of license plate locating method based on Traffic Surveillance Video

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于机器视觉的焊接工件识别与焊接轨迹校正方法研究";李春;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160115;全文 *

Also Published As

Publication number Publication date
CN108876784A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN113658133B (en) Gear surface defect detection method and system based on image processing
US7515764B2 (en) Image processing apparatus using morphology
CN110163219B (en) Target detection method based on image edge recognition
EP3176751B1 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
CN108898610A (en) A kind of object contour extraction method based on mask-RCNN
CN104200210A (en) License plate character segmentation method based on parts
Selvakumar et al. The performance analysis of edge detection algorithms for image processing
CN109447117B (en) Double-layer license plate recognition method and device, computer equipment and storage medium
CN111754538B (en) Threshold segmentation method for USB surface defect detection
CN109850518B (en) Real-time mining adhesive tape early warning tearing detection method based on infrared image
CN109255792B (en) Video image segmentation method and device, terminal equipment and storage medium
CN105447489A (en) Character and background adhesion noise elimination method for image OCR system
CN108876784B (en) Image processing method and device for removing connecting part of planar workpiece
CN106997599A (en) A kind of video moving object subdivision method of light sensitive
CN113610052A (en) Tunnel water leakage automatic identification method based on deep learning
CN116091495B (en) Accurate detection method for road diseases
Huang et al. A real-time algorithm for aluminum surface defect extraction on non-uniform image from CCD camera
Cheriet et al. A formal model for document processing of business forms
Meem et al. Zebra-crossing detection and recognition based on flood fill operation and uniform local binary pattern
Rajan et al. Text detection and character extraction in natural scene images using fractional Poisson model
CN112651936B (en) Steel plate surface defect image segmentation method and system based on image local entropy
CN114862889A (en) Road edge extraction method and device based on remote sensing image
Nain et al. Dynamic thresholding based edge detection
CN110705441B (en) Pedestrian crossing line image post-processing method and system
CN113345015A (en) Package position detection method, device and equipment and readable 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
GR01 Patent grant
GR01 Patent grant