CN110174065B - Fruit size nondestructive testing method based on orthogonal binocular machine vision - Google Patents

Fruit size nondestructive testing method based on orthogonal binocular machine vision Download PDF

Info

Publication number
CN110174065B
CN110174065B CN201910520317.0A CN201910520317A CN110174065B CN 110174065 B CN110174065 B CN 110174065B CN 201910520317 A CN201910520317 A CN 201910520317A CN 110174065 B CN110174065 B CN 110174065B
Authority
CN
China
Prior art keywords
fruit
image
industrial camera
machine vision
height
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
CN201910520317.0A
Other languages
Chinese (zh)
Other versions
CN110174065A (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.)
Hunan Agricultural University
Original Assignee
Hunan Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Agricultural University filed Critical Hunan Agricultural University
Priority to CN201910520317.0A priority Critical patent/CN110174065B/en
Publication of CN110174065A publication Critical patent/CN110174065A/en
Application granted granted Critical
Publication of CN110174065B publication Critical patent/CN110174065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • 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/30108Industrial image inspection
    • G06T2207/30128Food products

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Abstract

A fruit size nondestructive testing method based on orthogonal binocular machine vision comprises the steps of collecting images of an object by two industrial cameras with orthogonal central axes, preprocessing the collected images by an MATLAB algorithm, extracting characteristic quantity, calculating by a reasonable algorithm to obtain a top view standard contour map and a side view standard contour map, processing data of the side view standard contour map to obtain the distance from the maximum fruit diameter surface to the bottom of a fruit, namely the height of the fruit diameter surface, processing the top view standard contour map data to obtain a calculated fruit diameter, introducing a height proportion coefficient k in combination with the height of the fruit diameter surface, correcting the calculated fruit diameter to obtain the fruit diameter with smaller error, and comparing with the national fruit grading standard to realize fruit size measurement.

Description

Fruit size nondestructive testing method based on orthogonal binocular machine vision
Technical Field
The invention relates to the technical field of fruit detection, in particular to a fruit size nondestructive detection method based on orthogonal binocular machine vision.
Background
At present, fruit size grading is realized by mainly combining manual work with machinery in China, the maximum axial diameter of the fruit is judged by manual naked eyes or measured by a vernier caliper to serve as the fruit diameter of the fruit, the fruit shape of the fruit has great difference, the maximum axial diameter is not well mastered, the artificial grading error is very large, the work is tedious, the efficiency is low, serious damage is easily caused to the fruit in the grading process, and meanwhile, strong subjective factors exist, and the grading method cannot meet the requirement of fruit grading.
In recent years, the detection method gradually turns to the machine vision direction, can realize nondestructive detection, has the characteristics of high efficiency and high accuracy, is widely applied to product classification such as eggs, oranges, pears and the like at present, and has less research on fruits with various varieties, different sizes and shapes and complex structures.
The research of detecting characteristic information and grading of objects by adopting machine vision is numerous, Zhang Qingyi and the like realize the detection of the size and the rotten area of the apples by the machine vision technology [ Zhang Qingyi, Zhang Baoxing, Ji Chang Ying, and the like. the design and the test of an apple online grading system [ J ]. academic newspaper of south China agricultural university, 2017, 38(4): 117-; in the detection of the appearance quality of apples based on machine vision, the Lilong and the like extract and synthesize images under the motion state of the apples, then perform Gaussian filtering, Daluo method binarization and contour extraction processing on the images, perform circle fitting processing on the contours, and obtain the sizes of the apples [ Lilong, Penqueu, Liyonyu ] by using the diameters of the fitting circles [ Lilong, Pengyu ] the design and test of an online nondestructive detection grading system for the internal and external quality of fruits [ J ] agricultural engineering report, 2018, 34 (9): 267 and 275.; the Chenyangjun and the like design a set of apple sorting system based on a machine vision technology, and by scanning and extracting a contour, the maximum distance between two points on an apple contour line is taken as a grading standard, and the maximum cross-section diameter of an apple [ Chenyangjun, Zhang Jun bear, Liwei, Ningxin, Tan Yun ] is taken as a grading method [ J ] of the maximum cross-section diameter of the apple based on the machine vision, journal of agricultural engineering, 2012,28 (2): 284-288 ]; the method comprises the following steps of dynamically acquiring real-time images in the apple transmission process by means of a machine vision technology, extracting apple outlines [ Huangchen, Figurou ] by an improved three-layer Canny edge detection algorithm, wherein the real-time images are extracted from Huang and the like by the aid of an apple transmission process [ Huangchen, Figurouyou ] apple online classification method based on image feature fusion [ J ]. agricultural engineering bulletin, 2017,33 (1): 285- & lt291- ]; the system mainly comprises a single-channel online conveying device, an image acquisition device and a sorting device, analyzes defects on the surface of an apple by using a digital processing method, and provides that the defect size of the fruit is judged by using an area ratio, the total detection accuracy of the defects on the surface of the apple is 92.5% [ Zhajuan, Pengkun, SAGARDHAKAL and the like ] the apple appearance defect online detection based on machine vision [ J ] agricultural machinery science and report, 2013,44(1):260 + 263 ]; dawn et al introduced near-infrared, machine vision and information fusion techniques for internal and external quality detection of fruits, the near-infrared technique was used for internal quality detection such as fruit ripeness, firmness, soluble solids and internal defects, and the machine vision was used for external quality detection such as fruit size, shape, color, surface defects [ dawn glu, dong army, wang-yan-wei et al plum fruit ripeness identification methods based on near-infrared spectroscopy and stoichiometry research [ J ] modern food technology, 2014,30(12): 230-; zhangyuhua introduces the near infrared, machine vision and information fusion technology for detecting the internal and external quality of fruits, the near infrared technology is used for detecting the internal quality such as the ripeness, the firmness, the soluble solid content and the internal defect of the fruits, the machine vision is used for detecting the external quality such as the size, the shape, the color and the surface defect of the fruits [ Zhang Yuhua, Mengyo, Zhang Ming, etc. [ Zhang Yuhua, machine vision and information fusion-based comprehensive quality detection of the fruits [ J ] the food industry, 2018,39(11): 247-.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a fruit size nondestructive testing method based on orthogonal binocular machine vision, so as to solve the defects in the background technology.
The technical problem solved by the invention is realized by adopting the following technical scheme:
the fruit size nondestructive testing method based on orthogonal binocular machine vision comprises the following specific steps:
step S100): building monocular machine vision system
The monocular machine vision system comprises an industrial camera, a camera height adjusting mechanism, a non-mirror surface cylinder, a lifting platform, a light box, a computer and a graduated scale, wherein the industrial camera, the camera height adjusting mechanism, the non-mirror surface cylinder, the lifting platform and the graduated scale used for measuring distance are respectively arranged in the light box, the non-mirror surface cylinder positioned right below the industrial camera is arranged on the lifting platform, the industrial camera is arranged at the upper end of the camera height adjusting mechanism, the bottom end of the camera height adjusting mechanism and the bottom end of the lifting platform are positioned on the same horizontal line, and the computer internally provided with an image processing system is connected with the industrial camera;
step S200) calibrating the monocular machine vision system
After the monocular machine vision system is built, the lifting platform is adjusted to the lowest point, and the lifting platform is subjected to size calibration to obtain an initial position proportion;
step S300) of acquiring an object image
The industrial camera captures and acquires non-mirror surface cylinder image information in real time;
step S400), image processing is carried out by utilizing an MATLAB algorithm and an image processing flow is carried out by a reasonable algorithm calculation image processing system based on the MATLAB algorithm as follows:
reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image containing rich cylindrical surface information;
carrying out binarization treatment: through binarization processing, distinguishing a detection object from a background, adopting a graythresh function, finding an optimal threshold value by using a maximum inter-class variance method, and taking the optimal threshold value to carry out binarization processing to obtain an ideal binarization effect graph;
fourthly, noise reduction treatment: performing noise reduction processing on the binarization effect graph, applying a bwleabel function, adopting an 8-connectivity mode to search for a region, outputting a maximum connectivity region by using matrixes and the number of connectivity regions with the same size, and effectively removing noise to enable detected object information to be more accurate;
contour extraction: by using mathematical models of corrosion, expansion and the like, the denoised image is directly operated, the boundary of an object is expanded outwards after the expansion operation, becomes coarse and clear, the target contour can be accurately and quickly extracted, and a binary image with less noise is obtained through image preprocessing, so that the standard contour image can be obtained by directly performing the operations of corrosion and the like on the image;
MATLAB algorithm processing: taking the characteristic quantity of the extracted standard contour map as a pixel point numerical value, calculating the distance between two adjacent pixel points for multiple times, obtaining the average value of the distances between the two points, and calculating according to the initial position proportion obtained in the step S200) to realize the conversion from the pixel coordinate to the actual coordinate and calculate the diameter of the non-mirror surface cylinder;
step S500) of measuring the height ratio coefficient k
Adjusting the lifting platform, sequentially increasing the height of the lifting platform by 0.1cm, repeating the steps S300) to S400) to obtain the diameter of the non-mirror surface cylinder with the corresponding height, and fitting the obtained data after multiple experiments to obtain a height proportion coefficient k;
step S600) of building a binocular machine vision acquisition system
The binocular machine vision system comprises a forward industrial camera, a sealed box, fruits to be detected, a forward fruit transverse central position detection mechanism, a conveyor belt, a backward fruit transverse central position detection mechanism, a lateral industrial camera, a display processor and a motor, wherein the fruits to be detected are arranged on the conveyor belt arranged on a bottom plate of the sealed box, the conveyor belt is connected with the motor, the forward fruit transverse central position detection mechanism and the backward fruit transverse central position detection mechanism are arranged on two sides of the conveyor belt, the conveyor belt is controlled by the motor to rotate, and the fruits to be detected are conveyed to accurate positions to be photographed after being detected by the forward fruit transverse central position detection mechanism and the backward fruit transverse central position detection mechanism; a forward industrial camera is mounted on the upper part of the sealed box body, a lateral industrial camera is mounted on the right side of the sealed box body, and the central axes of the forward industrial camera and the lateral industrial camera are orthogonal; the forward industrial camera and the side industrial camera which are internally provided with the image acquisition modules are respectively connected with a display processor through kilomega communication data lines, and the display processor is internally provided with an image processing module for processing images in real time;
step S700), a forward industrial camera and a lateral industrial camera with the central axes in the orthogonal state are used for capturing front and side images of the fruit to be detected in real time to obtain non-mirror surface cylinder image information;
step S800) MATLAB Algorithm processing
The image processing module performs an image processing flow based on the MATLAB algorithm as follows:
a) obtaining the overlook and side view standard outline drawing of the fruit to be measured
Reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image containing rich cylindrical surface information;
carrying out binarization treatment: through binarization processing, distinguishing a detection object from a background, adopting a graythresh function, finding an optimal threshold value by using a maximum inter-class variance method, and taking the optimal threshold value to carry out binarization processing to obtain an ideal binarization effect graph;
fourthly, noise reduction treatment: performing noise reduction processing on the binarization effect graph, applying a bwleabel function, adopting an 8-connectivity mode to search for a region, outputting a maximum connectivity region by using matrixes and the number of connectivity regions with the same size, and effectively removing noise to enable detected object information to be more accurate;
contour extraction: by using mathematical models of corrosion, expansion and the like, the denoised image is directly operated, the boundary of an object is expanded outwards after the expansion operation, becomes coarse and clear, the target contour can be accurately and quickly extracted, and a binary image with less noise is obtained through image preprocessing, so that the overlooking standard contour map and the side-looking standard contour map can be obtained by directly performing the operations of corrosion and the like on the image;
b) processing the data of the side-looking standard contour map to obtain the distance from the maximum fruit diameter surface to the bottom of the fruit, which is hereinafter referred to as the height of the fruit diameter surface;
c) and processing the overlook standard contour map data to obtain a calculated fruit diameter, introducing a height proportion coefficient k in combination with the height of a fruit diameter surface, and correcting the calculated fruit diameter to obtain the fruit diameter with smaller error.
In the present invention, the operation principle of obtaining the initial position ratio a in step S200) is as follows:
taking two points on the scale, wherein the length between the two points is L, collecting a non-mirror surface cylinder picture, and reading a pixel coordinate difference value X between the two points2-X1When the distance from the lifting platform is 0, the initial position ratio A of the pixel coordinate to the actual coordinate is as follows:
Figure GDA0002675618630000071
in the present invention, in the step S500), the measured data is analyzed, the height G of the lifting platform is taken as the horizontal axis, the height scaling factor k is taken as the vertical axis, wherein the height scaling factor k is the calculated diameter/actual diameter, and the data is subjected to Polynomial fitting to obtain the specific height scaling factor k is 0.1007G + 0.9264.
In the invention, an annular LED electrodeless dimming light source for supplementing light is arranged on the industrial camera.
In the invention, the light sources for light supplement are respectively arranged on the forward industrial camera and the lateral industrial camera, and the light sources are electrodeless dimming lamp sources.
In the invention, the sealed box body is made of black materials, so that the background color is simplified, the sealed box body is easy to distinguish from the fruit to be detected, and the image processing is convenient to obtain a complete fruit contour map.
Has the advantages that: the method comprises the steps of obtaining a top view image and a side view image of the fruit based on orthogonal binocular machine vision, combining an MATLAB algorithm to perform image processing on the top view image and the side view image, thereby extracting the fruit diameter size of the round fruit, comparing the fruit diameter size with the national fruit grading standard, and further realizing the nondestructive measurement of the fruit size; meanwhile, effective reference is provided for assembly line operation, and the method has the characteristics of standardization, high efficiency, high precision and nondestructive detection and has important research significance.
Drawings
FIG. 1 is a flow chart of the preferred embodiment of the present invention.
FIG. 2 is a schematic diagram of a monocular machine vision system according to a preferred embodiment of the present invention.
FIG. 3 is a Polynomial fitting graph of the Hd test data in a preferred embodiment of the invention.
Fig. 4 is a schematic structural diagram of a binocular machine vision system in a preferred embodiment of the invention.
FIGS. 5-8 are schematic diagrams illustrating the image processing status of the image processing module based on the MATLAB algorithm in the preferred embodiment of the present invention.
Detailed Description
In order to make the technical means, the creation characteristics, the achievement purposes and the effects of the invention easy to understand, the invention is further explained below by combining the specific drawings.
Referring to fig. 1 to 8, the fruit size nondestructive testing method based on orthogonal binocular machine vision specifically comprises the following steps:
step S100) of building a monocular machine vision system
The monocular machine vision system comprises an industrial camera A1, an annular LED stepless dimming light source A2, a camera height adjusting mechanism A3, a non-mirror cylinder (with the height of 2cm and the diameter of 5.95cm) A4, a lifting platform A5, a light box A6, a computer A7 and a graduated scale A8, wherein the industrial camera A1, the annular LED stepless dimming light source A2, the camera height adjusting mechanism A3, the non-mirror cylinder A4, the lifting platform A5 and a graduated scale A8 are respectively arranged in the light box A6, the non-mirror cylinder A4 which is positioned right below the industrial camera A1 is arranged on the lifting platform A5, the industrial camera A1 is arranged at the upper end of the camera height adjusting mechanism A3, the bottom end of the camera height adjusting mechanism A3 and the bottom end of the lifting platform A5 are positioned at the same horizontal line, and the computer A7 is connected with the industrial camera A1;
step S200) calibrating the monocular machine vision system
After the monocular machine vision system is built, adjusting the lifting platform A5 to the lowest point, and carrying out size calibration on the lifting platform A5 to obtain an initial position proportion;
step S300) of acquiring an object image
The industrial camera A1 is a high-definition drive-free 500-ten-thousand-pixel industrial camera, a high-definition 300-thousand-pixel 1/2C interface is adopted to manually zoom a camera lens of a 6-12mm camera, an image is captured in real time, and information of a non-mirror surface cylinder A4 is acquired;
step S400) of image processing and rational algorithm calculation by using MATLAB algorithm
The computer a7 has an image processing system built therein, and the image processing system performs an image processing flow based on the MATLAB algorithm as follows:
reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image containing rich cylindrical surface information;
carrying out binarization treatment: through binarization processing, distinguishing a detection object from a background, adopting a graythresh function, finding an optimal threshold value by using a maximum inter-class variance method, and taking the optimal threshold value to carry out binarization processing to obtain an ideal binarization effect graph;
fourthly, noise reduction treatment: performing noise reduction processing on the binarization effect graph, applying a bwleabel function, adopting an 8-connectivity mode to search for a region, outputting a maximum connectivity region by using matrixes and the number of connectivity regions with the same size, and effectively removing noise to enable detected object information to be more accurate;
contour extraction: by using mathematical models of corrosion, expansion and the like, the denoised image is directly operated, the boundary of an object is expanded outwards after the expansion operation, becomes coarse and clear, the target contour can be accurately and quickly extracted, and a binary image with less noise is obtained through image preprocessing, so that the standard contour image can be obtained by directly performing the operations of corrosion and the like on the image;
MATLAB algorithm processing: taking the characteristic quantity of the extracted standard contour map as a pixel point numerical value, calculating the distance between two adjacent pixel points for multiple times, obtaining the average value of the distances between the two points, calculating according to the initial position proportion obtained in the step S200) to realize the conversion from the pixel coordinate to the actual coordinate, and calculating the diameter of the non-mirror surface cylinder A4;
step S500) of measuring the height ratio coefficient k
Adjusting the lifting platform A5, sequentially increasing the height of the lifting platform A5 by 0.1cm, repeating the steps S300) to S400) to obtain the diameter of the non-mirror surface cylinder A4 with the corresponding height, and performing multiple experiments to linearly fit the obtained experimental data to obtain a height proportion coefficient k;
step S600) of building a binocular machine vision acquisition system
The binocular machine vision system comprises a forward industrial camera B1, a forward light source B2, a sealed box B3, a fruit B4 to be tested, a forward fruit transverse center position detection mechanism B5, a conveyor belt B6, a backward fruit transverse center position detection mechanism B7, a lateral light source B8, a lateral industrial camera B9, a display processor B10 and a motor B11, wherein the fruit B4 to be tested is arranged on the conveyor belt B6 arranged on the bottom plate of the sealed box B3, the conveyor belt B6 is connected with the motor B11, the forward fruit transverse center position detection mechanism B5 and the backward fruit transverse center position detection mechanism B7 are arranged on two sides of the conveyor belt B6, the motor B11 is used for controlling the conveyor belt B6 to rotate, and the fruit B4 to be tested is conveyed to an accurate position to be photographed after being detected by the forward fruit transverse center position detection mechanism B5 and the backward fruit transverse center position detection mechanism B7; a forward industrial camera B1 is installed at the upper part of the sealed box B3, a lateral industrial camera B9 is installed at the right side of the sealed box B3, and the forward industrial camera B1 is orthogonal to the central axis of the lateral industrial camera B9; the forward industrial camera B1 is provided with a forward light source B2, the lateral industrial camera B9 is provided with a lateral light source B8, the forward industrial camera B1 and the lateral industrial camera B9 which are internally provided with image acquisition modules are respectively connected with a display processor B10 through gigabit communication data lines, and the display processor B10 is internally provided with an image processing module for processing images in real time;
the sealed box body B3 is made of black materials, so that the background color is simplified, the sealed box body B3 is easy to distinguish from the fruit B4 to be detected, the image processing is facilitated to obtain a complete fruit outline picture, the forward light source B2 and the lateral light source B8 adopt electrodeless dimming lamp sources, electrodeless dimming is realized, the optimal illumination intensity can be better obtained, a good detection light environment is provided, and the inner diameter is 28mm and 60mm, so that the sealed box body B3 is used for light supplement matching to obtain a clearer image; the forward industrial camera B1 and the lateral industrial camera B9 adopt a high-definition drive-free 500-ten-thousand-pixel industrial camera, and the lens is a high-definition 300-thousand-pixel 1/2C interface manual zooming 6-12mm camera lens;
the focal length, the object distance and other parameters of the forward industrial camera B1 and the lateral industrial camera B9 are adjusted to be the same as the industrial camera A1 in the step S100);
the forward fruit transverse center position detection mechanism B5 and the backward fruit transverse center position detection mechanism B7 are respectively provided with a touch sensor for detecting the position of the fruit B4 to be detected;
the backward fruit transverse center position detection mechanism B7 is positioned below the camera photographing center point;
step S700), a forward industrial camera B1 and a lateral industrial camera B9 with the central axes in the orthogonal state are used for capturing front and side images of a fruit B4 to be detected in real time to obtain image information of a non-mirror cylinder A4;
step S800) MATLAB Algorithm processing
The display processor B10 has an image processing module built therein, and the image processing module performs an image processing flow based on the MATLAB algorithm as follows:
a) obtaining the top view and side view standard outline of the fruit B4 to be measured
Reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image containing rich cylindrical surface information;
carrying out binarization treatment: through binarization processing, distinguishing a detection object from a background, adopting a graythresh function, finding an optimal threshold value by using a maximum inter-class variance method, and taking the optimal threshold value to carry out binarization processing to obtain an ideal binarization effect graph;
fourthly, noise reduction treatment: performing noise reduction processing on the binarization effect graph, applying a bwleabel function, adopting an 8-connectivity mode to search for a region, outputting a maximum connectivity region by using matrixes and the number of connectivity regions with the same size, and effectively removing noise to enable detected object information to be more accurate;
contour extraction: by using mathematical models of corrosion, expansion and the like, the denoised image is directly operated, the boundary of an object is expanded outwards after the expansion operation, becomes coarse and clear, the target contour can be accurately and quickly extracted, and a binary image with less noise is obtained through image preprocessing, so that the overlooking standard contour map and the side-looking standard contour map can be obtained by directly performing the operations of corrosion and the like on the image;
b) processing the data of the side-looking standard contour map to obtain the distance from the maximum fruit diameter surface to the bottom of the fruit, which is hereinafter referred to as the height of the fruit diameter surface;
c) and processing the overlook standard contour map data to obtain a calculated fruit diameter, introducing a height proportion coefficient k in combination with the height of a fruit diameter surface, and correcting the calculated fruit diameter to obtain the fruit diameter with smaller error.
In this embodiment, the operation principle of step S200) is as follows:
taking two points on a graduated scale A8 with a length L between the two points, collecting a non-mirror cylindrical picture, and reading a pixel coordinate difference value X between the two points2-X1If the distance from the lifting platform a5 is 0, the initial position ratio a of the pixel coordinate to the actual coordinate is:
Figure GDA0002675618630000121
the step S400) has the following process codes:
Figure GDA0002675618630000122
Figure GDA0002675618630000131
Figure GDA0002675618630000141
in the step S500), analyzing the measured data, with the height G of the lifting platform a5 as the horizontal axis and the height proportionality coefficient k as the vertical axis, wherein the height proportionality coefficient k is the calculated diameter/actual diameter, and performing Polynomial fitting on the data to obtain a specific height proportionality coefficient k 0.1007G + 0.9264;
in step S800), the maximum fruit diameter surface height H is calculated: firstly, the distance between each point is calculated in the vertical direction, the maximum distance is found out, the connecting line of the two points with the maximum distance can form a surface in three dimensions, namely the maximum fruit diameter surface of the fruit, the distance between the maximum fruit diameter surface and the lowest surface is the height H of the maximum fruit diameter surface, and the specific codes are as follows:
Figure GDA0002675618630000142
Figure GDA0002675618630000151
Figure GDA0002675618630000161
and (3) introducing a height proportion coefficient k in combination with the height of the maximum fruit diameter surface to correct the calculated fruit diameter, wherein the specific codes are as follows:
Figure GDA0002675618630000162

Claims (8)

1. the fruit size nondestructive testing method based on orthogonal binocular machine vision is characterized by comprising the following specific steps:
step S100): building monocular machine vision system
The monocular machine vision system comprises an industrial camera, a camera height adjusting mechanism, a non-mirror surface cylinder, a lifting platform, a light box, a computer and a graduated scale, wherein the industrial camera, the camera height adjusting mechanism, the non-mirror surface cylinder, the lifting platform and the graduated scale used for measuring distance are respectively arranged in the light box, the non-mirror surface cylinder positioned right below the industrial camera is arranged on the lifting platform, the industrial camera is arranged at the upper end of the camera height adjusting mechanism, the bottom end of the camera height adjusting mechanism and the bottom end of the lifting platform are positioned on the same horizontal line, and the computer internally provided with an image processing system is connected with the industrial camera;
step S200) calibrating the monocular machine vision system
After the monocular machine vision system is built, the lifting platform is adjusted to the lowest point, and the lifting platform is subjected to size calibration to obtain an initial position proportion;
step S300) of acquiring an object image
The industrial camera captures and acquires non-mirror surface cylinder image information in real time;
step S400), image processing is carried out by utilizing an MATLAB algorithm and an image processing flow is carried out by a reasonable algorithm calculation image processing system based on the MATLAB algorithm as follows:
reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image;
carrying out binarization treatment: obtaining a binarization effect graph through binarization processing;
fourthly, noise reduction treatment: carrying out noise reduction processing on the binarization effect graph;
contour extraction: extracting the contour of the denoised binary effect image to obtain a standard contour image;
MATLAB algorithm processing: taking the characteristic quantity of the extracted standard contour map as a pixel point numerical value, calculating the distance between two adjacent pixel points for multiple times, obtaining the average value of the distances between the two points, and calculating according to the initial position proportion obtained in the step S200) to obtain the diameter of the non-mirror surface cylinder;
step S500) of measuring the height ratio coefficient k
Adjusting a lifting platform, sequentially increasing the height of the lifting platform by 0.1cm, repeating the steps S300) to S400) to obtain the diameter of the non-mirror surface cylinder with the corresponding height, performing multiple experiments, analyzing and processing the measured data, wherein the height G of the lifting platform is a horizontal axis, a height proportion coefficient k is taken as a vertical axis, the height proportion coefficient k is a calculated diameter/actual diameter, and performing Polynomial fitting on the obtained experimental data to obtain the height proportion coefficient k is 0.1007G + 0.9264;
step S600) of building a binocular machine vision acquisition system
The binocular machine vision system comprises a forward industrial camera, a sealed box body, fruits to be detected, a forward fruit transverse central position detection mechanism, a conveyor belt, a backward fruit transverse central position detection mechanism, a lateral industrial camera, a display processor and a motor, wherein the fruits to be detected are arranged on the conveyor belt arranged on a bottom plate of the sealed box body, the conveyor belt is connected with the motor, and the forward fruit transverse central position detection mechanism and the backward fruit transverse central position detection mechanism are arranged on two sides of the conveyor belt; a forward industrial camera is mounted on the upper part of the sealed box body, a lateral industrial camera is mounted on the right side of the sealed box body, and the central axes of the forward industrial camera and the lateral industrial camera are orthogonal; the forward industrial camera and the side industrial camera which are internally provided with the image acquisition modules are respectively connected with a display processor, and the display processor is internally provided with an image processing module for processing images in real time;
step S700), a forward industrial camera and a lateral industrial camera with the central axes in the orthogonal state are used for capturing front and side images of the fruit to be detected in real time to obtain non-mirror surface cylinder image information;
step S800) MATLAB Algorithm processing
The image processing module performs an image processing flow based on the MATLAB algorithm as follows:
a) obtaining the overlook and side view standard outline drawing of the fruit to be measured
Reading a color image;
image graying: b component extraction is carried out on the color image to obtain a gray level image;
carrying out binarization treatment: obtaining a binarization effect graph through binarization processing;
fourthly, noise reduction treatment: carrying out noise reduction processing on the binarization effect graph;
contour extraction: extracting the contours of the denoised binarization effect image to obtain a top view standard contour image and a side view standard contour image;
b) processing the data of the side-looking standard contour map to obtain the distance from the maximum fruit diameter surface to the bottom of the fruit, which is called the height of the fruit diameter surface;
c) and processing the overlook standard contour map data to obtain a calculated fruit diameter, introducing a height proportion coefficient k in combination with the height of a fruit diameter surface, and correcting the calculated fruit diameter to obtain the fruit diameter with smaller error.
2. The fruit size nondestructive testing method based on orthogonal binocular machine vision as claimed in claim 1, wherein light sources for light supplement are respectively installed on the forward industrial camera and the lateral industrial camera, and the light sources are electrodeless dimming lamp sources.
3. The orthogonal binocular machine vision-based fruit size nondestructive testing method according to claim 1, wherein the sealed box body is made of a black material.
4. The fruit size nondestructive testing method based on orthogonal binocular machine vision according to claim 1, wherein an annular LED stepless dimming light source for light supplement is mounted on the industrial camera.
5. The orthogonal binocular machine vision-based fruit size nondestructive testing method according to claim 1, wherein the forward fruit transverse center position detection mechanism and the backward fruit transverse center position detection mechanism are respectively provided with a touch sensor.
6. The orthogonal binocular machine vision-based fruit size nondestructive testing method according to claim 1, wherein the backward fruit transverse center position detection mechanism is located below a camera photographing center point.
7. The fruit size nondestructive testing method based on orthogonal binocular machine vision according to claim 1, wherein the operation principle of obtaining the initial position ratio A in the step S200) is as follows:
taking two points on the scale, wherein the length between the two points is L, collecting a non-mirror surface cylinder picture, and reading a pixel coordinate difference value X between the two points2-X1When the distance from the lifting platform is 0, the initial position ratio A of the pixel coordinate to the actual coordinate is as follows:
Figure FDA0002795131330000041
8. the orthogonal binocular machine vision based fruit size nondestructive testing method according to claim 1, wherein in the step S800), the maximum fruit diameter surface height H is calculated: firstly, the distance between each point is calculated in the vertical direction, the maximum distance is found out, the connecting line of the two points with the maximum distance is formed, a surface is formed in three dimensions, the surface is the maximum fruit diameter surface of the fruit, and the distance between the maximum fruit diameter surface and the lowest surface is the height H of the maximum fruit diameter surface.
CN201910520317.0A 2019-06-17 2019-06-17 Fruit size nondestructive testing method based on orthogonal binocular machine vision Active CN110174065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910520317.0A CN110174065B (en) 2019-06-17 2019-06-17 Fruit size nondestructive testing method based on orthogonal binocular machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910520317.0A CN110174065B (en) 2019-06-17 2019-06-17 Fruit size nondestructive testing method based on orthogonal binocular machine vision

Publications (2)

Publication Number Publication Date
CN110174065A CN110174065A (en) 2019-08-27
CN110174065B true CN110174065B (en) 2021-02-26

Family

ID=67698500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910520317.0A Active CN110174065B (en) 2019-06-17 2019-06-17 Fruit size nondestructive testing method based on orthogonal binocular machine vision

Country Status (1)

Country Link
CN (1) CN110174065B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110146516B (en) * 2019-06-17 2024-04-02 湖南农业大学 Fruit grading device based on orthogonal binocular machine vision
CN110823136B (en) * 2019-11-26 2022-07-19 湖南农业大学 Method for rapidly estimating surface area of rape pod
CN112461135B (en) * 2020-10-10 2021-12-21 华南农业大学 Dendrobium growth parameter nondestructive online measuring device and measuring method thereof
CN112683190B (en) * 2020-10-27 2022-10-04 广东奥普特科技股份有限公司 Transparent body built-in object depth detection method and detection system thereof
CN112556606A (en) * 2020-12-24 2021-03-26 宁夏农林科学院农业经济与信息技术研究所(宁夏农业科技图书馆) Self-propelled wolfberry fruit actual measurement method and device based on binocular vision
CN117422757B (en) * 2023-10-31 2024-05-03 安徽唯嵩光电科技有限公司 Fruit and vegetable size sorting method and device, computer equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES8608152A1 (en) * 1985-05-29 1986-06-16 Texpa Engeneering S A Optoelectronic method for measuring the dimensions and shapes of fruits, vegetables and various objects
FR2795499B1 (en) * 1999-06-28 2001-09-28 Materiel Arboriculture ANALYSIS METHOD AND DEVICE FOR THE AUTOMATIC SORTING OF PRODUCTS SUCH AS FRUIT
JP2001228087A (en) * 2000-02-16 2001-08-24 Yanmar Agricult Equip Co Ltd Nondestructive quality determining apparatus
KR100559242B1 (en) * 2004-01-14 2006-03-15 조재호 Buffer of classifier for fruit sorter
FR2874425B1 (en) * 2004-08-17 2006-10-27 Materiel Arboriculture DEVICE FOR OPTICALLY ANALYZING PRODUCTS SUCH AS FRUITS WITH BILATERAL TAKING DEVICES
CN201876242U (en) * 2010-05-26 2011-06-22 华中农业大学 Fruit image acquiring device
CN101949686A (en) * 2010-08-02 2011-01-19 扬州福尔喜果蔬汁机械有限公司 Online nondestructive testing (NDT) method and device for comprehensive internal/external qualities of fruits
CN102896093B (en) * 2012-11-13 2014-06-25 潍坊永昱电控科技有限公司 Automatic sorting machine of LED (Light-Emitting Diode) wafer
CN105203543B (en) * 2015-09-22 2018-04-10 华中农业大学 FCL red grape fruit size fractionation devices and methods therefor based on machine vision
CN105562361B (en) * 2015-12-23 2017-12-22 西安工程大学 A kind of autonomous method for sorting of fabric sorting machine people
CN108076832B (en) * 2017-12-30 2019-12-17 浙江工贸职业技术学院 Orange picking robot
CN108491892A (en) * 2018-04-05 2018-09-04 聊城大学 fruit sorting system based on machine vision
CN109590231A (en) * 2018-12-19 2019-04-09 上海易持自动系统有限公司 A kind of non-regular shape material image measurement measuring and controlling device and method

Also Published As

Publication number Publication date
CN110174065A (en) 2019-08-27

Similar Documents

Publication Publication Date Title
CN110174065B (en) Fruit size nondestructive testing method based on orthogonal binocular machine vision
CN110146516B (en) Fruit grading device based on orthogonal binocular machine vision
CN107941808B (en) 3D printing forming quality detection system and method based on machine vision
CN210071686U (en) Fruit grading plant based on orthogonal binocular machine vision
CN108288288B (en) Method, device and system for measuring precision shaft dimension based on visual identification
CN109269951B (en) Image-based flotation tailing ash content, concentration and coarse particle content detection method
CN109598715B (en) Material granularity online detection method based on machine vision
CN110779928B (en) Defect detection device and method
CN107804514B (en) Toothbrush sorting method based on image recognition
CN106969706A (en) Workpiece sensing and three-dimension measuring system and detection method based on binocular stereo vision
CN103454285A (en) Transmission chain quality detection system based on machine vision
Uluişik et al. Image processing based machine vision system for tomato volume estimation
CN104197836A (en) Vehicle lock assembly size detection method based on machine vision
CN107891012B (en) Pearl size and circularity sorting device based on equivalent algorithm
CN112184648A (en) Piston surface defect detection method and system based on deep learning
CN111122590B (en) Ceramic surface defect detection device and detection method
CN110260818B (en) Electronic connector robust detection method based on binocular vision
CN106248680A (en) A kind of engine commutator quality detecting system based on machine vision and detection method
CN106780437B (en) A kind of quick QFN chip plastic packaging image obtains and amplification method
CN104198325A (en) Method for measuring ratio of cut stem to cut tobacco based on computer vision
CN111739003B (en) Machine vision method for appearance detection
CN113847881A (en) Free-form surface profile tolerance detection method based on machine vision
CN111487192A (en) Machine vision surface defect detection device and method based on artificial intelligence
CN110738644A (en) automobile coating surface defect detection method and system based on deep learning
CN107576600B (en) Quick detection method for matcha granularity grade

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