欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture ›› 2024, Vol. 6 ›› Issue (1): 135-146.doi: 10.12133/j.smartag.SA202309011

• 信息处理与决策 • 上一篇    下一篇

基于机器视觉的胡麻种子自动化考种方法

毛永文(), 韩俊英(), 刘成忠   

  1. 甘肃农业大学 信息科学技术学院,甘肃 兰州 730000,中国
  • 收稿日期:2023-09-11 出版日期:2024-01-30
  • 作者简介:
    毛永文,研究方向为农业信息化。E-mail:
  • 通信作者:
    韩俊英,教授,研究方向为机器视觉、深度学习在农业中的应用。E-mail:

Automated Flax Seeds Testing Methods Based on Machine Vision

MAO Yongwen(), HAN Junying(), LIU Chengzhong   

  1. College of Information Science and Technology, Gansu Agricultural University, Lanzhou 730000, China
  • Received:2023-09-11 Online:2024-01-30
  • corresponding author:
    HAN Junying, E-mail:
  • About author:

    MAO Yongwen, E-mail:

  • Supported by:
    Gansu Provincial University Innovation Fund Project in China(2021A-056); Gansu Provincial University Industry Support and Guidance Project in China(2021CYZC-57)

摘要:

目的/意义 胡麻种子的周长、面积、长短轴和千粒重是胡麻考种过程中常用的参数,对于胡麻的育种、栽培,以及种子品质和性状的评估都具有重要的意义。 方法 针对胡麻种子自动化考种时出现的数据统计错误率高、效率低等问题,基于机器视觉研究胡麻种子的轮廓特点、探索形态特征的测量方法,针对籽粒重叠现象提出基于融合角点特征的轮廓拟合图像分割方法,设计胡麻种子自动化考种数据实时分析系统,最终实现胡麻种子自动化考种的研究。本研究在工业相机获取的胡麻种子图像上进行试验。 结果和讨论 提出的自动化考种方法对不同品种胡麻种子的统计识别准确率达97.28%,百粒种子平均处理时长69.58 ms,相较于极限腐蚀算法、基于距离变换的分水岭算法,平均计算准确率比极限腐蚀算法提升19.6%,平均运算时间低于直接使用分水岭算法所需时间。 结论 自动化考种方法具有更好的计算准确率和处理速度,能够更准确地批量获取胡麻种子的形态学特征参数,使测量误差能够保持在10%以内,可为今后胡麻考种相关工作提供技术支撑,助力相关产业发展。

关键词: 胡麻种子, 机器视觉, 自动化考种, 图像分割, 软件系统

Abstract:

Objective Flax, characterized by its short growth cycle and strong adaptability, is one of the major cash crops in northern China. Due to its versatile uses and unique quality, it holds a significant position in China's oil and fiber crops. The quality of flax seeds directly affects the yield of the flax plant. Seed evaluation is a crucial step in the breeding process of flax. Common parameters used in the seed evaluation process of flax include circumference, area, length axis, and 1 000-seed weight. To ensure the high-quality production of flax crops, it is of great significance to understand the phenotypic characteristics of flax seeds, select different resources as parents based on breeding objectives, and adopt other methods for the breeding, cultivation, and evaluation of seed quality and traits of flax. Methods In response to the high error rates and low efficiency issues observed during the automated seed testing of flax seeds, the measurement methods were explored of flax seed contours based on machine vision research. The flax seed images were preprocessed, and the collected color images were converted to grayscale. A filtering and smoothing process was applied to obtain binary images. To address the issues of flax seed overlap and adhesion, a contour fitting image segmentation method based on fused corner features was proposed. This method incorporated adaptive threshold selection during edge detection of the image contour. Only multi-seed target areas that met certain criteria were subjected to image segmentation processing, while single-seed areas bypassed this step and were directly summarized for seed testing data. After obtaining the multi-seed adhesion target areas, the flax seeds underwent contour approximation, corner extraction, and contour fitting. Based on the provided image contour information, the image contour shape was approximated to another contour shape with fewer vertices, and the original contour curve was simplified to a more regular and compact line segment or polygon, minimizing computational complexity. All line shape characteristics in the image were marked as much as possible. Since the pixel intensity variations in different directions of image corners were significant, the second derivative matrix based on pixel grayscale values was used to detect image corners. Based on the contour approximation algorithm, contour corner detection was performed to obtain the coordinates of each corner. The resulting contour points and corners were used as outputs to further improve the accuracy and precision of subsequent contour fitting methods, resulting in a two-dimensional discrete point dataset of the image contour. Using the contour point dataset as an input, the geometric moments of the image contour were calculated, and the optimal solution for the ellipse parameters was obtained through numerical optimization based on the least squares method and the geometric features of the ellipse shape. Ultimately, the optimal contour was fitted to the given image, achieving the segmentation and counting of flax seed images. Meanwhile, each pixel in the digital image was a uniform small square in size and shape, so the circumference, area, and major and minor axes of the flax seeds could be represented by the total number of pixels occupied by the seeds in the image. The weight of a single seed could be calculated by dividing the total weight of the seeds by the total number of seeds detected by the contour, thereby obtaining the weight of the individual seed and converting it accordingly. Through the pixelization of the 1 yuan and 1 jiao coins from the fifth iteration of the 2019 Renminbi, a summary of the circumference, area, major axis, minor axis, and 1 000-seed weight of the flax seeds was achieved. Additionally, based on the aforementioned method, this study designed an automated real-time analysis system for flax seed testing data, realizing the automation of flax seed testing research. Experiments were conducted on images of flax seeds captured by an industrial camera. Results and Discussions The proposed automated seed identification method achieved an accuracy rate of 97.28% for statistically distinguishing different varieties of flax seeds. The average processing time for 100 seeds was 69.58 ms. Compared to the extreme erosion algorithm and the watershed algorithm based on distance transformation, the proposed method improved the average calculation accuracy by 19.6% over the extreme erosion algorithm and required a shorter average computation time than the direct use of the watershed algorithm. Considering the practical needs of automated seed identification, this method did not employ methods such as dilation or erosion for image morphology processing, thereby preserving the original features of the image to the greatest extent possible. Additionally, the flax seed automated seed identification data real-time analysis system could process image information in batches. By executing data summarization functions, it automatically generated corresponding data table folders, storing the corresponding image data summary tables. Conclusions The proposed method exhibits superior computational accuracy and processing speed, with shorter operation time and robustness. It is highly adaptable and able to accurately acquire the morphological feature parameters of flax seeds in bulk, ensuring measurement errors remain within 10%, which could provide technical support for future flax seed evaluation and related industrial development.

Key words: flax seeds, machine vision, automated seed testing, image segmentation, software systems