A method for online rapid measurement of potato volume

By establishing a three-dimensional coordinate system for potatoes using machine vision technology and four-angle image acquisition, and using the cropping method to model and calculate potato volume, the problem of slow volume measurement speed in existing technologies is solved, and online, fast, and non-destructive measurement is realized.

CN116309787BActive Publication Date: 2025-12-19CHINESE ACAD OF AGRI MECHANIZATION SCI GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310240177.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2025-12-19
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

There is a lack of effective online methods for measuring potato volume in existing technologies. The water displacement method is slow and cumbersome, making it unsuitable for practical production.

Method used

Using a machine vision-based approach, images were acquired from four different angles and a three-dimensional coordinate system was established. A cropping method was used to model the circumscribed cuboid of a potato and calculate its volume.

Benefits of technology

This technology enables rapid, non-destructive online measurement of potato volume, improving measurement accuracy and efficiency, and is applicable to actual agricultural product processing and production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309787B_ABST
    Figure CN116309787B_ABST
Patent Text Reader

Abstract

A kind of potato volume online fast measurement method, comprising the following steps: two mutually perpendicular angles of the potato image to be measured are collected respectively, and other arbitrary two angles of the potato image to be measured are collected, four potato images to be measured are obtained, and the corresponding potato image contour is extracted;According to the potato image contour, a three-dimensional coordinate system of potato is established, and the upper and lower vertices of the potato to be measured determined by the three-dimensional coordinate system of potato are used to set the constraint relationship for different angle images;And using the clipping method in the three-dimensional coordinate system of potato, the circumscribed cuboid of the potato to be measured is modeled, and the non-potato part is subtracted, to calculate the volume of the potato to be measured.The volume of the potato is measured by four potato images of different angles, the online, fast and non-destructive measurement of the volume of the potato is realized, the cost is low, the control is simple, and it is conducive to the practical application of agricultural product processing and production.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to agricultural product processing intelligent equipment and machine vision technology, in particular to a potato volume online rapid measurement method based on machine vision and with the help of image processing technology. BACKGROUND

[0002] Volume, shape, color, surface defects and the like are important physical characteristics of potatoes, which have important influence on potato harvesting, storage, processing and sales links, and are important factors affecting potato grade and price. At present, machine vision technology is often used to detect potato shape, color, surface defects and the like, and its detection method has been relatively mature. In the production of agricultural products, machine vision technology uses image sensors to collect images of agricultural products, and obtains shape, color, texture and surface defect information through computer processing, which has the characteristics of fast acquisition, non-destructive and the like.

[0003] However, there is no good measurement method for online measurement of potato volume. The existing technology uses the drainage method to measure the volume of agricultural products: the agricultural products are put into a container full of water, and the volume of the overflow water is measured to obtain the volume of the agricultural products. The drainage method for measuring volume has high requirements for measurement conditions, slow measurement speed and troublesome steps, and cannot be applied in actual production. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a potato volume online rapid measurement method based on machine vision to realize fast and high-precision online measurement of potato volume, aiming at the above-mentioned defects of the prior art.

[0005] In order to achieve the above-mentioned purpose, the present application provides a potato volume online rapid measurement method, which comprises the following steps:

[0006] S100, two images of a potato to be measured at mutually perpendicular angles are collected respectively, and other images of the potato to be measured at any two angles are collected, so that four images of the potato to be measured are obtained, and the corresponding potato image contours are extracted;

[0007] S200, a three-dimensional coordinate system of the potato is established according to the potato image contours, and the upper and lower vertices of the potato to be measured determined by the three-dimensional coordinate system of the potato are used to set a constraint relationship for images at different angles; and

[0008] S300, a long rectangular cuboid circumscribed around the potato to be measured is modeled in the three-dimensional coordinate system of the potato using a clipping method, and the part other than the potato is subtracted, so that the volume of the potato to be measured is calculated.

[0009] The potato volume online rapid measurement method described above, wherein step S100 further comprises:

[0010] S101, using a first camera to take a front image of the potato to be measured, binarizing the image, and extracting a first contour of the potato to be measured;

[0011] S102, using a second camera to take a side image of the potato to be measured, the first camera being 90 degrees apart from the second camera, binarizing the image, and extracting a second contour of the potato to be measured;

[0012] S103, using a third camera to take an image of the potato to be measured on the left side of the first camera by an angle α, 0 < α < 90 degrees, binarizing the image, and extracting a third contour of the potato to be measured; and

[0013] S104, using a fourth camera to take an image of the potato to be measured on the right side of the first camera by an angle β, 0 < β < 90 degrees, binarizing the image, and extracting a fourth contour of the potato to be measured.

[0014] The potato volume online rapid measurement method described above, wherein step S200 further comprises:

[0015] S201, taking the length a and width b of the circumscribed rectangle of the first contour and the length c of the circumscribed rectangle of the second contour as the length, width and height of the circumscribed cuboid of the potato to be measured, and establishing a three-dimensional coordinate system of the potato;

[0016] S202, discretizing the potato circumscribed cuboid and storing it in a three-dimensional array V, and setting all values in the three-dimensional array V to 1;

[0017] S203, respectively acquiring the upper vertex A1' and lower vertex B1' of the first contour, and the upper vertex A2' and lower vertex B2' of the second contour, taking the horizontal coordinate of the upper vertex A1' of the first contour, the horizontal coordinate of the upper vertex A2' of the second contour and the vertical coordinate of the upper vertex A2' of the second contour as the upper vertex A(x A , y A , z A ) of the potato to be measured, and taking the horizontal coordinate of the lower vertex B1' of the first contour, the horizontal coordinate of the lower vertex B2' of the second contour and the vertical coordinate of the lower vertex B2' of the second contour as the lower vertex B(x B , y B , z B ) of the potato to be measured; and

[0018] C204, respectively acquiring the upper vertex A3' and lower vertex B3' of the third contour, and the upper vertex A4' and lower vertex B4' of the fourth contour.

[0019] The potato volume online rapid measurement method described above, wherein in step S202, the potato circumscribed cuboid is discretized with a length of 1 mm.

[0020] The potato volume online rapid measurement method, wherein the first contour and the second contour are calculated by using an OpenCv circumscribed rectangle calculation method; and the length and width of the circumscribed rectangle of the first contour and the second contour are respectively converted into actual length and width by using an internal and external parameter matrix, and the coordinate point set of the first contour and the second contour is converted into an actual size coordinate point set.

[0021] The potato volume online rapid measurement method, wherein the third contour point set is extracted, the third contour point set is converted into an actual size point set in the potato three-dimensional coordinate system by using an internal and external parameter matrix of the third camera, and the upper vertex A3' and the lower vertex B3' of the third contour are extracted.

[0022] The potato volume online rapid measurement method, wherein the third contour is projected on a plane y=xtan alpha-atan alpha, so as to ensure that a straight line AA3': is perpendicular to the plane y=xtan alpha-atan alpha, and a straight line BB3': is perpendicular to the plane y=xtan alpha-atan alpha; the third contour is inversely translated along the straight line AA' to a plane y=xtan alpha+c, and a value of a corresponding point outside the third contour and in the three-dimensional array V is taken as 0.

[0023] The potato volume online rapid measurement method, wherein the fourth contour point set is extracted, the fourth contour point set is converted into an actual size point set in the potato three-dimensional coordinate system by using an internal and external parameter matrix of the fourth camera, and the upper vertex A4' and the lower vertex B4' of the fourth contour are extracted.

[0024] The potato volume online rapid measurement method, wherein the fourth contour is projected on a plane y=xtan beta, so as to ensure that a straight line AA4': is perpendicular to the plane y=xtan alpha-atan alpha, and a straight line BB4': is perpendicular to the plane y=xtan alpha-atan alpha; the fourth contour is translated in the direction of the straight line AA' to a plane y=(x-a)tan beta+c, and a value of a corresponding point outside the fourth contour and in the three-dimensional array V is taken as 0.

[0025] The potato volume online rapid measurement method, wherein in the step S300, the three-dimensional array V is traversed, a number of points with an internal value of 1 is counted, and the number is divided by a size of the three-dimensional array V to obtain a volume of the potato to be measured.

[0026] The technical effect of the present application is that:

[0027] The present application is based on machine vision to measure the volume of potatoes on line quickly on the basis of contour extraction algorithm, four potato images are collected, including two images with perpendicular angles and two images with other arbitrary angles, so as to realize the quick measurement of the volume of potatoes, and the constraint relationship between the angles of the images can improve the accuracy of the measurement; the constraint relationship is provided for different angle images by the upper and lower vertices of the potatoes, the cutting method is used, the circumscribed cuboid of the potato is modeled first, and then the non-potato part is subtracted, so that the calculation speed and efficiency are higher, and the multi-angle simultaneous shooting can ensure the accuracy of the measurement. The volume of the potato is measured through four potato images with different angles, a new method for measuring the volume of the potato is provided, the on-line, quick and non-destructive measurement of the volume of the potato is realized, the cost is low, the control is simple, and the practical agricultural product processing and production popularization and application are facilitated.

[0028] The present application is described in detail below in combination with the drawings and specific embodiments, but is not limited to the present application. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 The front and side of the potato image collection schematic diagram of an embodiment of the present application is shown in the figure;

[0030] Figure 2 The circumscribed cuboid coordinate system of the potato of an embodiment of the present application is shown in the figure;

[0031] Figure 3 The upper and lower vertex coordinates of the potato of an embodiment of the present application are shown in the figure;

[0032] Figure 4 The other two sides of the potato image collection schematic diagram of an embodiment of the present application is shown in the figure;

[0033] Figure 5 The third contour projection schematic diagram of an embodiment of the present application is shown in the figure;

[0034] Figure 6 The fourth contour projection schematic diagram of an embodiment of the present application is shown in the figure.

[0035] In the figure, the reference signs

[0036] 1 first contour

[0037] 2 second contour

[0038] 3 third contour

[0039] 4 fourth contour

[0040] 5 potato to be measured

[0041] 6 circumscribed cuboid

[0042] 7 first camera

[0043] 8 second camera

[0044] 9 third camera

[0045] 10 fourth camera DETAILED DESCRIPTION

[0046] The structural principle and working principle of the present application will be described in detail below in combination with the drawings:

[0047] The potato volume online rapid measurement method of the present application measures the volume of the potato through four potato images at different angles, provides a new method for potato volume measurement, realizes online, rapid and non-destructive measurement of the potato volume, has low cost and simple control, and is conducive to practical agricultural product processing and production popularization and application. Specifically, the method can include the following steps:

[0048] Step S100, two images of the potato to be measured 5 at mutually perpendicular angles are respectively acquired, and other two images of the potato to be measured 5 at any two angles are acquired, a total of four images of the potato to be measured 5 are acquired, and corresponding potato image contours are extracted;

[0049] Step S200, a three-dimensional coordinate system of the potato is established according to the potato image contours, and the upper and lower vertices of the potato to be measured 5 determined by the three-dimensional coordinate system of the potato are used to set a constraint relationship for the images at different angles; and

[0050] Step S300, a long rectangular cuboid 6 circumscribed around the potato to be measured 5 is modeled in the three-dimensional coordinate system of the potato using a clipping method, the non-potato part is subtracted, and the volume of the potato to be measured 5 is calculated.

[0051] The step S100 further includes:

[0052] Step S101, the first camera 7 is used to shoot an image of the potato to be measured 5 from the front, the image is binarized, and a first contour 1 of the potato to be measured 5 is extracted;

[0053] Step S102, the second camera 8 is used to shoot an image of the potato to be measured 5 from the side, the first camera 7 and the second camera 8 are separated by 90 degrees, the image is binarized, and a second contour 2 of the potato to be measured 5 is extracted;

[0054] Step S103, the third camera 9 is used to acquire an image of the potato to be measured 5 at the left side α of the first camera 7, 0 < α < 90 degrees, the image is binarized, and a third contour 3 of the potato to be measured 5 is extracted; and

[0055] Step S104, the fourth camera 10 is used to acquire an image of the potato to be measured 5 at the right side β of the first camera 7, 0 < β < 90 degrees, the image is binarized, and a fourth contour 4 of the potato to be measured 5 is extracted.

[0056] Step S200 further comprises:

[0057] Step S201, taking the length a and width b of the circumscribed rectangle of the first profile 1 and the length c of the circumscribed rectangle of the second profile 2 as the length, width and height of the circumscribed cuboid 6 of the potato 5 to be measured, and establishing the three-dimensional coordinate system of the potato;

[0058] Step S202, discretizing the potato circumscribed cuboid 6 in units of 1mm in length, storing it in a three-dimensional array V, and setting all values in the three-dimensional array V to 1;

[0059] Step S203, respectively acquiring the upper vertex A1' and the lower vertex B1' of the first profile 1, and the upper vertex A2' and the lower vertex B2' of the second profile 2, taking the horizontal coordinate of the upper vertex A1' of the first profile 1, the horizontal coordinate of the upper vertex A2' of the second profile 2 and the vertical coordinate of the upper vertex A2' of the second profile 2 as the upper vertex A(x A , y A , z A ) of the potato 5 to be measured, and taking the horizontal coordinate of the lower vertex B1' of the first profile 1, the horizontal coordinate of the lower vertex B2' of the second profile 2 and the vertical coordinate of the lower vertex B2' of the second profile 2 as the lower vertex B(x B , y B , z B ) of the potato 5 to be measured; and

[0060] Step C204, respectively acquiring the upper vertex A3' and the lower vertex B3' of the third profile 3, and the upper vertex A4' and the lower vertex B4' of the fourth profile 4.

[0061] In this embodiment, the circumscribed rectangle calculation method in OpenCv is used to calculate the circumscribed rectangle of the first profile 1 and the second profile 2; through the internal and external parameter matrix, the length and width of the circumscribed rectangle of the first profile 1 and the second profile 2 are respectively converted into actual length and width, and the coordinate point set of the first profile 1 and the second profile 2 is converted into an actual size coordinate point set.

[0062] Wherein, the third profile 3 point set is extracted, the third profile 3 point set is converted into an actual size point set in the potato three-dimensional coordinate system through the internal and external parameter matrix of the third camera 9, and the upper vertex A3' and the lower vertex B3' of the third profile 3 are extracted. Project the third profile 3 on the plane y=xtanα-atanα, ensure that the straight line AA3': is perpendicular to the plane y=xtanα-atanα, and the straight line BB3': is perpendicular to the plane y=xtan a-atan a; inversely translating the third contour 3 along the straight line AA' to the plane y=xtan a+c, the values of the corresponding points outside the third contour 3 and inside the three-dimensional array V are taken as 0.

[0063] wherein a fourth contour 4 point set is extracted, the fourth contour 4 point set is converted into an actual size point set in the potato three-dimensional coordinate system through an internal and external parameter matrix of the fourth camera 10, and an upper vertex A4' and a lower vertex B4' of the fourth contour 4 are extracted. The fourth contour 4 is projected on the plane y=xtan b, and the straight line AA4': is perpendicular to the plane y=xtan a-atan a; the straight line BB4': is perpendicular to the plane y=xtan a-atan a; the fourth contour 4 is translated along the straight line AA' to the plane y=(x-a)tan b+c, and the values of the corresponding points outside the fourth contour 4 and inside the three-dimensional array V are taken as 0.

[0064] In step S300 of the embodiment, the number of points with an internal value of 1 is counted by traversing the three-dimensional array V, and the volume of the potato 5 to be measured is obtained by dividing the number by the size of the three-dimensional array V.

[0065] In actual applications, the internal and external parameters of the camera can be calculated by using an existing calibration method (such as the camera calibration method of Zhang Zhengyou et al.), and the relationship between the camera image coordinate system and the world coordinate system and the relationship between the camera coordinate system and the camera coordinate system are established. The camera is used to shoot images of potatoes at four different angles, a potato three-dimensional coordinate system is established, and the volume of the potato is obtained. The specific implementation process of an embodiment of the application will be described in detail below with reference to the drawings:

[0066] Referring to Figure 1 , Figure 1 is a schematic diagram of collecting potato images from the front and side surfaces according to an embodiment of the application. A first camera 7 is used to shoot a potato image from the front, as shown in Figure 1 indicates that the front refers to the main view direction in the three-view image; the image is binarized, the first contour 1 of the potato is extracted, and the circumscribed rectangle of the first contour 1 is calculated. The circumscribed rectangle calculation algorithm in OpenCv is used for calculation; the actual length and width of the circumscribed rectangle of the first contour 1 of the potato are converted through the internal and external parameter matrix, and the actual size coordinate point set of the first contour 1 of the potato is converted.

[0067] As Figure 1As shown, the potato image is taken from the side by using the second camera 8, the side refers to the right view direction in the three-view, the first camera 7 is separated from the second camera 8 by 90 degrees, the image is binarized, the second contour 2 of the potato is extracted, and the circumscribed rectangle of the second contour 2 is calculated; through the internal and external parameter matrix, the length and width of the circumscribed rectangle of the second contour 2 of the potato are converted into the actual length and width, and the coordinate point set of the second contour 2 of the potato is converted into the actual size coordinate point set.

[0068] Referring to Figure 2 , Figure 2 The coordinate system diagram of the potato circumscribed cuboid 6 of an embodiment of the present application is shown. The length a and the width b of the circumscribed rectangle of the first contour 1 of the potato and the length c of the circumscribed rectangle of the second contour 2 of the potato are taken as the length, width and height of the potato circumscribed cuboid 6, and a space coordinate system is established, as shown. Figure 2 The potato circumscribed cuboid 6 coordinate system is discretized with 1mm as the unit length and stored in a three-dimensional array V, and all values in the array are set to 1.

[0069] Referring to Figure 3 , Figure 3 The coordinate diagram of the upper and lower vertexes of the potato of an embodiment of the present application is shown. The first contour 1 of the potato and the second contour 2 of the potato are projected on the Y=0 and X=0 planes of the coordinate system, the equation of the first contour 1 of the potato is Y=0, f(x, z), and the equation of the second contour 2 of the potato is X=0, f(y, z); the X=0 to X=a plane in the array V is traversed along the X-axis direction, and the pixel points outside the first contour 1 of the potato are taken as 0, that is, the X=0 to X=a plane of the circumscribed cuboid 6 is traversed along the X-axis direction, and the points outside the first contour 1 of the potato, the corresponding point values in the array V are set to 0; the Y=0 to Y=c plane in the array V is traversed along the Y-axis direction, and the pixel points outside the second contour 2 of the potato are taken as 0; the upper vertex A1' and the lower vertex B1' of the first contour 1 and the upper vertex A2' and the lower vertex B2' of the second contour 2 are obtained respectively, the horizontal coordinate of the upper vertex A1' of the first contour 1, the horizontal coordinate of the upper vertex A2' of the second contour 2 and the vertical coordinate of the upper vertex A2' of the second contour 2 are taken as the upper vertex A(x A , y A , z A ) of the potato to be measured 5, and the horizontal coordinate of the lower vertex B1' of the first contour 1, the horizontal coordinate of the lower vertex B2' of the second contour 2 and the vertical coordinate of the lower vertex B2' of the second contour 2 are taken as the lower vertex B(x B , y B , z B ) of the potato to be measured 5; that is, the point with the value 1 in the uppermost layer of the array V is taken as the upper vertex A(x A , y A , z A ) of the potato, and the point with the value 1 in the lowermost layer of the array V is taken as the lower vertex B(xB , y B , z B ); that is, after two traversals, traverse the plane Z = b to the plane Z = 0 along the positive direction of the Z axis, take the point with the first value of 1 in the corresponding array V as the upper vertex A(x A , y A , z A ) of the potato, traverse the plane Z = 0 to the plane Z = b along the negative direction of the Z axis, and take the point with the first value of 1 in the corresponding array V as the lower vertex B(x B , y B , z B ) of the potato. Wherein a is the length of the circumscribed rectangle of the potato shot by the first camera 7, b is the width of the circumscribed rectangle of the potato shot by the first camera 7, and c is the length of the circumscribed rectangle of the potato shot by the second camera 8. The first contour 1 of the potato is Y = 0, f(x, z), wherein f(x, z) is the potato contour point coordinates extracted after binarization of the potato image shot by the first camera 7; the second contour 2 of the potato is X = 0, f(y, z), wherein f(y, z) is the potato contour point coordinates extracted after binarization of the potato image shot by the second camera 8; A(x A , y A , z A ) is the upper vertex coordinate of the potato after screening, and B(x B , y B , z B ) is the lower vertex coordinate of the potato after screening.

[0070] Referring to Figure 4 , Figure 4The schematic diagram of collecting potato image on the other two sides of the embodiment of the present application is shown. The third camera 9 collects potato image at an angle of α (0 < α < 90) degrees left to the first camera 7, and the fourth camera 10 collects potato image at an angle of β (0 < β < 90) degrees right to the first camera 7, to obtain the third camera 9 shooting picture and the fourth camera 10 shooting picture, wherein, α (0 < α < 90) is the included angle between the shooting direction of the first camera 7 and the third camera 9; β (0 < β < 90) is the included angle between the shooting direction of the second camera 8 and the fourth camera 10. The image is binarized to obtain the third potato contour 3 and the fourth potato contour 4, and the top vertex A3' and the lower vertex B3' of the third potato contour 3 are taken, and the top vertex A4' and the lower vertex B4' of the fourth potato contour 4 are taken; that is, the third camera 9 shooting picture is binarized, the third potato contour 3 point set is extracted, the third potato contour 3 point set is converted into an actual size point set through the internal and external parameter matrix of the third camera 9, and the top vertex A3' and the lower vertex B3' of the third potato contour 3 are extracted; the fourth camera 10 shooting picture is binarized, the fourth potato contour 4 point set is extracted, the fourth potato contour 4 point set is converted into an actual size point set through the internal and external parameter matrix of the fourth camera 10, and the top vertex A4' and the lower vertex B4' of the fourth potato contour 4 are extracted.

[0071] Referring to Figure 5 , Figure 5 The schematic diagram of the third contour 3 projection of the embodiment of the present application is shown. Along the Y-axis direction, the surface of the potato circumscribed cuboid 6 is traversed: y = x tan α - atan α to the surface: y = x tan α + c, the top vertex A3' of the third potato contour 3 passes through the line: z = b, the lower vertex B3' passes through the line: z = 0, and the points outside the third potato contour 3 are taken as 0; that is, the third potato contour 3 is projected on the plane y = x tan α - atan α, to ensure that the straight line AA3': z = b, is perpendicular to the plane y = x tan α - atan α, the straight line BB3': z = 0, is perpendicular to the plane y = x tan α - atan α, and the third potato contour 3 point set coordinates are converted into actual coordinate points in the potato circumscribed cuboid 6 coordinate system; the third potato contour 3 is inversely translated along the straight line AA' to the plane y = x tan α + c, and the values of the corresponding points in the array V outside the third contour 3 are taken as 0.

[0072] Referring to Figure 6 , Figure 6 The schematic diagram of the fourth contour 4 projection of the embodiment of the present application is shown. Along the X-axis direction, the surface of the potato circumscribed cuboid 6 is traversed: y = x tan β to the surface: y = (x - a) tan β + c, the top vertex A3' of the third potato contour 3 passes through the line: z = b, the lower vertex B3' passes through the line: z = 0, Points outside the third profile 3 of the potato take 0; that is, the fourth profile 4 of the potato is projected on the plane y=xtanβ, and the straight line AA4': z=b is ensured, The straight line BB4': z=0 is perpendicular to the plane y=xtanα-atanα, The straight line BB4': z=0 is perpendicular to the plane y=xtanα-atanα, and the point set coordinates of the fourth profile 4 of the potato are converted into the actual coordinate points in the coordinate system of the circumscribed cuboid 6 of the potato; the fourth profile 4 is translated along the direction of the straight line AA' to the plane y=(x-a)tanβ+c, and the values of the corresponding points outside the fourth profile 4 and in the array V are taken as 0.

[0073] Finally, the volume of the part with the value of 1 in the array V is calculated, and the volume of the potato is converted into the volume of the potato through the internal and external parameters of the camera. If the array V can be traversed, the number of points with the value of 1 inside is counted, and the volume of the potato is obtained by dividing the size of the array V, and the unit is cubic millimeter.

[0074] On the basis of the algorithm of profile extraction, the potato volume is measured online and quickly based on machine vision, four potato images are obtained by collecting two potato images with perpendicular angles and other two potato images with arbitrary angles, the potato volume is measured quickly, the constraint relationship between the image angles can improve the accuracy of measurement; the upper and lower vertices of the potato provide constraint relationship for different angle images, the cutting method is used, the circumscribed cuboid 6 of the potato is modeled first, and then the non-potato part is subtracted, the calculation speed and efficiency are higher, and the accuracy of measurement can be ensured by multi-angle shooting at the same time. The volume of the potato is detected by the method of combining ordinary industrial cameras with machine vision, the potato profiles under different angles are extracted according to four different angle potato images, the constraint between the profiles is calculated through the angle relationship, the accuracy of measurement is improved, and the method has certain robustness.

[0075] Of course, the present application can have other various embodiments, and those skilled in the art can make various corresponding changes and modifications according to the present application without departing from the spirit and essence of the present application, but these corresponding changes and modifications should belong to the protection scope of the claims attached to the present application.

Claims

1. A method for online rapid measurement of potato volume, characterized in that, The method comprises the following steps: S100, two images of the potato to be measured at mutually perpendicular angles are collected respectively, and other images of the potato to be measured at any two angles are collected, so that four images of the potato to be measured are obtained, and the corresponding potato image contours are extracted; S200, a three-dimensional coordinate system of the potato is established according to the potato image contours, and the upper and lower vertices of the potato to be measured determined by the three-dimensional coordinate system of the potato are used to set a constraint relationship for the images at different angles; S300, a long rectangular parallelepiped circumscribed around the potato to be measured is modeled in the three-dimensional coordinate system of the potato by using a clipping method, and the part other than the potato is subtracted, so that the volume of the potato to be measured is calculated; In step S100, the following steps are further included: S101, a first camera is used to capture an image of the potato to be measured from the front, the image is binarized, and a first contour of the potato to be measured is extracted; S102, a second camera is used to capture an image of the potato to be measured from the side, the first camera and the second camera are separated by 90 degrees, the image is binarized, and a second contour of the potato to be measured is extracted; S103, a third camera is used to capture an image of the potato to be measured at the left side of the first camera by an angle α, 0 < α < 90 degrees, the image is binarized, and a third contour of the potato to be measured is extracted; and S104, a fourth camera is used to capture an image of the potato to be measured at the right side of the first camera by an angle β, 0 < β < 90 degrees, the image is binarized, and a fourth contour of the potato to be measured is extracted; Step S200 further comprises the following steps: S201, the length a and the width b of the circumscribed rectangle of the first contour and the length c of the circumscribed rectangle of the second contour are taken as the length, width and height of the long rectangular parallelepiped circumscribed around the potato to be measured, and the three-dimensional coordinate system of the potato is established; S202, the long rectangular parallelepiped circumscribed around the potato is discretized and stored in a three-dimensional array V, and all values in the three-dimensional array V are set to 1; C204, the upper vertex A3' and the lower vertex B3' of the third contour and the upper vertex A4' and the lower vertex B4' of the fourth contour are obtained respectively. S203, respectively, the first profile of the upper vertex A1' and the lower vertex B1', and the second profile of the upper vertex A2' and the lower vertex B2', take the first profile of the upper vertex A1' horizontal coordinate, the second profile of the upper vertex A2' horizontal coordinate and the second profile of the upper vertex A2' vertical coordinate as the upper vertex A(x A , y A , z A ) of the measured potato, take the first profile of the lower vertex B1' horizontal coordinate, the second profile of the lower vertex B2' horizontal coordinate and the second profile of the lower vertex B2' vertical coordinate as the lower vertex B(x B , y B , z B ) of the measured potato; and In step S202, the long rectangular parallelepiped circumscribed around the potato is discretized with a unit length of 1 mm.

2. The potato volume on-line rapid measurement method according to claim 1, characterized in that, The circumscribed rectangle calculation method in OpenCv is used to calculate the circumscribed rectangles of the first contour and the second contour; the actual length and width of the circumscribed rectangles of the first contour and the second contour are converted by an internal and external parameter matrix, and the actual size coordinate point set of the first contour and the second contour is converted.

3. The potato volume on-line rapid measurement method according to claim 1, wherein The third contour point set is extracted, the third contour point set is converted into the actual size point set in the three-dimensional coordinate system of the potato by the internal and external parameter matrix of the third camera, and the upper vertex A3' and the lower vertex B3' of the third contour are extracted.

4. The potato volume on-line rapid measurement method of claim 1, wherein, The fourth contour point set is extracted, the fourth contour point set is converted into the actual size point set in the three-dimensional coordinate system of the potato by the internal and external parameter matrix of the fourth camera, and the upper vertex A4' and the lower vertex B4' of the fourth contour are extracted.

5. The potato volume on-line rapid measurement method according to claim 4, characterized in that, projecting said third profile on the plane y = x tan a - atan a guarantees the straight line AA3': z = b, perpendicular to the plane y = x tan a - atan a, the straight line BB3': z = 0, perpendicular to the plane y = x tan a - atan a; inversely translating said third profile along the straight line AA' to the plane y = x tan a + c, taking the value of the corresponding point outside said third profile and inside said three-dimensional array V as 0, where a is the length of the circumscribed rectangle of the first profile, b is the width of the circumscribed rectangle of the first profile and c is the length of the circumscribed rectangle of the second profile.

6. The potato volume on-line rapid measurement method as claimed in claim 5, characterized by, In step S300, the three-dimensional array V is traversed, the number of points with an internal value of 1 is counted, and the volume of the potato to be measured is obtained by dividing the size of the three-dimensional array V.

7. The potato volume on-line rapid measurement method as claimed in claim 6, characterized by, projecting said fourth profile on the plane y = x tan β guarantees that the straight line AA4': is perpendicular to the plane y = x tan α - atan α, the straight line BB4': z = 0, is perpendicular to the plane y = x tan α - atan α; translating said fourth profile in the direction of the straight line AA' to the plane y = (x - a) tan β + c, taking the values of the corresponding points outside said fourth profile and inside said three-dimensional array V as 0, where a is the length of the circumscribed rectangle of the first profile, b is the width of the circumscribed rectangle of the first profile and c is the length of the circumscribed rectangle of the second profile.

8. The method for online fast measurement of potato volume according to any one of claims 1 to 7, characterized in that, ​

Citation Information

Patent Citations

  • Machine vision-based agricultural product volume rapid measurement device and measurement method

    CN106548480A

  • Profile-image-based potato three-dimensional modeling method

    CN108053485A