Gridding cloth wrapping machine visual identification method and system based on OpenCV
By applying OpenCV machine vision technology in the mesh wrapping process of EPS decorative lines, automatic identification of EPS lines and calculation of package layout are realized, solving the problems of low efficiency and inconsistent quality of traditional manual wrapping, and improving production efficiency and automation. level.
Patent Information
- Application Number
- CN202411374716.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In the prior art, most of the grid cloth packages are manual and have low degree of automation, resulting in low efficiency and inconsistent package quality.
The grid cloth wrapping machine visual recognition method based on OpenCV is used to realize the automatic recognition of EPS lines and the calculation of the wrapping layout through steps such as image collection, preprocessing, corner point extraction and coordinate conversion.
Improve the efficiency and automation level of EPS decorative lines, ensure the consistency and stability of the quality of the package, and reduce the cost of labor.
Smart Images

Figure CN119338842A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of visual recognition, and relates to a visual recognition method and system for a mesh cloth wrapping machine based on OpenCV. Background Art
[0002] With the acceleration of global urbanization, the construction industry is undergoing unprecedented changes and innovations. This industry not only carries multiple functional requirements such as living, office, and business, but also increasingly becomes an important window to showcase regional culture, scientific and technological level, and environmental protection concepts. In this context, more stringent and diversified requirements are put forward for the aesthetic pursuit of building appearance, structural safety, energy efficiency improvement, and the application of green building materials. EPS (polystyrene foam) decorative lines stand out among many building materials with their light weight, high strength, good weather resistance, easy processing and good thermal insulation performance, and become the new favorite in the field of modern building decoration. Its rich modeling ability and high degree of customizability enable designers to break through traditional limitations and create architectural appearances that meet user needs and are artistic, meeting the market's urgent demand for personalized, environmentally friendly, and efficient building decoration materials.
[0003] However, despite the great potential of EPS decorative lines in design and application, some links in its production process, especially the key step of mesh wrapping, still face the challenge of low automation. The traditional manual wrapping method is not only inefficient, but also easily affected by human factors, resulting in uneven wrapping quality, which in turn affects the overall performance and appearance consistency of the product. In addition, with the increase in labor costs and the intensification of the "labor shortage" phenomenon, companies are increasingly in need of improving the level of production automation and reducing dependence on manpower. Summary of the invention
[0004] The purpose of the present invention is to solve the technical problem that most of the mesh cloth wrapping in the prior art is done manually and the degree of automation is low, and to provide a mesh cloth wrapping machine visual recognition method and system based on OpenCV.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a visual recognition method for a mesh cloth wrapping machine based on OpenCV, comprising:
[0007] Collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image;
[0008] Extracting the model contour of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0009] Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established;
[0010] Based on the conversion relationship, the coordinate information of each corner point is converted into the coordinate information of the EPS line in the world coordinate system to complete the visual recognition of the mesh cloth wrapping machine.
[0011] Further improvements are:
[0012] After preprocessing the image to obtain a binary image, the method further includes:
[0013] Based on the hash algorithm, the binary image is compared with the image in the existing EPS line database. If the same image exists, the coordinate information of the EPS line corresponding to the same image in the EPS line database is directly called; if the same object does not exist, continue with the subsequent steps.
[0014] The comparison of the binary image with the image in the existing EPS line database based on the hash algorithm is specifically as follows:
[0015] The final result of the hash algorithm is obtained through the calculation result of the Hamming distance. The hash value calculation function is constructed using the Python language and the OpenCV open source library:
[0016] The binary image is reduced in size and simplified in color using the OpenCV open source library;
[0017] Calculate the pixel mean. When calculating the Hamming distance, the data in the two lists to be compared only consists of binary data 0 and 1. The process of converting specific numerical values into binary data is based on the comparison results of all pixel value data with a specific threshold. In the hash algorithm, the mean of all pixel values is used as the threshold.
[0018] Construct a one-dimensional perceptual hash value table, construct a feature matrix based on the relationship between the pixel value and the mean value in the image, compare the image with a specific value, and get a logical value of True or False. According to the returned logical value, convert the logical value into an integer value through astype(int) to construct a feature matrix; the perceptual hash value at this time is a two-dimensional array. To simplify the subsequent algorithm, the two-dimensional array can be processed into a one-dimensional array through the flatten function;
[0019] Encapsulation function, when retrieving an image, it is necessary to extract the perceptual hash value of the retrieved image, and also to extract the perceptual hash values of all images in the graphics library. In order to extract more conveniently, all the above functions need to be encapsulated;
[0020] Read all images in the existing EPS line database through the Glob library, call the encapsulated perceptual hash value calculation function, calculate the perceptual hash value of each image, and provide data for the subsequent calculation of the Hamming distance between the target image to be tested and each image in the folder;
[0021] When the external conditions such as background environment, shooting distance, focal length, rotation and translation are not too different, there is a big difference between the similarity of photos of completely identical EPS decorative lines and the similarity of photos of highly similar but different EPS decorative lines. Based on this difference, a basic specific value can be determined, and the decision can be made by comparing the similarity with the specific value.
[0022] After the operation, the Hamming distance between the newly collected binary image and each sample in the existing EPS line database is obtained. In order to intuitively obtain the similarity of the picture, the above data is processed; the similarity calculation formula is:
[0023]
[0024] Wherein, s represents similarity; t represents the total pixel value. When the image is processed with a size of 10×10, the total pixel value of the image is 100; h represents the Hamming distance, which is specifically expressed as the difference between images; th represents the similarity value of the images. The total calculation formula represents the similarity of the images in the form of a percentage; 92% is used as the judgment threshold. If the similarity is greater than 92%, it proves that the similarity is high, and it is determined that there is an image in the existing EPS line database that matches the EPS decorative line to be tested.
[0025] The image is preprocessed to obtain a binary image as follows:
[0026] Reduce the size of the image based on the downsampling method in the image pyramid;
[0027] Smooth the image and remove noise through Gaussian filtering;
[0028] The binary image of EPS line contour is obtained by threshold segmentation.
[0029] The model contour of the EPS line to be wrapped is extracted based on the binary image, and the coordinate information of each corner point of the model contour is extracted based on the Shi-Tomasi operator:
[0030] Edge detection is achieved through the canny algorithm, the model contour is extracted, and the contour is fitted by the least squares method; then the corner points are detected by the Shi-Tomasi corner point detection algorithm. In the Shi-Tomasi algorithm, based on the principle that the stability of the corner points is related to the smaller eigenvalue of the matrix M, the smaller eigenvalue is used as a necessary condition, which effectively avoids the problem of selecting the k value; the improved Shi-Tomasi algorithm formula principle is as follows:
[0031] R=min(λ1,λ2) (2)
[0032] During the detection process, the corner detection algorithm will generate a rectangular area in the image and calculate the sum of all pixel values in the rectangular area. Then, the area will be moved and the sum of pixel values in the rectangular area of the next area will be calculated. If the calculated pixel values in the two rectangular areas before and after the move are very different, it is considered that the original area before the move has corner points that need to be detected, otherwise it is considered that there are no corner points that need to be detected in the original area.
[0033] Usually, the detected corner points can be divided into negative corner points and positive corner points according to whether they appear concave or convex. The corner points of special concern among all corner points are negative corner points, that is, concave corner points. In the concave places on the upper surface of the EPS decorative lines, in its image, two points on the contour near the point that are located on both sides of the point and close to the point are taken, and the two points are connected to generate a straight line, and the concave point is located below the straight line. In the geometric relationship under the rectangular coordinate system, when the coefficient of the straight line function y is negative, if the result is greater than 0 after substituting the coordinates, it means that it is located below the image. However, due to the different positive direction regulations of the coordinate system, the judgment process is completely opposite, that is, when the result is less than 0, it means that the point is located below the image, which can be said to be a negative corner point of the image.
[0034] Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established as follows:
[0035] The camera calibration model is established, including the following four important coordinate systems and three important transformation methods:
[0036] World coordinate system, the position coordinates of the world coordinate system are (x w ,y w ,z w ), which is the real coordinate in the coordinate system established in the real world;
[0037] Camera coordinate system, camera coordinate system refers to the coordinate system formed with the camera center as the origin, and its coordinates are expressed as (X c ,Y c ,Z c );
[0038] Image coordinate system: The coordinates of the image coordinate system are expressed as (x, y). The image coordinate system can be obtained by trigonometric transformation of the camera coordinate system. The coordinate system takes the intersection of the optical axis and the image plane as the origin and is in millimeters.
[0039] Pixel coordinate system: The pixel coordinate system is obtained by changing the image coordinate system. The coordinates are expressed as (u, v). The coordinate system takes the upper left corner of the image as the origin. u and v represent the number of columns and rows of pixels in the digital chart, respectively. Pixels are usually used as coordinate units to describe the physical size and position of the image.
[0040] The above four coordinate systems can realize the transformation of coordinates between different coordinate systems through the relationship between each other; the transformation from the world coordinate system to the camera coordinate system is mainly realized by rigid body change, that is, only rotation and translation transformation occur; the change process is described as:
[0041]
[0042] The process of converting from the camera coordinate system to the image coordinate system is mainly achieved through triangular similarity changes; the conversion from the image coordinate system to the pixel coordinate system is achieved through the offset of coordinates;
[0043]
[0044] in:
[0045]
[0046] In the formula, (u0, v0) represents the offset of the origin of the image coordinate system relative to the origin of the pixel coordinate system, and dx, dy represents the size of each pixel;
[0047] The purpose of camera calibration is to solve the parameters of all matrices in the above formula, that is, to solve the internal and external parameters of the camera. The f, dx, and dy in the formula are obtained through camera calibration. x ,f y ;
[0048] Combining the above formula, the final conversion formula is:
[0049]
[0050] Where:
[0051]
[0052] Camera calibration model solution:
[0053] A 12×9 chessboard calibration plate is used to calibrate the camera. The internal and external parameters of the camera are solved with the help of OpenCV open source library and Python language. After processing, the internal parameter matrix is obtained:
[0054]
[0055] The distortion parameters of the camera are: k1 = 0.324242681, k2 = -2.18543749, p1 = -0.000966342267, p2 = -0.000839539629, k3 = 4.95031381, and the parameters k1, k2, p1, p2, k3 in the obtained distortion parameters correspond to the parameter values in formula (11);
[0056] Obtain the external parameters of the camera about the plane where the EPS line cross-section profile is located, that is, the rotation matrix and translation matrix obtained through camera calibration are:
[0057]
[0058]
[0059] Formula (12) represents the rotation matrix, and formula (13) represents the translation matrix.
[0060] The calculation of the distortion parameters is specifically as follows:
[0061] Distortion parameters include radial distortion coefficient and tangential distortion coefficient. The distortion in the image needs to be corrected during camera calibration. Radial distortion is caused by the shape of the additive lens. It is distributed along the radial direction of the lens and is more curved away from the center of the lens. It can be described by a mathematical polynomial as follows:
[0062]
[0063] Where k1, k2, k3 represent radial distortion parameters, which are camera internal parameters;
[0064]
[0065] Combining formulas (14) and (15), the distortion formula is as follows:
[0066]
[0067] In a second aspect, the present invention discloses a visual recognition system for a mesh cloth wrapping machine based on OpenCV, comprising:
[0068] An image acquisition module is used to acquire an image of the EPS line to be wrapped and pre-process the image to obtain a binary image;
[0069] A corner point coordinate information acquisition module is used to extract the model contour of the EPS line to be wrapped based on the binary image, and to extract the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0070] The conversion relationship establishment module obtains the internal and external parameters of the camera used to collect images based on the OpenCV library, and establishes the conversion relationship between the pixel coordinate system and the world coordinate system;
[0071] The coordinate information conversion module converts the coordinate information of each corner point into the coordinate information of the EPS line in the world coordinate system based on the conversion relationship to complete the visual recognition of the mesh cloth wrapping machine.
[0072] In a third aspect, the present invention discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned OpenCV-based mesh cloth wrapping machine visual recognition method when executing the computer program.
[0073] In a fourth aspect, the present invention discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned OpenCV-based mesh cloth wrapping machine visual recognition method are implemented.
[0074] Compared with the prior art, the present invention has the following beneficial effects:
[0075] The present invention discloses a visual recognition method for a mesh cloth wrapping machine based on OpenCV. The present invention designs a set of methods specifically for identifying and classifying the contours of EPS lines of different shapes, extracting and storing feature points, providing a new idea for the coating process of EPS lines, optimizing the problem of the single coating model of the traditional coating device, and at the same time, through the combination of the algorithm module and the control system, effectively improving the efficiency of the production of EPS decorative lines and the automation and intelligence of the production process. The present invention provides strong technical support for the automation upgrade of the production of EPS decorative lines. Machine vision technology simulates human visual functions and uses high-precision image acquisition and processing algorithms to achieve rapid and accurate recognition and measurement of information such as object shape, size, and position. In the mesh cloth wrapping link, the machine vision system can capture the three-dimensional contour information of the EPS decorative lines in real time, accurately calculate the size and layout of the required mesh cloth, and guide the automated mechanical arm or wrapping equipment to complete the precise wrapping operation, thereby significantly improving production efficiency, reducing labor costs, and ensuring the consistency and stability of the wrapping quality. In summary, the application of machine vision technology in the automated production of EPS decorative line mesh wrapping is not only a major innovation in traditional production processes, but also an important measure to respond to the national policy call and promote the construction industry to develop in the direction of intelligence, greenness and efficiency. Therefore, the development of an EPS decorative line mesh automated wrapping system based on machine vision technology has important practical significance and market prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0077] Figure 1 It is a flow chart of a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0078] Figure 2 It is an overall technical roadmap of a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0079] Figure 3 It is a schematic diagram of the principle of a hash algorithm in a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0080] Figure 4 This is a Gaussian filter processing effect diagram in a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0081] Figure 5 This is a diagram showing the result of threshold segmentation processing in a visual recognition method for a mesh cloth wrapping machine based on OpenCV in the present invention;
[0082] Figure 6 This is a diagram of the processing result of the Canny operator in a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0083] Figure 7 This is a line contour extraction result diagram in a visual recognition method for a mesh cloth wrapping machine based on OpenCV in the present invention;
[0084] Figure 8 This is a corner point detection result diagram in a visual recognition method for a mesh cloth wrapping machine based on OpenCV in the present invention;
[0085] Fig. 9 A schematic diagram of concave points in a visual recognition method for a mesh cloth wrapping machine based on OpenCV in the present invention;
[0086] Fig.10 It is a schematic diagram of the principle of triangle similarity change in a visual recognition method of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0087] Fig.11 A mesh cloth covering flow chart in a mesh cloth wrapping machine visual recognition method based on OpenCV in the present invention;
[0088] Fig.12 It is a module diagram of a visual recognition system of a mesh cloth wrapping machine based on OpenCV in the present invention;
[0089] Fig.13 This is a module diagram of an electronic device in the present invention. DETAILED DESCRIPTION
[0090] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0091] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0092] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0093] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0094] See also Figure 1 The present invention discloses a visual recognition method of a mesh cloth wrapping machine based on OpenCV, comprising:
[0095] S1, collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image;
[0096] S2, extracting the model contour of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0097] S3, based on the OpenCV library, obtains the internal and external parameters of the camera used to collect the image, and establishes the conversion relationship between the pixel coordinate system and the world coordinate system;
[0098] S4, based on the conversion relationship, converting the coordinate information of each corner point into the coordinate information of the EPS line in the world coordinate system, and completing the visual recognition of the mesh cloth wrapping machine.
[0099] The present invention discloses a visual recognition method for a mesh cloth wrapping machine based on OpenCV. The present invention designs a set of methods specifically for identifying and classifying the contours of EPS lines of different shapes, extracting and storing feature points, providing a new idea for the coating process of EPS lines, optimizing the problem of the single coating model of the traditional coating device, and at the same time, through the combination of the algorithm module and the control system, effectively improving the efficiency of the production of EPS decorative lines and the automation and intelligence of the production process. The present invention provides strong technical support for the automation upgrade of the production of EPS decorative lines. Machine vision technology simulates human visual functions and uses high-precision image acquisition and processing algorithms to achieve rapid and accurate recognition and measurement of information such as object shape, size, and position. In the mesh cloth wrapping link, the machine vision system can capture the three-dimensional contour information of the EPS decorative lines in real time, accurately calculate the size and layout of the required mesh cloth, and guide the automated mechanical arm or wrapping equipment to complete the precise wrapping operation, thereby significantly improving production efficiency, reducing labor costs, and ensuring the consistency and stability of the wrapping quality. In summary, the application of machine vision technology in the automated production of EPS decorative line mesh wrapping is not only a major innovation in traditional production processes, but also an important measure to respond to the national policy call and promote the construction industry to develop in the direction of intelligence, greenness and efficiency. Therefore, the development of an EPS decorative line mesh automated wrapping system based on machine vision technology has important practical significance and market prospects.
[0100] See also Figure 2 The embodiment of the present invention discloses a visual recognition method for a mesh cloth wrapping machine based on OpenCV. The content of the present invention is described in detail below in conjunction with specific embodiments:
[0101] Step 1, collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image;
[0102] Build a hardware platform for image acquisition: including camera selection, light source selection and arrangement, image acquisition position determination, camera calibration; select a 500W pixel CCD industrial camera, arrange the camera horizontally, and arrange a ring LED light above the camera to illuminate the EPS foam lines from the front. The collection position is 50CM away from the camera. After the hardware platform is built, calibrate the camera according to Zhang Youzheng's camera calibration method to obtain the camera's internal and external parameters, and establish the relationship between the pixel coordinate system and the world coordinate system.
[0103] Establish an EPS line model database, store images of each model and information about its contours and corner points, compare the newly acquired images with the existing images in the database, and directly call the mechanical part according to the stored information if it is an existing model, and further process it if it is a new model;
[0104] The preprocessing of the image includes:
[0105] (1) Down-sampling method in image pyramid reduces the size of the image to facilitate image display.
[0106] First, perform Gaussian filtering on the image. Gaussian filtering is also called Gaussian kernel convolution. The specific method is to obtain the desired new pixel value by weighted average of each pixel in the entire image and other pixel values in the neighborhood. After the kernel processing operation of the pixels in the original image, the result image is obtained. Furthermore, all even rows and columns are deleted. The size of the image to be processed is reduced to 1 / 4 of the original size through the Gaussian pyramid. This is to facilitate the display of the image in various subsequent operations to view the image processing effect.
[0107] (2) Perform image smoothing and denoising through Gaussian filtering. Figure 4 shown.
[0108] Gaussian filtering is a linear filter that smoothes an image by applying a Gaussian function to each pixel in the image. Gaussian filtering is usually implemented using convolution operations. First, a Gaussian kernel is created, which is a two-dimensional Gaussian function matrix. Then, this kernel is applied to each pixel of the image, and the smoothed pixel value is obtained by calculating the weighted sum of the kernel and the local area of the image.
[0109] In image processing, all images are two-dimensional and two-dimensional Gaussian functions are often used. In the two-dimensional Gaussian function, the circularly symmetric Gaussian formula is shown below:
[0110]
[0111] Among them, x, y are the point coordinates, σ is the standard deviation;
[0112] (3) Obtain the binary image of EPS line contours through threshold segmentation. Figure 5 shown.
[0113] The purpose of image thresholding is to divide the pixel set according to the grayscale level. Each subset obtained forms an area corresponding to the real scene. Each area has consistent attributes, while the adjacent areas do not have such consistent attributes. Such division can be achieved by selecting a threshold value based on the grayscale level. The segmentation threshold is obtained through the grayscale histogram. The grayscale value of the part with a grayscale value less than the selected threshold is zero, and the grayscale value of the part with a grayscale value greater than or equal to the selected threshold is 255, completing the binarization of the image.
[0114] See also Figure 3, step 2, based on the hash algorithm, the binary image is compared with the image in the existing EPS line database. If the same image exists, the coordinate information of the EPS line corresponding to the same image in the EPS line database is directly called; if the same object does not exist, the subsequent steps are continued;
[0115] (1) Reduce size: The OpenCV open source library provides the function cv2.resize(src, dsize) to implement this function, where src is the input image and dsize is the size of the converted image. Through the conversion, the original image size of (1440, 1920, 3) is reduced to the size of (10, 10, 3), where 3 indicates that the image is a color image with three channels.
[0116] (2) Simplify colors:
[0117] The image can be converted into a grayscale image by using the grayscale function cv2.cvtCOLOR provided in the OpenCV open source library. At this time, the image size is expressed as (10, 10)
[0118] (3) Calculate the pixel mean
[0119] In the subsequent calculation of the Hamming distance, the data in the two lists being compared consists only of binary data 0 and 1. The process of converting specific numerical values into binary data is based on the comparison results of all pixel value data with a specific threshold. In the hash algorithm, the mean of all pixel values is used as the threshold.
[0120] (4) Constructing a one-dimensional perceptual hash value table
[0121] The feature matrix is constructed based on the relationship between the pixel value and the mean value in the image. The image is compared with a specific value to obtain a logical value of True or False. According to the returned logical value, the logical value is converted into an integer value through astype(int) to construct a feature matrix. At this time, the perceptual hash value is a two-dimensional array. To simplify the subsequent algorithm, the two-dimensional array can be processed into a one-dimensional array through the flatten function.
[0122] (5) Encapsulation function
[0123] When retrieving an image, it is necessary to extract the perceptual hash value of the retrieved image, and it is also necessary to extract the perceptual hash values of all images in the graphics library. In order to facilitate the extraction, all the above functions need to be encapsulated.
[0124] The Glob library can realize the function of efficiently reading files. This method uses the Glob library to read all image files in the specified folder, calls the encapsulated perceptual hash value calculation function, traverses all image files in the folder, calculates the perceptual hash value of each image, and provides data for the subsequent calculation of the Hamming distance between the target image to be tested and each image in the folder.
[0125] When the external conditions such as background environment, shooting distance, focal length, rotation and translation are basically the same, there is a big difference between the similarity of photos of exactly the same EPS decorative lines and the similarity of photos of highly similar but different EPS decorative lines. Based on this difference, a basic specific value can be determined, and the decision can be made by comparing the similarity with the specific value.
[0126] After calculation, the Hamming distance between the newly collected EPS line image and each sample in the database can be obtained. In order to intuitively obtain the similarity of the image, the above data is processed. The similarity calculation formula is:
[0127]
[0128] In the above formula, s represents similarity, t represents the total pixel value. When the image size is 10×10, the total pixel value of the image is 100. h represents the Hamming distance, which is the difference between the images. th represents the similarity value of the images. The total calculation formula represents the similarity of the images in percentage.
[0129] 92% is used as the judgment threshold. If the similarity is greater than 92%, it proves that the similarity is high and sufficient to determine that there is an image in the database that matches the image taken of the EPS decorative line to be tested, and then proves that there is a packaging solution that matches the EPS decorative line to be tested. At this time, the logical value True is returned. By sorting by similarity, the model lines existing in the database can be screened out to prepare for calling the packaging solution of the corresponding model of EPS decorative lines in the operating system. If there is no picture with a matching degree higher than 92%, it means that there is no EPS decorative line image and data matching the model of EPS decorative line to be tested in the database. At this time, False is returned and another branch of the program is entered. At this time, the coordinates of the important feature points of the EPS decorative line and their real coordinates in the world coordinate system are detected and returned to achieve the effect of generating a matching packaging solution and controlling the roller to perform corresponding operations.
[0130] Step three, extracting the model outline of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model outline based on the Shi-Tomasi operator; Figure 6 shown.
[0131] Edge detection is achieved through the canny algorithm, the model contour is extracted, and the contour is fitted by the least squares method. Then the corner points are detected by the Shi-Tomasi corner point detection algorithm. In the Shi-Tomasi algorithm, based on the principle that the stability of the corner points is related to the smaller eigenvalue of the matrix M, the smaller eigenvalue is used as a necessary condition, which effectively avoids the problem of selecting the k value. The improved Shi-Tomasi algorithm formula principle is as follows:
[0132] R=min(λ1,λ2) (2)
[0133] During the detection process, the corner detection algorithm will generate a rectangular area in the image and calculate the sum of all pixel values in the rectangular area. Then it will move the area and calculate the sum of pixel values in the next rectangular area. If the calculated pixel values in the two rectangular areas before and after the move are very different, it is considered that the original area before the move has corners that need to be detected, otherwise it is considered that there are no corners that need to be detected in the original area. Figure 7 , Figure 8 and Fig. 9 shown.
[0134] The corner points currently detected can be divided into concave corner points and yang corner points according to whether they are concave or convex. The corner points of special concern among all corner points are concave corner points, that is, concave corner points. During the wrapping process, convex corner points are easy to get better wrapping effects, but concave corner points are more likely to have loose wrapping and gaps. Therefore, special attention should be paid to concave corner points during the wrapping process. This method is based on the fact that most EPS decorative lines have rich shapes on the upper surface of the EPS decorative lines, and therefore the concave points all exist on the upper surface of the EPS decorative lines. A corner point classification scheme is designed to achieve the classification of concave corner points and yang corner points.
[0135] In the concave part of the EPS decorative line, in its image, take two points on the contour near the point, located on both sides of the point and close to the point, connect the two points to generate a straight line, and the concave point is located below the straight line. In the geometric relationship under the rectangular coordinate system, when the coefficient of the straight line function y is negative, if the result obtained after substituting the coordinates is greater than 0, it means that it is located below the image. However, due to the different regulations on the positive direction of the coordinate system, the judgment process is completely opposite, that is, when the result is less than 0, it means that the point is located below the image, which means that the point is a negative corner point of the image.
[0136] Step 4: Based on the OpenCV library, the internal and external parameters of the camera used to collect the image are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established;
[0137] (1) Camera calibration model establishment, including the following four important coordinate systems and three important transformation methods:
[0138] (a) World coordinate system. The position coordinates of the world coordinate system are (x w ,y w ,z w ), is the real coordinate in the coordinate system established in the real world;
[0139] (b) Camera coordinate system
[0140] The camera coordinate system refers to the coordinate system formed with the camera center as the origin, and its coordinates are expressed as (X c ,Y c ,Z c ), which can be obtained by rigid body transformation of the world coordinate system coordinates.
[0141] (c) Image coordinate system
[0142] The coordinates of the image coordinate system are expressed as (x, y). The image coordinate system can be obtained by trigonometric transformation of the camera coordinate system. The coordinate system takes the intersection of the optical axis and the image plane as the origin and is in millimeters.
[0143] (d) Pixel coordinate system
[0144] The pixel coordinate system is obtained by transforming the image coordinate system. The coordinates are expressed as (u, v). The coordinate system takes the upper left corner of the image as the origin. u and v represent the column and row numbers of the pixel in the digital chart respectively. Pixels are usually used as the coordinate unit to describe the physical size and position of the image.
[0145] The above four coordinate systems can realize the conversion of coordinates between different coordinate systems through the relationship between each other. The conversion from the world coordinate system to the camera coordinate system is mainly realized through rigid body change, that is, only rotation and translation transformation occur. The change process can be roughly described as:
[0146]
[0147] The process of converting from the camera coordinate system to the image coordinate system is mainly achieved through triangular similarity transformation.
[0148] Through the offset of coordinates, the transformation from the image coordinate system to the pixel coordinate system can be achieved. Fig.10 shown.
[0149]
[0150] in:
[0151]
[0152] In the formula, (u0, v0) represents the offset of the origin of the image coordinate system relative to the origin of the pixel coordinate system, and dx, dy represents the size of each pixel.
[0153] The purpose of camera calibration is to solve the parameters of all matrices in the above formula, that is, to solve the internal and external parameters of the camera. The f, dx, and dy in the formula cannot be obtained by direct calibration, but f can be obtained through camera calibration. x ,f y .
[0154] Combining the above formula, the final conversion formula is:
[0155]
[0156] Where:
[0157]
[0158] In the actual application of machine vision, the internal and external parameters of the camera may affect the final research results. The above formula mainly explains the influence of the camera external parameters, namely the translation matrix and rotation matrix, and the camera internal parameters, namely the camera focal length, on the final experimental results. By directly or indirectly solving the above parameters, theoretically, the conversion between different coordinate systems can be achieved.
[0159] (2) Camera calibration model solution
[0160] This method uses a 12×9 chessboard calibration plate to calibrate the camera, and uses the OpenCV library and Python language to solve the camera's internal and external parameters. After processing, the internal parameter matrix is obtained:
[0161]
[0162] The distortion parameters of the camera are: k1=0.324242681, k2=-2.18543749, p1=-0.000966342267, p2=-0.000839539629, k3=4.95031381. The parameters k1, k2, p1, p2, k3 in the obtained distortion parameters correspond to the parameter values in formulas 1-12.
[0163] However, in actual applications, some cameras are affected by their own quality issues, and the pictures they take may be distorted. For this type of camera, during the camera calibration process, it is also necessary to consider the impact of the distortion parameters on the final experimental results.
[0164] The distortion parameters include radial distortion coefficient and tangential distortion coefficient. The distortion in the image needs to be corrected during the camera calibration process.
[0165] Radial distortion is caused by the additive lens shape, distributed along the radial direction of the lens, and more curved away from the center of the lens. It can be described by a mathematical polynomial as follows:
[0166]
[0167] Where k1, k2, k3 represent radial distortion parameters, which are camera internal parameters.
[0168]
[0169] Combining formulas (14) and (15), the distortion formula can be obtained as follows:
[0170]
[0171] Step 5: Based on the conversion relationship, the coordinate information of each corner point is converted into the coordinate information of the EPS line in the world coordinate system to complete the visual recognition of the mesh cloth wrapping machine.
[0172] Obtain the external parameters of the camera about the plane where the EPS line cross-section profile is located, that is, the rotation matrix and translation matrix obtained through camera calibration are:
[0173]
[0174] Formula (12) represents the rotation matrix, and formula (13) represents the translation matrix.
[0175] The simulation verification of the present invention:
[0176] The coordinate transformation mentioned in this method mainly transforms the coordinates in the pixel coordinate system into the coordinates in the world coordinate system. Formula (6) illustrates the transformation method of coordinates in different coordinate systems. The real coordinates in the world coordinate system can be deduced by the inverse operation of formula (6).
[0177] Through the joint verification of the interactive corner detection method and the Shi-Tomasi-based corner detection method, it can be jointly proved that the corner point coordinates in the pixel coordinate system are real and valid. During the verification process, it was found that the results obtained by the two corner detection methods are basically the same. Since the corner point information obtained by the Shi-Tomasi algorithm has no strict order, in order to facilitate the detection of the authenticity of the coordinate conversion information, the mouse callback function is combined with the coordinate conversion function to obtain the real coordinate value of the feature point.
[0178] During the calibration process, there is a picture in which the relative position relationship between the camera and the calibration plate is the same as the position relationship between the camera and the EPS decorative line when the picture is taken. The establishment of the world coordinate system is also based on this picture. Therefore, it is not easy to directly determine the coordinate conversion effect in the world coordinate system through coordinate comparison. The coordinate conversion effect can be indirectly obtained through the distance and angle between the corner points. If these two indicators are within a reasonable range, it can also be proved that the roller can perform the mesh cloth wrapping operation normally. Since single-target calibration lacks depth information, the measured coordinate value is not completely equivalent to the real value, but the result has a certain relationship with the real coordinate. There is a certain proportional relationship between the distance between the corner points and the real distance. The coordinate conversion effect can be indirectly verified by measuring the distance and angle.
[0179] Table 1 Coordinates of corner points in the world coordinate system
[0180]
[0181] Select a data that can basically achieve a small difference between the converted distance and the actual distance. After the camera is calibrated, the proportional coefficient between the distance value returned in the world coordinate system and the actual measured distance value is 210.0458. Based on this, the actual returned distance value and angle can be obtained. Under the premise that the relative position of the camera and the target to be measured does not change, the proportional coefficient remains basically unchanged.
[0182] Table 2 Coordinate transformation effect detection
[0183]
[0184]
[0185] The errors in distance and angle come from multiple factors, such as measurement errors, corner point drawing errors during corner detection, and errors caused by the lack of depth information in the algorithm. The distance error is within 1mm, and the angle error is within 3°. Overall, the detection effect can achieve the expected effect.
[0186] By testing the quality of various types of EPS decorative lines, the coordinate conversion effect can be tested. Four groups of EPS decorative lines are selected, and 5 groups of length and angle data are selected for each group of lines. The results are shown in the following table.
[0187] Table 3 Corner point coordinate transformation results verification
[0188]
[0189] It can be seen from the table data that the corner point coordinate conversion effect is relatively good, and the error is basically within the controllable range.
[0190] In summary, the visual recognition method of mesh cloth wrapping machine based on OpenCV has good feature point recognition ability, which can extract the physical position information of feature points within the error range and be used in the mesh cloth wrapping process to better realize the preset functions, such as Fig.11 shown.
[0191] See also Fig.12 The embodiment of the present invention further discloses a visual recognition system for a mesh cloth wrapping machine based on OpenCV, comprising:
[0192] An image acquisition module is used to acquire an image of the EPS line to be wrapped and pre-process the image to obtain a binary image;
[0193] A corner point coordinate information acquisition module is used to extract the model contour of the EPS line to be wrapped based on the binary image, and to extract the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0194] The conversion relationship establishment module obtains the internal and external parameters of the camera used to collect images based on the OpenCV library, and establishes the conversion relationship between the pixel coordinate system and the world coordinate system;
[0195] The coordinate information conversion module converts the coordinate information of each corner point into the coordinate information of the EPS line in the world coordinate system based on the conversion relationship to complete the visual recognition of the mesh cloth wrapping machine.
[0196] See also Fig.13 The third object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the visual recognition method of a mesh cloth wrapping machine based on OpenCV are implemented.
[0197] The OpenCV-based visual recognition method for a mesh cloth wrapping machine comprises the following steps:
[0198] Collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image;
[0199] Extracting the model contour of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0200] Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established;
[0201] Based on the conversion relationship, the coordinate information of each corner point is converted into the coordinate information of the EPS line in the world coordinate system to complete the visual recognition of the mesh cloth wrapping machine.
[0202] The fourth object of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the visual recognition method of a mesh cloth wrapping machine based on OpenCV are implemented.
[0203] The OpenCV-based visual recognition method for a mesh cloth wrapping machine comprises the following steps:
[0204] Collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image;
[0205] Extracting the model contour of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator;
[0206] Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established;
[0207] Based on the conversion relationship, the coordinate information of each corner point is converted into the coordinate information of the EPS line in the world coordinate system to complete the visual recognition of the mesh cloth wrapping machine.
[0208] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0209] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0210] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0211] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0212] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A visual recognition method for a mesh cloth wrapping machine based on OpenCV, characterized in that: include: Collecting an image of the EPS line to be wrapped, and preprocessing the image to obtain a binary image; Extracting the model contour of the EPS line to be wrapped based on the binary image, and extracting the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator; Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established; Based on the conversion relationship, the coordinate information of each corner point is converted into the coordinate information of the EPS line in the world coordinate system to complete the visual recognition of the mesh cloth wrapping machine.
2. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 1 is characterized in that: After preprocessing the image to obtain a binary image, the method further includes: Based on the hash algorithm, the binary image is compared with the image in the existing EPS line database. If the same image exists, the coordinate information of the EPS line corresponding to the same image in the EPS line database is directly called; if the same object does not exist, continue with the subsequent steps.
3. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 2 is characterized in that: The comparison of the binary image with the image in the existing EPS line database based on the hash algorithm is specifically as follows: The final result of the hash algorithm is obtained through the calculation result of the Hamming distance. The hash value calculation function is constructed using the Python language and the OpenCV open source library: The binary image is reduced in size and simplified in color using the OpenCV open source library; Calculate the pixel mean. When calculating the Hamming distance, the data in the two lists to be compared only consists of binary data 0 and 1. The process of converting specific numerical values into binary data is based on the comparison results of all pixel value data with a specific threshold. In the hash algorithm, the mean of all pixel values is used as the threshold. Construct a one-dimensional perceptual hash value table, construct a feature matrix based on the relationship between the pixel value and the mean value in the image, compare the image with a specific value, and get a logical value of True or False. According to the returned logical value, convert the logical value into an integer value through astype(int) to construct a feature matrix; the perceptual hash value at this time is a two-dimensional array. To simplify the subsequent algorithm, the two-dimensional array can be processed into a one-dimensional array through the flatten function; Encapsulation function, when retrieving an image, it is necessary to extract the perceptual hash value of the retrieved image, and also to extract the perceptual hash values of all images in the graphics library. In order to extract more conveniently, all the above functions need to be encapsulated; Read all images in the existing EPS line database through the Glob library, call the encapsulated perceptual hash value calculation function, calculate the perceptual hash value of each image, and provide data for the subsequent calculation of the Hamming distance between the target image to be tested and each image in the folder; When the external conditions such as background environment, shooting distance, focal length, rotation and translation are not too different, there is a big difference between the similarity of photos of completely identical EPS decorative lines and the similarity of photos of highly similar but different EPS decorative lines. Based on this difference, a basic specific value can be determined, and the decision can be made by comparing the similarity with the specific value. After the operation, the Hamming distance between the newly collected binary image and each sample in the existing EPS line database is obtained. In order to intuitively obtain the similarity of the pictures, the above data is processed; The similarity calculation formula is: Wherein, s represents similarity; t represents the total pixel value. When the image is processed with a size of 10×10, the total pixel value of the image is 100; h represents the Hamming distance, which is specifically expressed as the difference between images; th represents the similarity value of the images. The total calculation formula represents the similarity of the images in the form of a percentage; 92% is used as the judgment threshold. If the similarity is greater than 92%, it proves that the similarity is high, and it is determined that there is an image in the existing EPS line database that matches the EPS decorative line to be tested.
4. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 1, characterized in that: The image is preprocessed to obtain a binary image as follows: Reduce the size of the image based on the downsampling method in the image pyramid; Smooth the image and remove noise through Gaussian filtering; The binary image of EPS line contour is obtained by threshold segmentation.
5. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 1, characterized in that: The model contour of the EPS line to be wrapped is extracted based on the binary image, and the coordinate information of each corner point of the model contour is extracted based on the Shi-Tomasi operator: Edge detection is achieved through the canny algorithm, the model contour is extracted, and the contour is fitted by the least squares method; then the corner points are detected by the Shi-Tomasi corner point detection algorithm. In the Shi-Tomasi algorithm, based on the principle that the stability of the corner points is related to the smaller eigenvalue of the matrix M, the smaller eigenvalue is used as a necessary condition, which effectively avoids the problem of selecting the k value; the improved Shi-Tomasi algorithm formula principle is as follows: R=min(λ1,λ2) (2) During the detection process, the corner detection algorithm will generate a rectangular area in the image and calculate the sum of all pixel values in the rectangular area. Then, the area will be moved and the sum of pixel values in the rectangular area of the next area will be calculated. If the calculated pixel values in the two rectangular areas before and after the move are very different, it is considered that the original area before the move has corner points that need to be detected, otherwise it is considered that there are no corner points that need to be detected in the original area. Usually, the detected corner points can be divided into negative corner points and positive corner points according to whether they appear concave or convex. The corner points of special concern among all corner points are negative corner points, that is, concave corner points. In the concave places on the upper surface of the EPS decorative lines, in its image, two points on the contour near the point that are located on both sides of the point and close to the point are taken, and the two points are connected to generate a straight line, and the concave point is located below the straight line. In the geometric relationship under the rectangular coordinate system, when the coefficient of the straight line function y is negative, if the result is greater than 0 after substituting the coordinates, it means that it is located below the image. However, due to the different positive direction regulations of the coordinate system, the judgment process is completely opposite, that is, when the result is less than 0, it means that the point is located below the image, which can be said to be a negative corner point of the image.
6. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 5 is characterized in that: Based on the OpenCV library, the internal and external parameters of the camera used to collect images are obtained, and the conversion relationship between the pixel coordinate system and the world coordinate system is established as follows: The camera calibration model is established, including the following four important coordinate systems and three important transformation methods: World coordinate system, the position coordinates of the world coordinate system are (x w ,y w ,z w ), which is the real coordinate in the coordinate system established in the real world; Camera coordinate system, camera coordinate system refers to the coordinate system formed with the camera center as the origin, and its coordinates are expressed as (X c ,Y c ,Z c ); Image coordinate system: The coordinates of the image coordinate system are expressed as (x, y). The image coordinate system can be obtained by trigonometric transformation of the camera coordinate system. The coordinate system takes the intersection of the optical axis and the image plane as the origin and is in millimeters. Pixel coordinate system: The pixel coordinate system is obtained by changing the image coordinate system. The coordinates are expressed as (u, v). The coordinate system takes the upper left corner of the image as the origin. u and v represent the number of columns and rows of pixels in the digital chart, respectively. Pixels are usually used as coordinate units to describe the physical size and position of the image. The above four coordinate systems can realize the transformation of coordinates between different coordinate systems through the relationship between each other; the transformation from the world coordinate system to the camera coordinate system is mainly realized by rigid body change, that is, only rotation and translation transformation occur; the change process is described as: The process of converting from the camera coordinate system to the image coordinate system is mainly achieved through triangular similarity changes; the conversion from the image coordinate system to the pixel coordinate system is achieved through the offset of coordinates; in: In the formula, (u0, v0) represents the offset of the origin of the image coordinate system relative to the origin of the pixel coordinate system, and dx, dy represents the size of each pixel; The purpose of camera calibration is to solve the parameters of all matrices in the above formula, that is, to solve the internal and external parameters of the camera. The f, dx, and dy in the formula are obtained through camera calibration. x ,f y ; Combining the above formula, the final conversion formula is: Where: Camera calibration model solution: A 12×9 chessboard calibration plate is used to calibrate the camera. The internal and external parameters of the camera are solved with the help of OpenCV open source library and Python language. After processing, the internal parameter matrix is obtained: The distortion parameters of the camera are: k1 = 0.324242681, k2 = -2.18543749, p1 = -0.000966342267, p2 = -0.000839539629, k3 = 4.95031381, and the parameters k1, k2, p1, p2, k3 in the obtained distortion parameters correspond to the parameter values in formula (11); Obtain the external parameters of the camera about the plane where the EPS line cross-section profile is located, that is, the rotation matrix and translation matrix obtained through camera calibration are: Formula (12) represents the rotation matrix, and formula (13) represents the translation matrix.
7. The visual recognition method of mesh cloth wrapping machine based on OpenCV according to claim 6 is characterized in that: The calculation of the distortion parameters is specifically as follows: Distortion parameters include radial distortion coefficient and tangential distortion coefficient. The distortion in the image needs to be corrected during camera calibration. Radial distortion is caused by the shape of the additive lens. It is distributed along the radial direction of the lens and is more curved away from the center of the lens. It can be described by a mathematical polynomial as follows: Where k1, k2, k3 represent radial distortion parameters, which are camera internal parameters; Combining formulas (14) and (15), the distortion formula is as follows:
8. A visual recognition system for mesh cloth wrapping machine based on OpenCV, characterized in that: include: An image acquisition module is used to acquire an image of the EPS line to be wrapped and pre-process the image to obtain a binary image; A corner point coordinate information acquisition module is used to extract the model contour of the EPS line to be wrapped based on the binary image, and to extract the coordinate information of each corner point of the model contour based on the Shi-Tomasi operator; The conversion relationship establishment module obtains the internal and external parameters of the camera used to collect images based on the OpenCV library, and establishes the conversion relationship between the pixel coordinate system and the world coordinate system; The coordinate information conversion module converts the coordinate information of each corner point into the coordinate information of the EPS line in the world coordinate system based on the conversion relationship to complete the visual recognition of the mesh cloth wrapping machine.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the OpenCV-based visual recognition method for a mesh cloth wrapping machine as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the visual recognition method for a mesh cloth wrapping machine based on OpenCV according to any one of claims 1 to 7.
Citation Information
Patent Citations
Depth extraction method based on monocular vision
CN109035320A
A method for detecting the camber of plates based on machine vision
CN109190628A
A robot article sorting visual detection method based on a deep neural network
CN109685141A
Visual system for four-axis industrial palletizing robot
CN111604909A
Method and system for quickly identifying goods shelf grids based on visual identification, and medium
CN114897998A