CN109934817B - Method for detecting malformation of external contour of fruit body - Google Patents

Method for detecting malformation of external contour of fruit body Download PDF

Info

Publication number
CN109934817B
CN109934817B CN201910217215.1A CN201910217215A CN109934817B CN 109934817 B CN109934817 B CN 109934817B CN 201910217215 A CN201910217215 A CN 201910217215A CN 109934817 B CN109934817 B CN 109934817B
Authority
CN
China
Prior art keywords
fruit body
fruit
image
vector
external contour
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
CN201910217215.1A
Other languages
Chinese (zh)
Other versions
CN109934817A (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.)
Dalian University
Original Assignee
Dalian 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 Dalian University filed Critical Dalian University
Priority to CN201910217215.1A priority Critical patent/CN109934817B/en
Publication of CN109934817A publication Critical patent/CN109934817A/en
Application granted granted Critical
Publication of CN109934817B publication Critical patent/CN109934817B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for detecting the malformation of the external contour of a fruit body, which comprises the following steps: s1, collecting a color image of the external outline of a fruit, and converting the color image into a gray image; s2, carrying out image segmentation processing on the gray-scale image, and extracting the boundary area of the fruit body in the image by adopting a canny algorithm; s3, adopting a pixel tracking method to clockwise obtain pixel point coordinates of the fruit body boundary; s4, judging the concavity and convexity of the external contour of the fruit body by adopting a right-hand rule; and S5, comparing the number of concave particles on the external contour of the fruit body with a preset threshold value to judge whether the fruit body is removed or reserved. The method is based on computer software to detect the concave-convex defect degree of the fruit body surface, so that the malformed fruit body is removed at a certain precision and speed, a good foundation is laid for the subsequent grading, and the grading quality of the fruit body is improved.

Description

Method for detecting external contour deformity of fruit body
Technical Field
The invention relates to the technical field of fruit body external defect detection, in particular to a fruit body external contour malformation detection method.
Background
In the fruit malformation detection technology, the blade moves on the elevator through the blade opening on the hardware in the prior art, and the abnormal part of the fruit can be cut off by the blade under the action of pressing the fruit downwards. In addition, in the prior art, the defect detection method for the fruit in the can body utilizes the light axis to irradiate along the surface tangential direction of the can body, so that the irregular reflection and shadow are generated at the concave-convex part, and the defect part of the fruit body is detected. However, fruit defect detection methods in the prior art are based on industrial mechanical devices to detect fruit defects, so that not only is technical support of hardware equipment required, but also the detection precision is low due to external interference in the fruit defect detection process, and even after the fruit defects are detected, malformed fruits still appear.
Disclosure of Invention
According to the problems in the prior art, the invention discloses a method for detecting the malformation of the external contour of a fruit body, which specifically comprises the following steps:
s1, collecting a color image of the external outline of a fruit, and converting the color image into a gray image;
s2, carrying out image segmentation processing on the gray level image, removing fruit stalks by utilizing morphological open operation, carrying out denoising processing on fruit bodies by utilizing morphological close operation, and extracting the boundary area of the fruit bodies in the image by adopting a canny algorithm;
s3, adopting a pixel tracking method to clockwise obtain the pixel point coordinates of the fruit body boundary;
s4, judging the concave-convex property of the external outline of the fruit body by adopting a right-hand rule;
and S5, comparing the number of the concave particles on the external contour of the fruit body with a preset threshold value to judge whether the fruit body is removed or reserved.
Further, the concavity and convexity of the outer contour are specifically as follows:
selecting three pixel points of the fruit body boundary, taking m as a base point, setting m + lambda as the pixel point of the mth pixel point which is shifted forward by lambda, setting m-lambda as the pixel point of the mth pixel point which is shifted backward by lambda, and carrying out vector quantity
Figure BDA0002002465790000011
Is a vector formed by base points and backward shifted lambda-bit pixel points
Figure BDA0002002465790000012
Is a vector formed by base points and forward shifted lambda pixel points, and theta is a vector
Figure BDA0002002465790000013
Sum vector
Figure BDA0002002465790000014
Angle of formation, will vector
Figure BDA0002002465790000015
Sum vector
Figure BDA0002002465790000016
And (3) judging the orientation of a normal vector vertical plane by adopting right-hand determination for cross multiplication, judging that the external outline of the fruit body is convex if the normal vector vertical plane faces outwards, judging that the external outline of the fruit body is concave if the normal vector vertical plane faces inwards, moving m clockwise backwards by one bit, and sequentially and circularly judging the concavity and convexity of the boundary pixel points of the fruit body.
Further, the fruit body is removed or retained by adopting the following specific method:
calculating the number x of concave particles, comparing the number x with a threshold th, and when x is larger than or equal to th, determining that the fruit body is a defect and rejecting the fruit body; when x is less than th, the fruit body is regarded as normal and reserved;
Figure BDA0002002465790000021
due to the technical scheme, the method for detecting the malformation of the external contour of the fruit body is based on the software used by a computer to detect the concave-convex defect degree of the surface of the fruit body, so that the malformed fruit body is removed at a certain precision and speed, a good basis is laid for the subsequent grading, and the grading quality of the fruit body is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a schematic diagram of an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of the present invention.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the following describes the technical solutions in the embodiments of the present invention clearly and completely with reference to the drawings in the embodiments of the present invention:
as shown in fig. 1, the method for detecting the malformation of the external contour of a fruit body specifically comprises the following steps:
1. the RGB color mode is used to collect image information outside the fruit body, but RGB does not actually reflect morphological features of the image, so the color image needs to be grayed and converted into an 8-bit grayscale image, and then processed, for example, histogram, grayscale change, binarization and other operations are performed.
2. Dividing the gray image into image, and removing cherry fruit stem and shape by using morphological opening operation
3. And (4) denoising the fruit body by the closed-loop operation, and finally extracting the boundary of the fruit body by adopting a canny algorithm. And acquiring the coordinates of the pixel points of the fruit body boundary clockwise by adopting an 8-connected pixel tracking method on the denoised fruit body boundary.
4. As shown in fig. 2, three pixel points of the boundary of the fruit body are taken, m is taken as a base point, m can rotate clockwise, λ is the step length of the adjacent pixel point, m + λ is the pixel point of the mth pixel point which is shifted forward by λ, and m- λ is the pixel point of the mth pixel point which is shifted backward by λ, and a vector is obtained
Figure BDA0002002465790000031
Is a vector formed by base points and backward shifted lambda-bit pixel points
Figure BDA0002002465790000032
Is a vector formed by a base point and a forward-moving lambda-bit pixel point, theta is an included angle formed by the two vectors, and the right polygon approximately replaces the normal cherry fruit body. For convex edge knowledge, vector
Figure BDA0002002465790000033
Sum vector
Figure BDA0002002465790000034
The right-handed rule for cross-multiplication can determine that the normal vector vertical plane is outward. As shown in fig. 2 and 3, the right polygon is approximately substituted for the body of the cherry with the defect, and the concave edge is known as the vector
Figure BDA0002002465790000035
Sum vector
Figure BDA0002002465790000036
The normal vector obtained by cross multiplication faces inward in the vertical plane. And m, moving clockwise one bit backward, and sequentially and circularly judging the concavity and convexity of the boundary pixel points of the fruit body.
5. Calculating the number of concave particles and comparing the number with a preset threshold value, wherein x is the number of the concave particles and th is the preset threshold value as shown in formula (1), when x is larger than or equal to th, more points with deep concave degree on the fruit body are obtained, and the fruit body is regarded as a defect and is removed; and when x is less than th, the points with deep sunken degrees on the fruit body are less, and the fruit body is regarded as normal and is reserved for the next detection.
Figure BDA0002002465790000037
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

Claims (2)

1. A method for detecting the outer contour deformity of a fruit body is characterized by comprising the following steps:
s1, collecting a color image of the external outline of a fruit, and converting the color image into a gray image;
s2, carrying out image segmentation processing on the gray image, removing fruit stalks by using morphological open operation, carrying out denoising processing on fruit bodies by using morphological close operation, and extracting the boundary region of the fruit bodies in the image by using a canny algorithm;
s3, adopting a pixel tracking method to clockwise obtain the pixel point coordinates of the fruit body boundary;
s4, judging the concavity and convexity of the external contour of the fruit body by adopting a right-hand rule;
s5, comparing the number of concave particles on the external contour of the fruit body with a preset threshold value to judge whether the fruit body is removed or reserved;
the method for judging the concave-convex of the external contour of the fruit body specifically adopts the following mode:
selecting three pixel points of the fruit body boundary, taking m as a base point, setting m + lambda as the pixel point of the mth pixel point which is shifted forward by lambda, setting m-lambda as the pixel point of the mth pixel point which is shifted backward by lambda, and carrying out vector quantity
Figure FDA0003978445910000012
Is a vector formed by base points and backward shifted lambda-bit pixel points
Figure FDA0003978445910000013
Is a vector formed by base points and advanced lambda-bit pixel points, and theta is a vector
Figure FDA0003978445910000016
Sum vector
Figure FDA0003978445910000017
Form an angle of separation, a vector
Figure FDA0003978445910000014
Sum vector
Figure FDA0003978445910000015
Performing cross multiplication and judging the orientation of the normal vector vertical plane by adopting right-hand determination, and if the normal vector vertical plane faces outwards, judgingAnd (3) cutting the external contour of the fruit body into a convex edge, judging that the external contour of the fruit body is a concave edge if the normal vector vertical plane faces inwards, moving m clockwise backwards for one bit, and sequentially and circularly judging the concavity and convexity of the boundary pixel points of the fruit body.
2. The method for detecting malformation of exterior contour of fruit body according to claim 1, further characterized by: the specific method for judging whether the fruit body is removed or reserved is as follows:
calculating the number x of concave particles, comparing the number x with a threshold th, and when x is larger than or equal to th, determining that the fruit body is a defect and rejecting the fruit body; when x is less than th, the fruit body is regarded as normal and reserved;
Figure FDA0003978445910000011
CN201910217215.1A 2019-03-21 2019-03-21 Method for detecting malformation of external contour of fruit body Active CN109934817B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910217215.1A CN109934817B (en) 2019-03-21 2019-03-21 Method for detecting malformation of external contour of fruit body

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910217215.1A CN109934817B (en) 2019-03-21 2019-03-21 Method for detecting malformation of external contour of fruit body

Publications (2)

Publication Number Publication Date
CN109934817A CN109934817A (en) 2019-06-25
CN109934817B true CN109934817B (en) 2023-02-03

Family

ID=66987930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910217215.1A Active CN109934817B (en) 2019-03-21 2019-03-21 Method for detecting malformation of external contour of fruit body

Country Status (1)

Country Link
CN (1) CN109934817B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113096073B (en) * 2021-03-19 2022-10-18 浙江华睿科技股份有限公司 Method and device for detecting surface flatness of chemical fiber spindle
CN116758529B (en) * 2023-08-21 2023-11-14 广东电网有限责任公司广州供电局 Line identification method, device and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10289319A (en) * 1997-04-16 1998-10-27 Sumitomo Electric Ind Ltd Method and device for checking stripe-shaped defect
CN105891231A (en) * 2015-01-26 2016-08-24 青岛农业大学 Carrot surface defect detection method based on image processing
CN108447070A (en) * 2018-03-15 2018-08-24 中国科学院沈阳自动化研究所 A kind of industrial part defect detection algorithm based on pixel vectors invariant relation feature

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10289319A (en) * 1997-04-16 1998-10-27 Sumitomo Electric Ind Ltd Method and device for checking stripe-shaped defect
CN105891231A (en) * 2015-01-26 2016-08-24 青岛农业大学 Carrot surface defect detection method based on image processing
CN108447070A (en) * 2018-03-15 2018-08-24 中国科学院沈阳自动化研究所 A kind of industrial part defect detection algorithm based on pixel vectors invariant relation feature

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Fruit Classification System Using Computer Vision:A Review;Raja Sekar L等;《International Journal of Trend in Research and Development》;20180228;第22-26页 *
Recent Advances in Image Processing Techniquesor Automated Harvesting Purposes: A Review;Carlos S. Pereira等;《Intelligent Systems Conference 2017》;20180326;第566-575页 *
基于NI Vision Assistant的樱桃缺陷检测方法;王昭等;《Computer Science and Application》;20171205;第1-13页 *
基于机器视觉的柚子尺寸检测系统的研究;龚昌来等;《农机化研究》;20131130;第22-25页 *

Also Published As

Publication number Publication date
CN109934817A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109377485A (en) A kind of instant noodles packaging defect machine vision detection method
CN105784713B (en) Sealing ring detection method of surface flaw based on machine vision
CN115375676A (en) Stainless steel product quality detection method based on image recognition
CN108596930B (en) Radiographic image weld extraction method based on longicorn whisker algorithm and mathematical morphology
CN109658402B (en) Automatic detection method for geometric dimension of industrial profile based on computer vision imaging
CN111179243A (en) Small-size chip crack detection method and system based on computer vision
CN116703907B (en) Machine vision-based method for detecting surface defects of automobile castings
CN112053376B (en) Workpiece weld joint identification method based on depth information
CN115880248B (en) Surface scratch defect identification method and visual detection equipment
CN110070523B (en) Foreign matter detection method for bottle bottom
WO2022205525A1 (en) Binocular vision-based autonomous underwater vehicle recycling guidance false light source removal method
CN114399522A (en) High-low threshold-based Canny operator edge detection method
CN114693610A (en) Welding seam surface defect detection method, equipment and medium based on machine vision
CN115131359B (en) Method for detecting pitting defects on surface of metal workpiece
CN113298776B (en) Method for detecting appearance defects of metal closed water pump impeller
CN109934817B (en) Method for detecting malformation of external contour of fruit body
CN110717872A (en) Method and system for extracting characteristic points of V-shaped welding seam image under laser-assisted positioning
CN113298769B (en) FPC flexible flat cable appearance defect detection method, system and medium
CN115797872A (en) Machine vision-based packaging defect identification method, system, equipment and medium
CN111524156A (en) Overlapped citrus segmentation method based on distance transformation and angular point detection
CN114863492B (en) Method and device for repairing low-quality fingerprint image
CN113513991A (en) Battery pole piece burr height detection method and device
CN110060239B (en) Defect detection method for bottle opening of bottle
CN112508913A (en) Cable section edge detection method based on image detection
CN111932490A (en) Method for extracting grabbing information of visual system of industrial robot

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