Tea seed picking system based on image recognition
By performing grayscale, binarization and contour extraction processing on the tea seed images, combining three-dimensional coordinates and robotic arms, the automated picking and accurate identification of tea seeds is achieved, and the low picking efficiency and inaccurate identification in the existing technology are solved. question.
Patent Information
- Application Number
- CN202411320612.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art lacks an automated tea seed picking process, and the image recognition process of tea seeds is not accurate enough, making it difficult to accurately distinguish tea seeds and tea seed backgrounds.
By obtaining the tea seed image, greyscale processing, binarization processing and contour extraction, the maturity of the tea seed outline is judged, and the tea seed three-dimensional coordinates and robotic arms are used for picking.
It realizes automatic picking and accurate identification of tea seeds, improves picking efficiency and accuracy, and can automatically obtain tea seed outlines and mature tea seeds, and accurately pick them.
Smart Images

Figure CN119445560A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of tea seed recognition and picking, and in particular to a tea seed picking system based on image recognition. Background Art
[0002] Tea seed oil has antioxidant capacity, can lower blood pressure, lower blood lipids and inhibit arteriosclerosis, so it is necessary to pick tea seeds in the tea garden. Traditional manual picking is inefficient, and the maturity and picking period of tea seeds are short, which brings picking pressure to large areas of tea gardens. In addition, many tea trees grow on mountains with different slopes, which also increases the difficulty of picking. At the same time, with the development of agricultural automation, tea seed picking can be combined with image recognition technology to complete picking;
[0003] Image recognition technology is a technology that uses computer vision and machine learning algorithms to identify, classify, and analyze objects, scenes, and patterns from images or videos. Therefore, the outline and maturity of tea seeds can be identified based on image recognition technology, and then a robotic arm can be used to pick the tea seeds. The existing technology lacks the above-mentioned automated tea seed picking process, and the image recognition process of tea seeds is not accurate enough, making it difficult to accurately distinguish between tea seeds and tea seed backgrounds. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by acquiring a tea seed image, graying the tea seed image, binarizing the tea seed grayscale image, and performing contour extraction on the tea seed binarization image, determining whether the tea seeds with the tea seed contour are mature, and picking the tea seeds using a robotic arm based on the three-dimensional coordinates of the tea seeds and the tea seed contour, so as to solve the problem that the prior art lacks an automated tea seed picking process, and at the same time solves the problem that the prior art is not accurate enough in the image recognition process of tea seeds, and it is difficult to accurately distinguish the tea seeds from the tea seed background.
[0005] To achieve the above-mentioned purpose, the present application provides a tea seed picking system based on image recognition, comprising: an image acquisition module, an image processing module and a tea seed picking module;
[0006] The image acquisition module is used to acquire tea seed images;
[0007] The image processing module includes a tea seed contour acquisition unit and a tea seed maturity judgment unit. The tea seed contour acquisition unit is used to grayscale the tea seed image and mark it as a tea seed grayscale image, binarize the tea seed grayscale image and mark it as a tea seed binarization image, and perform contour extraction on the tea seed binarization image and mark it as a tea seed contour. The tea seed maturity judgment unit is used to judge whether the tea seeds of the tea seed contour are mature.
[0008] The tea seed picking module is used to obtain the three-dimensional coordinates of the tea seeds, and to pick the tea seeds using a robotic arm based on the three-dimensional coordinates of the tea seeds and the contours of the tea seeds.
[0009] Furthermore, the tea seed contour acquisition unit is configured with a grayscale processing strategy, and the grayscale processing strategy includes: acquiring the RGB value of each pixel of the tea seed image;
[0010] Get the R weight a1, G weight a2, and B weight a3 in the RGB value;
[0011] Use the grayscale conversion formula to convert the RGB value into a grayscale value. The grayscale conversion formula is:
[0012] H=a1*R+a2*G+a3*B; wherein H is the gray value, and R, G and B are three values in the RGB value.
[0013] Further, the tea seed contour acquisition unit is configured with a weight acquisition strategy, which includes: respectively acquiring a first number of images containing only tea seeds and tea tree images without tea seeds, and marking them as tea seed fruit images and tea seed background images respectively;
[0014] The RGB values of all pixels of the tea seed fruit image and the RGB values of all pixels of the tea seed background image are counted respectively, and marked as fruit RGB value and background RGB value respectively;
[0015] Calculate the mean value of R in the fruit RGB value as Jgr, the mean value of G as Jgg, and the mean value of B as Jgb;
[0016] Calculate the mean of R in the background RGB value as Jbr, the mean of G as Jbg, and the mean of B as Jbb;
[0017] Calculate Cr = Jgr-Jbr, Cg = Jgg-Jbg, Cb = Jgb-Jbb; where Cr is the R difference, Cg is the G difference, and Cb is the B difference;
[0018] Get the minimum value among Cr, Cg and Cb, marked as Cmin;
[0019] The offset is calculated as: p = p1-Cmin; where p is the offset and p1 is a positive number;
[0020] Calculate Cr1=Cr+p, Cg1=Cg+p, Cb1=Cb+p respectively; where Cr1 is the bias value of Cr, Cg1 is the bias value of Cg, and Cb1 is the bias value of Cb;
[0021] It is calculated that a1=Cr1 / (Cr1+Cg1+Cb1), a2=Cg1 / (Cr1+Cg1+Cb1), and a3=Cb1 / (Cr1+Cg1+Cb1) respectively.
[0022] Further, the tea seed contour acquisition unit is configured with a grayscale histogram establishment strategy, and the grayscale histogram establishment strategy includes: evenly dividing the grayscale values from 0 to 255 into d equal intervals;
[0023] Statistically count the frequency of grayscale values in each equal interval, and mark it as the interval frequency;
[0024] Draw a histogram with the grayscale value as the X-axis and the frequency as the Y-axis, and mark it as the grayscale histogram.
[0025] Further, the tea seed contour acquisition unit is configured with a binarization processing strategy, and the binarization processing strategy includes: obtaining the frequency Ps of all grayscale values;
[0026] If there is an interval with an interval frequency less than Ps / d, mark it as a low-frequency region. If both sides of the low-frequency region contain intervals with an interval frequency greater than Ps / d, mark it as an initial region, and mark the initial region with the least frequency as the threshold region;
[0027] Set the grayscale values of the pixel points greater than or equal to the threshold region to 255, and set the grayscale values of the pixel points less than the threshold region to 0.
[0028] Further, the tea seed contour acquisition unit is configured with a contour extraction processing strategy, and the contour extraction processing strategy includes: if a pixel point with a grayscale value of 255 is adjacent to a pixel point with a grayscale value of 0, mark the pixel point with a grayscale value of 255 as a tea seed edge pixel point;
[0029] Statistically count all tea seed edge pixel points and mark them as the tea seed contour.
[0030] Further, the tea seed maturity judgment unit is configured with a maturity judgment strategy, and the maturity judgment strategy includes: drawing the tea seed contour on the tea seed image, and obtaining the R mean value, G mean value, and B mean value of all pixel points within the contour, and marking them as Rg, Gg, and Bg respectively;
[0031] Obtain the first threshold w1, the second threshold w2, the third threshold w3, the fourth threshold w4, the fifth threshold w5, and the sixth threshold w6;
[0032] If w1 < Rg < w2, w3 < Gg < w4, and w5 < Gg < w6 are satisfied simultaneously, then mark the tea seed with this tea seed contour as a mature tea seed.
[0033] Further, the tea seed maturity judgment unit is configured with a threshold acquisition strategy, and the threshold acquisition strategy includes: obtaining the second number of images containing only mature tea seeds, and marking them as mature tea seed images;
[0034] Obtain the minimum value and the maximum value of the pixel point R in each mature tea seed image, and mark them as Rmax and Rmin respectively;
[0035] Obtain the minimum and maximum values of pixel B in each mature tea seed image, marked as Bmax and Bmin respectively;
[0036] Obtain the minimum and maximum values of the pixel points G in each mature tea seed image, marked as Gmax and Gmin respectively;
[0037] The means of Rmax, Rmin, Bmax, Bmin, Gmax and Gmin are obtained and marked as w1, w2, w3, w4, w5 and w6 respectively.
[0038] Furthermore, the tea seed picking module is configured with a tea seed picking strategy, which includes: taking any point near the robot arm as the origin, the vertical direction as the Z-axis direction, any horizontal direction as the Y-axis direction, and a horizontal direction perpendicular to the Y-axis as the X-axis to establish a three-dimensional coordinate system;
[0039] The coordinates of the endpoint of the real-time end effector are obtained as (x1, y1, z1), the coordinates of the center of the end effector and the farthest coordinates of the mature tea seeds are obtained as (x2, y2, z2), and the coordinate point of the picking completion delivery is (x3, y3, z3);
[0040] The end effector is first controlled to move x2-x1 distance in the X-axis direction, then y2-y1 distance in the Y-axis direction, and z2-z1 distance in the Z-axis direction. Based on the contour of the tea seeds, the end effector is controlled to move x3-x2 distance in the X-axis direction, y3-y2 distance in the Y-axis direction, and z3-z2 distance in the Z-axis direction to reach the picking completion delivery coordinate point. Finally, the end effector releases the mature tea seeds to complete the picking.
[0041] Beneficial effects of the present invention: The present invention obtains tea seed images, grayscales the tea seed images, binarizes the tea seed grayscale images, performs contour extraction on the tea seed binarization images, determines whether the tea seeds with the tea seed contours are mature, and uses a mechanical arm to pick the tea seeds based on the three-dimensional coordinates of the tea seeds and the tea seed contours. The advantage is that the tea seed contours, mature tea seeds, and tea seed picking can be automatically obtained, solving the problem of low manual picking efficiency. The RGB values of the tea seeds and the tea seed background are combined when obtaining the weight of the grayscale value, so that the converted tea seed grayscale image is easier to distinguish between the tea seeds and the tea seed background;
[0042] The present invention establishes a grayscale histogram, which has the advantage that the threshold of tea seeds and tea seed background can be found according to the distribution of the grayscale histogram, and then the tea seed grayscale image is converted into a binary value according to the threshold, which can help distinguish the tea seed area from the tea seed background area;
[0043] The present invention utilizes the establishment of a three-dimensional coordinate system, which has the advantage that the coordinates of the robotic arm, tea seeds and the delivery point can be obtained by establishing the three-dimensional coordinate system, and the robotic arm can be accurately moved to the tea seed position and the delivery point position according to the coordinate position, thereby improving the accuracy of the robotic arm's picking. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a functional block diagram of the system of the present invention;
[0045] Figure 2 It is a schematic diagram of the grayscale histogram of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Example 1, please refer to Figure 1 As shown, the present application provides a tea seed picking system based on image recognition, including an image acquisition module, an image processing module and a tea seed picking module;
[0048] The image acquisition module is used to acquire tea seed images;
[0049] The image processing module includes a tea seed contour acquisition unit and a tea seed maturity judgment unit. The tea seed contour acquisition unit is used to grayscale the tea seed image and mark it as a tea seed grayscale image; binarize the tea seed grayscale image and mark it as a tea seed binary image; perform contour extraction on the tea seed binary image and mark it as a tea seed contour; the tea seed contour acquisition unit is configured with a grayscale processing strategy, which includes: obtaining the RGB value of each pixel point of the tea seed image;
[0050] Get the R weight a1, G weight a2, B weight a3 in the RGB value; weight combination
[0051] Use the grayscale conversion formula to convert the RGB value into a grayscale value. The grayscale conversion formula is:
[0052] H=a1*R+a2*G+a3*B; wherein H is the gray value, and R, G and B are three values in the RGB value.
[0053] In practical applications, the calculated values of a1=206 / 311, a2=30 / 311, a3=75 / 311, and H=206 / 311*R+30 / 311*G+75 / 311*B are obtained, and the data of a pixel point R=140, G=50, and B=30 are substituted, then H=105, where the calculation of H retains integers;
[0054] The tea seed contour acquisition unit is configured with a weight acquisition strategy, which includes: respectively acquiring a first number of images containing only tea seeds and tea tree images without tea seeds, and marking them as tea seed fruit images and tea seed background images respectively;
[0055] The RGB values of all pixels of the tea seed fruit image and the RGB values of all pixels of the tea seed background image are counted respectively, and marked as fruit RGB value and background RGB value respectively;
[0056] Calculate the mean value of R in the fruit RGB value as Jgr, the mean value of G as Jgg, and the mean value of B as Jgb;
[0057] Calculate the mean of R in the background RGB value as Jbr, the mean of G as Jbg, and the mean of B as Jbb;
[0058] Calculate Cr = Jgr-Jbr, Cg = Jgg-Jbg, Cb = Jgb-Jbb; Cr is the R difference, Cg is the G difference, and Cb is the B difference; calculate the difference between the fruit RGB value and the background RGB value to obtain the difference, and obtain the weight of the grayscale conversion formula according to the size of the difference;
[0059] Get the minimum value among Cr, Cg and Cb, marked as Cmin;
[0060] The offset is obtained as follows: p = p1-Cmin; where p is the offset, and p1 is any positive number; the offset is set because the weight sum must be 1 and the weight must be between 0 and 1 when setting the weight. Negative values are meaningless in the weight ratio, so an offset needs to be set, and all differences plus this offset are positive numbers, where p1 is set as a positive number, but p1 cannot be set too small or too large, otherwise it will affect the calculated weight. Therefore, p1 is set in combination with the maximum values of R, G and B in the RGB of the tea seed fruit and the maximum grayscale range of 255. The maximum value of R, G and B in the RGB of the tea seed fruit is R value 195, and 255-195=60 is obtained, so p1 can be set according to the difference, p1 is set between 0 and 60, and is preferably set to 30;
[0061] Calculate Cr1=Cr+p, Cg1=Cg+p, Cb1=Cb+p respectively; where Cr1 is the bias value of Cr, Cg1 is the bias value of Cg, and Cb1 is the bias value of Cb;
[0062] It is calculated that a1=Cr1 / (Cr1+Cg1+Cb1), a2=Cg1 / (Cr1+Cg1+Cb1), and a3=Cb1 / (Cr1+Cg1+Cb1) respectively.
[0063] In practical applications, the mean values of R, G and B in the fruit RGB values are calculated to be 132, 52 and 38 respectively; the mean values of R, G and B in the background RGB values are calculated to be 32, 128 and 69 respectively; Cr=132-32=100, Cg=52-128=-76, Cb=38-69=-31 are calculated; Cmin=-76 is obtained, where p1 is set to 30, p=30-(-76)=106, Cr1=100+106=206, Cg1=-76+106=30, Cb1=-31+106=75, then a1=206 / 311, a2=30 / 311, a3=75 / 311;
[0064] The tea seed contour acquisition unit is configured with a grayscale histogram establishment strategy, which includes: dividing the grayscale values of 0-255 into d equal intervals;
[0065] Count the frequency of grayscale values in each equally divided interval and mark it as interval frequency;
[0066] A histogram is drawn with grayscale value as the X-axis and frequency as the Y-axis, marked as a grayscale histogram.
[0067] The tea seed contour acquisition unit is configured with a binarization processing strategy, which includes: obtaining the frequency Ps of all gray values;
[0068] If there is an interval with an interval frequency less than Ps / d, it is marked as a low-frequency area. If both sides of the low-frequency area contain intervals with an interval frequency greater than Ps / d, they are marked as initial areas, and the initial area with the least frequency is marked as the threshold area. The principle is that the threshold area is the segmentation area between the tea seeds and the background area, and the segmentation area has a small frequency distribution. Therefore, first find the interval with a frequency value less than the average frequency value of the interval, and then determine whether the two sides contain intervals with a frequency value greater than the average frequency value of the interval, and then obtain the threshold area according to the minimum value.
[0069] The grayscale values of pixels in the area greater than or equal to the threshold are set to 255, and the grayscale values of pixels in the area less than the threshold are set to 0.
[0070] For practical applications, please refer to Figure 2As shown, the grayscale values from 0 to 255 are evenly divided into 8 equal intervals, and a grayscale histogram is drawn. The frequency Ps of all grayscale values is 3.75 million, and Ps / d = 375 / 8 = 468,750. There are intervals with a frequency less than 468,750, which are marked as low-frequency regions. It is judged whether both sides of the low-frequency region contain intervals with a frequency greater than 468,750. For the initial region, the initial region with the least frequency is marked as the threshold region;
[0071] The tea seed contour acquisition unit is configured with a contour extraction processing strategy, and the contour extraction processing strategy includes: if a pixel point with a grayscale value of 255 is adjacent to a pixel point with a grayscale value of 0, the pixel point with a grayscale value of 255 is marked as a tea seed edge pixel point;
[0072] All tea seed edge pixel points are counted and marked as the tea seed contour;
[0073] The tea seed maturity judgment unit is used to judge whether the tea seeds in the tea seed contour are mature; the tea seed maturity judgment unit is configured with a maturity judgment strategy, and the maturity judgment strategy includes: drawing the tea seed contour on the tea seed image, obtaining the R mean, G mean, and B mean of all pixel points within the contour, and marking them as Rg, Gg, and Bg respectively;
[0074] Obtain the first threshold w1, the second threshold w2, the third threshold w3, the fourth threshold w4, the fifth threshold w5, and the sixth threshold w6;
[0075] If w1 < Rg < w2, w3 < Gg < w4, and w5 < Gg < w6 are satisfied simultaneously, the tea seeds in the tea seed contour are marked as mature tea seeds. The R values, G values, and B values of all pixel points are compared with the R values, G values, and B values of the mature pixel points to judge maturity;
[0076] In practical applications, w1 = 125, w2 = 91, w3 = 60, w4 = 21, w5 = 51, w6 = 21 are obtained, and Rg = 121, Gg = 32, Bg = 23 are obtained. If w1 < Rg < w2, w3 < Gg < w4, and w5 < Gg < w6 are satisfied simultaneously, the tea seeds in the tea seed contour are marked as mature tea seeds;
[0077] The tea seed maturity judgment unit is configured with a threshold acquisition strategy, and the threshold acquisition strategy includes: obtaining a second number of images containing only mature tea seeds, and marking them as mature tea seed images;
[0078] Obtain the minimum and maximum values of pixel point R in each mature tea seed image, and mark them as Rmax and Rmin respectively;
[0079] Obtain the minimum and maximum values of pixel point B in each mature tea seed image, and mark them as Bmax and Bmin respectively;
[0080] Obtain the minimum and maximum values of the pixel points G in each mature tea seed image, marked as Gmax and Gmin respectively;
[0081] The mean values of Rmax, Rmin, Bmax, Bmin, Gmax and Gmin are obtained respectively and marked as w1, w2, w3, w4, w5 and w6 respectively; the principle is to obtain the distribution range of RGB of each mature tea seed image and obtain the distribution range of RGB of the mature tea seed image;
[0082] In practical applications, three groups of data are taken as examples. There are multiple groups of data in practical applications. Rmax is 128, 125 and 123, Rmin is 92, 89 and 91, Bmax is 60, 62 and 59, Bmin is 22, 19 and 21, Gmax is 50, 53 and 49, Gmin is 21, 22 and 20, then w1=(128+125+123) / 3=125, w2=(92+89+91) / 3=91, w3=(60+62+59) / 3=60, w4=(22+19+21) / 3=21, w5=(50+53+49) / 3=51, w6=(21+22+20) / 3=21, where the above calculation results retain integers;
[0083] The tea seed picking module is used to obtain the three-dimensional coordinates of the tea seeds, and to pick the tea seeds using a robotic arm based on the three-dimensional coordinates of the tea seeds and the contours of the tea seeds; the tea seed picking module is configured with a tea seed picking strategy, which includes: taking any point near the robotic arm as the origin, the vertical direction as the Z-axis direction, any horizontal direction as the Y-axis direction, and a horizontal direction perpendicular to the Y-axis as the X-axis direction, to establish a three-dimensional coordinate system;
[0084] The coordinates of the endpoint of the real-time end effector are obtained as (x1, y1, z1), the coordinates of the center of the end effector and the farthest coordinates of the mature tea seeds are obtained as (x2, y2, z2), and the coordinate point of the picking completion delivery is (x3, y3, z3);
[0085] The end effector is first controlled to move a distance of x2-x1 in the X-axis direction, then a distance of y2-y1 in the Y-axis direction, and a distance of z2-z1 in the Z-axis direction. Based on the contour of the tea seeds, the end effector is controlled to clamp and pick the mature tea seeds. The end effector is controlled to move a distance of x3-x2 in the X-axis direction, a distance of y3-y2 in the Y-axis direction, and a distance of z3-z2 in the Z-axis direction to reach the coordinate point where picking is completed. Finally, the end effector releases the mature tea seeds to complete picking.
[0086] In actual applications, the coordinates of the real-time end effector endpoint are obtained as (22, 12, 20), the coordinates of the end effector center coordinates and the farthest coordinates of the mature tea seeds are obtained as (120, 80, 30), and the coordinate point for picking and delivery is (100, 30, 0). The end effector is first controlled to move 98 cm in the X-axis direction, then 18 cm in the Y-axis direction, and 10 cm in the Z-axis direction. Based on the contour of the tea seeds, the end effector is used to clamp and pick the mature tea seeds. The end effector is controlled to move -20 cm in the X-axis direction, -50 cm in the Y-axis direction, and -30 cm in the Z-axis direction to reach the coordinate point for picking and delivery. Finally, the end effector releases the mature tea seeds to complete picking.
[0087] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
Claims
1. A tea seed picking system based on image recognition, characterized in that: include: Image acquisition module, image processing module and tea seed picking module; The image acquisition module is used to acquire tea seed images; The image processing module includes a tea seed contour acquisition unit and a tea seed maturity judgment unit. The tea seed contour acquisition unit is used to grayscale the tea seed image and mark it as a tea seed grayscale image, binarize the tea seed grayscale image and mark it as a tea seed binarization image, and perform contour extraction on the tea seed binarization image and mark it as a tea seed contour. The tea seed maturity judgment unit is used to judge whether the tea seeds of the tea seed contour are mature. The tea seed picking module is used to obtain the three-dimensional coordinates of the tea seeds, and to pick the tea seeds using a robotic arm based on the three-dimensional coordinates of the tea seeds and the contours of the tea seeds.
2. A tea seed picking system based on image recognition according to claim 1, characterized in that: The tea seed contour acquisition unit is configured with a grayscale processing strategy, and the grayscale processing strategy includes: acquiring the RGB value of each pixel of the tea seed image; Get the R weight a1, G weight a2, and B weight a3 in the RGB value; Use the grayscale conversion formula to convert the RGB value into a grayscale value. The grayscale conversion formula is: H=a1*R+a2*G+a3*B; wherein H is the gray value, and R, G and B are three values in the RGB value.
3. The tea seed picking system based on image recognition according to claim 2, characterized in that: The tea seed contour acquisition unit is configured with a weight acquisition strategy, which includes: respectively acquiring a first number of images containing only tea seeds and tea tree images without tea seeds, and marking them as tea seed fruit images and tea seed background images respectively; The RGB values of all pixels of the tea seed fruit image and the RGB values of all pixels of the tea seed background image are counted respectively, and marked as fruit RGB value and background RGB value respectively; Calculate the mean value of R in the fruit RGB value as Jgr, the mean value of G as Jgg, and the mean value of B as Jgb; Calculate the mean of R in the background RGB value as Jbr, the mean of G as Jbg, and the mean of B as Jbb; Calculate Cr = Jgr-Jbr, Cg = Jgg-Jbg, Cb = Jgb-Jbb; where Cr is the R difference, Cg is the G difference, and Cb is the B difference; Get the minimum value among Cr, Cg and Cb, marked as Cmin; The offset is calculated as: p = p1-Cmin; where p is the offset and p1 is a positive number; Calculate Cr1=Cr+p, Cg1=Cg+p, Cb1=Cb+p respectively; where Cr1 is the bias value of Cr, Cg1 is the bias value of Cg, and Cb1 is the bias value of Cb; It is calculated that a1=Cr1 / (Cr1+Cg1+Cb1), a2=Cg1 / (Cr1+Cg1+Cb1), and a3=Cb1 / (Cr1+Cg1+Cb1) respectively.
4. The tea seed picking system based on image recognition according to claim 3, characterized in that: The tea seed contour acquisition unit is configured with a grayscale histogram establishment strategy, and the grayscale histogram establishment strategy includes: dividing the grayscale values of 0-255 into d equal intervals; Count the frequency of grayscale values in each equally divided interval and mark it as interval frequency; A histogram is drawn with grayscale value as the X-axis and frequency as the Y-axis, marked as a grayscale histogram.
5. The tea seed picking system based on image recognition according to claim 4, characterized in that: The tea seed contour acquisition unit is configured with a binarization processing strategy, which includes: obtaining the frequency Ps of all gray values; If there is an interval with a frequency less than Ps / d, it is marked as a low-frequency region. If both sides of the low-frequency region contain intervals with a frequency greater than Ps / d, it is marked as an initial region, and the initial region with the least frequency is marked as the threshold region; Set the grayscale value of the pixel points greater than or equal to the threshold region to 255, and set the grayscale value of the pixel points less than the threshold region to 0.
6. The tea seed picking system based on image recognition according to claim 5, characterized in that: The tea seed contour acquisition unit is configured with a contour extraction processing strategy, and the contour extraction processing strategy includes: if a pixel point with a grayscale value of 255 is adjacent to a pixel point with a grayscale value of 0, mark the pixel point with a grayscale value of 255 as a tea seed edge pixel point; Count all the tea seed edge pixel points and mark them as the tea seed contour.
7. The tea seed picking system based on image recognition according to claim 6, characterized in that: The tea seed maturity judgment unit is configured with a maturity judgment strategy, and the maturity judgment strategy includes: draw the tea seed contour on the tea seed image, obtain the R mean value, G mean value, and B mean value of all pixel points within the contour, and mark them as Rg, Gg, and Bg respectively; Obtain the first threshold w1, the second threshold w2, the third threshold w3, the fourth threshold w4, the fifth threshold w5, and the sixth threshold w6; If w1 < Rg < w2, w3 < Gg < w4, and w5 < Gg < w6 are satisfied simultaneously, then mark the tea seed with this tea seed contour as a mature tea seed.
8. The tea seed picking system based on image recognition according to claim 7, characterized in that: The tea seed maturity judgment unit is configured with a threshold acquisition strategy, and the threshold acquisition strategy includes: obtain the second number of images containing only mature tea seeds, and mark them as mature tea seed images; Obtain the minimum value and the maximum value of pixel point R in each mature tea seed image, and mark them as Rmax and Rmin respectively; Obtain the minimum value and the maximum value of pixel point B in each mature tea seed image, and mark them as Bmax and Bmin respectively; Obtain the minimum value and the maximum value of pixel point G in each mature tea seed image, and mark them as Gmax and Gmin respectively; Respectively calculate the mean values of Rmax, Rmin, Bmax, Bmin, Gmax, and Gmin, and mark them as w1, w2, w3, w4, w5, and w6 respectively.
9. The tea seed picking system based on image recognition according to claim 8, characterized in that: The tea seed picking module is configured with a tea seed picking strategy, and the tea seed picking strategy includes: taking any point near the robotic arm as the origin, the vertical direction as the Z-axis direction, taking any horizontal direction as the Y-axis direction, and a horizontal direction perpendicular to the Y-axis as the X-axis direction to establish a three-dimensional coordinate system; Obtain the coordinates of a real-time end effector endpoint as (x1, y1, z1), obtain the coordinates of the center of the end effector that is the farthest from the mature tea seed as (x2, y2, z2), and the picking completion dropping coordinate point as (x3, y3, z3); Control the end effector to first move a distance of x2 - x1 in the X-axis direction, then move a distance of y2 - y1 in the Y-axis direction, move a distance of z2 - z1 in the Z-axis direction, and based on the tea seed contour, the end effector clamps and picks the mature tea seed. Control the end effector to move a distance of x3 - x2 in the X-axis direction, move a distance of y3 - y2 in the Y-axis direction, move a distance of z3 - z2 in the Z-axis direction to reach the picking completion dropping coordinate point, and finally the end effector releases the mature tea seed to complete the picking.
Citation Information
Cited By
Stem cell culture image recognition and detection method
CN119992548A