Pipelined product image rectification method, device, equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN HAIWEI TECH CO LTD
- Filing Date
- 2023-12-19
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]本发明的主要目的在于提供一种流水线产物图像矫正方法,旨在解决流水线上的产物因不规则运动而导致的生产图像产生扭曲的问题
[0016]本发明通过获取流水线上载盘的实时图像,将载盘的实时图像拆分为矫正参考图像与待矫正图像;将矫正参考图像进行等宽拆分,得到多个矫正参考子图像;获取每一个矫正参考子图像的行特征参数,根据行特征参数按照,得到矫正参数序列;根据矫正参数序列,对待矫正图像进行矫正,得到矫正后的产物图像。上述方法通过线性相机拍摄和基于矫正参考图像的方法,可以有效地对产物图像进行矫正,消除由于流水线速度引起的扭曲,从而得到准确无误的图像数据,实现了流水线上产物的自动识别、定位和质量检测,提高了生产效率和生产观察精度。
Smart Images

Figure CN118115402B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated production technology, and in particular to a method, apparatus, equipment and storage medium for image correction of products on an assembly line. Background Technology
[0002] In modern manufacturing, the widespread application of intelligent manufacturing technologies has become an important means to improve production efficiency and product quality. Among them, automation technology and vision processing technology are widely used for product observation, identification, and quality control in assembly line production processes.
[0003] However, in actual assembly line production, the products on the line are not stationary but move irregularly as the line operates. This affects the cameras used for production observation when capturing images of the products. Because the products experience image distortion related to their direction of movement, the images acquired by the cameras are distorted, thus impacting the machine vision system's ability to accurately identify and analyze the products.
[0004] Therefore, the technical challenge lies in how to effectively handle image distortion caused by irregular movement of products through image processing and intelligent analysis algorithms, thereby ensuring accurate product image data and enabling accurate observation, identification, and quality control of products on the production line. Summary of the Invention
[0005] The main objective of this invention is to provide a method for correcting images of products on an assembly line, which aims to solve the problem of distortion in production images caused by irregular movement of products on an assembly line.
[0006] To achieve the above objectives, the present invention provides a method for image correction of production line products, comprising: Acquire real-time images of the loading tray on the production line, and split the real-time images of the loading tray into a correction reference image and an image to be corrected; The correction reference image is divided into multiple correction reference sub-images by dividing it into equal-width segments; Obtain the row feature parameters of each correction reference sub-image, and obtain the correction parameter sequence based on the row feature parameters; The image to be corrected is corrected according to the correction parameter sequence to obtain the corrected product image.
[0007] Optionally, acquiring a real-time image of the loading tray on the production line, and splitting the real-time image of the loading tray into a correction reference image and an image to be corrected, includes: When the carrier tray is detected to be in the shooting area, the production line is photographed by a linear camera to obtain a real-time image of the carrier tray; The real-time image is divided into a correction reference image and an image to be corrected, wherein the width of the correction reference image is between the width of the correction reference region and the width of the reference image.
[0008] Optionally, the step of splitting the correction reference image into multiple correction reference sub-images of equal width includes: Based on the vertical resolution of the linear camera, determine the upper limit of the number of divisible rows of the correction reference image; The preset split row width is determined based on the upper limit of the number of splittable rows and the graphic parameters of the reference image; The correction reference image is split along the direction of the pipeline movement according to the preset image row width to obtain multiple correction reference sub-images.
[0009] Optionally, obtaining the row feature parameters of each corrected reference sub-image and obtaining the correction parameter sequence based on the row feature parameters includes: The grayscale value of the correction reference sub-image is detected in the direction perpendicular to the direction of the pipeline movement to obtain a grayscale value distribution image in which the grayscale value of the correction reference sub-image is associated with the detection direction coordinates. Based on the grayscale value distribution image of the correction reference sub-image, a correction reference sub-image containing the reference reference image is determined; Feature analysis is performed on the grayscale value distribution image of the corrected reference sub-image containing the reference image to obtain the row feature parameters of the corrected reference sub-image corresponding to the grayscale value distribution image; The row feature parameters of the corrected reference sub-image containing the reference reference image are arranged in row order to obtain the corrected parameter sequence.
[0010] Optionally, the step of performing feature analysis on the grayscale distribution image of the corrected reference sub-image containing the reference reference image to obtain the row feature parameters of the corrected reference sub-image corresponding to the grayscale distribution image includes: Based on the grayscale value distribution image, a grayscale value distribution sequence with respect to the detection direction coordinates is obtained; Calculate the graphical deformation of the corrected reference sub-image corresponding to the grayscale value distribution sequence; Based on the graphical deformation, the row feature parameters of the corrected reference sub-image are determined.
[0011] Optionally, the image to be corrected is corrected according to the correction parameter sequence to obtain a corrected product image, including: According to the preset splitting line width, the image to be corrected is split along the pipeline movement direction to obtain multiple product sub-images; According to the correction parameter sequence, the product sub-images of the corresponding row sequence are translated, and the translated product sub-images are stitched together to obtain a stitched image. The stitched image is then cropped to the same width. The processed stitched image is then subjected to Gaussian filtering to obtain the corrected product image.
[0012] Optionally, the carrier disk is divided into a correction reference area and a product area; the reference image is set in the correction reference area, and the shorter side of the reference reference image is greater than the maximum diameter of the product; the product is fixed to the product area of the carrier disk.
[0013] Furthermore, the present invention provides an image correction device for production line products, comprising: The image processing module is used to acquire real-time images of the loading tray on the production line and to split the real-time images of the loading tray into a correction reference image and an image to be corrected. The image processing module is further configured to split the correction reference image into multiple correction reference sub-images by equal width. The correction parameter calculation module is used to obtain the row feature parameters of each correction reference sub-image and obtain the correction parameter sequence based on the row feature parameters; The image correction module is used to correct the image to be corrected according to the correction parameter sequence to obtain the corrected product image.
[0014] Furthermore, the present invention provides a production line product image correction device, the production line product image correction device comprising: a memory, a processor, and a production line product image correction program stored in the memory and executable on the processor, the production line product image correction program being configured to implement the steps of any of the production line product image correction methods described herein.
[0015] Furthermore, the present invention provides a storage medium storing a production line product image correction program, wherein when the production line product image correction program is executed by a processor, it implements the steps of any of the production line product image correction methods described above.
[0016] This invention acquires real-time images of the loading tray on the production line, then splits these images into a correction reference image and an image to be corrected. The correction reference image is then divided into multiple correction reference sub-images of equal width. Row feature parameters of each correction reference sub-image are obtained, and a correction parameter sequence is derived based on these parameters. The image to be corrected is then corrected according to the correction parameter sequence to obtain the corrected product image. This method, using a linear camera and a correction reference image-based approach, effectively corrects the product image, eliminating distortions caused by production line speed, thus obtaining accurate image data. This enables automatic identification, positioning, and quality inspection of products on the production line, improving production efficiency and observation accuracy. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of the production line product image correction device, which is part of the hardware operating environment of the production line product image correction method of the present invention. Figure 2 This is a flowchart illustrating the first embodiment of the production line product image correction method of the present invention. Figure 3 This is a flowchart illustrating the second embodiment of the production line product image correction method of the present invention. Figure 4 This is a schematic diagram showing the location of the relevant equipment in the production line of this invention; Figure 5 This is a flowchart illustrating the third embodiment of the production line product image correction method of the present invention. Figure 6 This is a flowchart illustrating the fourth embodiment of the production line product image correction method of the present invention. Figure 7 This is a structural block diagram of the first embodiment of the production line product image correction method of the present invention.
[0018] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0020] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the pipeline product image correction device in the hardware operating environment involved in the embodiments of the present invention.
[0021] like Figure 1As shown, the image correction device for the production line product may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0022] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the image correction equipment for production line products and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0023] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and an image correction program for production line products.
[0024] exist Figure 1 In the illustrated production line product image correction device, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the production line product image correction device of the present invention can be set in the production line product image correction device, and the production line product image correction device calls the production line product image correction program stored in the memory 1005 through the processor 1001 and executes the production line product image correction method provided in the embodiment of the present invention.
[0025] This invention provides a method for correcting images of production line products, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the production line product image correction method of the present invention.
[0026] The method for correcting images of production line products includes: Step S10: Obtain a real-time image of the loading tray on the production line, and split the real-time image of the loading tray into a correction reference image and an image to be corrected.
[0027] It should be noted that the production line and the carrier are not completely fixed together; they move together by friction. Therefore, the carrier may move in different directions and at different speeds than the production line. Also, since industrial cameras take pictures with a certain exposure time and shutter speed, when the subject moves differently, the resulting image will be distorted or stretched along the direction of movement.
[0028] Understandably, the root cause of this image distortion is the inability to ensure that the product moves at a constant speed for stable shooting by an industrial camera. At the production line level, maintaining a stable movement of the product on the assembly line places very high demands on both the production line and the product itself, resulting in excessively high costs. On the other hand, using industrial cameras with faster shutter speeds and shorter exposure times can reduce image distortion caused by irregular movements, but this also increases hardware costs. Furthermore, while such industrial cameras reduce image distortion caused by irregular movements, they cannot simultaneously guarantee image accuracy and meet the final requirements.
[0029] It should be understood that due to the high cost of hardware solutions, this solution addresses the aforementioned problems to some extent by setting up a reference image on the production line, combining it with appropriate software algorithms for image correction, and in conjunction with lower-cost hardware modifications. Because there is relative motion between the production line and the product, a carrier tray is placed on the production line to ensure that the reference image and the product image exhibit the same image deformation. The product is fixed on the tray, and a correction image for reference is placed on the tray. After an industrial camera captures real-time production line footage, the resulting image is divided into a reference image and a product image. Various deformation elements in the reference image are identified, and then the product image is restored at the corresponding position, resulting in a distortion-free product image.
[0030] Step S20: Divide the correction reference image into equal-width sub-images to obtain multiple correction reference sub-images.
[0031] It should be noted that, in order to ensure that the reference image of the corresponding area on the carrier disk is fully captured, the actual size of the correction reference image is larger than that of the reference image. Also, considering that the carrier disk will undergo some irregular movement, the actual correction reference image must have sufficient redundancy space in order to fully capture the reference image that has undergone deformation. Therefore, it must contain some image content other than the reference reference image.
[0032] Understandably, after obtaining the correction reference image, a linear camera was chosen for the industrial shooting. A linear camera is a special type of camera. Unlike traditional cameras, it has only one-dimensional pixel arrangement on its image sensor, rather than a two-dimensional array. Its main characteristic is that a linear camera can capture image data at high speed in a single direction and achieve high resolution along a single axis. This allows for high-resolution imaging of long objects or continuous scenes. Therefore, it is clear that a linear camera captures images line by line. In the vertical direction along the assembly line, the object does not deform. In other words, the overall image is a combination of translational distortions in each line. Although the shape of the image changes, it can be obtained by translating it back line by line in the same way as the reference image.
[0033] It should be understood that the direction of splitting is consistent with the direction of the pipeline movement. In order to ensure the accuracy of correction, the size of the sub-images should be the same when splitting the correction reference image into multiple rows of sub-images, that is, the splitting should be of equal width. At the same time, the characteristics of the reference image should be taken into account. The smaller the width of the split, the more realistic the final corrected image will be.
[0034] Step S30: Obtain the row feature parameters of each correction reference sub-image, and obtain the correction parameter sequence based on the row feature parameters.
[0035] It should be noted that, for each sub-image, by combining the image characteristics of the original reference image, it is possible to determine what kind of deformation has occurred in each row direction of the distorted reference image, and the degree of deformation. Based on these changes, unique row feature parameters for each sub-image are obtained. Through the row feature parameters of each row image, the correction parameter sequence of the entire correction reference image can be obtained, and the correction parameter sequence can be applied to the correction of the product image in row order.
[0036] Step S40: Correct the image to be corrected according to the correction parameter sequence to obtain the corrected product image.
[0037] It is understandable that the process of restoring each row of the correction reference sub-image to the reference reference image of the corresponding row will correspond to the row feature parameters of that row. The corresponding row of the product image can be identified by the same row sequence, and the same correction can be performed on it. When the correction reference image is restored to the reference reference image, the corresponding image to be corrected can also be restored to the actual product image.
[0038] It should be understood that since only the portion containing the reference image can determine how the corresponding row has changed, the size of the reference image on the disk should be based on the actual size of the product to avoid the inability to perform corrections because the row position corresponding to the product image does not contain the reference image.
[0039] In this embodiment, by setting a reference image on the production line and combining it with an appropriate software algorithm for image correction, specifically by analyzing the features of each row of images and applying a sequence of correction parameters, the image to be corrected can be effectively corrected, improving the accuracy and correction precision of the image. This can solve the problem of image distortion caused by irregular movement of products to a certain extent, and does not require significant production line modifications or high-cost hardware equipment.
[0040] Reference Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the production line product image correction method of the present invention.
[0041] Based on the first embodiment described above, step S10 in the automated production line product image correction method of this embodiment includes: Step S101: When the carrier tray is detected to appear in the shooting area, the production line is photographed by a linear camera to obtain a real-time image of the carrier tray.
[0042] It should be noted that sensors can be installed on the carrier tray, and related equipment is installed in the imaging area of the production line. When a sensor signal on the carrier tray is detected, a signal is sent to the imaging equipment, which then captures images of the imaging area according to predetermined parameters. Since line scan cameras are more suitable for high-speed imaging of fast-moving targets and high-resolution imaging requirements on industrial production lines, while also offering relatively low cost and more efficient space utilization, a linear camera is preferred as the imaging equipment in this embodiment.
[0043] Furthermore, the carrier disk is divided into a correction reference area and a product area; the reference image is set in the correction reference area, and the shorter side of the reference reference image is greater than the maximum diameter of the product; the product is fixed to the product area of the carrier disk.
[0044] It is understandable that the subject of the photograph is the image on the disc appearing in the photographing area, and the specific scene is as follows: Figure 4As shown, the product is fixed on the product area of the carrier disk, and the reference image is the black and white checkerboard image within the correction reference area. The black and white checkerboard image here is the reference image. Obviously, the reference image is only a part of the correction reference area, not a complete coverage. The purpose is to ensure that the image obtained after movement can completely contain the distorted reference image. At the same time, the size of the original reference image needs to be able to completely cover the size of the product in the image to ensure that the product image cannot be completely corrected due to incomplete parameters during subsequent correction.
[0045] Step S102: Divide the real-time image into a correction reference image and an image to be corrected, wherein the width of the correction reference image is between the width of the correction reference region and the width of the reference image.
[0046] It is understandable that, due to the irregular movement of the carrier disk, the effective content of the actual real-time image may be offset in different directions. Since the program cannot predict in advance which type of offset it is, in the process of cropping the image to obtain the images on both sides, it is necessary to leave a certain amount of cropping redundancy for the correction reference image and the image to be corrected. Therefore, the width of the correction reference image is between the width of the correction reference area and the width of the reference image.
[0047] Based on the first embodiment described above, step S20 in the automated production line product image correction method of this embodiment includes: Step S201: Determine the upper limit of the number of divisible rows of the correction reference image based on the vertical resolution of the linear camera.
[0048] It should be noted that when a linear camera captures images, it obtains a series of very narrow but very long images. These images may be only a few pixels wide in the direction of the pipeline movement, while in the vertical direction, they can be the same width as or even longer than those of a regular area scan camera. For most linear cameras, there is usually only one row of pixels in the vertical direction, so the vertical resolution can be said to be 1 pixel. This can be adjusted appropriately depending on equipment requirements and specific production needs. Once the vertical resolution of the linear camera and the length of the correction reference image in the pipeline movement direction are known, the number of rows of images combined in the correction reference image can be calculated. This determines the upper limit of the number of rows that can be split. The more rows split in subsequent steps, the more refined and accurate the correction of the product image. However, more rows mean longer system calculation time, affecting real-time performance. Therefore, the number of rows split needs to be adjusted according to specific requirements.
[0049] Step S202: Determine the preset split row width based on the upper limit of the number of splittable rows and the graphic parameters of the reference image.
[0050] Understandably, the lower limit of the preset split line width is determined by the accuracy of the line scan camera and the length of the correction reference image, while the upper limit is determined by the graphic parameters of the reference image, such as... Figure 4 As shown, since the reference image is a black and white checkerboard image, the part mainly used for image restoration is a uniformly distributed black and white grid of equal width. Therefore, in actual operation, it is still based on... Figure 4 For example, the preset split row width should not be wider than the side length of the black and white grid. When it exceeds this length, effective calibration will fail. This embodiment is based on a black and white checkerboard image as the reference image. In fact, the reference image is not limited to a black and white checkerboard image; other images with similar functions can be used. In actual operation, the corresponding graphic parameters can be reasonably used to provide a correction reference for the product image.
[0051] Step S203: The correction reference image is split along the direction of the pipeline movement according to the preset image row width to obtain multiple correction reference sub-images.
[0052] It should be noted that, due to the redundancy in the previous step to ensure image integrity, the correction reference sub-image in this step includes not only row images with checkerboard features but also row images without checkerboard features.
[0053] In this embodiment, when the carrier disk is detected to appear in the shooting area, a linear camera captures an image of the production line to obtain a real-time image of the carrier disk. The real-time image is divided into a correction reference image and an image to be corrected. The width of the correction reference image is between the width of the correction reference area and the width of the reference image. Then, based on the vertical resolution of the linear camera, the upper limit of the number of divisible rows of the correction reference image is determined. Based on the upper limit of the number of divisible rows and the graphic parameters of the reference image, a preset splitting row width is determined. The correction reference image is then split along the direction of the production line movement according to the preset image row width to obtain multiple correction reference sub-images. This achieves more refined correction and image processing, promotes efficient correction and repair of product images, and ensures real-time performance and accuracy through the capture and preprocessing of real-time images, thus providing a better foundation for subsequent image analysis and processing.
[0054] Reference Figure 5 , Figure 5 This is a flowchart illustrating the third embodiment of the production line product image correction method of the present invention.
[0055] Based on the first embodiment described above, step S30 in the automated production line product image correction method of this embodiment includes: Step S301: Perform grayscale value detection on the correction reference sub-image in the direction perpendicular to the pipeline movement direction to obtain a grayscale value distribution image of the correction reference sub-image that is associated with the detection direction coordinates.
[0056] It should be noted that after obtaining multiple correction reference sub-images arranged in row order, grayscale value detection is performed on each correction reference sub-image to... Figure 4 For example, in a standard 8-bit grayscale image, the grayscale value is usually between 0 and 255, where 0 represents black and 255 represents white. A grayscale value distribution image is constructed with the grayscale value as the vertical axis and the detection direction coordinate as the horizontal axis. When a continuous and uniform square wave appears in the image, it means that an alternating bright and dark scene has been identified, which is considered as detecting a checkerboard feature. When the feature does not appear in a certain sub-image, it can be considered that there is no checkerboard feature, and the image does not contain the reference image.
[0057] Step S302: Determine a correction reference sub-image containing the reference reference image based on the grayscale value distribution image of the correction reference sub-image.
[0058] It is understandable that after the grayscale detection of all rows of sub-images is completed, all correction reference sub-images can be filtered according to whether they contain checkerboard features, and the original redundant parts can be removed. At this time, the remaining correction reference sub-images are all correction reference sub-images containing the reference image. According to the row order of each image, the position that the original image needs to be adjusted can be determined.
[0059] Step S303: Perform feature analysis on the gray value distribution image of the corrected reference sub-image containing the reference image to obtain the row feature parameters of the corrected reference sub-image corresponding to the gray value distribution image.
[0060] It is understandable that the original grayscale distribution image does not have checkerboard features starting from the origin of the coordinate system. Instead, it detects a length of irregular grayscale values. When the image undergoes a sudden change and begins to have checkerboard features, that is, from this point onwards, it enters the reference image on the original correction reference sub-image. The coordinate length of the irregular grayscale curve on the grayscale image is also different in different sub-images, which represents the different left and right displacement deformations generated in that row.
[0061] Further, step S303 includes: obtaining a gray value distribution sequence with respect to the detection direction coordinates based on the gray value distribution image; calculating the graphic deformation of the correction reference sub-image corresponding to the gray value distribution sequence; and determining the row feature parameters of the correction reference sub-image based on the graphic deformation.
[0062] It should be noted that due to the characteristics of linear cameras, the image in the horizontal direction may have a positional shift, but there will be no deformation. Therefore, the length of the checkerboard feature of each row of sub-images is the same in the grayscale image. However, the length of the part from the starting point of the image to the starting point of the image part with the checkerboard feature varies depending on the position of the row. Therefore, each row will have a corresponding row feature parameter.
[0063] It is understandable that the gray value distribution image of each row, as a continuous image, can be transformed into a discrete gray value distribution sequence under appropriate precision requirements. At the same time, in the gray value distribution sequence, apart from the gray value abrupt changes caused by the alternation of black and white in the checkerboard pattern, the gray value abrupt changes at other positions can be used as the starting point of graphic deformation.
[0064] Step S304: Arrange the row feature parameters of the corrected reference sub-image containing the reference reference image according to the row order to obtain the correction parameter sequence.
[0065] It should be noted that the row feature parameters generated from the sub-image containing the reference image are arranged in row order to obtain the correction parameter sequence, and the row order will directly correspond to the part that is adjusted on the product image.
[0066] In this embodiment, grayscale value detection is performed on the correction reference sub-image along the direction perpendicular to the pipeline movement direction to obtain the grayscale value distribution image of the image and the grayscale value distribution image along the detection direction. Based on the grayscale value distribution image, a correction reference sub-image containing the reference image is determined. Then, feature analysis is performed on the grayscale value distribution image of this correction reference sub-image to obtain the row feature parameters of the correction reference sub-image corresponding to the grayscale value distribution image. The row feature parameters are arranged according to row order to obtain the correction parameter sequence. By calculating and analyzing the grayscale value distribution sequence, the equivalent deformation of the product image is obtained, which helps to understand the displacement and deformation of the image in the detection direction coordinates, providing an important reference and basis for subsequent image correction.
[0067] Reference Figure 6 , Figure 6 This is a flowchart illustrating the fourth embodiment of the production line product image correction method of the present invention.
[0068] Based on the first embodiment described above, step S40 in the production line product image correction method of this embodiment includes: Step S401: According to the preset splitting line width, the image to be corrected is split along the pipeline movement direction to obtain multiple product sub-images.
[0069] It should be noted that the preset split line width here is the same as the preset split line width used to split the correction reference image in the above steps. In other words, the correction reference image is split into a certain number of lines, and the image to be corrected is also split into product sub-images of the same width and the same number of lines.
[0070] Understandably, since the actual size of the product is smaller than the reference image, there is more redundant image generated relative to the correction reference area, but this can avoid correction loss due to uncertainty in the specific location.
[0071] Step S402: According to the correction parameter sequence, the product sub-images of the corresponding row sequence are translated, and the translated product sub-images are stitched together to obtain a stitched image.
[0072] Understandably, the correction parameter sequence is a series of correction parameters that mark the row order. Based on these parameters and the spacing of the function transformation sequence, the product sub-image corresponding to each correction parameter can be determined and adjusted accordingly. After the adjustment is completed, all the translated and adjusted product sub-images are stitched together to obtain a stitched image that is aligned vertically but not horizontally. However, the product images within the stitched image are normal and the distortion is corrected.
[0073] Step S403: Perform equal-width cropping on the stitched image.
[0074] Understandably, since the product image has been repaired, it is necessary to crop the "rough edges" on the left and right sides of the image to facilitate subsequent processing. In addition, a lot of redundancy was reserved in the previous steps. The cropping here can be done by first determining the innermost row of the image on the left and right sides of the stitched image, and using this as the base point for cropping, so that the cropped image is a complete rectangle.
[0075] Step S404: Perform Gaussian filtering on the processed stitched image to obtain the corrected product image.
[0076] It should be noted that after this step, due to the multiple image processing steps, the image may be somewhat distorted and noisy. Applying a Gaussian filter to the final stitched image can effectively reduce high-frequency noise in the image. This noise usually causes image details to be blurred or distorted. By blurring the high-frequency signals in the image, Gaussian filtering can make the image clearer and easier to analyze. In addition, Gaussian filtering can achieve a smoothing effect by blurring the image, thereby better highlighting the overall features of the image.
[0077] In this embodiment, the image to be corrected is split along the pipeline movement direction according to the preset splitting row width to obtain multiple product sub-images. Based on the correction parameter sequence, the product sub-images in the corresponding row order are translated, and the translated product sub-images are stitched together to obtain a stitched image. The stitched image is then subjected to equal-width cropping, and finally, Gaussian filtering is applied to the processed stitched image to obtain the corrected product image. After the correction process, the elements and structures in the product image become more uniform and neat, eliminating distortion and misalignment, making the image more consistent with reality and easier to understand and analyze.
[0078] like Figure 7 As shown, the image correction device for production line products proposed in this embodiment of the invention includes: Image processing module 10 is used to acquire real-time images of the loading tray on the production line and split the real-time images of the loading tray into a correction reference image and an image to be corrected. The image processing module 10 is further configured to split the correction reference image into multiple correction reference sub-images by equal width. The correction parameter calculation module 20 is used to obtain the row feature parameters of each correction reference sub-image and obtain the correction parameter sequence based on the row feature parameters. The image correction module 30 is used to correct the image to be corrected according to the correction parameter sequence to obtain the corrected product image.
[0079] In one embodiment, the image processing module 10 is further configured to, when a carrier disk is detected to appear in the shooting area, take a picture of the production line using a linear camera to obtain a real-time image of the carrier disk; divide the real-time image into a correction reference image and an image to be corrected, wherein the width of the correction reference image is between the width of the correction reference area and the width of the reference image.
[0080] In one embodiment, the image processing module 10 is further configured to determine the upper limit of the number of divisible rows of the correction reference image based on the vertical resolution of the linear camera; determine a preset splitting row width based on the upper limit of the number of divisible rows and the graphic parameters of the reference image; and split the correction reference image along the pipeline movement direction according to the preset image row width to obtain multiple correction reference sub-images.
[0081] In one embodiment, the correction parameter calculation module 20 is further configured to perform grayscale value detection on the correction reference sub-image in the direction perpendicular to the pipeline movement direction to obtain a grayscale value distribution image of the correction reference sub-image associated with the grayscale value of the detection direction coordinate; determine a correction reference sub-image containing the reference reference image based on the grayscale value distribution image of the correction reference sub-image; perform feature analysis on the grayscale value distribution image of the correction reference sub-image containing the reference reference image to obtain the row feature parameters of the correction reference sub-image corresponding to the grayscale value distribution image; and arrange the row feature parameters of the correction reference sub-image containing the reference reference image according to the row order to obtain a correction parameter sequence.
[0082] In one embodiment, the correction parameter calculation module 20 is further configured to obtain a gray value distribution sequence with respect to the detection direction coordinates based on the gray value distribution image; calculate the graphic deformation of the correction reference sub-image corresponding to the gray value distribution sequence; and determine the row feature parameters of the correction reference sub-image based on the graphic deformation.
[0083] In one embodiment, the image correction module 30 is further configured to: divide the image to be corrected along the pipeline movement direction according to the preset splitting row width to obtain multiple product sub-images; translate the product sub-images of the corresponding row order according to the correction parameter sequence; stitch the translated product sub-images together to obtain a stitched image; perform equal-width cropping processing on the stitched image; and perform Gaussian filtering processing on the processed stitched image to obtain the corrected product image.
[0084] Furthermore, to achieve the above objectives, the present invention provides a production line product image correction device, the production line product image correction device comprising: a memory, a processor, and a production line product image correction program stored in the memory and executable on the processor, the production line product image correction program being configured to implement the steps of the production line product image correction method.
[0085] Furthermore, to achieve the above objectives, the present invention provides a storage medium storing a production line product image correction program, wherein the production line product image correction program, when executed by a processor, implements the steps of the production line product image correction method.
[0086] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0087] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0088] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0089] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for correcting images of production line products, characterized in that, The method for correcting images of production line products includes: A real-time image of the carrier tray on the production line is acquired using a linear camera, and the real-time image of the carrier tray is split into a correction reference image and an image to be corrected. The correction reference image is divided into multiple correction reference sub-images with equal width, and the direction of the equal width division is consistent with the direction of the pipeline movement. Obtain the row feature parameters of each correction reference sub-image, and obtain the correction parameter sequence based on the row feature parameters; The step of obtaining the row feature parameters of each corrected reference sub-image and obtaining the correction parameter sequence based on the row feature parameters includes: The grayscale value of the correction reference sub-image is detected in the direction perpendicular to the direction of the pipeline movement to obtain a grayscale value distribution image in which the grayscale value of the correction reference sub-image is associated with the detection direction coordinates. Based on the grayscale value distribution image of the correction reference sub-image, a correction reference sub-image containing the reference reference image is determined; Feature analysis is performed on the grayscale value distribution image of the corrected reference sub-image containing the reference image to obtain the row feature parameters of the corrected reference sub-image corresponding to the grayscale value distribution image; The row feature parameters of the corrected reference sub-image containing the reference reference image are arranged in row order to obtain the corrected parameter sequence; The image to be corrected is corrected according to the correction parameter sequence to obtain the corrected product image.
2. The method for image correction of production line products according to claim 1, characterized in that, The step of acquiring a real-time image of the loading tray on the production line, and splitting the real-time image of the loading tray into a correction reference image and an image to be corrected, includes: When the carrier tray is detected to be in the shooting area, the production line is photographed by a linear camera to obtain a real-time image of the carrier tray; The real-time image is divided into a correction reference image and an image to be corrected, wherein the width of the correction reference image is between the width of the correction reference region and the width of the reference image.
3. The method for image correction of production line products according to claim 1, characterized in that, The step of splitting the correction reference image into multiple correction reference sub-images of equal width includes: The upper limit of the number of divisible rows of the corrected reference image is determined based on the vertical resolution of the linear camera; The preset split row width is determined based on the upper limit of the number of splittable rows and the graphic parameters of the reference image; The correction reference image is split along the direction of the pipeline movement according to the preset splitting row width to obtain multiple correction reference sub-images.
4. The method for image correction of production line products according to claim 1, characterized in that, The step of performing feature analysis on the grayscale distribution image of the corrected reference sub-image containing the reference reference image to obtain the row feature parameters of the corrected reference sub-image corresponding to the grayscale distribution image includes: Based on the grayscale value distribution image, a grayscale value distribution sequence with respect to the detection direction coordinates is obtained; Calculate the graphical deformation of the corrected reference sub-image corresponding to the grayscale value distribution sequence; Based on the graphical deformation, the row feature parameters of the corrected reference sub-image are determined.
5. The method for image correction of production line products according to claim 3, characterized in that, The image to be corrected is corrected according to the correction parameter sequence to obtain a corrected product image, including: According to the preset splitting line width, the image to be corrected is split along the pipeline movement direction to obtain multiple product sub-images; According to the correction parameter sequence, the product sub-images of the corresponding row sequence are translated, and the translated product sub-images are stitched together to obtain a stitched image. The stitched image is then cropped to the same width. The processed stitched image is then subjected to Gaussian filtering to obtain the corrected product image.
6. The method for image correction of production line products according to claim 1, characterized in that, The carrier disk is divided into a correction reference area and a product area; a reference image is set in the correction reference area, and the shorter side of the reference reference image is greater than the maximum diameter of the product; the product is fixed to the product area of the carrier disk.
7. An image correction device for production line products, characterized in that, The production line product image correction device includes: The image processing module is used to acquire real-time images of the loading tray on the production line through a linear camera, and to split the real-time images of the loading tray into a correction reference image and an image to be corrected. The image processing module is further configured to split the correction reference image into multiple correction reference sub-images with equal widths, wherein the direction of the equal width splitting is consistent with the direction of the pipeline movement. The correction parameter calculation module is used to obtain the row feature parameters of each correction reference sub-image and obtain the correction parameter sequence based on the row feature parameters. The correction parameter calculation module is further configured to perform grayscale value detection on the correction reference sub-image in the direction perpendicular to the pipeline movement direction to obtain a grayscale value distribution image of the correction reference sub-image associated with the grayscale value of the detection direction coordinate; determine a correction reference sub-image containing a reference image based on the grayscale value distribution image of the correction reference sub-image; perform feature analysis on the grayscale value distribution image of the correction reference sub-image containing the reference image to obtain the row feature parameters of the correction reference sub-image corresponding to the grayscale value distribution image; and arrange the row feature parameters of the correction reference sub-image containing the reference image according to the row order to obtain a correction parameter sequence. The image correction module is used to correct the image to be corrected according to the correction parameter sequence to obtain the corrected product image.
8. An image correction device for production line products, characterized in that, The production line product image correction device includes: a memory, a processor, and a production line product image correction program stored in the memory and executable on the processor, the production line product image correction program being configured to implement the steps of the production line product image correction method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a production line product image correction program, which, when executed by a processor, implements the steps of the production line product image correction method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Image correction method and device, irregular text recognition method and device, storage medium and equipment
CN111223065A
Mark block-based high-precision image splicing method and related equipment thereof
CN117094894A