CN117392162B - Visual-based watermelon section phenotype analysis method, system and device - Google Patents

Visual-based watermelon section phenotype analysis method, system and device Download PDF

Info

Publication number
CN117392162B
CN117392162B CN202311684603.3A CN202311684603A CN117392162B CN 117392162 B CN117392162 B CN 117392162B CN 202311684603 A CN202311684603 A CN 202311684603A CN 117392162 B CN117392162 B CN 117392162B
Authority
CN
China
Prior art keywords
watermelon
pulp
section
outline
image
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
CN202311684603.3A
Other languages
Chinese (zh)
Other versions
CN117392162A (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.)
Zhejiang Top Cloud Agri Technology Co ltd
Original Assignee
Zhejiang Top Cloud Agri 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 Zhejiang Top Cloud Agri Technology Co ltd filed Critical Zhejiang Top Cloud Agri Technology Co ltd
Priority to CN202311684603.3A priority Critical patent/CN117392162B/en
Publication of CN117392162A publication Critical patent/CN117392162A/en
Application granted granted Critical
Publication of CN117392162B publication Critical patent/CN117392162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/10024Color 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/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention discloses a vision-based watermelon section phenotype analysis method, system and device, wherein the method comprises the following steps: acquiring a watermelon section image, obtaining a watermelon pulp binary image and a watermelon section binary image through binarization, and obtaining an initial watermelon pulp contour and an initial watermelon section contour by contour extraction; optimizing and smoothing the initial watermelon pulp outline and the initial watermelon section outline to obtain the watermelon pulp outline and the watermelon section outline; calculating the phenotype parameters of the watermelon section based on the outline of the watermelon flesh and the outline of the watermelon section; separating the watermelon pulp cavity area through the watermelon pulp binary image to obtain an initial cavity area outline; detecting to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle by combining the watermelon seed region circumscribed rectangle, and further obtaining the watermelon pulp cavity area. The method realizes automatic and accurate calculation of the phenotype information of the watermelons, reduces the manual measurement difficulty and error, and improves the efficiency of measuring the phenotype parameters of the cut surfaces of the watermelons.

Description

Visual-based watermelon section phenotype analysis method, system and device
Technical Field
The invention relates to the technical field of image processing, in particular to a visual-based watermelon section phenotype analysis method, system and device.
Background
The analysis of the watermelon section phenotype parameters refers to that parameters such as the longitudinal diameter of the watermelon section, the transverse diameter of the watermelon section, the fruit type parameters of the watermelon, the perimeter of the watermelon section, the area of the watermelon section, the thickness of the watermelon peel, the area of the watermelon pulp, the area occupation ratio of the watermelon pulp and the like are obtained through calculation, the quality of the watermelon is reflected by the watermelon section phenotype parameters to a certain extent, the analysis of the watermelon section phenotype parameters is performed, the analysis can be used for making a watermelon cultivation scheme and guiding the research and development of new varieties of the watermelon, and meanwhile, the watermelon section phenotype parameters are one of important standards for measuring the quality of the watermelon. At present, the calculation of the phenotype parameters of the watermelon section mainly depends on manual measurement, and the method for manually measuring the phenotype parameters of the watermelon section has the problems of large error, high difficulty and low speed.
Along with the rapid development of the machine vision technology, the machine vision is applied to the calculation and analysis of the watermelon section phenotype parameters, so that the rapid and accurate parameter calculation can be realized, meanwhile, the automation and intelligent calculation of the watermelon section phenotype parameters are realized based on the machine vision method, the manual measurement difficulty is reduced, a large amount of manpower and material resources are saved, and the measurement efficiency of the watermelon section phenotype parameters is greatly improved.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a method, a system and a device for analyzing the phenotype of a watermelon section based on vision.
In order to solve the technical problems, the invention is solved by the following technical scheme:
a vision-based watermelon cut surface phenotype analysis method, comprising the following steps:
acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicellus melo and umbilicus melo and pedicellus melo is removed;
performing abnormal restoration on the initial watermelon section outline to obtain a watermelon section outline, and optimizing the initial watermelon pulp outline based on the watermelon section outline to obtain a watermelon pulp outline;
determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the pulp, so as to obtain phenotype parameters of the cut surface of the pulp;
separating the watermelon pulp cavity area based on the watermelon pulp binary image to obtain an initial cavity area outline and an initial cavity area outline circumscribed rectangle;
detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
As an embodiment, the pretreatment includes the steps of:
binarizing the watermelon section image to obtain a watermelon section binary image;
separating white channels from the watermelon tangent plane image in RGB space to obtain a first white channel image, wherein the specific expression is as follows:
wherein,the pixel value of the first white channel image at a certain point is R, G, B which is the separation value of each channel of the watermelon tangent plane image in RGB space, and the sign is that&Representing an AND operation;
and subtracting the watermelon section binary image from the first white channel image to obtain a watermelon pulp binary image.
As an implementation mode, the method for repairing the abnormality of the initial watermelon section profile to obtain the watermelon section profile comprises the following steps:
acquiring all contour point information of the initial watermelon tangent plane contour to obtain a tangent plane contour point set;
calculating minimum points of longitudinal coordinate values in the tangent plane profile point set, connecting all profile points in the tangent plane profile point set by taking the minimum points of longitudinal coordinate values as starting points to form profile line segments, obtaining a profile line segment set, calculating included angles between all profile line segments in the profile line segment set and the negative direction of the longitudinal axis to obtain a line segment included angle set, and calculating the minimum value of the line segment included angle set and the corresponding profile points to obtain minimum included angles of the line segments and included angle profile points;
forming a convex hull point set based on the minimum points of the longitudinal coordinate values and the included angle contour points, judging the distribution relation between all contour points in the tangent plane contour point set and the convex hull point set, if the contour points are positioned on one side of the convex hull point set in the negative direction of the transverse axis, continuing to judge, and if the contour points are positioned on one side of the convex hull point set in the positive direction of the transverse axis, adding the points into the convex hull point set;
traversing the section profile point set, connecting all points in the convex hull point set to obtain a first watermelon section profile, and performing smoothing treatment on the first watermelon section profile to obtain the watermelon section profile.
As an implementation manner, the method optimizes the initial watermelon pulp contour based on the watermelon section contour to obtain the watermelon pulp contour, and includes the following steps:
dividing and extracting the watermelon section image based on the watermelon pulp binary image to obtain a watermelon pulp image;
performing distance transformation on the watermelon section binary image to obtain a distance transformation image;
calculating the pulp distances from all contour points in the initial watermelon pulp contour to the watermelon section contour based on the distance conversion image and the watermelon section contour, and forming a pulp distance set;
traversing all the pulp distances in the pulp distance set, if the pulp distances are smaller than a preset first threshold value, shifting the corresponding outline points of the pulp distances along the direction of the outline center point of the initial pulp to obtain offset points, drawing a circle in the pulp image by taking the offset points as circle centers and a preset second threshold value as radius, and setting the pixel value in the circle area to be 0 to obtain the initial pulp image;
and carrying out smoothing treatment and contour extraction on the initial watermelon pulp image to obtain the watermelon pulp contour.
As an implementation manner, the determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the watermelon comprises the following steps:
obtaining a convex polygon of a watermelon flesh outline and a convex polygon of a watermelon section outline, and obtaining the convex polygon and the convex polygon of the section of the watermelon flesh;
calculating the shortest distance from each point in the watermelon flesh outline to the convex polygon of the watermelon flesh to obtain a set of shortest distances of the watermelon flesh, and calculating the shortest distance from each point in the watermelon tangent plane outline to the convex polygon of the tangent plane to obtain a set of shortest distances of the tangent plane;
and obtaining the positions of pedicellus melo and umbilicus of the melon based on the data change characteristics of the minimum distance set of the melon pulp and the minimum distance set of the tangent plane.
As an embodiment, the watermelon section phenotype parameter includes a longitudinal watermelon section diameter, a transverse watermelon section diameter, a fruit type watermelon parameter, a perimeter of the watermelon section, a cross-sectional area of the watermelon, a thickness of the watermelon peel, an area of the watermelon pulp, and a ratio of the area of the watermelon pulp, and the method comprises the following steps:
based on the positions of the pedicel and the umbilicus, taking the straight line direction between the pedicel and the umbilicus as the rectangular long side direction, obtaining the external rectangle of the outline of the watermelon section, obtaining the external rectangle of the watermelon section, calculating the length of the external rectangle of the watermelon section and the width of the external rectangle of the watermelon section, and obtaining the longitudinal diameter of the watermelon section and the transverse diameter of the watermelon section;
performing polygon fitting on the outline of the watermelon section to obtain a polygon of the watermelon section, and calculating the perimeter and the polygon area of the watermelon section to obtain the perimeter and the area of the watermelon section;
performing distance transformation based on the outline of the watermelon flesh to obtain a watermelon flesh distance image, and obtaining the thickness of the watermelon peel based on pixel values of each point in the watermelon flesh distance image;
based on the outline of the watermelon flesh, the area of the watermelon flesh is obtained, and the area of the watermelon flesh is combined with the area of the section of the watermelon to obtain the area ratio of the watermelon flesh, which is expressed as follows:
obtaining parameters of watermelon fruits according to the longitudinal diameter of the cut surface of the watermelon and the transverse diameter of the cut surface of the watermelon, wherein the parameters are expressed as follows:
wherein,represents the area ratio of watermelon pulp, +.>Indicates the area of watermelon pulp and the content of the watermelon pulp>The cross-sectional area of the watermelon is shown,representing parameters of watermelon fruit type->Represents the transverse diameter of the section of the watermelon>The longitudinal diameter of the cut watermelon surface is shown.
As an embodiment, the obtaining the cavity area of the watermelon pulp includes the following steps:
calculating the ratio of the area of the outline circumscribed rectangle of the initial cavity area to the square of the perimeter of the outline circumscribed rectangle of the initial cavity area, setting a cavity threshold value, and filtering the outline circumscribed rectangle of the initial cavity area meeting the cavity threshold value condition to obtain a first cavity circumscribed rectangle;
detecting the watermelon section image through a detection algorithm to obtain a watermelon seed region circumscribed rectangle, calculating the intersection ratio of the watermelon seed region circumscribed rectangle and the first cavity circumscribed rectangle, and obtaining an intersection ratio set;
setting a cross-over threshold value, and filtering a first cavity external rectangle corresponding to the cross-over threshold value condition in the cross-over set to obtain a watermelon pulp cavity external rectangle;
calculating the rectangular area circumscribed by the watermelon pulp cavity to obtain the watermelon pulp cavity area.
As an embodiment, the obtained set of intersection ratios is represented as follows:
wherein,left upper corner abscissa of circumscribed rectangle representing watermelon seed region, ">Represents the left upper corner abscissa of the first cavity circumscribed rectangle, < >>Vertical sitting position of left upper corner of circumscribed rectangle for watermelon seed regionMark (I) of->Indicating the ordinate of the upper left corner of the first cavity circumscribed rectangle,/->Indicates the abscissa of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Represents the abscissa of the right lower corner of the first cavity circumscribed rectangle, < >>Indicating the ordinate of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Indicating the ordinate of the right lower corner of the first cavity circumscribed rectangle, < >>Representing the cross-over ratio.
A watermelon section phenotype analysis system based on vision comprises an image processing module, a contour optimization module, a phenotype parameter calculation module, a cavity extraction module and a cavity processing and calculation module;
the image processing module is used for acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicel and umbilicus and pedicel is removed;
the profile optimization module is used for carrying out abnormal restoration on the initial watermelon section profile to obtain a watermelon section profile, and optimizing the initial watermelon pulp profile based on the watermelon section profile to obtain a watermelon pulp profile;
the phenotype parameter calculation module is used for determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp of the watermelon and the outline of the section of the watermelon so as to obtain phenotype parameters of the section of the watermelon;
the cavity extraction module separates watermelon pulp cavity areas based on watermelon pulp binary images to obtain initial cavity area outlines and initial cavity area outline circumscribed rectangles;
and the cavity processing and calculating module is used for detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
A computer readable storage medium storing a computer program which when executed by a processor performs the method of:
acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicellus melo and umbilicus melo and pedicellus melo is removed;
performing abnormal restoration on the initial watermelon section outline to obtain a watermelon section outline, and optimizing the initial watermelon pulp outline based on the watermelon section outline to obtain a watermelon pulp outline;
determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the pulp, so as to obtain phenotype parameters of the cut surface of the pulp;
separating the watermelon pulp cavity area based on the watermelon pulp binary image to obtain an initial cavity area outline and an initial cavity area outline circumscribed rectangle;
detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
A vision-based watermelon cut surface phenotype analysis device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the following method when executing the computer program:
acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicellus melo and umbilicus melo and pedicellus melo is removed;
performing abnormal restoration on the initial watermelon section outline to obtain a watermelon section outline, and optimizing the initial watermelon pulp outline based on the watermelon section outline to obtain a watermelon pulp outline;
determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the pulp, so as to obtain phenotype parameters of the cut surface of the pulp;
separating the watermelon pulp cavity area based on the watermelon pulp binary image to obtain an initial cavity area outline and an initial cavity area outline circumscribed rectangle;
detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
The invention has the remarkable technical effects due to the adoption of the technical scheme:
the method can solve the problem of manually calculating the phenotype parameters of the watermelon section, reduce the difficulty of manual calculation under the condition of irregular section, and save a large amount of human resources;
the method realizes the automation and intelligent measurement of the phenotype parameters of the watermelon section, realizes the rapid and accurate measurement of the phenotype parameters of the watermelon section, and greatly improves the measurement efficiency of the phenotype parameters of the watermelon section.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a schematic flow chart of the method of the present invention;
FIG. 2 is an overall schematic of the system of the present invention;
FIG. 3 is a schematic view of the invention for capturing images of a cut of a watermelon;
FIG. 4 is a schematic drawing of the cut surface profile of a watermelon according to the invention;
FIG. 5 is a schematic drawing of the watermelon flesh profile of the invention.
Detailed Description
The present invention will be described in further detail with reference to the following examples, which are illustrative of the present invention and are not intended to limit the present invention thereto.
Example 1:
a visual-based watermelon section phenotype analysis method is shown in fig. 1, and comprises the following steps:
s100, acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicel and umbilicus and pedicel is removed;
s200, carrying out abnormal restoration on the initial watermelon section outline to obtain a watermelon section outline, and optimizing the initial watermelon pulp outline based on the watermelon section outline to obtain a watermelon pulp outline;
s300, determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the pulp, and further obtaining phenotype parameters of the cut surface of the pulp;
s400, separating the watermelon flesh cavity area based on the watermelon flesh binary image to obtain an initial cavity area outline and an initial cavity area outline circumscribed rectangle;
s500, detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
The method solves the problem that the calculation of the phenotype parameters of the watermelon section by manpower is time-consuming and labor-consuming; the automatic and intelligent measurement of the phenotype parameters of the watermelon cut surface is realized, the error of manual measurement is reduced, and the measurement efficiency of the phenotype parameters of the watermelon is improved; meanwhile, the method solves the problem that the phenotype parameters of the irregular polygonal watermelon section are difficult to calculate manually, and achieves the purpose of rapidly and accurately acquiring the phenotype parameters of the watermelon section.
In step S100, a watermelon section image is obtained, a watermelon section binary image and a watermelon pulp binary image are obtained through preprocessing, an initial watermelon section contour and an initial watermelon pulp contour are extracted, wherein the watermelon section image is cut along the directions of a melon base and a melon umbilicus and the melon base is removed, and the method comprises the following steps:
s110: in this embodiment, the image of the watermelon section can be acquired by a scanner or a camera, when the scanner is adopted to acquire the image of the watermelon section, the whole section of the watermelon is put into the scanner, the image of the watermelon section is obtained by scanning, when the camera is adopted to acquire the image of the watermelon section, a glass plate with calibration characteristics or other materials with better light transmittance are covered on the surface of the watermelon section, and the image of the watermelon section is obtained according to the position relationship among the characteristic points, as shown in fig. 3;
s120: graying the watermelon section image to obtain a watermelon gray image image_gray, wherein the watermelon section image is cut along the directions of pedicel and umbilicus and pedicel is removed;
s130: in the embodiment, binarization processing is carried out on the watermelon gray image image_gray by an inter-class variance threshold segmentation method to obtain a watermelon section binary image image_binary;
s140: in RGB space, separating white channel of watermelon section image to obtain first white image rind_binary, subtracting watermelon section binary image image_binary from first white image rind_binary to obtain watermelon pulp binary image, and expressing as follows:
wherein,the pixel value of the first white channel image at a certain point is R, G, B which is the separation value of each channel of the watermelon tangent plane image in RGB space, and the sign is that&Representing an AND operation;
s150: and extracting an initial watermelon section outline and an initial watermelon flesh outline from the watermelon section binary image image_binary and the watermelon flesh binary image pulp_binary respectively by using a library function findContours () of OpenCV.
In step S200, the initial watermelon cut surface contour is subjected to anomaly restoration to obtain a watermelon cut surface contour, and the initial watermelon pulp contour is optimized based on the watermelon cut surface contour to obtain a watermelon pulp contour, comprising the following steps:
s210: because the cellulose content in the watermelon peel is not high, bundling fibers are not formed, lignin in the watermelon peel is excessively accumulated, the strength of the watermelon peel is reduced, a certain pressure exists in the pulp of the watermelon, when a knife just cuts a small opening, the local stress at the cut position of the watermelon is excessively concentrated to cause the cracking of the watermelon, after the cracking of the watermelon, cracks are formed on a section, errors are generated when the phenotype parameters of the section of the watermelon are calculated, and according to the outline of the section of the original watermelon, the crack position of the watermelon is connected and repaired by utilizing a polygon fitting method, and the following steps are detailed in the following steps:
step1: acquiring a section profile point set according to the initial watermelon section profileCalculate->Minimum point of middle ordinate value->To->Is the starting point, connect->Obtaining a contour line segment set +.>Distribution calculation->The included angles between all the contour line segments and the negative direction of the longitudinal axis are obtained to obtain a line segment included angle set +.>
Step2: calculation ofContour points corresponding to the minimum values, the included angle contour points +.>According to->Size pair corresponding contour line segment->Sequencing to establish a convex hull point set +.>If->Distributed in->One side of the horizontal axis in the negative direction is selected as the point +.>To make a determination if->Distributed in->On the other side of the negative direction of the horizontal axis, point +.>Adding a convex hull point set;
step3: traversingConnecting the resultant->The first watermelon cut surface profile is obtained from all points in (a).
S220: in this embodiment, the gaussian function is used to smooth the profile of the first watermelon section, and the smoothing process is detailed in the following steps:
step1: separating an abscissa and an ordinate in the profile of the first watermelon tangent plane to establish an abscissa array X and an ordinate array Y;
step2: generating a discrete array G with a length R according to a Gaussian formula, wherein the Gaussian formula is expressed as follows:
wherein,xthe value is taken for the coordinates and,for mean value->Is the standard deviation;
step3: the discrete array G is weighted with the abscissa array X and the ordinate array Y respectively to obtain the profile of the watermelon section, as shown in figure 4.
S230: watermelon pulp is unevenly distributed at pedicel and umbilicus, watermelon pulp separation abnormality exists by color segmentation, the position of the watermelon pulp separation abnormality is repaired by adopting a rounding method, and the specific steps of the rounding method are as follows:
step1: dividing and extracting the watermelon cut surface image by combining the watermelon pulp binary image to obtain the watermelon pulp image, and performing distance transformation on the watermelon cut surface binary image by utilizing a distance transformation function distance transformation () of an OpenCV library function to obtain a distance transformation image image_dist;
Step2:
RCM(D,P,I)
c=null;
num=0,thick=0;
for i in P
d=D.at<float>(P[i].y,P[i].y);
c.push_back(d);
thick+=d;
num++;
thick=thick/num;
for i in c
if(c[i]<0.25*thick)
k=abs(P[i].y-O[i].y)/abs(P[i].x-O[i].x);
delta_x=0.25*thick/sqrt(1+k*k);
delta_y=delta_x*k;
circle(I, Point(delta_x+P[i].x, delta_y+P[i].y), thick* 0.25, Scalar(0),-1);
wherein D is a distance conversion image image_dist, P is a watermelon flesh outline, and I is a watermelon flesh image;
step3: obtaining the pulp distances from all contour points in the initial pulp contour to the contour of the watermelon section based on the distance conversion image to obtain a pulp distance setCalculating average distance +.>
Step4: traversingIf the distance between the melon flesh is smaller than the preset first threshold, the preset first threshold is a quarter of the average distance +.>The corresponding contour point is shifted 0.25 x from the original watermelon flesh contour center O>About 0.25 × offset point as center of circle>And drawing a circle in the watermelon flesh image with the radius, and filling the pixel value in the circle to be 0 to obtain an initial watermelon flesh image.
S240: extracting the outline of the original watermelon pulp image, and smoothing the outline by adopting a mean value method to obtain the outline of the watermelon pulp, wherein the outline is expressed as follows:
ASM(P,C)
C=null;
L=approxPolyDP(P)
for i in L
C.push_back((L[i].x+L[i+1].x)/2,(L[i].y+L[i+1].y)/2);
wherein P is an initial watermelon pulp outline image, an empty set C is initialized, polygon fitting processing is performed on the initial watermelon pulp outline image to obtain a polygon outline L, coordinates of two continuous points in the polygon outline are averaged, and the watermelon pulp outline is obtained after smoothing processing, as shown in fig. 5.
In step S300, the positions of the pedicellus melo and the umbilicus melo are determined based on the outline of the pulp and the outline of the cut surface of the pulp, so as to obtain the phenotype parameters of the cut surface of the pulp melo, comprising the following steps:
s310: according to the watermelon pulp outline pulp_contour and the watermelon section outline image_contour, calculating to obtain a convex polygon pulp_hull of the watermelon pulp outline and a convex polygon image_hull of the watermelon section outline;
s320: obtaining the shortest distance from each contour point in watermelon pulp contour p_contour to a convex polygon of watermelon pulp contour p_hull to obtain a set P of shortest distances of the watermelon pulp, and calculating the shortest distance from each contour point in watermelon section contour image_contour to a convex polygon of watermelon section contour to obtain a set H of shortest distances of sections;
s330: calculating the data change characteristics of the melon pulp shortest distance set P and the tangent plane shortest distance set H by utilizing a sliding window method, wherein the specific steps are as follows:
h=null,b=null;
int window_width=a;
for i-a in H
for j in a
d+=H[i+j];
h.push_pack(d/a);
d=0;
for i-1 in h
b.push_back(h[i+1]-h[i]);
initializing empty sets h and b, wherein the empty sets h and b are used for storing data calculated by a sliding window method and differences between two adjacent data calculated by the sliding window method, initializing the size of the sliding window to be a, calculating the average value of data in a window of the set P, H, putting the average value into the set b, and determining positions of pedicellus melo and umbilicus melo of watermelons according to the data in the set b;
s340: calculating the external rectangle R of the contour image_contour of the watermelon section from the direction of the straight line of the pedicel and the navel of the watermelon as the direction of the long side of the rectangle, and calculating the length of R as the longitudinal diameter of the watermelon sectionCalculating the width of R as the transverse diameter of the section of the watermelon>Obtaining parameters of watermelon fruits according to the longitudinal diameter of the cut surface of the watermelon and the transverse diameter of the cut surface of the watermelon, wherein the parameters are expressed as follows:
wherein,parameters representing watermelon fruits;
s350: performing polygon fitting on the watermelon section profile image_contour to obtain a fitted section profile A, calculating the perimeter of the fitted section profile A to obtain the perimeter of the watermelon section and the watermelon section area, obtaining the watermelon pulp area based on the watermelon pulp profile pulp_contour, and obtaining the watermelon pulp area occupation ratio based on the watermelon section area and the watermelon pulp area, wherein the method comprises the following steps of:
wherein,represents the area ratio of watermelon pulp, +.>Indicates the area of watermelon pulp and the content of the watermelon pulp>Representing the cross-sectional area of the watermelon;
s360: and traversing pixel values of each point of the watermelon flesh outline in the distance transformation image rind_dist based on the distance transformation image rind_dist, and carrying out weighted average on the obtained pixel values to obtain the thickness of the watermelon peel.
In step S400, separating the watermelon pulp void area based on the watermelon pulp binary image to obtain an initial void area outline and an initial void area outline circumscribed rectangle, including the following steps:
watermelon hollowness refers to the phenomenon that hollow or cracks appear in the pulp, so that the yield and the quality are greatly affected. The watermelon is hollow and is mainly influenced by various factors such as temperature, illumination, melon sitting position, fertilizer and water management, harvesting time and the like. The hole area of the watermelon is darker in color, the hole edge is smoother, the initial hole area outline is obtained by extraction based on the binary image of the watermelon pulp and the characteristics of the watermelon pulp, and the circumscribed rectangle of the initial hole area outline is calculated to obtain the circumscribed rectangle of the initial hole area outline.
In step S500, the watermelon seeds in the watermelon section image are detected to obtain a watermelon seed region circumscribed rectangle, the initial cavity region outline circumscribed rectangle is screened based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and the watermelon pulp cavity area is obtained based on the watermelon pulp cavity circumscribed rectangle, comprising the following steps:
s510: watermelon flesh itself also has texture, color distribution inhomogeneous, and some watermelon flesh regions can misrecognize as the cavity, and the partial edge that watermelon flesh misrecognized as the cavity region is jagged, and the ratio of girth and area of accessible initial cavity region outline circumscribed rectangle rejects the false detection region, and is expressed as follows:
wherein,represents the outline circumscribed rectangular area of the initial cavity area, +.>Representing the perimeter of the outline circumscribed rectangle of the initial cavity area, setting a cavity threshold value, filtering the initial cavity circumscribed rectangle meeting the cavity threshold value condition, and obtaining a first cavity circumscribed rectangle;
s520: acquiring a watermelon section image with watermelon seeds, detecting a watermelon seed region in the watermelon section image by using a detection algorithm to obtain a watermelon seed region circumscribed rectangle seed_rectangle, and calculating the cross-over ratio of a first cavity circumscribed rectangle hole_rectangle to the watermelon seed region circumscribed rectangle seed_rectangleThe expression is as follows:
wherein,left upper corner abscissa of circumscribed rectangle representing watermelon seed region, ">Represents the left upper corner abscissa of the first cavity circumscribed rectangle, < >>Indicates the vertical coordinate of the upper left corner of the circumscribed rectangle of the watermelon seed region,>indicating the ordinate of the upper left corner of the first cavity circumscribed rectangle,/->Indicates the abscissa of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Represents the abscissa of the right lower corner of the first cavity circumscribed rectangle, < >>Indicating the ordinate of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Representing the ordinate of the lower right corner of the circumscribed rectangle of the first cavity,representing the cross-over ratio;
s530: and setting an intersection ratio threshold value, filtering a first cavity external rectangle corresponding to the intersection ratio threshold value condition to obtain a watermelon pulp cavity external rectangle, and calculating the area of the watermelon pulp cavity external rectangle to obtain the area of the watermelon pulp cavity.
Example 2:
a vision-based watermelon section phenotype analysis system is shown in fig. 2, and comprises an image processing module 100, a profile optimization module 200, a phenotype parameter calculation module 300, a cavity extraction module 400 and a cavity processing and calculation module 500;
the image processing module 100 acquires a watermelon section image, obtains a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracts an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicel and umbilicus and the pedicel is removed;
the profile optimization module 200 performs abnormal restoration on the initial watermelon section profile to obtain a watermelon section profile, and optimizes the initial watermelon pulp profile based on the watermelon section profile to obtain a watermelon pulp profile;
the phenotype parameter calculation module 300 determines positions of pedicellus melo and umbilicus of the melon based on the outline of the watermelon flesh and the outline of the cut surface of the watermelon, so as to obtain phenotype parameters of the cut surface of the watermelon;
the cavity extraction module 400 separates the watermelon pulp cavity region based on the watermelon pulp binary image to obtain an initial cavity region outline and an initial cavity region outline circumscribed rectangle;
the cavity processing and calculating module 500 detects watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screens the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtains a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle.
All changes and modifications that come within the spirit and scope of the invention are desired to be protected and all equivalent thereto are deemed to be within the scope of the invention.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that identical and similar parts of each embodiment are mutually referred to.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that:
reference in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Thus, the appearances of the phrase "one embodiment" or "an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment.
In addition, the specific embodiments described in the present specification may differ in terms of parts, shapes of components, names, and the like. All equivalent or simple changes of the structure, characteristics and principle according to the inventive concept are included in the protection scope of the present invention. Those skilled in the art may make various modifications or additions to the described embodiments or substitutions in a similar manner without departing from the scope of the invention as defined in the accompanying claims.

Claims (9)

1. A vision-based watermelon cut surface phenotype analysis method, which is characterized by comprising the following steps:
acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicellus melo and umbilicus melo and pedicellus melo is removed;
performing abnormal restoration on the initial watermelon section outline to obtain a watermelon section outline, and optimizing the initial watermelon pulp outline based on the watermelon section outline to obtain a watermelon pulp outline;
determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp and the outline of the cut surface of the pulp, so as to obtain phenotype parameters of the cut surface of the pulp;
separating the watermelon pulp cavity area based on the watermelon pulp binary image to obtain an initial cavity area outline and an initial cavity area outline circumscribed rectangle;
detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle;
the method comprises the following steps of:
acquiring all contour point information of the initial watermelon tangent plane contour to obtain a tangent plane contour point set;
calculating minimum points of longitudinal coordinate values in the tangent plane profile point set, connecting all profile points in the tangent plane profile point set by taking the minimum points of longitudinal coordinate values as starting points to form profile line segments, obtaining a profile line segment set, calculating included angles between all profile line segments in the profile line segment set and the negative direction of the longitudinal axis to obtain a line segment included angle set, and calculating the minimum value of the line segment included angle set and the corresponding profile points to obtain minimum included angles of the line segments and included angle profile points;
forming a convex hull point set based on the minimum points of the longitudinal coordinate values and the included angle contour points, judging the distribution relation between all contour points in the tangent plane contour point set and the convex hull point set, if the contour points are positioned on one side of the convex hull point set in the negative direction of the transverse axis, continuing to judge, and if the contour points are positioned on one side of the convex hull point set in the positive direction of the transverse axis, adding the points into the convex hull point set;
traversing the section profile point set, connecting all points in the convex hull point set to obtain a first watermelon section profile, and performing smoothing treatment on the first watermelon section profile to obtain a watermelon section profile;
the method comprises the following steps of:
dividing and extracting the watermelon section image based on the watermelon pulp binary image to obtain a watermelon pulp image;
performing distance transformation on the watermelon section binary image to obtain a distance transformation image;
calculating the pulp distances from all contour points in the initial watermelon pulp contour to the watermelon section contour based on the distance conversion image and the watermelon section contour, and forming a pulp distance set;
traversing all the pulp distances in the pulp distance set, if the pulp distances are smaller than a preset first threshold value, shifting the corresponding outline points of the pulp distances along the direction of the outline center point of the initial pulp to obtain offset points, drawing a circle in the pulp image by taking the offset points as circle centers and a preset second threshold value as radius, and setting the pixel value in the circle area to be 0 to obtain the initial pulp image;
and carrying out smoothing treatment and contour extraction on the initial watermelon pulp image to obtain the watermelon pulp contour.
2. The vision-based watermelon cut surface phenotyping method of claim 1, wherein said pretreatment comprises the steps of:
binarizing the watermelon section image to obtain a watermelon section binary image;
separating white channels from the watermelon tangent plane image in RGB space to obtain a first white channel image, wherein the specific expression is as follows:
wherein,the pixel value of the first white channel image at a certain point is R, G, B which is the separation value of each channel of the watermelon tangent plane image in RGB space, and the sign is that&Representing an AND operation;
and subtracting the watermelon section binary image from the first white channel image to obtain a watermelon pulp binary image.
3. The vision-based watermelon cut surface phenotyping method of claim 1, wherein said determining the positions of the pedicellus melo and the umbilicus of the watermelon based on the outline of the pulp and the outline of the cut surface of the watermelon comprises the steps of:
obtaining a convex polygon of a watermelon flesh outline and a convex polygon of a watermelon section outline, and obtaining the convex polygon and the convex polygon of the section of the watermelon flesh;
calculating the shortest distance from each point in the watermelon flesh outline to the convex polygon of the watermelon flesh to obtain a set of shortest distances of the watermelon flesh, and calculating the shortest distance from each point in the watermelon tangent plane outline to the convex polygon of the tangent plane to obtain a set of shortest distances of the tangent plane;
and obtaining the positions of pedicellus melo and umbilicus of the melon based on the data change characteristics of the minimum distance set of the melon pulp and the minimum distance set of the tangent plane.
4. A vision-based watermelon cut surface phenotyping method according to claim 1 or 3, wherein said watermelon cut surface phenotyping parameters comprise a watermelon cut surface longitudinal diameter, a watermelon cut surface transverse diameter, a watermelon fruit type parameter, a watermelon cut surface perimeter, a watermelon cut surface area, a watermelon peel thickness, a watermelon pulp area and a watermelon pulp area ratio, comprising the steps of:
based on the positions of the pedicel and the umbilicus, taking the straight line direction between the pedicel and the umbilicus as the rectangular long side direction, obtaining the external rectangle of the outline of the watermelon section, obtaining the external rectangle of the watermelon section, calculating the length of the external rectangle of the watermelon section and the width of the external rectangle of the watermelon section, and obtaining the longitudinal diameter of the watermelon section and the transverse diameter of the watermelon section;
performing polygon fitting on the outline of the watermelon section to obtain a polygon of the watermelon section, and calculating the perimeter and the polygon area of the watermelon section to obtain the perimeter and the area of the watermelon section;
performing distance transformation based on the outline of the watermelon flesh to obtain a watermelon flesh distance image, and obtaining the thickness of the watermelon peel based on pixel values of each point in the watermelon flesh distance image;
based on the outline of the watermelon flesh, the area of the watermelon flesh is obtained, and the area of the watermelon flesh is combined with the area of the section of the watermelon to obtain the area ratio of the watermelon flesh, which is expressed as follows:
obtaining parameters of watermelon fruits according to the longitudinal diameter of the cut surface of the watermelon and the transverse diameter of the cut surface of the watermelon, wherein the parameters are expressed as follows:
wherein,represents the area ratio of watermelon pulp, +.>Indicates the area of watermelon pulp and the content of the watermelon pulp>Indicates the area of the section of the watermelon, and the root of the formula%>Representing parameters of watermelon fruit type->Represents the transverse diameter of the section of the watermelon>The longitudinal diameter of the cut watermelon surface is shown.
5. The vision-based watermelon cut surface phenotyping method of claim 1, wherein said obtaining the area of the cavity of the watermelon flesh comprises the steps of:
calculating the ratio of the area of the outline circumscribed rectangle of the initial cavity area to the square of the perimeter of the outline circumscribed rectangle of the initial cavity area, setting a cavity threshold value, and filtering the outline circumscribed rectangle of the initial cavity area meeting the cavity threshold value condition to obtain a first cavity circumscribed rectangle;
detecting the watermelon section image through a detection algorithm to obtain a watermelon seed region circumscribed rectangle, calculating the intersection ratio of the watermelon seed region circumscribed rectangle and the first cavity circumscribed rectangle, and obtaining an intersection ratio set;
setting a cross-over threshold value, and filtering a first cavity external rectangle corresponding to the cross-over threshold value condition in the cross-over set to obtain a watermelon pulp cavity external rectangle;
calculating the rectangular area circumscribed by the watermelon pulp cavity to obtain the watermelon pulp cavity area.
6. The vision-based watermelon cut surface phenotyping method of claim 5, wherein said set of obtained cross-ratios is expressed as follows:
wherein,left upper corner abscissa of circumscribed rectangle representing watermelon seed region, ">Represents the left upper corner abscissa of the first cavity circumscribed rectangle, < >>Indicates the vertical coordinate of the upper left corner of the circumscribed rectangle of the watermelon seed region,>indicating the ordinate of the upper left corner of the first cavity circumscribed rectangle,/->Indicates the abscissa of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Representing the abscissa of the lower right corner of the first void bounding rectangle,indicating the ordinate of the right lower corner of the circumscribed rectangle of the watermelon seed region, < ->Representing the ordinate of the lower right corner of the circumscribed rectangle of the first cavity,representing the cross-over ratio.
7. The watermelon section phenotype analysis system based on vision is characterized by comprising an image processing module, a contour optimization module, a phenotype parameter calculation module, a cavity extraction module and a cavity processing and calculation module;
the image processing module is used for acquiring a watermelon section image, respectively acquiring a watermelon section binary image and a watermelon pulp binary image through pretreatment, and extracting an initial watermelon section outline and an initial watermelon pulp outline, wherein the watermelon section image is cut along the directions of pedicel and umbilicus and pedicel is removed;
the profile optimization module is used for carrying out abnormal restoration on the initial watermelon section profile to obtain a watermelon section profile, and optimizing the initial watermelon pulp profile based on the watermelon section profile to obtain a watermelon pulp profile;
the phenotype parameter calculation module is used for determining positions of pedicellus melo and umbilicus melo based on the outline of the pulp of the watermelon and the outline of the section of the watermelon so as to obtain phenotype parameters of the section of the watermelon;
the cavity extraction module separates watermelon pulp cavity areas based on watermelon pulp binary images to obtain initial cavity area outlines and initial cavity area outline circumscribed rectangles;
the cavity processing and calculating module is used for detecting watermelon seeds in the watermelon section image to obtain a watermelon seed region circumscribed rectangle, screening the initial cavity region outline circumscribed rectangle based on the watermelon seed region circumscribed rectangle and the initial cavity region outline circumscribed rectangle to obtain a watermelon pulp cavity circumscribed rectangle, and obtaining a watermelon pulp cavity area based on the watermelon pulp cavity circumscribed rectangle;
the method comprises the following steps of:
acquiring all contour point information of the initial watermelon tangent plane contour to obtain a tangent plane contour point set;
calculating minimum points of longitudinal coordinate values in the tangent plane profile point set, connecting all profile points in the tangent plane profile point set by taking the minimum points of longitudinal coordinate values as starting points to form profile line segments, obtaining a profile line segment set, calculating included angles between all profile line segments in the profile line segment set and the negative direction of the longitudinal axis to obtain a line segment included angle set, and calculating the minimum value of the line segment included angle set and the corresponding profile points to obtain minimum included angles of the line segments and included angle profile points;
forming a convex hull point set based on the minimum points of the longitudinal coordinate values and the included angle contour points, judging the distribution relation between all contour points in the tangent plane contour point set and the convex hull point set, if the contour points are positioned on one side of the convex hull point set in the negative direction of the transverse axis, continuing to judge, and if the contour points are positioned on one side of the convex hull point set in the positive direction of the transverse axis, adding the points into the convex hull point set;
traversing the section profile point set, connecting all points in the convex hull point set to obtain a first watermelon section profile, and performing smoothing treatment on the first watermelon section profile to obtain a watermelon section profile;
the method comprises the following steps of:
dividing and extracting the watermelon section image based on the watermelon pulp binary image to obtain a watermelon pulp image;
performing distance transformation on the watermelon section binary image to obtain a distance transformation image;
calculating the pulp distances from all contour points in the initial watermelon pulp contour to the watermelon section contour based on the distance conversion image and the watermelon section contour, and forming a pulp distance set;
traversing all the pulp distances in the pulp distance set, if the pulp distances are smaller than a preset first threshold value, shifting the corresponding outline points of the pulp distances along the direction of the outline center point of the initial pulp to obtain offset points, drawing a circle in the pulp image by taking the offset points as circle centers and a preset second threshold value as radius, and setting the pixel value in the circle area to be 0 to obtain the initial pulp image;
and carrying out smoothing treatment and contour extraction on the initial watermelon pulp image to obtain the watermelon pulp contour.
8. A computer readable storage medium storing a computer program, which when executed by a processor implements the method of any one of claims 1 to 6.
9. A vision-based watermelon cut surface phenotyping device comprising a memory, a processor and a computer program stored in said memory and running on said processor, wherein said processor implements the method of any one of claims 1 to 6 when executing said computer program.
CN202311684603.3A 2023-12-11 2023-12-11 Visual-based watermelon section phenotype analysis method, system and device Active CN117392162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311684603.3A CN117392162B (en) 2023-12-11 2023-12-11 Visual-based watermelon section phenotype analysis method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311684603.3A CN117392162B (en) 2023-12-11 2023-12-11 Visual-based watermelon section phenotype analysis method, system and device

Publications (2)

Publication Number Publication Date
CN117392162A CN117392162A (en) 2024-01-12
CN117392162B true CN117392162B (en) 2024-02-09

Family

ID=89470564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311684603.3A Active CN117392162B (en) 2023-12-11 2023-12-11 Visual-based watermelon section phenotype analysis method, system and device

Country Status (1)

Country Link
CN (1) CN117392162B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065149A (en) * 2012-12-21 2013-04-24 上海交通大学 Netted melon fruit phenotype extraction and quantization method
CN104346614A (en) * 2014-09-04 2015-02-11 四川农业大学 Watermelon image processing and positioning method under real scene
WO2017067390A1 (en) * 2015-10-20 2017-04-27 努比亚技术有限公司 Method and terminal for obtaining depth information of low-texture regions in image
CN113518182A (en) * 2021-06-30 2021-10-19 天津市农业科学院 Cucumber phenotype characteristic measuring method based on raspberry pie
CN116721121A (en) * 2023-06-13 2023-09-08 王亮苗 Plant phenotype color image feature extraction method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10186029B2 (en) * 2014-09-26 2019-01-22 Wisconsin Alumni Research Foundation Object characterization
CN115147638A (en) * 2022-05-07 2022-10-04 杭州电子科技大学 Machine vision-based cherry picking and classifying method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065149A (en) * 2012-12-21 2013-04-24 上海交通大学 Netted melon fruit phenotype extraction and quantization method
CN104346614A (en) * 2014-09-04 2015-02-11 四川农业大学 Watermelon image processing and positioning method under real scene
WO2017067390A1 (en) * 2015-10-20 2017-04-27 努比亚技术有限公司 Method and terminal for obtaining depth information of low-texture regions in image
CN113518182A (en) * 2021-06-30 2021-10-19 天津市农业科学院 Cucumber phenotype characteristic measuring method based on raspberry pie
CN116721121A (en) * 2023-06-13 2023-09-08 王亮苗 Plant phenotype color image feature extraction method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘万辉 ; 杨晔 ; .温室场景下成熟西瓜的图像识别研究.福建电脑.2013,(05),全文. *
基于改进的SSD框架与表型特征的黄瓜快速分级算法;李凤菊;王浩;王建春;郭仰东;刘楠;李扬;;贵州农业科学;20191215(12);全文 *
曹姝清 ; 刘宗明 ; 牟金震 ; 张翰墨 ; 张宇 ; .空间目标快速轮廓特征提取与跟踪技术.飞控与探测.2018,(02),全文. *

Also Published As

Publication number Publication date
CN117392162A (en) 2024-01-12

Similar Documents

Publication Publication Date Title
CN115375676B (en) Stainless steel product quality detection method based on image recognition
CN115311292B (en) Strip steel surface defect detection method and system based on image processing
CN114419025A (en) Fiberboard quality evaluation method based on image processing
CN108181316B (en) Bamboo strip defect detection method based on machine vision
CN108943179B (en) Optimal cutting method for wood surface defects
CN114219805B (en) Intelligent detection method for glass defects
CN115294144B (en) Method for identifying surface defects of furniture composite board
CN108038838A (en) A kind of cotton fibriia species automatic testing method and system
CN113298776B (en) Method for detecting appearance defects of metal closed water pump impeller
CN116310845B (en) Intelligent monitoring system for sewage treatment
CN115880299A (en) Quality detection system of lightweight concrete composite self-insulation external wall panel
CN115115642A (en) Strip steel scab defect detection method based on image processing
CN111122590A (en) Ceramic surface defect detection device and detection method
CN116188468B (en) HDMI cable transmission letter sorting intelligent control system
CN115620061A (en) Hardware part defect detection method and system based on image recognition technology
CN115294159A (en) Method for dividing corroded area of metal fastener
CN113298769A (en) FPC flexible flat cable appearance defect detection method, system and medium
CN117392162B (en) Visual-based watermelon section phenotype analysis method, system and device
CN117253024B (en) Industrial salt quality inspection control method and system based on machine vision
CN107239761B (en) Fruit tree branch pulling effect evaluation method based on skeleton angular point detection
CN109934817B (en) Method for detecting malformation of external contour of fruit body
CN111524143A (en) Processing method for foam adhesion image area segmentation
CN114550167B (en) Artificial intelligence based pear quality classification method and device
CN114913152A (en) Machine vision-based wood cutting surface deburring quality evaluation method and system
CN115496753A (en) Tobacco shred structure detection method based on machine vision

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