# Application of 3D Digital Image Processing Technology in Modern Packaging Design

Authors: Kun Meng; Fulong Liu
Journal: Advances in Multimedia
 (2022)

---

## Abstract

In this paper, a modern packaging model is constructed by combining three-dimensional digital image processing technology, which has achieved the effect of improving the quality of modern packaging design. In addition, this paper proposes a new target recognition and tracking scheme, which uses the method of servo motor to control the synchronous conveyor belt to monitor the moving objects in real time and proposes a decision analysis algorithm to avoid repeated identification of multiple moving targets. At the same time, the software structure and execution flow of the visual control system are designed, the level of each functional module of the software is divided, and the key technology of the software is studied. The experimental research shows that the 3D digital image processing technology is effective in improving modern packaging design methods and can improve the interactivity and user experience of modern packaging design.


---

## Body

## 1. Introduction

On the basis of traditional computer graphic methods, the graphics described by Euclidean geometry theory are all geometric patterns with smooth surfaces and regular shapes. However, packaging designers often need to design more arbitrary graphics when designing packaging patterns and sometimes need some abstract, realistic three-dimensional graphics to meet the aesthetic needs of consumers. Fractal graphics are rich in layers and profound in connotation, and their spectacular and unpredictable nature can just meet people’s needs [1]. Nowadays, fractal pattern design is playing a special role in the pattern design of packaging, performance, trademark, logo, cover, clothing, and so on. Moreover, fractal pattern design has become a popular subject and a creative and efficient design method [2].At present, the international packaging industry has put forward a new concept of transforming packaging suppliers (manufacturers) into “total packaging solution” suppliers. “Total packaging solution” means that packaging suppliers (manufacturers) provide users with a complete set of system services from packaging design, packaging manufacturing, product packaging, transportation, warehousing, and shipping to the safe arrival of products at their destination [3]. Traditional packaging solutions have certain defects, such as lack of innovation, high procurement cost, high logistics cost, high labor cost, long design cycle, and low qualification rate. In addition, with the maturity of traditional packaging, traditional packaging has bottlenecks, it is difficult to achieve the dual indicators of profit maximization and customer satisfaction. This project takes a project during the internship as the source of topic selection and uses the overall packaging solution for the vibration feeding equipment to achieve the design intent [4].In terms of packaging, an important function of AR technology in this field is to make consumers understand product information more intuitively. Consumers can selectively understand product information according to their own needs. This is intelligence enhancement. It is completely consumer-centered and refuses mandatory information input. People have the right to choose information [5]. The application of AR technology can reduce unnecessary text information on packaging and decoration, effectively enhancing the overall artistic beauty of the packaging, while the information is hidden in the AR virtual scene, which is a new interactive form brought by technology to people, completely independent. The interactive experience is also a fusion of technology and modern packaging that is completely under the control of consumers to make people feel good [6].Intelligent packaging design is the product of social science and technology development and is a new trend in the development of today’s packaging industry. Intelligent packaging is mainly divided into three categories, namely, material intelligent packaging, structural intelligent packaging, and information intelligent packaging. Among them, information intelligent packaging is the most potential development of intelligent packaging. On the basis of satisfying the basic functions of packaging, it can enhance the convenience, richness, and interactivity of product information acquisition for consumers. Traditional packaging mainly focuses on product protection and display functions, while intelligent packaging pays more attention to the interaction between packaging and consumers, and pays more attention to the interactive experience of consumers during use [7]. Information intelligent packaging mainly refers to the packaging of new information transmission and information management realized through computer network, Internet, new technology means, etc. The more common ones in the market are QR code recognition, RFID, NFC, EPC technology, etc. [8].Information intelligent packaging is developing in the direction of advanced information intelligent packaging, and the curiosity of consumers contributes to the development of more advanced information intelligent packaging. The application of AR technology conforms to the needs of this development and makes packaging more fun [9]. The application of augmented reality technology in smart packaging will have higher acceptance and recognition. The application of AR technology makes the interaction between consumers and packaging stronger. Using AR technology as a medium, packaging has changed from traditional two-dimensional plane visual communication to three-dimensional visual expression. Users can perform certain operations on three-dimensional objects, such as displacement, rotating, zooming, and clicking to improve the user’s experience and cognition of the product, and obtain the text, audio, video, three-dimensional images, etc. of the product through interactive operations [10]. The interactive experience of AR packaging cannot be achieved by traditional packaging. With AR technology as the medium, product packaging vision will be richer. AR technology seamlessly connects virtual visual information with real printing vision, realizes dynamic printing vision, breaks through the limitation of information bearing on the packaging display surface, presents richer and more vivid information, and increases consumption. Users use favorability [11].Intelligent packaging technology is the product of the continuous development of society. It is a new type of technology based on multidisciplinary technology and combined with packaging development needs. Intelligent packaging technology has changed the traditional packaging design concept, making packaging more important to people. With attractiveness and affinity, shopping and use are more autonomous and convenient [12]. The development of intelligent packaging has just begun. The development of intelligent packaging is realized through the use of technologies in different fields, such as material intelligence, structural intelligence, and information intelligence. The application of AR technology to packaging belongs to a relatively advanced category of information intelligence packaging [13]. The development of intelligent packaging will become a new direction of packaging development, and information intelligence will be the most potential type of intelligent packaging for the development of intelligent packaging, and it is also the most dynamic and promising packaging technology. Combining AR technology with product packaging is also a positive trend. It is a breakthrough in the development of information-intelligent packaging [14].The design purpose of augmented reality technology is to make packaging break through the two-dimensional plane mode, allowing consumers to enter the three-dimensional virtual world of products through packaging as a medium. The realization of augmented reality technology needs to build scenes and models after determining the interaction process. Today, the unity engine is mostly used in the development of augmented reality in the industry, and finally mobile terminals or AR glasses are used for image recognition to realize the virtual interaction between users and packaging [15]. During this process, users will come to a semi-immersive virtual world, where virtual objects are combined with real objects, and consumers can interact with virtual objects through buttons to obtain a virtual three-dimensional interactive experience [16].In terms of decoration, cameras are relatively high-end electronic devices. Consumers who can buy and use such products generally have a high level of aesthetics and acceptability. Therefore, camera packaging is mostly used in a stable and concise layout and color to improve the quality of the packaging sense. In addition, considering the characteristics of product performance and subbrands selected for design, as well as the combination of this packaging and AR technology, it can effectively avoid excessive product information on the packaging surface affecting the overall aesthetics of the packaging, and the packaging and decoration adopts a relatively simple decoration way to remove unnecessary or a lot of repetitive packaging information to improve the aesthetics of the packaging [17]. A large amount of information will be hidden by using AR technology. Consumers can obtain the dynamic decoration information of the camera through the experience of AR technology. In terms of color use, this packaging design adopts a relatively single color to maintain the mystery of the packaging and enhance consumers’ understanding of the packaging. The curiosity of AR virtual content guides its interactive experience [18].This paper combines three-dimensional digital image processing technology to build a modern packaging model to improve the quality of modern packaging design, promote the effect of commodity marketing, and improve user experience.


## 2. 3D Digital Image Processing

### 2.1. Image Processing Flow Design

The image processing tasks involved in this topic are mainly to obtain the position coordinates of moving objects from the acquired images, so the image processing flow can include the following three parts:(1)
Image preprocessing (image smoothing and denoising and image sharpening)(2)
Image segmentation (recognizing target objects)(3)
Image postprocessing (calculating the position coordinates of the centroid of the object)We set a one-dimensional sequencef1,f2,⋯⋯,fn, and use a window with a window length of m (m is an odd number) to perform median filtering on the sequence, which is to successively extract m numbers fi−v,⋯⋯,fi−1,fi,fi+1,⋯⋯,fi+v from the input sequence f1,f2,⋯⋯,fn. Among them, f is the center value of the window, v=m−1/2. Then, the value of this point is arranged according to its numerical value, and the value whose serial number is in the middle is taken as the output of the filter. Mathematically, it can be expressed as
(1)Yi=Medfi−v,⋯,fi,⋯,fi+vi∈Z,v,=m−12.To apply the above method to image filtering, it needs to be converted into a two-dimensional filtering formula(2)gx,y=Medfx−k,y−l,k,l∈W.Among them,fx,y and gx,y are the original image and the target image, respectively, W is a two-dimensional template, usually selected as a 3x3 or 5x5 square field, and it can also be a line, a cross, a circle, and other shapes.The median filter uses the data sorting method to replace the value of the noise point with the point that is not polluted by the noise, so it has a good effect on the suppression of the random salt and pepper noise. During the experiment, based on the analysis of a large number of on-site photos, it is found that the noise of the visual control system of this subject is mostly slight salt and pepper noise. At the same time, considering the processing speed requirements of the entire control system, the median filter of the 3x3 template is selected as the image-smoothing process. The method can meet the system requirements.This subject adopts the peak-valley method to determine the segmentation threshold. The principle is that if there is a certain difference in gray level between the target area and the background area contained in the image, the gray level histogram of the image will present a double peak shape (as shown in Figure1). That is, the target and background pixels will form respective peaks on the grayscale histogram of the image according to their occurrence probability, and a valley will appear between the two peaks. Therefore, the gray value of the pixel at the valley can be selected as the threshold T for image segmentation.Figure 1
Image grayscale histogram.The purpose of identifying the centroid of the target object is to determine the position of the centroid of the object in the captured image, because the visual control system of this subject selects the suction cup as the actuator of the sorting action. Therefore, the centroid position of the object can be calculated to meet the system requirements. Its calculation method for binary images is as follows:First, the (p+q) order matrix mpq=∑i=1M∑j=1Mipjqρi,j of the image is defined.Among them,M andN represent the length and width of the image range of the target object, ρ represents the pixel value (0 or 1), and i and j are the pixel abscissa and pixel ordinate values, respectively.Then, the image coordinates of the object centroid can be expressed as(3)x¯=∑i=1M∑j=1Niρi,j∑i=1M∑j=1Nρi,j,y¯=∑i=1M∑j=1Njρi,j∑i=1M∑j=1Nρi,j.Bothx¯ and y¯ take the vertex in the upper left corner of the image as the coordinate origin.


### 2.2. Decision Analysis Algorithm to Avoid Repeated Identification of Multiple Moving Targets

The decision analysis algorithm to avoid the repeated recognition of multiple moving targets is mainly for the recognition and statistics of objects in long sequences of images. The algorithm can take interval shots of objects that are continuously moving on the conveyor belt, obtain the position information of each object by processing the obtained image sequence, and ensure that the position information of these objects cannot be repeated or omitted.Since the CCD camera is controlled based on the distance the conveyor belt moves, that is, based on the number of feedback pulses from the servo motor. In order to make the problem easy to analyze here, we use the number of image pixels to represent the distance that the conveyor belt moves. If it is assumed that the CCD camera takes a picture every time the field of view image moves by ds pixels, the two pictures (a) and (b) of Figure2, respectively, represent two adjacent shooting moments. The camera’s field of view in the figure is MXN (in pixels, represented by a dotted box in the figure), the pixel coordinate system takes the upper left corner of the field of view as the coordinate origin, and the directions of the x- and y-axis are shown in the figure.Figure 2
Schematic diagram of camera field of view and conveyor belt.
(a)(b)In Figure2(a), there are four object images in the camera’s field of view, including three complete object images and one partial object image. Figure 2(b) indicates that the field of view image has moved forward distance (ds). At this time, there are three object images in the camera’s field of view, including two complete object images and one partial object image. We know that the objects on the conveyor belt move forward with the conveyor belt. Therefore, in this process, all objects also move forward by a distance (ds). After the images obtained at these two moments are processed, the obtained position information of the object only differs by ds pixels in the x-axis coordinate, and the y-axis coordinate does not change.From this, the following conclusions can be drawn:(1)
Whends<M−ϕ/2, there may be repeated and complete object images in the two images(2)
WhenM−ϕ/2≤ds≤M+ϕ/2, there may be repeated and incomplete object images in the two images(3)
Whends>M+ϕ/2, there may be objects in the two images that are not captured at allAmong them,φ represents the maximum length of the object in the x-axis direction.Considering that the difference between the position coordinatesx of the same object obtained by every two image processing is a fixed value ds (the yvalue does not change), the difference method can be used to compare the position coordinates of the objects obtained in the two images one by one. At the same time, the position information of objects with the same y-coordinate value and the difference between the x-coordinate values is ds is discarded, and the specific process is as follows:Definition 1.
The set of coordinates of objects obtained in the first image is recorded as set A:(4)A=xi,yi0<xi,yi<M,i∈N.
The set of coordinates of objects obtained in the second image is denoted as set B:(5)B=xi,yi0<xj,yj<M,j∈N.
The set of all correctly identified object position coordinates is denoted as set T:(6)T=xk,yk0<xk,yk<M,k∈N.Step 2.
The algorithm calculates the values ofxj−xi and yj−yi, and the results are divided into the following cases:
(1)
Whenxj−xi=ds and yj−yi=0, it means that the j-th object in set B is a repeated image of the i-th object in set A, and the position coordinates corresponding to the j-th object in set B should be discarded(2)
Whenxj−xi=ds and yj−yi≠0, it means that in the pixel coordinate system, the j-th object in set B and the i-th object in set A are located on the same vertical line, and the position coordinates corresponding to the j-th object in set B should be reserved(3)
Whenxj−xi≠ds, it means that the j-th object in set B and the i-th object in set A are not the same image, and the position coordinates corresponding to the j-th object in set B should be reservedStep 3.
The algorithm merges the position coordinates of the remaining objects in the set B into the set T.
In practical applications, considering the influence of system noise and light and shadow conditions on the image processing results, the above method will have great limitations. Therefore, a certain error range must be added here to make each step difference judgment more accurate.Operability. The error valueε1 and ε2 needs to be introduced here to change the above process.Step 4.
The algorithm calculates the values ofxj−xi and yj−yi, and the results are divided into the following cases:
(1)
Whenxj−xi−ds≤ε1 and yj−yi−ds≤ε2, it means that the j-th object in set B is a repeated image of the i-th object in set A, and the position coordinates corresponding to the j-th object in set B should be discarded(2)
Whenxj−xi−ds≤ε1 and yj−yi−ds>ε2, it means that in the pixel coordinate system, the j-th object in set B and the i-th object in set A are located on the same vertical line, and the position coordinates corresponding to thej-th object in set B should be reserved(3)
Whenxj−xi−ds>ε1, it means that the j-th object in set B and the i-th object in set A are not the image of the same object, and the position coordinates corresponding to the j-th object in set B should be reservedStep 5.
The algorithm merges the position coordinates of the remaining objects in the set B into the set T.
The above exemplifies the recognition process of two consecutive images. When the conveyor belt runs continuously forward, every two adjacent images can be processed by the above method. Finally, the position information of all objects on the conveyor belt can be obtained, and the ds,ε1, ε2, and other values involved in the formula will be determined through experiments.


### 2.3. Software Design

Software structure design is an important part of the whole control system design task. Because the control system is developed based on virtual instrument, the concept of “software is instrument” can be fully embodied here. Generally speaking, using a modular and hierarchical structure to build the entire control system can make the software structure clear, easy to set up and easy to debug. Due to the design of a unified interface at each level, the reuse rate of the code is improved, and the upgrade and maintenance are more convenient.The control system software design of this subject is divided into four levels:(1)
User interface layer(2)
Functional module layer(3)
Instrument driver layer(4)
I/O interface driver layerThe specific hierarchical structure of the entire control system is shown in Figure3.Figure 3
The software hierarchy of the control system.The whole control system can be divided into image processing module and motion control module, so the whole system software structure should also be built around these two parts. Therefore, the software frame structure of this subject is determined as two real-time modules (image processing module and motion control module) running in parallel, and the object position information database is used for communication between the two modules. Its structure is shown in Figure4.Figure 4
Software structure of the control system.In the software structure shown in Figure4, the image-processing module and the motion control module are two real-time modules running in parallel.Modular design of software is a commonly used method in control systems, especially for more complex and huge systems, it can simplify the programming process, shorten the development cycle, and improve the reliability of the software. Moreover, many functional modules of the vision control system have great commonalities. Through module reuse, one-time programming and multiple calls can be realized. This section refines the functional module layer and determines all functional units required by the entire system (as shown in Figure5).Figure 5
Software module design.The speed control of the conveyor belt is to coordinate the forward speed of the conveyor belt with the sorting speed of the manipulator to ensure that the manipulator can sort all the objects on the conveyor belt.The speed control of the conveyor belt is based on the distribution density of objects in the robot workspace. In theory, in order to ensure the highest sorting efficiency of the manipulator, the speed of the conveyor belt should change at any time according to the distribution density of the objects. However, if the program is written in this way, it will bring a lot of trouble to the subsequent calculation of the pick-and-place position of the manipulator. Therefore, in order to simplify the problem, the forward speed of the conveyor belt will be divided into several speed levels. The specific speed control is as follows:The current speed of the conveyor belt isvt, the maximum design speed of the conveyor belt is vmax, the distribution density of objects in the working space of the manipulator is p, the cross-sectional area of the working space of the manipulator is S, the longest time for the manipulator to sort the next object is T, and the distance between the frontmost object on the conveyor belt and the boundary of the working space of the manipulator is L (as shown in Figure 6) .Figure 6
Schematic diagram of conveyor belt speed control parameters.The conveyor belt speed is expressed as:(7)vt=vmax,pS=0,orT≤Lvmax,23vmax,Lvmax<Τ≤3L2vmax,13vmax,3L2vmax<Τ≤3Lvmax,0,T>3Lvmax.The calculation of the grasping position of the object refers to calculating the grasping position of the manipulator under the condition of considering the time delay caused by various factors, so that the suction cup at the end of the manipulator can accurately reach the target position area to perform the predetermined action.When the motion control program reads the feedback position of the conveyor belt and detects the target object in the working space of the manipulator, the sorting action needs to be completed through the following steps:(1)
The motion trajectory is generated according to the current position and placement position of the object(2)
The motion trajectory is converted into the control pulse value of the servo motor through the inverse solution formula of the manipulator motion(3)
The motion control card sends the control pulse signal to the servo drive(4)
The output signal of the servo driver controls the operation of the motor, and the manipulator moves to the grasping positionThe time occupied by steps (1), (2), and (3) of this process is in the order of milliseconds, and the time length is relatively fixed. Therefore, this kind of time delay does not have a great impact on the conveyor belt moving at a low speed, but for the control system design, the possible error impact of each step operation should be considered. Therefore, it is advisable to set the total time spent in steps (1), (2), and (3) as ts, and the value of ts will be determined testly. The time tt that the manipulator mentioned in step (10) takes to move to the grasping position is proportional to the moving distance S. Since S is known, tt is known. When the conveyor belt moves forward at a constant speed at a speed vt, the conveyor belt moves a distance ΔL=vttt in time tt, and when the conveyor belt moves at a variable speed in time tt, the problem is analyzed as follows:The speed change time isΔT, the maximum allowable value of acceleration is amax, the distance the object moves within tt time is ΔL, and the acceleration planning mode of the sinusoidal motion law is as follows:
(8)a=amaxsin2πΔTt,0≤t≤ΔT.When both sides of Formula (9) are integrated over time, we get:
(9)v=∫adt=∫amaxsin2πΔTtdt+C=amaxΔT2π−cos2πΔTt+C.From the boundary conditionst=0, V=s, C=vt+amaxΔT/2π is obtained. By substituting it into Equation (10), we get
(10)v=amaxΔT2π1−cos2πtΔT+vt.Then, integrating both sides of Formula (11) with respect to time, we get
(11)ΔL=∫vdt=∫amaxΔT2π1−cos2πtΔT+vtdt+C==amaxΔT22πtΔT−12πsin2πtΔT+vtt+C.Fromt=0, s=0, and C=0 can be obtained, then
(12)ΔL=amaxΔT22πtΔT−12πsin2πtΔT+vtt.Therefore, in timett, the distance the conveyor belt moves is:
(13)ΔL=amaxΔT22πttΔT−12πsin2πttΔT+vttt.It can be seen from the above analysis process thatΔL+vtts is the final grasping position of the manipulator.The working space of the manipulator is a circular area, which contains n objects to be sorted, the labels of the objects to be sorted are 1, 2, 3..., and the corresponding moving distance of the objects to be sorted isSi. In order to simplify the problem, the coordinate of the object placement position is xd,yd, the ratio of the time ti spent by the manipulator sorting a single object and the moving distance Si corresponding to the object to be sorted is approximately regarded as a constant f, and the current speed of the conveyor belt is vt, then,
(14)∑i=1nSi=S1+S2+⋯+Sn,=x1−xd2+y1−yd2+x2+xtfS1−xd2+y1−yd2+⋯+xn+vtf∑i=1n−1Sn−1−xd2+yn−yd2,=∑i=1nxi+vtf∑i=1i−1Si−1−xd2+yi−yd2=x1−xd2+y1−yd2+x2+xtfS1−xd2+y1−yd2+⋯+xn+vtf∑i=1n−1Sn−1−xd2+yn−yd2,=∑i=1nxi+vtf∑i=1i−1Si−1−xd2+yi−yd2It can be seen that the minimum valueSmin of ∑i=1nSi depends on how the objects to be sorted are sorted and different sorting orders will correspond to different ∑i=1nSi values. Considering that there is an upper limit on the number of objects in the workspace (no more than 20), it is possible to consider using a computer program to obtain the most appropriate sorting order. The specific process is to calculate the total time ∑i=1nSi corresponding to each sorting order, sort the obtained ∑i=1nSi array by the bubble method, obtain the minimum total sorting time, and finally output the sorting order corresponding to the minimum time. Since the current industrial personal computers have powerful computing performance, the delay caused by the calculation time of this process can be ignored.


## 2.1. Image Processing Flow Design

The image processing tasks involved in this topic are mainly to obtain the position coordinates of moving objects from the acquired images, so the image processing flow can include the following three parts:(1)
Image preprocessing (image smoothing and denoising and image sharpening)(2)
Image segmentation (recognizing target objects)(3)
Image postprocessing (calculating the position coordinates of the centroid of the object)We set a one-dimensional sequencef1,f2,⋯⋯,fn, and use a window with a window length of m (m is an odd number) to perform median filtering on the sequence, which is to successively extract m numbers fi−v,⋯⋯,fi−1,fi,fi+1,⋯⋯,fi+v from the input sequence f1,f2,⋯⋯,fn. Among them, f is the center value of the window, v=m−1/2. Then, the value of this point is arranged according to its numerical value, and the value whose serial number is in the middle is taken as the output of the filter. Mathematically, it can be expressed as
(1)Yi=Medfi−v,⋯,fi,⋯,fi+vi∈Z,v,=m−12.To apply the above method to image filtering, it needs to be converted into a two-dimensional filtering formula(2)gx,y=Medfx−k,y−l,k,l∈W.Among them,fx,y and gx,y are the original image and the target image, respectively, W is a two-dimensional template, usually selected as a 3x3 or 5x5 square field, and it can also be a line, a cross, a circle, and other shapes.The median filter uses the data sorting method to replace the value of the noise point with the point that is not polluted by the noise, so it has a good effect on the suppression of the random salt and pepper noise. During the experiment, based on the analysis of a large number of on-site photos, it is found that the noise of the visual control system of this subject is mostly slight salt and pepper noise. At the same time, considering the processing speed requirements of the entire control system, the median filter of the 3x3 template is selected as the image-smoothing process. The method can meet the system requirements.This subject adopts the peak-valley method to determine the segmentation threshold. The principle is that if there is a certain difference in gray level between the target area and the background area contained in the image, the gray level histogram of the image will present a double peak shape (as shown in Figure1). That is, the target and background pixels will form respective peaks on the grayscale histogram of the image according to their occurrence probability, and a valley will appear between the two peaks. Therefore, the gray value of the pixel at the valley can be selected as the threshold T for image segmentation.Figure 1
Image grayscale histogram.The purpose of identifying the centroid of the target object is to determine the position of the centroid of the object in the captured image, because the visual control system of this subject selects the suction cup as the actuator of the sorting action. Therefore, the centroid position of the object can be calculated to meet the system requirements. Its calculation method for binary images is as follows:First, the (p+q) order matrix mpq=∑i=1M∑j=1Mipjqρi,j of the image is defined.Among them,M andN represent the length and width of the image range of the target object, ρ represents the pixel value (0 or 1), and i and j are the pixel abscissa and pixel ordinate values, respectively.Then, the image coordinates of the object centroid can be expressed as(3)x¯=∑i=1M∑j=1Niρi,j∑i=1M∑j=1Nρi,j,y¯=∑i=1M∑j=1Njρi,j∑i=1M∑j=1Nρi,j.Bothx¯ and y¯ take the vertex in the upper left corner of the image as the coordinate origin.


## 2.2. Decision Analysis Algorithm to Avoid Repeated Identification of Multiple Moving Targets

The decision analysis algorithm to avoid the repeated recognition of multiple moving targets is mainly for the recognition and statistics of objects in long sequences of images. The algorithm can take interval shots of objects that are continuously moving on the conveyor belt, obtain the position information of each object by processing the obtained image sequence, and ensure that the position information of these objects cannot be repeated or omitted.Since the CCD camera is controlled based on the distance the conveyor belt moves, that is, based on the number of feedback pulses from the servo motor. In order to make the problem easy to analyze here, we use the number of image pixels to represent the distance that the conveyor belt moves. If it is assumed that the CCD camera takes a picture every time the field of view image moves by ds pixels, the two pictures (a) and (b) of Figure2, respectively, represent two adjacent shooting moments. The camera’s field of view in the figure is MXN (in pixels, represented by a dotted box in the figure), the pixel coordinate system takes the upper left corner of the field of view as the coordinate origin, and the directions of the x- and y-axis are shown in the figure.Figure 2
Schematic diagram of camera field of view and conveyor belt.
(a)(b)In Figure2(a), there are four object images in the camera’s field of view, including three complete object images and one partial object image. Figure 2(b) indicates that the field of view image has moved forward distance (ds). At this time, there are three object images in the camera’s field of view, including two complete object images and one partial object image. We know that the objects on the conveyor belt move forward with the conveyor belt. Therefore, in this process, all objects also move forward by a distance (ds). After the images obtained at these two moments are processed, the obtained position information of the object only differs by ds pixels in the x-axis coordinate, and the y-axis coordinate does not change.From this, the following conclusions can be drawn:(1)
Whends<M−ϕ/2, there may be repeated and complete object images in the two images(2)
WhenM−ϕ/2≤ds≤M+ϕ/2, there may be repeated and incomplete object images in the two images(3)
Whends>M+ϕ/2, there may be objects in the two images that are not captured at allAmong them,φ represents the maximum length of the object in the x-axis direction.Considering that the difference between the position coordinatesx of the same object obtained by every two image processing is a fixed value ds (the yvalue does not change), the difference method can be used to compare the position coordinates of the objects obtained in the two images one by one. At the same time, the position information of objects with the same y-coordinate value and the difference between the x-coordinate values is ds is discarded, and the specific process is as follows:Definition 1.
The set of coordinates of objects obtained in the first image is recorded as set A:(4)A=xi,yi0<xi,yi<M,i∈N.
The set of coordinates of objects obtained in the second image is denoted as set B:(5)B=xi,yi0<xj,yj<M,j∈N.
The set of all correctly identified object position coordinates is denoted as set T:(6)T=xk,yk0<xk,yk<M,k∈N.Step 2.
The algorithm calculates the values ofxj−xi and yj−yi, and the results are divided into the following cases:
(1)
Whenxj−xi=ds and yj−yi=0, it means that the j-th object in set B is a repeated image of the i-th object in set A, and the position coordinates corresponding to the j-th object in set B should be discarded(2)
Whenxj−xi=ds and yj−yi≠0, it means that in the pixel coordinate system, the j-th object in set B and the i-th object in set A are located on the same vertical line, and the position coordinates corresponding to the j-th object in set B should be reserved(3)
Whenxj−xi≠ds, it means that the j-th object in set B and the i-th object in set A are not the same image, and the position coordinates corresponding to the j-th object in set B should be reservedStep 3.
The algorithm merges the position coordinates of the remaining objects in the set B into the set T.
In practical applications, considering the influence of system noise and light and shadow conditions on the image processing results, the above method will have great limitations. Therefore, a certain error range must be added here to make each step difference judgment more accurate.Operability. The error valueε1 and ε2 needs to be introduced here to change the above process.Step 4.
The algorithm calculates the values ofxj−xi and yj−yi, and the results are divided into the following cases:
(1)
Whenxj−xi−ds≤ε1 and yj−yi−ds≤ε2, it means that the j-th object in set B is a repeated image of the i-th object in set A, and the position coordinates corresponding to the j-th object in set B should be discarded(2)
Whenxj−xi−ds≤ε1 and yj−yi−ds>ε2, it means that in the pixel coordinate system, the j-th object in set B and the i-th object in set A are located on the same vertical line, and the position coordinates corresponding to thej-th object in set B should be reserved(3)
Whenxj−xi−ds>ε1, it means that the j-th object in set B and the i-th object in set A are not the image of the same object, and the position coordinates corresponding to the j-th object in set B should be reservedStep 5.
The algorithm merges the position coordinates of the remaining objects in the set B into the set T.
The above exemplifies the recognition process of two consecutive images. When the conveyor belt runs continuously forward, every two adjacent images can be processed by the above method. Finally, the position information of all objects on the conveyor belt can be obtained, and the ds,ε1, ε2, and other values involved in the formula will be determined through experiments.


## 2.3. Software Design

Software structure design is an important part of the whole control system design task. Because the control system is developed based on virtual instrument, the concept of “software is instrument” can be fully embodied here. Generally speaking, using a modular and hierarchical structure to build the entire control system can make the software structure clear, easy to set up and easy to debug. Due to the design of a unified interface at each level, the reuse rate of the code is improved, and the upgrade and maintenance are more convenient.The control system software design of this subject is divided into four levels:(1)
User interface layer(2)
Functional module layer(3)
Instrument driver layer(4)
I/O interface driver layerThe specific hierarchical structure of the entire control system is shown in Figure3.Figure 3
The software hierarchy of the control system.The whole control system can be divided into image processing module and motion control module, so the whole system software structure should also be built around these two parts. Therefore, the software frame structure of this subject is determined as two real-time modules (image processing module and motion control module) running in parallel, and the object position information database is used for communication between the two modules. Its structure is shown in Figure4.Figure 4
Software structure of the control system.In the software structure shown in Figure4, the image-processing module and the motion control module are two real-time modules running in parallel.Modular design of software is a commonly used method in control systems, especially for more complex and huge systems, it can simplify the programming process, shorten the development cycle, and improve the reliability of the software. Moreover, many functional modules of the vision control system have great commonalities. Through module reuse, one-time programming and multiple calls can be realized. This section refines the functional module layer and determines all functional units required by the entire system (as shown in Figure5).Figure 5
Software module design.The speed control of the conveyor belt is to coordinate the forward speed of the conveyor belt with the sorting speed of the manipulator to ensure that the manipulator can sort all the objects on the conveyor belt.The speed control of the conveyor belt is based on the distribution density of objects in the robot workspace. In theory, in order to ensure the highest sorting efficiency of the manipulator, the speed of the conveyor belt should change at any time according to the distribution density of the objects. However, if the program is written in this way, it will bring a lot of trouble to the subsequent calculation of the pick-and-place position of the manipulator. Therefore, in order to simplify the problem, the forward speed of the conveyor belt will be divided into several speed levels. The specific speed control is as follows:The current speed of the conveyor belt isvt, the maximum design speed of the conveyor belt is vmax, the distribution density of objects in the working space of the manipulator is p, the cross-sectional area of the working space of the manipulator is S, the longest time for the manipulator to sort the next object is T, and the distance between the frontmost object on the conveyor belt and the boundary of the working space of the manipulator is L (as shown in Figure 6) .Figure 6
Schematic diagram of conveyor belt speed control parameters.The conveyor belt speed is expressed as:(7)vt=vmax,pS=0,orT≤Lvmax,23vmax,Lvmax<Τ≤3L2vmax,13vmax,3L2vmax<Τ≤3Lvmax,0,T>3Lvmax.The calculation of the grasping position of the object refers to calculating the grasping position of the manipulator under the condition of considering the time delay caused by various factors, so that the suction cup at the end of the manipulator can accurately reach the target position area to perform the predetermined action.When the motion control program reads the feedback position of the conveyor belt and detects the target object in the working space of the manipulator, the sorting action needs to be completed through the following steps:(1)
The motion trajectory is generated according to the current position and placement position of the object(2)
The motion trajectory is converted into the control pulse value of the servo motor through the inverse solution formula of the manipulator motion(3)
The motion control card sends the control pulse signal to the servo drive(4)
The output signal of the servo driver controls the operation of the motor, and the manipulator moves to the grasping positionThe time occupied by steps (1), (2), and (3) of this process is in the order of milliseconds, and the time length is relatively fixed. Therefore, this kind of time delay does not have a great impact on the conveyor belt moving at a low speed, but for the control system design, the possible error impact of each step operation should be considered. Therefore, it is advisable to set the total time spent in steps (1), (2), and (3) as ts, and the value of ts will be determined testly. The time tt that the manipulator mentioned in step (10) takes to move to the grasping position is proportional to the moving distance S. Since S is known, tt is known. When the conveyor belt moves forward at a constant speed at a speed vt, the conveyor belt moves a distance ΔL=vttt in time tt, and when the conveyor belt moves at a variable speed in time tt, the problem is analyzed as follows:The speed change time isΔT, the maximum allowable value of acceleration is amax, the distance the object moves within tt time is ΔL, and the acceleration planning mode of the sinusoidal motion law is as follows:
(8)a=amaxsin2πΔTt,0≤t≤ΔT.When both sides of Formula (9) are integrated over time, we get:
(9)v=∫adt=∫amaxsin2πΔTtdt+C=amaxΔT2π−cos2πΔTt+C.From the boundary conditionst=0, V=s, C=vt+amaxΔT/2π is obtained. By substituting it into Equation (10), we get
(10)v=amaxΔT2π1−cos2πtΔT+vt.Then, integrating both sides of Formula (11) with respect to time, we get
(11)ΔL=∫vdt=∫amaxΔT2π1−cos2πtΔT+vtdt+C==amaxΔT22πtΔT−12πsin2πtΔT+vtt+C.Fromt=0, s=0, and C=0 can be obtained, then
(12)ΔL=amaxΔT22πtΔT−12πsin2πtΔT+vtt.Therefore, in timett, the distance the conveyor belt moves is:
(13)ΔL=amaxΔT22πttΔT−12πsin2πttΔT+vttt.It can be seen from the above analysis process thatΔL+vtts is the final grasping position of the manipulator.The working space of the manipulator is a circular area, which contains n objects to be sorted, the labels of the objects to be sorted are 1, 2, 3..., and the corresponding moving distance of the objects to be sorted isSi. In order to simplify the problem, the coordinate of the object placement position is xd,yd, the ratio of the time ti spent by the manipulator sorting a single object and the moving distance Si corresponding to the object to be sorted is approximately regarded as a constant f, and the current speed of the conveyor belt is vt, then,
(14)∑i=1nSi=S1+S2+⋯+Sn,=x1−xd2+y1−yd2+x2+xtfS1−xd2+y1−yd2+⋯+xn+vtf∑i=1n−1Sn−1−xd2+yn−yd2,=∑i=1nxi+vtf∑i=1i−1Si−1−xd2+yi−yd2=x1−xd2+y1−yd2+x2+xtfS1−xd2+y1−yd2+⋯+xn+vtf∑i=1n−1Sn−1−xd2+yn−yd2,=∑i=1nxi+vtf∑i=1i−1Si−1−xd2+yi−yd2It can be seen that the minimum valueSmin of ∑i=1nSi depends on how the objects to be sorted are sorted and different sorting orders will correspond to different ∑i=1nSi values. Considering that there is an upper limit on the number of objects in the workspace (no more than 20), it is possible to consider using a computer program to obtain the most appropriate sorting order. The specific process is to calculate the total time ∑i=1nSi corresponding to each sorting order, sort the obtained ∑i=1nSi array by the bubble method, obtain the minimum total sorting time, and finally output the sorting order corresponding to the minimum time. Since the current industrial personal computers have powerful computing performance, the delay caused by the calculation time of this process can be ignored.


## 3. Modern Packaging Design Based on 3D Digital Image Processing

In the process of software development, the design of the development process is a very important link, which affects the progress of the development and even the success of the software. In order to realize the material function of the 3D packaging CAD system, we must first obtain the basic information of the material object (including geometric shape information and attribute information). Then, we perform 3D modeling based on this information and assign materials to the model based on the modeling. Therefore, based on this basic idea, this subject divides the design of the 3D packaging CAD system rendering software into several functional modules as shown in Figure7.Figure 7
Flowchart of the software.This paper combines the algorithm of the second part to verify the effect of modern packaging design, evaluates it through multiple groups of designs, scores the design results, and finally obtains the test results shown in Table1 and Figure 8.Table 1
Effect evaluation of modern packaging design system based on 3D digital image processing.
NumberPackage design183.15285.57390.26486.33588.75683.54787.63891.53989.541090.121191.211287.741390.641488.151591.741690.591786.041885.491988.422090.422183.242284.382385.152489.022584.672687.952783.092885.252990.733085.883188.403284.053388.453484.943591.293686.883789.483891.953989.654091.034189.704289.734385.514491.714583.77Figure 8
Visual diagram of test results.Through the above test research, it can be seen that the modern packaging design method based on 3D digital image processing can effectively improve the interactivity and user experience of modern packaging design.


## 4. Conclusion

In the rapidly developing modern society, people’s living standards are constantly improving, and their requirements for various things are getting higher and higher. Especially with the continuous popularization and application of computer technology, the development of computer graphics has also made a qualitative leap. Fractal graphics presents a colorful and unpredictable beautiful world in front of people. Fractals simultaneously changed from an analysis tool to a design tool. In addition, fractal design has gradually shown its powerful power in natural landscape reconstruction, nonsmooth and nondifferentiable curve and surface generation, art decoration texture design, computer animation, and simulated human body generation. At the same time, the pattern based on fractal design also has fidelity and anticounterfeiting. In addition, commodities are indispensable things in people’s lives, so people have higher and higher pursuits for the decorative design of commodity appearance packaging. This paper combines three-dimensional digital image processing technology to build a modern packaging model, improves the quality of modern packaging design, greatly improves the interactivity and user experience of modern packaging design, and enriches people’s lives.



---

*Source: 5239479-2022-09-21.xml*