A detection method and system for detecting the bottom size of a target product groove

Through the image acquisition device and preset correction algorithm, the problem of difficulty in measuring the bottom dimension of the product groove in the prior art is solved, and efficient and accurate measurement is achieved, which is suitable for large-scale use.

CN115019027BActive Publication Date: 2025-05-30SUZHOU JQS INFO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210612837.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-05-30
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

It is difficult to accurately measure the bottom dimensions of the product tank, especially in the workshop production line working environment, where traditional measuring equipment is costly, complicated to operate and cannot adapt to the measurement of the bottom dimensions of the tank.

Method used

An image acquisition device is used to collect images of the product slot at a target inclination angle, and the initial image position information is corrected through a preset correction algorithm to obtain the size information of the product slot.

Benefits of technology

It realizes efficient and accurate measurement of the bottom size of the product slot that cannot be measured by traditional vision systems, reduces measurement costs and time-consuming, and is suitable for large-scale use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115019027B_ABST
    Figure CN115019027B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of vision detection technology, and specifically to a detection method and system for detecting the bottom size of a target product groove. The method is applied to a product groove bottom size detection device, and the angle between the optical axis of its image acquisition device and the vertical direction is the target inclination angle. The method includes: controlling the image acquisition device to obtain an overall product image at the target inclination angle, and obtaining the initial image position information corresponding to the product groove in the overall product image; performing correction processing on the initial image position information based on a preset correction algorithm to obtain corrected coordinate information; calculating the bottom size of the product groove according to the target scaling ratio and the image correction information to obtain the size information of the product groove. When the present invention acquires an image of the product groove at the target inclination angle, through the above correction steps, it can accurately obtain the size information of the product groove, can efficiently and accurately measure the size information that cannot be measured by traditional vision systems, and has high measurement efficiency, low measurement cost and less measurement time consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual detection, and particularly relates to a detection method and system for detecting the bottom size of a target product groove. Background Art

[0002] In the field of industrial automation, controlling the process of products plays a crucial role in the quality of industrial products. There is a requirement for full inspection of products on the production line, and the quality control of products is very strict. Therefore, high-precision measuring instruments are needed for dimension measurement.

[0003] Currently, the commonly used standard measurement methods are high-precision three-coordinate contact measuring equipment and CCD measuring equipment. The software of the high-precision three-coordinate contact measuring equipment has powerful functions and is very suitable for standard product measurement and sampling measurement. However, due to its high cost, high technical ability requirements for operators, and the fact that the high-precision three-coordinate contact measuring equipment can only be used in a clean measuring room, it cannot adapt to the working environment of the workshop production line. The CCD measuring equipment cannot measure the bottom size of similar grooves. When detecting the bottom size of the groove, its working range is relatively small, and size deviation is likely to occur, affecting the accuracy of the bottom size of the groove.

[0004] Based on the disadvantages of the existing technology, there is an urgent need to research a detection method and system for detecting the bottom size of a target product groove to solve the above problems. Summary of the Invention

[0005] In order to solve the above technical problems, the present invention provides a detection method and system for detecting the bottom size of a target product groove. When the present invention uses an image acquisition device to acquire an image of the product groove at a target tilt angle, through the above-mentioned size correction step, the size information of the product groove can be accurately obtained, expanding the working range that cannot be measured by traditional vision, and being able to efficiently and accurately measure the size information of the product groove that cannot be measured by the traditional vision system. Moreover, the measurement efficiency is high, the measurement cost is low, and the measurement time is short, and it is suitable for large-scale use.

[0006] The present invention discloses a detection method for detecting the bottom size of a target product groove. The method is applied to a product groove bottom size detection device, which includes an image acquisition device, a support device, and a light source device. The image acquisition device and the light source device are inclined and installed on the support device. The included angle between the optical axis of the image acquisition device and the vertical direction is the target tilt angle. The method includes:

[0007] Controlling the image acquisition device to acquire an overall product image of the target product with the target tilt angle as the acquisition angle. A product groove is provided on the side of the target product facing the image acquisition device.

[0008] Perform product slot recognition on the overall product image to obtain the initial image position information corresponding to the product slot in the overall product image;

[0009] Perform correction processing on the initial image position information based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; wherein, the preset correction algorithm is obtained by performing position calibration on the pixel positions of a reference image and a standard image with a target tilt angle as the acquisition angle;

[0010] Obtain the target scaling ratio corresponding to the target tilt angle;

[0011] Calculate the bottom size of the product slot according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product slot; wherein, the size information includes the lengths of the sides of the bottom of the slot and the coordinate values of the vertices of the bottom of the slot.

[0012] Furthermore, the initial image position information includes the pixel distances between the vertices of the bottom of each product slot and the preset image origin and the initial coordinates of the vertices of the bottom of each product slot;

[0013] The performing product slot recognition on the overall product image to obtain the initial image position information corresponding to the product slot in the overall product image includes:

[0014] Determine the origin coordinates of the preset image origin from the overall product image;

[0015] Perform recognition of the vertices of the bottom of the slot in the overall product image to obtain the initial coordinates corresponding to each vertex of the bottom of the slot in the overall product image;

[0016] Perform pixel calculation based on the initial coordinates corresponding to each vertex of the bottom of the slot and the origin to respectively obtain the initial coordinates of each vertex of the bottom of the slot and the pixel distances between each vertex of the bottom of the slot and the preset image origin.

[0017] Furthermore, the image correction information at least includes the corrected pixel distances of the bottom sides of the slot;

[0018] The performing correction processing on the initial image position information based on a preset correction algorithm to obtain the image correction information corresponding to the initial image position information includes:

[0019] Perform calculation of the lengths of the bottom sides of the product slot based on the initial coordinates of the vertices of the bottom of the slot and the origin coordinates of the preset image origin according to the preset pixel distance algorithm to obtain the reference corrected lengths of the bottom sides of the product slot;

[0020] Based on the initial coordinates of the target bottom vertex among the bottom vertices of each groove and the reference correction lengths of the bottom sides of the product groove, correct the initial coordinates of the bottom vertices of each groove to obtain the corrected coordinates of the target bottom vertex.

[0021] Further, the correcting the initial coordinates of the bottom vertices of the groove based on the preset correction algorithm to obtain the reference correction lengths of the bottom sides of the product groove includes:

[0022] Based on the preset correction algorithm, calculate the bottom side length of the groove for the initial coordinates of two vertices on any one bottom side of the product groove bottom, to obtain the first pixel distance and the second pixel distance between the two vertices of any one bottom side and the origin respectively;

[0023] Perform a difference calculation on the first pixel distance and the second pixel distance to obtain the reference correction lengths of the bottom sides of the product groove bottom.

[0024] Further, the calculating the bottom size of the product groove according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product groove includes:

[0025] According to the target scaling ratio, perform a scaling calculation on the reference correction lengths of the bottom sides of the groove to obtain the actual lengths of the bottom sides of the product groove.

[0026] Further, the preset correction algorithm is D = n*(aX 2 +bX + c) / 10; where a, b, and c are calibration coefficients, D is the pixel distance between the bottom vertex and the origin, n is the number of pixel points of the vertex from the origin, and X is the ordinate corresponding to the initial coordinate of the bottom vertex of the groove.

[0027] Further, after the calculating the bottom size of the product groove according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product groove, it further includes:

[0028] According to the initial image position information corresponding to the target tilt angle, calculate the initial lengths of the bottom sides of the product groove to determine the initial length of the first bottom side of the groove and the initial length of the third bottom side of the groove; where the first side and the third side are perpendicularly arranged;

[0029] According to the size information of the product groove, the initial length of the first side, and the initial length of the third side, determine the scaling coefficient in the first direction and the scaling coefficient in the second direction corresponding to the target tilt angle; where the first direction is the same as the direction of the first side, and the second direction is the same as the direction of the third side;

[0030] Associate and store the target tilt angle, the scaling factor in the first direction, and the scaling factor in the second direction.

[0031] Further, the obtaining the target scaling ratio corresponding to the target tilt angle includes:

[0032] Obtain a standard image on the target product, where the standard image is an image that has not been processed by the image acquisition device and corresponds to its actual size;

[0033] Determine the distance between at least two calibration points in the standard image; a single calibration point is any point corresponding to the standard image;

[0034] Control the image acquisition device to use the target tilt angle as the acquisition angle to obtain a reference image corresponding to the standard image on the target product at the target tilt angle;

[0035] Determine the standard distance of at least two calibration points from the standard image;

[0036] Determine the reference pixel distance corresponding to the at least two calibration points in the reference image;

[0037] Perform scaling ratio calculation based on the standard distance and the reference pixel distance to obtain the target scaling ratio between the standard image and the reference image at the target tilt angle.

[0038] On the other hand, the present invention also protects a detection system for detecting the bottom size of a target product groove. The system is used to implement the detection method for detecting the bottom size of a target product groove as described above. The system includes:

[0039] A control module for controlling the image acquisition device to obtain an overall product image of the target product with the target tilt angle as the acquisition angle. There is a product groove on the side of the target product facing the image acquisition device;

[0040] A first execution module for identifying the product groove in the overall product image to obtain the initial image position information corresponding to the product groove in the overall product image;

[0041] A second execution module for performing correction processing on the initial image position information based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; wherein, the preset correction algorithm is obtained by performing position calibration on the pixel positions of the reference image and the standard image with the acquisition angle being the target tilt angle;

[0042] An acquisition module for obtaining the target scaling ratio corresponding to the target tilt angle;

[0043] A third execution module, configured to calculate the bottom size of the product slot according to the target scaling ratio and the corrected coordinate information, so as to obtain the size information of the product slot; wherein, the size information includes the lengths of the sides of the bottom of the slot and the coordinate values of the vertices of the bottom of the slot.

[0044] On the other hand, the present invention also protects a computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the detection method for detecting the bottom size of a target product slot as described above.

[0045] Implementing the embodiments of the present invention has the following beneficial effects:

[0046] In the present invention, an overall product image of a target product is taken obliquely by an image acquisition device to determine the initial image position information corresponding to the product slot, and the initial image position information is corrected based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; finally, the bottom size of the product slot is calculated according to the target tilt angle and the image correction information to obtain the size information of the product slot; it can be seen that when the image acquisition device is used to acquire an image of the product slot at the target tilt angle, through the above size correction steps, the size information of the product slot can be accurately obtained, expanding the working range that cannot be measured by traditional vision, and being able to efficiently and accurately measure the size information of the product slot that cannot be measured by the traditional vision system, with high measurement efficiency, low measurement cost and less measurement time-consuming, and being suitable for large-scale use. Description of the Drawings

[0047] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for use in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0048] Figure 1 It is a flowchart of the detection method for detecting the bottom size of a target product slot in this embodiment;

[0049] Figure 2 It is a structural diagram of the detection system for detecting the bottom size of a target product slot in this embodiment.

[0050] Among them, the corresponding reference numerals in the drawings are:

[0051] 1 - control module; 2 - first execution module; 3 - second execution module; 4 - acquisition module, 5 - third execution module. Detailed Embodiments

[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0054] The prior art has the following disadvantages: Currently, the commonly used standard measurement methods are high-precision three-coordinate contact measuring equipment and CCD measuring equipment. The software of the high-precision three-coordinate contact measuring equipment has powerful functions and is very suitable for standard product measurement and sampling measurement. However, due to its high cost, high technical ability requirements for operators, and the fact that the high-precision three-coordinate contact measuring equipment can only be used in a clean measuring room, it cannot adapt to the working environment of the workshop production line; while the CCD measuring equipment cannot measure the bottom size of similar grooves. When detecting the bottom size of the groove, its working range is relatively small, and size deviation is likely to occur, affecting the accuracy of the bottom size of the groove.

[0055] In view of the defects of the prior art, the present invention takes an overall product image of the target product by tilting the image acquisition device, determines the initial image position information corresponding to the product groove, performs correction processing on the initial image position information based on a preset correction algorithm to obtain the correction coordinate information corresponding to the initial image position information; finally, calculates the bottom size of the product groove according to the target tilt angle and the image correction information to obtain the size information of the product groove. It can be seen that when the present invention uses the image acquisition device to acquire an image of the product groove at the target tilt angle, through the above size correction steps, the size information of the product groove can be accurately obtained, expanding the working range that cannot be measured by traditional vision, and being able to efficiently and accurately measure the product groove that cannot be measured by the traditional vision system.

[0056] Embodiment 1

[0057] See attachedFigures 1 to 2 , this embodiment provides a detection method for detecting the bottom size of a target product. The method is applied to a product bottom size detection device, which includes an image acquisition device, a support device, and a light source device. The image acquisition device and the light source device are inclined and installed on the support device, and the included angle between the optical axis of the image acquisition device and the vertical direction is the target inclination angle. The method includes:

[0058] S101: Control the image acquisition device to obtain an overall product image of the target product with the target inclination angle as the acquisition angle. There is a product groove on the side of the target product facing the image acquisition device.

[0059] S102: Identify the product groove in the overall product image to obtain the initial image position information corresponding to the product groove in the overall product image.

[0060] S103: Perform correction processing on the initial image position information based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information. Among them, the preset correction algorithm is obtained by performing position calibration on the pixel positions of a reference image and a standard image with the acquisition angle being the target inclination angle.

[0061] S104: Obtain the target scaling ratio corresponding to the target inclination angle.

[0062] S105: Calculate the bottom size of the product groove according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product groove. Among them, the size information includes the lengths of the bottom sides of the groove and the coordinate values of the bottom vertices of the groove.

[0063] It should be noted that: in this embodiment, the overall product image of the target product is taken obliquely by the image acquisition device to determine the initial image position information corresponding to the product groove, and the initial image position information is corrected based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; finally, the bottom size of the product groove is calculated according to the target inclination angle and the image correction information to obtain the size information of the product groove. It can be seen that when the image acquisition device is used to acquire images of the product groove at the target inclination angle, through the above size correction steps, the size information of the product groove can be accurately obtained, expanding the working range that cannot be measured by traditional vision, and being able to efficiently and accurately measure the size information of the product groove that cannot be measured by traditional vision systems, with high measurement efficiency, low measurement cost, and less measurement time, and being suitable for large-scale use.

[0064] It should also be noted that: in this embodiment, the shape of the product groove is not limited. As long as the initial image position information is corrected according to the above preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information, and then the bottom size of the product groove is calculated according to the target tilt angle and the image correction information to obtain the size information of the product groove. It can be seen that in this embodiment, it is determined that the image acquisition device performs data acquisition on the product groove with the target tilt angle as the acquisition angle, and the size information of the product groove can be quickly obtained based on the preset correction algorithm. It can be seen that the detection method of this embodiment is applicable to product grooves of different sizes and different shapes, has a wide range of applicable occasions, can be suitable for large-scale use, and has good market application prospects.

[0065] In some possible embodiments, the initial image position information includes the pixel distance between each bottom vertex of the product groove and the preset image origin and the initial coordinates of each bottom vertex.

[0066] Identifying the product groove in the overall product image to obtain the initial image position information corresponding to the product groove in the overall product image includes:

[0067] S1021: Determine the origin coordinates of the preset image origin from the overall product image;

[0068] S1022: Identify the bottom vertices in the overall product image to obtain the initial coordinates of each bottom vertex corresponding to each other in the overall product image;

[0069] S1023: Based on the vertex coordinates corresponding to each bottom vertex and the origin, perform pixel calculations to obtain the initial coordinates of each bottom vertex and the pixel distance between each bottom vertex and the preset image origin respectively.

[0070] Specifically, determining the origin coordinates of the preset image origin from the overall product image includes:

[0071] Construct a coordinate system on the overall product image;

[0072] According to the coordinate system and the overall product image, determine the origin coordinates of the coordinate system.

[0073] Specifically, identifying the bottom vertices in the overall product image to obtain the initial coordinates of each bottom vertex corresponding to each other in the overall product image includes:

[0074] According to the coordinate system and the origin coordinates on the overall product image, identify the bottom vertices of the product groove to obtain the initial coordinates of each bottom vertex corresponding to each other in the coordinate system of the overall product image.

[0075] In some possible embodiments, the image correction information at least includes the corrected pixel distance of each bottom side of the bottom of the groove;

[0076] Perform correction processing on the initial image position information based on a preset correction algorithm to obtain image correction information corresponding to the initial image position information, including:

[0077] S1031: Calculate the reference correction lengths of the bottom sides of the product slots by calculating the bottom side lengths based on the preset pixel distance algorithm for the initial coordinates of the bottom vertices of each slot and the origin coordinates of the preset image origin.

[0078] S1032: Correct the initial coordinates of the bottom vertices of each slot according to the initial coordinates of the target bottom vertices among the bottom vertices of each slot and the reference correction lengths of the bottom sides of the product slots to obtain the corrected coordinates of the target bottom vertices.

[0079] Specifically, correcting the initial coordinates of the bottom vertices of each slot according to the initial coordinates of the target bottom vertices among the bottom vertices of each slot and the reference correction lengths of the bottom sides of the product slots to obtain the corrected coordinates of the target bottom vertices includes:

[0080] Determine the initial coordinates of one of the vertices of the target bottom according to the initial coordinates of the target bottom vertices of each bottom vertex.

[0081] Determine the initial coordinates of one vertex as the corrected coordinates of the current vertex.

[0082] Obtain the corrected coordinates of the other three vertices according to the reference coordinates of the current vertex and the reference correction lengths of the bottom sides.

[0083] In some possible embodiments, performing correction processing on the initial coordinates of the bottom vertices based on a preset correction algorithm to obtain the reference correction lengths of the bottom sides of the product slots includes:

[0084] S10311: Calculate the bottom side lengths based on the preset correction algorithm for the initial coordinates of the two vertices on any one bottom side of the product bottom slot respectively to obtain the first pixel distance and the second pixel distance between the two vertices of any one bottom side and the origin.

[0085] S10312: Calculate the difference between the first pixel distance and the second pixel distance to obtain the reference correction lengths of the bottom sides of the product bottom slot.

[0086] In this embodiment, the shape of the product bottom slot can be a regular shape or an irregular shape; taking the product bottom slot as a regular shape and an irregular shape as examples, that is, taking the product bottom slot as a rectangle and an irregular quadrilateral as examples respectively:

[0087] In some possible embodiments, when the product bottom slot is a rectangle, performing correction processing on the initial coordinates of the bottom vertices based on a preset correction algorithm to obtain the reference correction lengths of the bottom sides of the product slots includes:

[0088] Based on a preset calibration algorithm, calculate the bottom side length of the product groove bottom for the initial coordinates of two vertices on any one of the bottom sides, and obtain the first pixel distance and the second pixel distance between the two vertices of any one of the bottom sides and the origin respectively;

[0089] Perform a difference calculation on the first pixel distance and the second pixel distance to obtain the reference calibration length of one side and its opposite side;

[0090] Based on a preset calibration algorithm, calculate the bottom side length of the product groove bottom for the initial coordinates of two vertices of one of the other two sides respectively, and obtain the third pixel distance and the fourth pixel distance corresponding to the two vertices;

[0091] Perform a difference calculation on the third pixel distance and the fourth pixel distance to obtain the reference calibration lengths of the other two sides.

[0092] In some other possible embodiments, when the product groove bottom is an irregular quadrilateral, perform a calibration process on the initial coordinates of the groove bottom vertices based on a preset calibration algorithm, and the obtained reference calibration lengths of the bottom sides of the product groove include:

[0093] Based on a preset calibration algorithm, calculate the bottom side length of the product groove bottom for the initial coordinates of two vertices on the first side of the product groove bottom, and obtain the first pixel distance and the second pixel distance between the two vertices of the first side and the origin respectively;

[0094] Perform a difference calculation on the first pixel distance and the second pixel distance to obtain the reference calibration length of the first side;

[0095] Repeat the above steps of calculating the bottom side length of the product groove bottom for the initial coordinates of two vertices on the second side, the third side, and the fourth side respectively based on a preset calibration algorithm, and obtain the third pixel distance and the fourth pixel distance between the two vertices of the second side and the origin respectively, the fifth pixel distance and the sixth pixel distance between the two vertices of the third side and the origin respectively, and the seventh pixel distance and the eighth pixel distance between the two vertices of the fourth side and the origin respectively;

[0096] Perform a difference calculation on the third pixel distance and the fourth pixel distance, a difference calculation on the fifth pixel distance and the sixth pixel distance, and a difference calculation on the seventh pixel distance and the eighth pixel distance to obtain the reference calibration lengths of the bottom sides of the product groove bottom.

[0097] In some possible embodiments, calculate the bottom size of the product groove according to the target scaling ratio and the calibration coordinate information, and the obtained size information of the product groove includes:

[0098] According to the target scaling ratio, perform a scaling calculation on the reference calibration lengths of the bottom sides of the groove to obtain the actual lengths of the bottom sides of the product groove.

[0099] In some possible embodiments, the preset calibration algorithm is D = n*(aX 2 + bX + c) / 10; where a, b, and c are calibration coefficients, D is the pixel distance between the bottom vertex of the slot and the origin, n is the number of pixel points of the vertex from the origin, and X is the ordinate corresponding to the initial coordinates of the bottom vertex of the slot.

[0100] Specifically, when calculating the pixel distance between the current vertex and the origin according to the preset calibration algorithm, the ordinate of the initial coordinates of the current vertex is determined based on the overall product image, and the ordinate is substituted into the preset calibration algorithm to determine the pixel distance between the current vertex and the origin.

[0101] In some possible embodiments, after calculating the bottom size of the product slot according to the target scaling ratio and calibration coordinate information, and obtaining the size information of the product slot, it further includes:

[0102] Calculating the initial lengths of each side of the bottom of the product slot according to the initial image position information corresponding to the target tilt angle, and determining the initial length of the first side of the bottom and the initial length of the third side of the bottom; where the first side and the third side are perpendicularly arranged;

[0103] Determining the scaling coefficient in the first direction and the scaling coefficient in the second direction corresponding to the target tilt angle according to the size information of the product slot, the initial length of the first side, and the initial length of the third side; where the first direction is the same as the direction of the first side, and the second direction is the same as the direction of the third side;

[0104] Associatively storing the target tilt angle, the scaling coefficient in the first direction, and the scaling coefficient in the second direction.

[0105] Specifically, the scaling coefficient in the first direction is obtained by calculating based on the actual length of the first side of the product slot and the initial length of the first side, and the scaling coefficient in the second direction is obtained by calculating based on the actual length of the third side of the product slot and the initial length of the third side.

[0106] Associatively storing the target tilt angle, the scaling coefficient in the first direction, and the scaling coefficient in the second direction, so that when the image acquisition device next time measures the size of the product slot on the target product at the target tilt angle, the scaling coefficient in the first direction and the scaling coefficient in the second direction at the target tilt angle can be directly called, thereby reducing the calculation steps, accelerating the measurement of the size of the product slot, improving the measurement efficiency, and thus reducing the measurement cost.

[0107] In other possible embodiments, when the product slot is rectangular, the detection method for detecting the bottom size of the target product slot includes:

[0108] Control the image acquisition device to obtain the overall product image of the target product with the target tilt angle as the acquisition angle. There is a product groove on the side of the target product facing the image acquisition device.

[0109] Perform product groove recognition on the overall product image to obtain the initial image position information corresponding to the product groove in the overall product image.

[0110] According to the initial image position information, determine the initial length of the first side and the initial length of the third side of the groove bottom, where the first side and the third side are perpendicular to each other.

[0111] Perform calculations according to the preset formula, the initial length of the first side, and the initial length of the third side to determine the first offset coefficient in the direction of the first side and the second offset coefficient in the direction of the second side; wherein, the preset formula = the initial side length of the side of the product groove / 10.

[0112] Calculate the actual length of the first side according to the first offset coefficient and the initial length of the first side.

[0113] Calculate the actual length of the third side according to the second offset coefficient and the initial length of the third side.

[0114] Obtain the size information of the product groove according to the actual length of the first side and the actual length of the third side.

[0115] In some possible embodiments, obtaining the target scaling ratio corresponding to the target tilt angle includes:

[0116] S1041: Obtain the standard image on the target product. The standard image is an image that has not been processed by the image acquisition device and corresponds to its actual size.

[0117] S1042: Determine the distance between at least two calibration points in the standard image; a single calibration point is any point corresponding to the standard image.

[0118] S1043: Control the image acquisition device to use the target tilt angle as the acquisition angle to obtain the reference image corresponding to the standard image on the target product at the target tilt angle.

[0119] S1044: Determine the standard distance of at least two calibration points from the standard image.

[0120] S1045: Determine the reference pixel distance corresponding to at least two calibration points in the reference image.

[0121] S1046: Perform scaling ratio calculation based on the standard distance and the reference pixel distance to obtain the target scaling ratio between the standard image and the reference image at the target tilt angle.

[0122] The detection method for detecting the bottom size of the target product groove includes:

[0123] S101: Control the image acquisition device to obtain the overall product image of the target product with the target tilt angle as the acquisition angle. There is a product groove on the side of the target product facing the image acquisition device;

[0124] S1021: Determine the origin coordinates of the preset image origin from the overall product image;

[0125] S1022: Perform groove bottom vertex recognition in the overall product image to obtain the respective initial coordinates of each groove bottom vertex in the overall product image;

[0126] S1023: Based on the vertex coordinates corresponding to each groove bottom vertex and the origin, perform pixel calculations to respectively obtain the initial coordinates of each groove bottom vertex and the pixel distance between each groove bottom vertex and the preset image origin;

[0127] S1031: Based on the preset pixel distance algorithm, calculate the bottom side lengths of the product groove bottom for the initial coordinates of each groove bottom vertex and the origin coordinates of the preset image origin to obtain the reference correction lengths of each bottom side of the product groove bottom;

[0128] S1032: According to the initial coordinates of the target groove bottom vertex among each groove bottom vertex and the reference correction lengths of each bottom side of the product groove, correct the initial coordinates of each groove bottom vertex to obtain the corrected coordinates of the target groove bottom vertex;

[0129] S1041: Obtain the standard image on the target product. The standard image is an image that has not been processed by the image acquisition device and corresponds to its actual size;

[0130] S1042: Determine the distance between at least two calibration points in the standard image; A single calibration point is any point corresponding to the standard image;

[0131] S1043: Control the image acquisition device to use the target tilt angle as the acquisition angle to obtain the reference image corresponding to the standard image on the target product at the target tilt angle;

[0132] S1044: Determine the standard distances of at least two calibration points from the standard image;

[0133] S1045: Determine the reference pixel distances corresponding to at least two calibration points in the reference image;

[0134] S1046: Based on the standard distance and the reference pixel distance, perform scaling ratio calculation to obtain the target scaling ratio between the standard image and the reference image at the target tilt angle;

[0135] S105: Calculate the bottom size of the product slot based on the target scaling ratio and the calibrated coordinate information to obtain the size information of the product slot; wherein, the size information includes the lengths of the sides of the bottom of the slot and the coordinate values of the vertices of the bottom of the slot.

[0136] On the other hand, the present invention also protects a detection system for detecting the bottom size of a target product slot. The system is used to implement the above detection method for detecting the bottom size of a target product slot. The system includes:

[0137] The control module 1 is used to control the image acquisition device to obtain the overall product image of the target product with the target tilt angle as the acquisition angle. There is a product slot on the side of the target product facing the image acquisition device.

[0138] The first execution module 2 is used to identify the product slot in the overall product image to obtain the initial image position information corresponding to the product slot in the overall product image.

[0139] The second execution module 3 is used to perform calibration processing on the initial image position information based on a preset calibration algorithm to obtain the calibrated coordinate information corresponding to the initial image position information; wherein, the preset calibration algorithm is obtained by performing position calibration on the pixel positions of the reference image and the standard image with the acquisition angle as the target tilt angle.

[0140] The acquisition module 4 is used to acquire the target scaling ratio corresponding to the target tilt angle.

[0141] The third execution module 5 is used to calculate the bottom size of the product slot according to the target scaling ratio and the calibrated coordinate information to obtain the size information of the product slot; wherein, the size information includes the lengths of the sides of the bottom of the slot and the coordinate values of the vertices of the bottom of the slot.

[0142] On the other hand, the present invention also protects a computer-readable storage medium. At least one instruction or at least one segment of program is stored in the storage medium, and at least one instruction or at least one segment of program is loaded and executed by a processor to implement the above detection method for detecting the bottom size of a target product slot.

[0143] Optionally, in this embodiment, the above storage medium may be located in at least one of multiple network servers in a computer network. Optionally, in this embodiment, the above storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), external hard drives, magnetic disks, or optical discs and other media that can store program codes.

[0144] Although the present invention has been described by way of preferred embodiments, the present invention is not limited to the embodiments described herein. Various changes and modifications can be made without departing from the scope of the present invention.

[0145] In this document, the directional terms such as front, rear, upper, and lower are defined based on the positions of the components in the drawings and their relative positions to each other, solely for the sake of clarity and convenience in expressing the technical solution. It should be understood that the use of these directional terms should not limit the scope of protection claimed in this application.

[0146] Without conflict, the above-mentioned embodiments and the features in the embodiments herein can be combined with each other.

[0147] The above disclosure is only a preferred embodiment of the present invention, and of course, it cannot be used to limit the scope of the rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.

Claims

1. A detection method for detecting the bottom size of a target product slot, characterized in that, the method is applied to a product slot bottom size detection device, the device includes an image acquisition device, a support device and a light source device, the image acquisition device and the light source device are obliquely installed on the support device, the included angle between the optical axis of the image acquisition device and the vertical direction is the target tilt angle, and the method includes: controlling the image acquisition device to obtain an overall product image of the target product with the target tilt angle as the acquisition angle, and there is a product slot on the side of the target product facing the image acquisition device; identifying the product slot in the overall product image to obtain the initial image position information corresponding to the product slot in the overall product image; performing correction processing on the initial image position information based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; wherein, the preset correction algorithm is obtained by performing position calibration on the pixel positions of a reference image and a standard image with an acquisition angle of the target tilt angle; obtaining the target scaling ratio corresponding to the target tilt angle; calculating the bottom size of the product slot according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product slot; wherein, the size information includes the lengths of the bottom sides of the slot and the coordinate values of the bottom vertices of the slot.

2. The detection method for detecting the bottom size of a target product slot according to claim 1, characterized in that, the initial image position information includes the pixel distances between the bottom vertices of the product slot and a preset image origin and the initial coordinates of the bottom vertices; the identifying the product slot in the overall product image to obtain the initial image position information corresponding to the product slot in the overall product image includes: determining the origin coordinates of a preset image origin from the overall product image; identifying the bottom vertices of the slot in the overall product image to obtain the initial coordinates corresponding to each bottom vertex in the overall product image; performing pixel calculation based on the initial coordinates corresponding to each bottom vertex and the origin to respectively obtain the initial coordinates of each bottom vertex and the pixel distances between each bottom vertex and the preset image origin.

3. The detection method for detecting the bottom size of a target product slot according to claim 2, characterized in that, the image correction information at least includes the corrected pixel distances of the bottom sides of the slot; the performing correction processing on the initial image position information based on a preset correction algorithm to obtain the image correction information corresponding to the initial image position information includes: calculating the reference corrected lengths of the bottom sides of the product slot based on a preset pixel distance algorithm for the initial coordinates of each bottom vertex and the origin coordinates of a preset image origin; correcting the initial coordinates of each bottom vertex according to the initial coordinates of the target bottom vertex among each bottom vertex and the reference corrected lengths of the bottom sides of the product slot to obtain the corrected coordinates of the target bottom vertex.

4. The detection method for detecting the bottom size of a target product slot according to claim 3, characterized in that, Performing calibration processing on the initial coordinates of the bottom vertices of the product groove based on the preset calibration algorithm to obtain the reference calibration lengths of the bottom sides of the product groove includes: Calculating the bottom side lengths of the product groove bottom for any two vertices on any one bottom side based on the preset calibration algorithm to obtain the first pixel distance and the second pixel distance between the two vertices of any one bottom side and the origin respectively; Performing a difference calculation on the first pixel distance and the second pixel distance to obtain the reference calibration lengths of the bottom sides of the product groove bottom.

5. The detection method for detecting the bottom size of a target product groove according to claim 1, characterized in that, Calculating the bottom size of the product groove according to the target scaling ratio and the calibration coordinate information to obtain the size information of the product groove includes: Performing a scaling calculation on the reference calibration lengths of the bottom sides of the groove according to the target scaling ratio to obtain the actual lengths of the bottom sides of the product groove.

6. The detection method for detecting the bottom size of a target product groove according to claim 4, characterized in that, The preset calibration algorithm is D = n*(aX 2 + bX + c) / 10; where a, b, and c are calibration coefficients, D is the pixel distance between the bottom vertex of the groove and the origin, n is the number of pixel points of the vertex from the origin, and X is the ordinate corresponding to the initial coordinate of the bottom vertex of the groove.

7. The detection method for detecting the bottom size of a target product groove according to claim 4, characterized in that, After calculating the bottom size of the product groove according to the target scaling ratio and the calibration coordinate information to obtain the size information of the product groove, it further includes: Calculating the initial lengths of the bottom sides of the product groove according to the initial image position information corresponding to the target tilt angle to determine the initial length of the first bottom side and the initial length of the third bottom side of the groove bottom; wherein, the first side and the third side are perpendicularly arranged; Determining the scaling coefficient in the first direction and the scaling coefficient in the second direction corresponding to the target tilt angle according to the size information of the product groove, the initial length of the first side and the initial length of the third side; wherein, the first direction is the same as the direction of the first side, and the second direction is the same as the direction of the third side; Associatively storing the target tilt angle, the scaling coefficient in the first direction and the scaling coefficient in the second direction.

8. The detection method for detecting the bottom size of a target product groove according to claim 1, characterized in that, Obtaining the target scaling ratio corresponding to the target tilt angle includes: Obtaining a standard image on the target product, where the standard image is an image that has not been processed by the image acquisition device and corresponds to its actual size; Determining the distance between at least two calibration points in the standard image; a single calibration point is any point corresponding to the standard image; Controlling the image acquisition device to use the target tilt angle as the acquisition angle to obtain a reference image corresponding to the standard image on the target product at the target tilt angle; Determining the standard distance of at least two calibration points from the standard image; Determining the reference pixel distances corresponding to the at least two calibration points in the reference image; Based on the standard distance and the reference pixel distance, a scaling ratio calculation is performed to obtain the target scaling ratio between the standard image and the reference image at the target tilt angle.

9. A detection system for detecting the bottom size of a target product groove Characterized in that The system is used to implement the detection method for detecting the bottom size of a target product groove as described in any one of claims 1-8. The system includes: A control module, configured to control the image acquisition device to acquire an overall product image of the target product with the target tilt angle as the acquisition angle. There is a product groove on the side of the target product facing the image acquisition device. A first execution module, configured to identify the product groove in the overall product image to obtain the initial image position information corresponding to the product groove in the overall product image. A second execution module, configured to perform correction processing on the initial image position information based on a preset correction algorithm to obtain the corrected coordinate information corresponding to the initial image position information; wherein, the preset correction algorithm is obtained by performing position calibration on the pixel positions of a reference image and a standard image with an acquisition angle of the target tilt angle. An acquisition module, configured to acquire the target scaling ratio corresponding to the target tilt angle. A third execution module, configured to calculate the bottom size of the product groove according to the target scaling ratio and the corrected coordinate information to obtain the size information of the product groove; wherein, the size information includes the lengths of the bottom sides of the groove and the coordinate values of the bottom vertices of the groove.

10. A computer-readable storage medium Characterized in that At least one instruction or at least one program segment is stored in the storage medium, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the detection method for detecting the bottom size of a target product groove as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Object size measuring method, apparatus and system

    CN108240793A

  • Silk-screen printing sample plate size measurement method based on machine vision

    CN110136120A