CN115620279A - Pod phenotype analysis method, system and device based on computer vision - Google Patents

Pod phenotype analysis method, system and device based on computer vision Download PDF

Info

Publication number
CN115620279A
CN115620279A CN202211253503.0A CN202211253503A CN115620279A CN 115620279 A CN115620279 A CN 115620279A CN 202211253503 A CN202211253503 A CN 202211253503A CN 115620279 A CN115620279 A CN 115620279A
Authority
CN
China
Prior art keywords
pod
image
information
correction
binary 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.)
Pending
Application number
CN202211253503.0A
Other languages
Chinese (zh)
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 CN202211253503.0A priority Critical patent/CN115620279A/en
Publication of CN115620279A publication Critical patent/CN115620279A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level

Abstract

The invention discloses a pod phenotype analysis method, a pod phenotype analysis system and a pod phenotype analysis device based on computer vision, wherein the pod phenotype analysis method comprises the steps of carrying out image enhancement processing on an original pod image to obtain an enhanced pod image; preprocessing the enhanced pod image to obtain a pod binary image; detecting the perimeter and the area of the pod based on the pod binary image; extracting pod framework information based on the pod binary image, and correcting the pod binary image; extracting pod skeleton information after correction based on the binary image after correction, and detecting pod length and pod width by using a single-source path search algorithm and a vertical line cutting pod phenotype analysis method; and obtaining the number of the pod seeds based on the positive-turning binary image and the pod skeleton information after positive turning. The method overcomes the defects that the traditional measuring method has strong subjectivity and low efficiency in the measuring process and the same parameter needs to be measured in a segmented manner, can quickly and accurately obtain the pod phenotype parameters, meets the requirements of researchers on the pod phenotype parameter measurement, and provides data reference for pod phenotype research.

Description

Pod phenotype analysis method, system and device based on computer vision
Technical Field
The invention relates to the technical field of computer vision, in particular to a pod phenotype analysis method, system and device based on computer vision.
Background
In the prior art, phenotypic characteristics such as perimeter, area, length, width and automatic seed counting are mainly measured manually for pod phenotype information. A pod disease judgment standard and method are provided by comparing and analyzing the influences of different light source transmission angles, different carrying medium materials, different light source transmission distances and different collection environments on pod images and collecting and statistically analyzing diffuse reflection images and transmission images of pod samples based on transmission and diffuse reflection image collection modes of an image collection platform of a CMOS camera and a tungsten halogen lamp light source. The phenotypic characteristic data of soybean plants are extracted through a machine vision technology, a high-angle lighting system is adopted to carry a middle-high-end CMOS camera to obtain a high-quality whole soybean image, and the plant height, branch number, main stem, single plant pod number, pod width, pod length, pod type and other phenotypic information of the phenotypic characteristics of the soybean plants can be obtained through methods such as a deep convolution neural network, watershed image segmentation, ant colony algorithm, skeleton refinement, hough detection, SURF matching and the like. In addition, the pod number detection can be realized by a deep learning method, but the seed particle number and pod phenotype measurement functions are not realized.
In addition, in the existing pod phenotype typing device, a soybean seed and pod image analysis scheme is provided, and the particular placed pods are subjected to phenotype analysis in a multi-hardware combination mode of multi-camera combination, camera bellows, baffle plates and the like, wherein the phenotype analysis comprises pod color, seed number, pod length and width and the like, but the hardware and operation are too complex and tedious, and the phenotype analysis items are required to be perfected.
In conclusion, in the prior art, the pod phenotype analysis method has the problems of complex pod phenotype analysis method and incomplete pod phenotype analysis.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a pod phenotype analysis method, a pod phenotype analysis system and a pod phenotype analysis device based on computer vision.
In order to solve the technical problems, the invention is solved by the following technical scheme:
a computer vision-based pod phenotype analysis method, comprising the steps of:
based on an original pod image, performing image enhancement processing on the original pod image to obtain an enhanced pod image;
preprocessing the enhanced pod image to obtain a pod two-value image, wherein the pod two-value image only comprises pod area information;
extracting pod contour information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod contour information;
extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
extracting pod skeleton information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width;
and obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
As an implementation manner, the image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image includes:
when the illumination source is not unique and the illumination intensity is not constant, decomposing the original pod image into reflection image information and image brightness information, and carrying out image enhancement processing on the original pod image to balance the three aspects of dynamic range compression, edge enhancement and color constancy so as to obtain an enhanced pod image;
when the illumination source is unique and the illumination intensity is constant, image color channel sampling is carried out on the background area of the original pod image to obtain R, G and B distribution information, and the R, G and B distribution information is used for same distribution correction of the color channel of the original pod image to obtain an enhanced pod image.
As an embodiment, the extracting pod skeleton information based on the pod binary image, and performing a correction process on the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image includes the following steps:
obtaining a minimum circumscribed rectangle according to the pod contour information, determining the slope of the longest side corresponding to the longest side of the minimum circumscribed rectangle, and reversely solving a first angle based on the slope of the longest side;
based on the pod binary image, obtaining pod framework information by adopting a framework extraction algorithm;
performing linear fitting according to the pod framework information to obtain a linear slope corresponding to a straight line, and solving a second angle based on the linear slope;
and obtaining a pod binary image after turning right based on a preset rotation rule, wherein the preset rotation rule is set through the first angle and the second angle.
As an implementation manner, the extracting pod skeleton information after rotation correction based on the pod binary image after rotation correction, performing a single-source path search algorithm and a vertical line-cutting pod phenotype analysis method according to the pod skeleton information after rotation correction to obtain pod length and pod width includes the following steps:
based on the pod binary image after correction, adopting a skeleton extraction algorithm to obtain pod skeleton information after correction;
constructing a skeleton topological graph according to the pod skeleton information after correction to obtain a skeleton topological structure, and obtaining an endpoint set (e 1, e2, \ 8230;, em) based on the skeleton topological graph;
traversing any two end points according to the skeleton topological structure and the end point set (e 1, e2, \8230;, em), and obtaining an end point path according to a single-source path search algorithm, wherein the end point path is a pod skeleton main path, and the length of the end point path is pod length;
traversing each point on the pod framework trunk path based on the pod framework trunk path, and calculating a tangent perpendicular line of each point;
calculating the intersection of the pod binary image after the rotation and the tangent lines of each point, wherein the intersection is the width line segments of different positions of the pod, and further obtaining a pod width line segment set;
and screening the maximum value in the pod width line segment set, wherein the maximum value is the pod width.
As an implementation mode, obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating by a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain pod seed number, the method includes the following steps:
calculating an initial pit set based on the pod binary image after the correction;
filtering the concave points in the initial concave point set according to a preset screening rule according to the pod binary image after the correction and the initial concave point set to obtain an effective concave point set;
calculating a post-registration concave point pair according to the effective concave point set and the main path of the pod framework to obtain a concave point pair number, wherein the post-registration concave point pair is a corresponding concave point at the ridge of the pod;
obtaining the quantity of pod seeds according to the pod characteristics and the concave point logarithm, wherein the calculation formula of the quantity of the pod seeds is as follows:
seedNum=pairsNum+1
wherein, the pair Num is the pit logarithm.
As an embodiment, the preprocessing the enhanced pod image to obtain a pod binary image includes the following steps:
acquiring a gray scale image of the enhanced pod image;
carrying out bilateral filtering processing on the gray-scale image and removing noise interference to obtain a filtering image;
performing adaptive threshold segmentation on the filter graph to obtain a first binary graph, and performing edge extraction processing on the filter graph to obtain an edge image;
performing fusion processing on the first binary image and the edge image to obtain a fusion image;
and performing characteristic analysis on the fused image to remove impurities and filling small holes to obtain a pod binary image.
A pod phenotype analysis system based on computer vision comprises an image enhancement module, an image preprocessing module, a pod phenotype analysis module, an image correcting module and a pod seed number counting module;
the image enhancement module is used for carrying out image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image;
the image preprocessing module is used for preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary image only comprises pod area information;
the pod phenotype analysis module extracts pod contour information based on the pod binary image, and obtains pod perimeter and pod area based on the pod contour information;
the image correcting module extracts pod framework information based on the pod binary image, and corrects the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
the pod phenotype analysis module extracts pod skeleton information after correction based on the pod binary image after correction, and performs a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width;
and the pod seed number counting module obtains the skeleton information after correction based on the pod skeleton information after correction, and estimates through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed number.
As an implementation manner, the pod seed number counting module is configured to:
calculating an initial pit set based on the pod binary image after the correction;
filtering the pits in the initial pit set according to a preset screening rule according to the pod binary image after being corrected and the initial pit set to obtain an effective pit set;
calculating a post-registration concave point pair according to the effective concave point set and the main path of the pod framework to obtain a concave point pair number, wherein the post-registration concave point pair is a corresponding concave point at the ridge of the pod;
obtaining the quantity of pod seeds according to the pod characteristics and the concave point logarithm, wherein the calculation formula of the pod seed quantity is as follows:
seedNum=pairsNum+1
wherein, pair Num is the pit logarithm.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of:
based on an original pod image, performing image enhancement processing on the original pod image to obtain an enhanced pod image;
preprocessing the enhanced pod image to obtain a pod two-value image, wherein the pod two-value image only comprises pod area information;
extracting pod outline information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod outline information;
extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
extracting pod framework information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line-cutting pod phenotype analysis method according to the pod framework information after correction to obtain pod length and pod width;
and obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
A pod phenotype analysis apparatus based on computer vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor when executing the computer program implementing the method steps of:
based on an original pod image, performing image enhancement processing on the original pod image to obtain an enhanced pod image;
preprocessing the enhanced pod image to obtain a pod two-value image, wherein the pod two-value image only comprises pod area information;
extracting pod contour information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod contour information;
extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
extracting pod framework information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line-cutting pod phenotype analysis method according to the pod framework information after correction to obtain pod length and pod width;
and obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating by a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
Due to the adoption of the technical scheme, the invention has the remarkable technical effects that:
the invention provides a pod phenotype analysis method based on computer vision, which solves the problems that pod phenotype analysis methods in the prior art are complex and the pod phenotype analysis is incomplete, analyzes the length, width, perimeter, area and seed number of pods, and improves the pod phenotype analysis efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic overall flow diagram of the process of the present invention;
FIG. 2 is a schematic diagram of the overall structure of the system of the present invention;
FIG. 3 is a schematic view of an image capture device of the present invention;
FIG. 4 is a diagram of a neighborhood structure of any pixel 8 in an image during a skeleton extraction process;
fig. 5 to 6 are structural diagrams of a neighborhood of a pixel 8 in the process of analyzing an endpoint of a skeleton topology structure;
FIG. 7 is a schematic diagram of a perpendicular cut line measurement in an embodiment of the present invention;
FIG. 8 is a graph showing the results of phenotypic analysis of pods according to embodiments of the present invention.
Detailed Description
The present invention will be further described in 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 pod phenotype analysis method based on computer vision, as shown in fig. 1, comprising the following steps:
s100, based on an original pod image, carrying out image enhancement processing on the original pod image to obtain an enhanced pod image;
s200, preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary image only comprises pod area information;
s300, extracting pod outline information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod outline information;
s400, extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
s500, extracting pod framework information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod framework information after correction to obtain pod length and pod width;
s600, obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
In step S100, based on the original pod image, image enhancement processing is performed on the original pod image to obtain an enhanced pod image.
In one embodiment, when the illumination source is not unique and the illumination intensity is not constant, the original pod image is decomposed into reflection image information and image brightness information, and the original pod image is subjected to image enhancement processing, so that three aspects of dynamic range compression, edge enhancement and color constancy are balanced, and an enhanced pod image is obtained, which, in combination with actual operations, specifically is as follows:
placing the pods on a frosted backlight board, performing pod image acquisition through an image acquisition device to obtain an original pod image1, and decomposing the original pod image1 into a reflection image and a brightness image, as shown in fig. 3;
carrying out fuzzy processing on the original pod image1 according to a specified scale factor to obtain a fuzzy brightness image;
let I (x, y) = L (x, y) × R (x, y), take logarithm on both sides of formula, get Log [ R (x, y) ] = Log [ I (x, y) ] -Log [ L (x, y) ]
Wherein, I (x, y) is an original pod image, L (x, y) is a blurred brightness image, and R (x, y) is a reflection image;
approximating L (x, y) by a convolution with a Gaussian kernel, the formula for R (x, y) is obtained as:
Log(R(x,y))=(Log(I(x,y))-Log(I(x,y)·G(x,y)))
wherein I (x, y) is the original pod image, R (x, y) is the reflectance image, G (x, y) represents a Gaussian kernel;
the enhanced pod image2 is obtained by quantizing Log [ R (x, y) ] to pixel values of 0 to 255.
In another embodiment, when the illumination source is unique and the illumination intensity is constant, image color channel sampling is performed on a background area of the original pod image to obtain R, G, and B distribution information, and the R, G, and B distribution information is used for color channel co-distribution correction of the original pod image to obtain an enhanced pod image.
The specific process is as follows in combination with actual operation:
acquiring a background image in a standard mode, wherein the standard mode refers to: the only source of illumination is a backlight plate, the illumination intensity is constant, and the imaging unit of the image acquisition equipment is averagely close to parallel to the backlight plate to obtain a sample image sampleImage;
positioning a backlight plate area of the template image sampleImage, and counting R, G and B channel pixel mean values aveRPixel, aveGPixel and aveBPixel in the area to obtain three-channel proportions aveRPixel, aveGPixel and aveBPixel;
and (3) correcting by a background color prior method, traversing each pixel point on the original pod image1, setting three-channel pixel values of corresponding points as pixelR, pixelG and pixelB, and updating the pixelR, pixelG and pixelB of each point according to the following formula:
Figure BDA0003888930140000041
Figure BDA0003888930140000042
Figure BDA0003888930140000043
in conclusion, the enhanced pod image2 is obtained.
In step S200, preprocessing the enhanced pod image to obtain a pod binary image, where the pod binary image only includes pod area information, including the following steps:
s210, obtaining a gray scale image of the enhanced pod image;
s220, bilateral filtering processing is carried out on the gray level image, and noise interference is removed to obtain a filtered image;
s230, performing self-adaptive threshold segmentation on the filter graph to obtain a first binary graph, and performing edge extraction processing on the filter graph to obtain an edge image;
s240, carrying out fusion processing on the first binary image and the edge image to obtain a fusion image;
and S250, performing characteristic analysis on the fused image to remove impurities and filling small holes to obtain a pod binary image.
In actual operation, the following processing steps are available:
acquiring a gray level image of the enhanced pod image 2; carrying out bilateral filtering processing on the gray image and removing noise interference to obtain a filtered image; carrying out self-adaptive threshold segmentation on the filter image filterImage to obtain a first binary image1, and carrying out edge extraction processing on the filter image to obtain an edge image edgeImage; carrying out fusion processing on the first binary image binaryImage1 and the edge image edgeImage to obtain a fused image; and (4) performing characteristic analysis on the fused image fusion image to remove impurities and filling small holes, and finally obtaining the pod binary image.
In step S300, based on the pod binary image, pod contour information is extracted, and based on the pod contour information, a pod perimeter and a pod area are obtained, specifically:
and extracting pod contour information contourr based on the pod binary image, and performing morphological analysis based on the pod contour information contourr to obtain the pod perimeter and the pod area.
In step S400, pod skeleton information is extracted based on the pod binary image, and the pod binary image is corrected according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image, specifically:
s410, obtaining a minimum circumscribed rectangle according to the pod contour information, determining the slope of the longest side corresponding to the longest side of the minimum circumscribed rectangle, and reversely solving a first angle based on the slope of the longest side;
s420, obtaining pod framework information by adopting a framework extraction algorithm based on the pod binary image;
s430, performing straight line fitting according to the pod framework information to obtain a straight line slope corresponding to a straight line, and solving a second angle inversely based on the straight line slope;
s440, obtaining a pod binary image after positive turning based on a preset rotation rule, wherein the preset rotation rule is set through the first angle and the second angle.
In a specific implementation process, a minimum circumscribed rectangle is obtained according to the pod contour information, the slope of the longest side corresponding to the longest side of the minimum circumscribed rectangle is determined, and a first angle is solved based on the slope of the longest side, specifically:
step1, fitting a circumscribed rectangle RectMin according to the uppermost, lower, left and right points of the pod profile information contours, obtaining an area AreaMin, and setting a rotation angle alpha =0;
step2: rotating the contour contourr by an angle theta, and taking the rotated circumscribed rectangle newRectMin and the area newAreaMin according to Step 1;
step3: setting a rotation angle α = α + θ, comparing the magnitudes of newAreaMin and AreaMin, assigning a small area to AreaMin, assigning the rotation angle at that time to β = α, and assigning rectangle information to RectMin = newRectMin;
step4: circulating the steps from Step2 to Step3 to finally obtain RectMin and the corresponding rotation angle thereof;
step5: the calculated rectangle RectMin is inverted by an angle beta to obtain a minimum circumscribed rectangle, and the slope lambda of the longest edge corresponding to the minimum circumscribed rectangle is obtained 1 According to the slope λ of the longest side 1 Reversely solve the first angle omega 1 The first angle is ω 1 Between 0 ° and 180 °.
Fig. 4 is a diagram of a neighborhood structure of any pixel 8 in an image in a pod skeleton extraction process, where P1 is a target pixel, and pod skeleton information is extracted by performing structural analysis on each pixel in the image, specifically:
step1: and circulating all foreground pixel points, and marking the pixel points meeting the following conditions as deleted, wherein the conditions are as follows:
(a)2<=B(P1)<=6
(b)A(P1)=1
(c)P2*P4*P6=0
(d)P4*P6*P8=0
a condition (a) that the sum of the numbers of target pixels around the center pixel P1 is between 2 and 6; in the condition (b), in the 8-neighborhood pixels, the times of 0- >1 appears in two adjacent pixels in the clockwise direction;
step2: much like Step1, the conditions (a) and (b) are identical, but the conditions (c) and (d) are slightly different, and the pixel P1 satisfying the following conditions is marked as deleted:
(a)2<=B(P1)<=6
(b)A(P1)=1
(c)P2*P4*P8=0
(d)P2*P6*P8=0
and (4) circulating the two steps until no pixel is marked to be deleted in the two steps, outputting the result, namely the pod framework information after binary image refinement, and referring to fig. 5 to 6, wherein the neighborhood structure diagrams of the pixel 8 in the process of analyzing all endpoints in the pod framework information.
In a specific implementation process, linear fitting is carried out according to the pod framework information to obtain a linear slope lambda corresponding to a straight line 2 And according to the slope lambda of said line 2 Solve the second angle omega 2 The second angle ω 2 Between 0 ° and 180 °.
In the specific implementation process, based on a preset rotation rule, a positive rotation pod binary image is obtained, and the specific steps are as follows:
based on the first angle ω 1 And a second angle omega 2 Let Δ ω = | ω = 12 If Δ ω is less than 10, then rotate the local pod image by ω 1 -90 °; otherwise rotate omega 1 And (4) at the angle of-180 DEG, and finally obtaining a pod binary image after the pod is straightened.
In step S500, pod skeleton information after correction is extracted based on the pod binary image after correction, and a single-source path search algorithm and a vertical line cutting pod phenotype analysis method are performed according to the pod skeleton information after correction to obtain pod length and pod width, specifically:
s510, based on the pod binary image after correction, obtaining pod skeleton information after correction by adopting a skeleton extraction algorithm;
s520, constructing a skeleton topological graph according to the pod skeleton information after correction to obtain a skeleton topological structure, and obtaining an endpoint set (e 1, e2, \8230;, em) based on the skeleton topological graph;
s530, traversing any two end points according to the skeleton topological structure and the end point set (e 1, e2, \8230;, em), and obtaining an end point path according to a single-source path search algorithm, wherein the end point path is a pod skeleton main path, and the length of the end point path is the pod length;
s540, traversing each point on the pod framework trunk path based on the pod framework trunk path, and calculating tangent lines of each point;
s550, calculating the intersection of the pod binary image after the rotation and the tangent lines of each point, wherein the intersection is the width line segments of different positions of the pod, and further obtaining a pod width line segment set;
and S560, screening the maximum value in the pod width line segment set, wherein the maximum value is the pod width.
In a specific implementation process, the pod length is obtained based on a skeleton topological structure according to a single-source path search algorithm, and the pod width is detected according to a vertical line cutting pod phenotype analysis method, specifically:
obtaining pod framework information after correction by adopting a Zhang-Suen framework extraction algorithm based on the pod binary image after correction;
constructing a skeleton topological graph according to pod skeleton information after correction, traversing each pixel point on the skeleton topological graph, counting the number of 8 neighborhood pixel points, taking the point as an end point when the number is 1, and obtaining an end point set (e) 1 ,e 2 ,…,e m );
The single-source path calculation method adopts Dijkstra algorithm, and specifically comprises the following steps:
Figure BDA0003888930140000061
g is a skeleton topological graph, w is the weight of each edge, and s is a starting point; firstly, initializing an empty set S for storing the vertex of the determined shortest board path, wherein each point on a skeleton is used as the vertex of a graph; initializing a set Q, wherein the set Q comprises all vertexes G.V in the graph, the Q is a user-defined data structure, a minimum priority queue is adopted, and keys are the shortest distances of all vertexes; 4-8 lines, taking out the vertex u with the minimum shortest distance from S to the vertex from Q, adding u into S, and recalculating the path length of each vertex adjacent to u to replace the current shortest path but larger than the new path;
traversing any two endpoints according to the endpoint set to obtain the uppermost endpoint e and the lowermost endpoint e top 、e bottom Based on a skeletal topology according to a single-source path search algorithmThe fabric gets the end path tb Said end point path tb The pod skeleton path is a pod skeleton main path, and the length of the pod skeleton main path is the length of the pod;
traversing the path of the pod skeleton trunk path tb Calculating a tangent line of each point according to the tangent line calculation schematic diagram of the figure 7;
calculating the intersection of the corrected pod binary image and the tangent line of each point, wherein the intersection is the width line segment of the pod at different positions, and further obtaining a pod width line segment set widthLines;
and screening the maximum value in the pod width line segment set widthLines, wherein the obtained maximum value is the pod width.
In step S600, obtaining skeleton trunk information after correction based on the pod skeleton information after correction, and estimating by a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton trunk information after correction to obtain pod seed number, including the following steps:
s610, calculating an initial concave point set based on the pod binary image after positive rotation;
s620, filtering the pits in the initial pit set according to a preset screening rule according to the pod binary image after the pod is rotated to the positive and the initial pit set to obtain an effective pit set;
s630, calculating a post-registration concave point pair according to the effective concave point set and the main path of the pod framework to obtain a concave point pair number, wherein the post-registration concave point pair is a corresponding concave point at a ridge of the pod;
s640, obtaining the number of pod seeds according to the pod characteristics and the pit logarithm, wherein the calculation formula of the number of pod seeds is as follows:
seedNum=pairsNum+1
wherein, pair Num is the pit logarithm.
In the actual operation process, the method specifically comprises the following steps:
step1: extracting a two-value diagram contour contourr of the pod after being transformed according to the two-value diagram correctImage of the pod after being transformed;
step2: initializing a pod binary image profile degree interval step after positive turning, taking step =5, and making the profile point of the current pod binary image after positive turning be P, the P forward profile point be M and the P reverse profile point be N; setting a tangent line l as a tangent line of a certain point on the outline boundary of the pod binary image after the pod is rotated to be positive, if two side points of the tangent line fall outside the outline region of the pod binary image after the pod is rotated to be positive, the point is a local convex point, if the two side points fall inside the outline region of the pod binary image after the pod is rotated to be positive, the point is a local concave point, and only under the condition that the local point is a concave point, the point is possibly an object concave point, so as to obtain an initial concave point set initdots;
step3: traversing each concave point in the initPits, taking one point pit as an example, taking the pit as a center, taking 5 as a radius to make a circle, and extracting the pixel number pixelSum of the intersection area of the circular area and the corrected pod binary image, and two intersection points point1 and point2 of the circular area and the corrected pod binary image outline;
step4: calculating ≈ point1_ pit _ point2, and if and only if the ≈ point1_ pit _ point2 is less than 60 DEG and pixelSum is less than half of the circle area, keeping the pit, otherwise deleting the pit;
step5: repeating the steps from Step3 to Step4 to obtain a pit point set Pits;
step6: creating pit pair vectors Pairs;
step7: any pit in the pit set Pits is taken and deleted from the pit set Pits, making pit and main path of pod skeleton tb The vertical line of the pod binary image after being rotated to be normal is extended, and two intersection points exist between the extended line and the pod binary image after being rotated to be normal, wherein the two intersection points comprise a pit point and an intersection point;
step8: searching a concave point nearPit closest to the intersection point from the concave point set Pits, and calculating the Euclidean distance dis between the intersection point and the nearPit;
step9: if the Euclidean distance dis between the intersection point and the nearest concave point nearPit is smaller than a threshold value, the concave point pair < pit, nearPit > is pushed into a stack concave point pair vector pair;
step10: repeating the steps from Step6 to Step9 until the pit set pits are empty;
according to the above steps, the pair of concave points in the concave point vector Pairs is Pair, namely the corresponding concave point at the ridge of the pod, the logarithm of the concave points is PairsNum, according to the pod characteristics, the number of pod seeds is seedNum = PairsNum +1, and the pod phenotype analysis result of the embodiment is shown in FIG. 8.
Example 2:
a pod phenotype analysis system based on computer vision, as shown in fig. 2, includes an image enhancement module 100, an image preprocessing module 200, a pod phenotype analysis module 300, an image rectification module 400, and a pod seed number counting module 500;
the image enhancement module 100 performs image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image;
the image preprocessing module 200 is configured to preprocess the enhanced pod image to obtain a pod binary image, where the pod binary image only includes pod area information;
the pod phenotype analysis module 300 extracts pod contour information based on the pod binary image, and obtains pod perimeter and pod area based on the pod contour information;
the image correcting module 400 extracts pod framework information based on the pod binary image, and performs correcting processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
the pod phenotype analysis module 300 extracts pod skeleton information after correction based on the pod binary image after correction, and performs a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width;
the pod seed number counting module 500 obtains the corrected skeleton information based on the corrected pod skeleton information, and estimates the pod seed number through a concave point detection algorithm and a concave point registration algorithm according to the corrected pod binary image and the corrected skeleton information.
Example 3:
a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of:
s100, based on an original pod image, carrying out image enhancement processing on the original pod image to obtain an enhanced pod image;
s200, preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary image only comprises pod area information;
s300, extracting pod outline information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod outline information;
s400, extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
s500, extracting pod skeleton information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width;
s600, obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts in the embodiments are referred to each other.
In addition, it should be noted that the shapes, names, and the like of the components of the embodiments described in the present specification may be different. All equivalent or simple changes of the structure, the characteristics and the principle of the invention which are described in the patent conception of the invention are included in the protection scope of the patent of the invention. Various modifications, additions and substitutions for the specific embodiments described may be made by those skilled in the art without departing from the scope of the invention as defined in the accompanying claims.

Claims (10)

1. A method for computer vision-based pod phenotype analysis, comprising the steps of:
based on an original pod image, performing image enhancement processing on the original pod image to obtain an enhanced pod image;
preprocessing the enhanced pod image to obtain a pod two-value image, wherein the pod two-value image only comprises pod area information;
extracting pod contour information based on the pod binary image, and obtaining pod perimeter and pod area based on the pod contour information;
extracting pod framework information based on the pod binary image, and performing correction processing on the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
extracting pod framework information after correction based on the pod binary image after correction, and performing a single-source path search algorithm and a vertical line-cutting pod phenotype analysis method according to the pod framework information after correction to obtain pod length and pod width;
and obtaining skeleton information after correction based on the pod skeleton information after correction, and estimating by a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed quantity.
2. The method for computer vision based pod phenotype analysis of claim 1, wherein the image enhancing the original pod image based on the original pod image to obtain an enhanced pod image comprises:
when the illumination source is not unique and the illumination intensity is not constant, decomposing the original pod image into reflection image information and image brightness information, and carrying out image enhancement processing on the original pod image to balance the three aspects of dynamic range compression, edge enhancement and color constancy so as to obtain an enhanced pod image;
when the illumination source is unique and the illumination intensity is constant, image color channel sampling is carried out on the background area of the original pod image to obtain R, G and B distribution information, and the R, G and B distribution information is used for correcting the same distribution of the color channels of the original pod image to obtain an enhanced pod image.
3. The method of claim 1, wherein the step of extracting pod skeleton information based on the pod binary image, and performing a correction process on the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image comprises the steps of:
obtaining a minimum external rectangle according to the pod contour information, determining the slope of the longest edge corresponding to the longest edge of the minimum external rectangle, and solving a first angle based on the slope of the longest edge;
based on the pod binary image, obtaining pod framework information by adopting a framework extraction algorithm;
performing linear fitting according to the pod framework information to obtain a linear slope corresponding to a straight line, and solving a second angle based on the linear slope;
and obtaining a pod binary image after turning right based on a preset rotation rule, wherein the preset rotation rule is set through the first angle and the second angle.
4. The method of claim 1, wherein the step of extracting pod skeleton information after correction based on the pod binary image after correction and performing a single-source path search algorithm and a vertical-line-cut pod phenotype analysis method according to the pod skeleton information after correction to obtain the pod length and the pod width comprises the steps of:
based on the pod binary image after correction, obtaining pod skeleton information after correction by adopting a skeleton extraction algorithm;
constructing a skeleton topological graph according to the pod skeleton information after correction to obtain a skeleton topological structure, and obtaining an endpoint set (e) based on the skeleton topological graph 1 ,e 2 ,…,e m );
According to the skeleton topology and the endpoint set (e) 1 ,e 2 ,…,e m ) Traversing any two end points, and obtaining an end point path according to a single-source path search algorithm, wherein the end point path is a pod framework main path, and the length of the end point path is the pod length;
traversing each point on the pod framework trunk path based on the pod framework trunk path, and calculating each point tangent line;
calculating the intersection of the pod binary image after the rotation and the tangent lines of each point, wherein the intersection is the width line segments of different positions of the pod, and further obtaining a pod width line segment set;
and screening the maximum value in the pod width line segment set, wherein the maximum value is the pod width.
5. The computer vision-based pod phenotype analysis method according to claim 1 or 4, wherein after pod stem information is obtained based on the pod stem information after pod stem correction, and the pod seed number is obtained by estimating according to the pod binary map after pod correction and the pod stem information after pod stem correction through a pit detection algorithm and a pit registration algorithm, comprising the following steps:
calculating an initial pit set based on the pod binary image after the correction;
filtering the pits in the initial pit set according to a preset screening rule according to the pod binary image after being corrected and the initial pit set to obtain an effective pit set;
calculating a post-registration concave point pair according to the effective concave point set and the main path of the pod framework to obtain a concave point pair number, wherein the post-registration concave point pair is a corresponding concave point at the ridge of the pod;
obtaining the quantity of pod seeds according to the pod characteristics and the concave point logarithm, wherein the calculation formula of the pod seed quantity is as follows:
seedNum=pairsNum+1
wherein, pair Num is the pit logarithm.
6. The method for computer vision based phenotypic analysis of pods according to claim 1 wherein said pre-processing of said enhanced pod images to obtain a pod binary map comprises the steps of:
acquiring a gray scale image of the enhanced pod image;
carrying out bilateral filtering processing on the gray-scale image and removing noise interference to obtain a filtering image;
performing self-adaptive threshold segmentation on the filter graph to obtain a first binary graph, and performing edge extraction processing on the filter graph to obtain an edge image;
performing fusion processing on the first binary image and the edge image to obtain a fusion image;
and performing characteristic analysis on the fused image to remove impurities and filling small holes to obtain a pod binary image.
7. A pod phenotype analysis system based on computer vision is characterized by comprising an image enhancement module, an image preprocessing module, a pod phenotype analysis module, an image correcting module and a pod seed number counting module;
the image enhancement module is used for carrying out image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image;
the image preprocessing module is used for preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary image only comprises pod area information;
the pod phenotype analysis module extracts pod contour information based on the pod binary image, and obtains pod perimeter and pod area based on the pod contour information;
the image correcting module extracts pod framework information based on the pod binary image, and corrects the pod binary image according to the pod framework information and the pod outline information to obtain a corrected pod binary image;
the pod phenotype analysis module extracts pod skeleton information after correction based on the pod binary image after correction, and performs a single-source path search algorithm and a vertical line cutting pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width;
and the pod seed number counting module obtains the skeleton information after correction based on the pod skeleton information after correction, and estimates through a concave point detection algorithm and a concave point registration algorithm according to the pod binary image after correction and the skeleton information after correction to obtain the pod seed number.
8. The computer vision based pod phenotype analysis system of claim 7, wherein the pod seed number counting module is configured to:
calculating an initial pit set based on the pod binary image after the correction;
filtering the concave points in the initial concave point set according to a preset screening rule according to the pod binary image after the correction and the initial concave point set to obtain an effective concave point set;
calculating a post-registration concave point pair according to the effective concave point set and the main path of the pod framework to obtain a concave point pair number, wherein the post-registration concave point pair is a corresponding concave point at the ridge of the pod;
obtaining the quantity of pod seeds according to the pod characteristics and the concave point logarithm, wherein the calculation formula of the quantity of the pod seeds is as follows:
seedNum=pairsNum+1
wherein, pair Num is the pit logarithm.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of one of claims 1 to 6.
10. A pod phenotype analysis apparatus based on computer vision, comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor when executing the computer program realizes the method steps of any of claims 1 to 6.
CN202211253503.0A 2022-10-13 2022-10-13 Pod phenotype analysis method, system and device based on computer vision Pending CN115620279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211253503.0A CN115620279A (en) 2022-10-13 2022-10-13 Pod phenotype analysis method, system and device based on computer vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211253503.0A CN115620279A (en) 2022-10-13 2022-10-13 Pod phenotype analysis method, system and device based on computer vision

Publications (1)

Publication Number Publication Date
CN115620279A true CN115620279A (en) 2023-01-17

Family

ID=84863298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211253503.0A Pending CN115620279A (en) 2022-10-13 2022-10-13 Pod phenotype analysis method, system and device based on computer vision

Country Status (1)

Country Link
CN (1) CN115620279A (en)

Similar Documents

Publication Publication Date Title
CN114723701B (en) Gear defect detection method and system based on computer vision
CN113538433B (en) Mechanical casting defect detection method and system based on artificial intelligence
WO2018107939A1 (en) Edge completeness-based optimal identification method for image segmentation
CN110033516B (en) Needle flake particle content detection method based on binocular camera image acquisition and recognition
CN112233116B (en) Concave-convex mark visual detection method based on neighborhood decision and gray level co-occurrence matrix description
CN110473221B (en) Automatic target object scanning system and method
CN114862855B (en) Textile defect detection method and system based on template matching
CN115272312B (en) Plastic mobile phone shell defect detection method based on machine vision
CN111738931B (en) Shadow removal algorithm for aerial image of photovoltaic array unmanned aerial vehicle
CN116630813B (en) Highway road surface construction quality intelligent detection system
CN114331986A (en) Dam crack identification and measurement method based on unmanned aerial vehicle vision
CN113313107A (en) Intelligent detection and identification method for multiple types of diseases on cable surface of cable-stayed bridge
CN115841633A (en) Power tower and power line associated correction power tower and power line detection method
CN116523898A (en) Tobacco phenotype character extraction method based on three-dimensional point cloud
CN114067147B (en) Ship target confirmation method based on local shape matching
CN111354047B (en) Computer vision-based camera module positioning method and system
CN109712116B (en) Fault identification method for power transmission line and accessories thereof
CN114842262A (en) Laser point cloud ground object automatic identification method fusing line channel orthographic images
CN116883446B (en) Real-time monitoring system for grinding degree of vehicle-mounted camera lens
WO2020164042A1 (en) Region merging image segmentation algorithm based on boundary extraction
CN109544513A (en) A kind of steel pipe end surface defect extraction knowledge method for distinguishing
CN115690107B (en) High-throughput counting method, system and device for pod fruit grains based on image processing
CN114187269B (en) Rapid detection method for surface defect edge of small component
CN115170507B (en) Grouting pipe surface defect detection method and system based on image data
CN115620279A (en) Pod phenotype analysis method, system and device based on computer 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