CN-115620279-B - Bean pod phenotype analysis method, system and device based on computer vision
Abstract
The invention discloses a pod phenotype analysis method, system and device based on computer vision, wherein the method comprises the steps of performing image enhancement processing on an original pod image to obtain an enhanced pod image; the method comprises the steps of preprocessing an enhanced pod image to obtain a pod binary image, detecting the circumference and the area of the pod based on the pod binary image, extracting pod skeleton information based on the pod binary image, correcting the pod binary image, extracting corrected pod skeleton information based on the corrected binary image, detecting the pod length and the pod width by a single-source path search algorithm and a cut-to-vertical pod phenotype analysis method, and obtaining the pod seed quantity based on the corrected binary image and the corrected pod skeleton information. The pod phenotype parameter measuring method overcomes the defects of strong subjectivity, low efficiency and requirement for sectional measurement of the same parameter in the measuring process of the traditional measuring method, can rapidly and accurately acquire the pod phenotype parameter, meets the requirements of researchers on pod phenotype parameter measurement, and provides data reference for pod phenotype research.
Inventors
- CHEN YUYANG
- ZHU XUHUA
- WANG CHUANG
- LIU RONGLI
- XIE CHAOMING
- ZHANG YONGCHUAN
- Yuan Naduo
Assignees
- 浙江托普云农科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221013
Claims (9)
- 1. A method of computer vision based legume phenotype analysis comprising the steps of: performing image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image; Preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary 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 skeleton information based on the pod binary image, and correcting the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image; Extracting pod skeleton information after correction based on the pod binary diagram after correction, and carrying out a single-source path search algorithm and a cut-off vertical pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width; acquiring corrected skeleton trunk information based on the corrected pod skeleton information, and estimating through a pit detection algorithm and a pit registration algorithm according to the corrected pod binary image and the corrected skeleton trunk information to acquire pod seed quantity; extracting pod skeleton information based on the pod binary image, and carrying out correction processing on the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image, wherein the method comprises the steps of obtaining a minimum circumscribed rectangle according to the pod outline information, determining a longest side slope corresponding to the longest side of the minimum circumscribed rectangle, and reversely solving a first angle based on the longest side slope; Based on the pod binary image, acquiring pod skeleton information by adopting a skeleton extraction algorithm; Performing straight line fitting according to the pod skeleton information to obtain a straight line slope corresponding to a straight line, and reversely solving a second angle based on the straight line slope; and obtaining a pod binary image after correcting based on a preset rotation rule, wherein the preset rotation rule is set through the first angle and the second angle.
- 2. The method of claim 1, wherein the performing image enhancement processing on 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 performing image enhancement processing on the original pod image so as to balance three aspects of dynamic range compression, edge enhancement and color constancy and obtain an enhanced pod image; When the illumination source is unique and the illumination intensity is constant, sampling an image color channel of a background area of the original pod image to obtain R, G, B distribution information, and correcting the same distribution of the color channel of the original pod image by using the R, G, B distribution information to obtain an enhanced pod image.
- 3. The computer vision based pod phenotype analysis method according to claim 1, wherein the pod length and pod width are obtained by extracting pod skeleton information after conversion based on the pod binary map after conversion, and performing a single-source path search algorithm and a cut-off vertical pod phenotype analysis method according to the pod skeleton information after conversion, comprising the steps of: based on the corrected pod binary diagram, adopting a skeleton extraction algorithm to obtain corrected pod skeleton information; 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 ,e 2 ,…,e m ) based on the skeleton topological graph; Traversing any two endpoints according to the skeleton topological structure and the endpoint set (e 1 ,e 2 ,…,e m ), and obtaining an endpoint path according to a single-source path searching algorithm, wherein the endpoint path is a pod skeleton trunk path, and the length of the endpoint path is pod length; Traversing each point on the pod skeleton trunk path based on the pod skeleton trunk path, and calculating each point tangential line; Calculating intersection of the two-value diagram of the pod after the pod is turned right and the tangent lines of each point, wherein the intersection is a width line segment of different positions of the pod, and further a pod width line segment set is obtained; screening the maximum value in the pod width line segment set, wherein the maximum value is pod width.
- 4. A pod phenotype analysis method based on computer vision according to claim 1 or 3, wherein the pod seed number is obtained by obtaining post-conversion skeleton trunk information based on the post-conversion pod skeleton information, estimating by a pit detection algorithm and a pit registration algorithm based on the post-conversion pod binary image and the post-conversion skeleton trunk information, comprising the steps of: Calculating an initial concave point set based on the corrected pod binary image; Filtering pits in the initial pit set according to a preset screening rule according to the corrected pod binary diagram and the initial pit set to obtain an effective pit set; Calculating registered concave point pairs according to the effective concave point set and the pod skeleton trunk path to obtain concave point pairs, wherein the registered concave point pairs are corresponding concave points at pod ridges; according to pod characteristics and the concave point logarithm, the pod seed quantity is obtained, and the calculation formula of the pod seed quantity is as follows: seedNum=pairsNum+1 Wherein pairsNum is the pit pair number.
- 5. The method for analyzing pod phenotype based on computer vision according to claim 1, wherein the preprocessing of the enhanced pod image to obtain a pod binary image comprises the following steps: Acquiring a gray level image of the enhanced pod image; carrying out bilateral filtering treatment on the gray level map and removing noise interference to obtain a filtering map; performing adaptive threshold segmentation on the filter map to obtain a first binary map, and performing edge extraction processing on the filter map to obtain an edge image; Performing fusion processing on the first binary image and the edge image to obtain a fusion image; and performing feature analysis on the fusion image to remove impurities and filling small holes to obtain a pod binary image.
- 6. The 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 correction module and a pod seed quantity 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 is used for extracting pod outline information based on the pod binary image and obtaining pod perimeter and pod area based on the pod outline information; The image correcting module is used for extracting pod skeleton information based on the pod binary image, and correcting the pod binary image according to the pod skeleton 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 carries out a single-source path search algorithm and a vertical-cut pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width; The pod seed quantity counting module obtains corrected skeleton trunk information based on the corrected pod skeleton information, and estimates the corrected pod seed quantity through a concave point detection algorithm and a concave point registration algorithm according to the corrected pod binary image and the corrected skeleton trunk information; extracting pod skeleton information based on the pod binary image, and carrying out correction processing on the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image, wherein the method comprises the steps of obtaining a minimum circumscribed rectangle according to the pod outline information, determining a longest side slope corresponding to the longest side of the minimum circumscribed rectangle, and reversely solving a first angle based on the longest side slope; Based on the pod binary image, acquiring pod skeleton information by adopting a skeleton extraction algorithm; Performing straight line fitting according to the pod skeleton information to obtain a straight line slope corresponding to a straight line, and reversely solving a second angle based on the straight line slope; and obtaining a pod binary image after correcting based on a preset rotation rule, wherein the preset rotation rule is set through the first angle and the second angle.
- 7. The computer vision based pod phenotyping system of claim 6 wherein the pod seed number counting module is configured to: Calculating an initial concave point set based on the corrected pod binary image; Filtering pits in the initial pit set according to a preset screening rule according to the corrected pod binary diagram and the initial pit set to obtain an effective pit set; Calculating registered concave point pairs according to the effective concave point set and the pod skeleton trunk path to obtain concave point pairs, wherein the registered concave point pairs are corresponding concave points at pod ridges; according to pod characteristics and the concave point logarithm, the pod seed quantity is obtained, and the calculation formula of the pod seed quantity is as follows: seedNum=pairsNum+1 Wherein pairsNum is the pit pair number.
- 8. A computer-readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method steps of any one of claims 1 to 5.
- 9. A pod phenotype analysis device based on computer vision, comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor implements the method steps of any of claims 1 to 5 when executing the computer program.
Description
Bean 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 seed automatic count for pod phenotype information are measured primarily manually by hand. The pod disease judgment standard and method are provided by comparing and analyzing the influences of different light source transmission angles, different carrier medium materials, different light source transmission distances and different acquisition environments on pod images based on the transmission and diffuse reflection image acquisition modes of the image acquisition platform of the CMOS camera and the halogen tungsten light source. The method comprises the steps of extracting soybean plant phenotype characteristic data through a machine vision technology, carrying a medium-high end CMOS camera on a high-angle lighting system to obtain a high-quality whole soybean image, and obtaining phenotype information such as plant height, branch number, main stem, single plant pod number, pod width, pod length, pod type and the like of the soybean plant phenotype characteristic by adopting a deep convolution neural network, watershed image segmentation, an ant colony algorithm, skeleton refinement, hough detection, SURF matching and other methods. In addition, pod number detection can be realized by a deep learning method, but the pod number detection device does not have the functions of seed number and pod phenotype measurement. In addition, in the existing pod phenotype parting device, a soybean seed and pod image analysis scheme is provided, and the specific pod is subjected to phenotype analysis in a multi-camera combination mode, a camera, a baffle and other hardware combination modes, wherein the specific pod comprises pod colors, grain numbers, pod length and width and the like, but the hardware and operation are too complex and complicated, and the phenotype analysis item is still to be perfected. In summary, in the prior art, the pod phenotyping method has the problems of complex pod phenotyping method and imperfect pod phenotyping. Disclosure of Invention Aiming at the defects in the prior art, the invention provides a pod phenotype analysis method, system and 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: performing image enhancement processing on the original pod image based on the original pod image to obtain an enhanced pod image; Preprocessing the enhanced pod image to obtain a pod binary image, wherein the pod binary 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 skeleton information based on the pod binary image, and correcting the pod binary image according to the pod skeleton information and the pod outline information to obtain a corrected pod binary image; Extracting pod skeleton information after correction based on the pod binary diagram after correction, and carrying out a single-source path search algorithm and a cut-off vertical pod phenotype analysis method according to the pod skeleton information after correction to obtain pod length and pod width; And obtaining corrected skeleton trunk information based on the corrected pod skeleton information, and estimating through a pit detection algorithm and a pit registration algorithm according to the corrected pod binary image and the corrected skeleton trunk information to obtain pod seed quantity. As an implementation manner, the image enhancement processing is performed on the original pod image based on the original pod image to obtain an enhanced pod image, which 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 performing image enhancement processing on the original pod image so as to balance three aspects of dynamic range compression, edge enhancement and color constancy and obtain an enhanced pod image; When the illumination source is unique and the illumination intensity is constant, sampling an image color channel of a background area of the original pod image to obtain R, G, B distribution information, and correcting the same distribution of the color channel of the original pod image by using the R, G, B distribution information to obtain an enhanced pod image. As an implementation manner, the pod skeleton information is extracted based on the pod binary image, and the pod binary image is corrected according to the