# Collaborative Music Creation Method Based on Image Collection of Lattice Code

Authors: Yuehua Xiang
Journal: International Transactions on Electrical Energy Systems
 (2022)

---

## Abstract

With the development of science and technology, more and more emerging technologies have been integrated into electronic music, forming a rich and diverse form of interactive electronic music. This research mainly discusses the collaborative music creation method based on bit matrix code image acquisition. In the decoding process, the displacement value of each point should be determined according to the direction and distance from the point to the reference point of the corresponding grid raster. This article marks the position characteristics of image symbols according to the dot matrix code notation defined in the improved coding method. After searching for a pair of dot codes with the shortest distance in the horizontal or vertical direction, starting from the first code point in the vertical direction and following the second code point. Through the above method, it is possible to accurately construct the grid raster lines of the dot matrix position encoding symbol image formed after the improved encoding, so that the decoding of the dot matrix symbol image is more accurate, and the composition translation is reduced. The improved coding method reduces the error of the origin matrix code by about 0.11 mm as a whole. This research will realize the collaborative recording of data in the music creation process, which will bring great convenience to creators.


---

## Body

## 1. Introduction

With the continuous and in-depth development of interdisciplinary approach, creators began to find more ways in tradition and innovation, and the art form of combining science and technology into music creation was gradually enriched. How to create better music through scientific and technological means has become a hot topic for many creators.National musical instruments are important symbols in traditional Chinese music. This research hopes to combine the knowledge learned and explore the effective integration of tradition and innovation through the creation of electronic musical instruments. Therefore, in the research process of ultrasonic sensors, the creation of music is added, and a real-time instrumental interactive work is formed through the control of different sound effects during the performance of the performer.Early electronic music was determined by the way it was created and the technical way it was presented on the broadcast or through the speakers in the theater. Wan et al. proposed an image feature extraction method based on discrete information coding matrix [1]. Blackburn and Claridge considers generalization of matrix channels to model random linear network codes [2]. Yu et al. proposed an entangled polynomial code for intermediate computations of worker nodes [3]. Lockwood et al. pointed out that real-time imaging technology must be used throughout the image acquisition process to prevent the impact on the zebrafish’s ecological environment [4]. Nishimaki and Ohashi used imaging equipment to project three-dimensional images in virtual three-dimensional space into the real world [5]. Saragih et al. aims to provide the latest commentary on the theme of multiactor innovation in the music industry and emerging paradigms of openness, collaboration, and co-innovation. He conducts system reviews to generate analysis. He considered a variety of academic articles from well-known databases [6]. Many technologies are needed in the process of music creation, but music creation also requires collaborative innovation, so the combination with dot matrix coding is necessary.In the decoding process, the displacement value of each point should be determined according to the direction and distance of the point to the corresponding grid raster reference point. Therefore, when identifying and decoding, it is necessary to re-establish the grid raster line according to the characteristics of the defined symbol during encoding. After the grid raster line is determined, the displacement value of the point can be obtained according to the position of the point in the dot matrix image relative to the raster reference point in the grid raster line, and then the decoding operation can be performed. The two-dimensional Otsu threshold segmentation fast iterative algorithm is used to find the best threshold to improve the traditional Otsu threshold selection method for bit matrix code images. This algorithm avoids exhaustive search when it uses fast iterative search for the best threshold.


## 2. Research Methods

### 2.1. Dot Matrix Code

The dot matrix code can be divided into positioning area and data area. The positioning area is distributed in the upper left, upper right, and lower left of the dot matrix code. The data area contains content data, error correction code data, and anti-counterfeiting data, which are interleaved in the middle area of the dot matrix code. The black dots seem to be arranged irregularly in the graph. In fact, the internal area of the dot matrix is distinct, and different areas represent different information.SNR per subframe (31 samples) [7]:(1)SNR=20log∑n=031x2n∑n=031x2n−xmn,where xn is the weighted audio signal before the audio source is encoded. Average signal-to-noise ratio [8]:(2)SNR¯=1N∑n=0N=1SNR.Suppose the real-time interpolation period isT, the cumulative number of coding steps of the audio source encoder is MK steps, and the workflow of the player can be summarized as follows [9]:(3)st=st−T+Δst,Δkpt=kpt−Δkpt−T.Accumulate the command position increment to the command position at timet–T, and get the command position at time t [10]:(4)φt=φt−T+Δφt.The average value is calculated by weighting the three color components of the red componentR, green component G, and blue component B of the image. The weighted average method transforms the gray image by [11]:(5)H=0.2R+0.55G+0.44B.Intercept according to the number of bits of the data, a single color component can be obtained [12]:(6)DR,G,B=F0,0F1,0⋯F0,N−1⋮⋮⋯⋮⋮⋮⋯⋮FN−1,0⋯⋯FN−1,N−1.


### 2.2. Image Parameters

Image parameters refer to some parameters of the dot matrix code image, including the side length of the inner matrix that controls the distance between the points; the side length of the outer matrix that controls the amount of information that a single matrix module can represent: DPI (dots per inch); and the length and width of the generated image. The specific parameter information is shown in Table1.Table 1
Specific parameter information.
NameContentDescriptionDefaultsInner matrix side lengthAn integer not less than 1, and must be an odd numberRepresents the side length of the inner matrix4Outer matrix side lengthAn integer not less than 1, and must be an odd numberRepresents the side length of the inner matrix4DPI of the generated imageA real number not less than 0Indicates the DPI of the generated image, which can control the size of the dot when printing400The length of the generated imageA real number not less than 0Indicates the length of the generated image, in millimeters30The width of the generated imageA real number not less than 0Indicates the width of the generated image, in millimeters20Although the dot matrix code is composed of code points, the internal structure can be divided into individual areas. Each area consists of a double-layer square matrix. Both the positioning area and the data area are composed of such areas. The function of the internal matrix is mainly to increase the distance between the point and the point. The specific implementation is that only the center point of the matrix represents specific information. It can be set to dark or light, and the other parts are set to light. For example, the side length of the inner matrix is 4 by default, and the distance between points is at least 3 points in diameter. It can be adjusted according to your own needs during specific use. The side length of the outer matrix affects the amount of data that a regional unit can represent. In principle, the larger the side length, the more data can be represented, but it is also affected by the specific expression rules. By default, the side length of the outer matrix is 4. The data bits that can be represented by each area are 4-bit binary data.The dot matrix pen uses noncarbon ink when writing on the dot matrix paper, which can be seen by the naked eye. But when the dot matrix pen is writing, the infrared camera shoots (most infrared cameras use LED infrared light-emitting diodes as the main material of infrared cameras) the position of the handwriting information point at a speed of 100 frames per second. The ink on the dot matrix paper is completely invisible to the infrared camera when shooting, and the infrared camera captures it. It is only the grayscale dot matrix pattern of dot matrix coding, and each image contains at least one dot matrix pattern with the size of 1.5 mm × 1.5 mm.The dot matrix image acquired by the infrared camera will also have noise, tilt, etc. The existence of noise will reduce the resolving power of the detector and limit the dynamic performance of the infrared system. If it is used directly, the dot matrix position code image will not be decoded correctly, and the handwriting position will be inaccurate. Therefore, it is necessary to preprocess the image before decoding to ensure the correct rate of decoding and decoding. The recognition process of the dot matrix position code starts when the dot matrix pen is written on the dot matrix paper, and the gray image of the dot matrix code of the pen tip movement is obtained as the writing process. Image processing is performed through the image recognition and decoding program of the dot matrix position code and then decoded according to the decoding algorithm, the position code is decoded into the position coordinates, and the position coordinates of the position points are finally recorded.The image recognition and decoding process of the dot matrix position code is shown in Figure1. In the entire lattice position code recognition and decoding process, the position code image processing is an important part of the whole recognition process. The quality of image processing will affect the location and decoding accuracy of handwriting information points. According to the size of the matrix in the matrix set, coding prediction is performed on the matrices in the matrix set in sequence according to the coding order, and the reconstruction matrix of the matrix is obtained.Figure 1
Image recognition and decoding process of dot matrix position code.


### 2.3. Dot Matrix Image Preprocessing

Because the position code dot image obtained from the dot matrix paper is affected by the environment and paper, it may contain some noise. In order to make the dot matrix image clearer to distinguish different dot codes, the image processing program must first obtain grayscale images that are processed for image processing. Image processing generally includes denoising and thresholding.The mean filtering algorithm is a linear filtering algorithm based on the field. The basic idea of the mean filtering is that the pixel value of a certain point in the image is determined by other pixel values in a certain field of that point, and the pixel values of other points in the field are summed and averaged, and the result is used as the new pixel value of the point. In the selection of fields, the most commonly used are 4 fields with a unit length from the center point and 8 fields with a unit length of 12 units [13].(7)gx,y=1M∑Sgx,y.Among them,s is the collection of all pixels in the pixel (x, y) field in the image, g(x, y) is the pixel value of a certain pixel in the image, and M is the number of pixels in all fields. The advantage of this algorithm is that, in the image denoising process, if the image contains more Gaussian noise, then the algorithm will get better results when denoising the image. Most of the noise contained in the dot matrix code image obtained by the digital pen is Gaussian white noise generated by the external environment. In addition, due to the idea of mean filtering, the pixels of each dot code of the position code image are new based on the field average value. Pixel value, this also avoids treating a certain pixel in the point code as noise. Therefore, in the process of position code image processing in this article, the average filter processing algorithm (during filtering, the average value of the sampled values of N cycles is calculated, and the algorithm is very simple) is used to eliminate noise, and then thresholding is performed.The two-channel low-band signal of the input stereo signal is added into a mono signalMLF, which is realized as follows [14]:(8)MLF=0.5∗Rn+Ln.


### 2.4. Optimization Method of Image Threshold Processing of Dot Matrix Code

When the traditional Otsu threshold processing method is used for the dot matrix code image, some dot codes in the binarized image may appear uneven or incomplete, which affects the decoding of the dot matrix code image and the reconstruction of grid raster lines. In order to improve the effect of bit matrix code image threshold processing, and at the same time to reduce the calculation time of threshold processing, this paper uses dynamic threshold segmentation method to binarize the bit matrix code image on the basis of studying the threshold processing of the bit matrix code image. When the two-dimensional Otsu threshold segmentation fast iterative algorithm is used to find the optimal threshold, the traditional Otsu threshold selection method for lattice code images is improved. The algorithm uses fast iterative search for the optimal threshold to avoid exhaustive search and does not need to traverse the entire solution. In addition, it has a significantly better effect than the original traditional Otsu algorithm in terms of the effect of the image processing of the lattice position code, and the running time is also relatively reduced.This article edits and records the communication project file of the ultrasonic sensor in Arduino through the connection of the ultrasonic sensor with the D1 mini development board with its own ESP8266 chip and Anoto software platform. First, you need to load the ESP8266 development kit with WIFI communication protocol in the Anoto software platform. Wireless network in the category of wireless local area network refers to “wireless compatibility certification,” which is essentially a commercial certification and a wireless networking technology.Suppose the gray level of theM × N image is f(m, n), then [15]:(9)gm,n=1N∑x,y∈Dfx,y.Among them,D is the 8 neighborhood of the pixel (m, n), and N is the number of pixels in neighborhood D.In the two-dimensional Otsu threshold segmentation method, the tracetrσ of the matrix σ is used as the distance measurement function between the target class and the background class [16,17]:(10)trσt,s=w0η−ηi2+η−ηj2+η−ηsi2+η1−ηi2.Find the deviations oft and s respectively and set them to zero, namely [18]:(11)∂trσt,s∂t=0,∂trσt,s∂s=0.By separately seeking partial derivatives, we can get the following [19]:(12)Δ1t,st+Δ2t,s=0,Δ1t,st+Δ2t,s=0,where(13)Δ1t,s=2Eμ0−μ1,Δ2t,s=Eμi2−μj2−μ02−μ12+2Fμ02−μ12,Δ3t,s=2μ0E1+2μ0G−E1−2μ0G,Δ4t,s=2μ0E1−2μ−EE−2μ0G.Here:(14)E=∫0spt,ydy,F=∫0sypt,ydy,G=∫0sypx,sdx.Among them, (t, s) is the optimal threshold vector [20].


### 2.5. Lattice Code Image Recognition and Decoding

In the recognition and decoding process of the bit matrix code image after threshold processing, because the pen tip and the paper surface may have a certain angle when the image is obtained, the horizontal grid raster lines of the obtained bit matrix code image are squeezed, resulting in two levels. An optical device composed of a large number of parallel slits of equal width and equal spacing is called a grating. The distance between the grating lines is smaller than the standard grid distance, so that the vertical grating lines have an angle with each other and may cross at a certain position in the vertical direction. However, in the decoding process, the displacement value of each point must be determined according to the direction and distance of the point to the reference point of the corresponding grid raster. Therefore, when identifying and decoding, it is necessary to re-establish the grid raster according to the characteristics of the defined symbol during encoding. When the grid raster line is determined, the displacement value of the point can be obtained according to the position of the point in the dot image relative to the raster reference point in the grid raster line, and then the decoding operation can be performed. After the coding is improved in this paper, due to the change of the dot matrix code image, the construction method of grid raster lines has also changed. The method of constructing grid raster lines based on Anoto dot matrix code is shown in Figure2.Figure 2
Image recognition and decoding process of dot matrix position code.


#### 2.5.1. Anoto Dot Matrix Code Grid Raster Line Construction

The dot matrix code notation mark image obtained from dot matrix paper when writing is a subset of the dot pattern. The dot matrix code notation mark image is composed of multiple dot codes. The size of the notation mark image obtained at one time is about 3 mm × 3 mm. It contains approximately 8 to 10 dot codes in each direction. The obtained dot matrix code notation mark image is first subjected to denoising and binarization processing, so that each dot code is easier to distinguish.


#### 2.5.2. Construction of Grid Raster Line of Dot Matrix Code Notation Mark Image

First of all, according to the position characteristics of the dot matrix code notation mark image symbol defined in the improved coding method, after looking for a pair of dot codes with the shortest distance in the horizontal or vertical direction, this article starts from the first code point in the vertical direction along. In the second vector search, other vectors are put into the stack with angles of 90 degrees, 135 degrees, 0 degrees, −135 degrees, −90 degrees, and −45 degrees [21].The program proceeds in sequence according to the above-mentioned detection of the improved code, until the detected grid raster reference point has been detected and recorded and determined, then the stack item vector element in the next stack is used to continue the detection until all the vectors in the stack. If the element is empty, the reference point and the information point of the dot matrix code notation mark image grid raster have been completely determined. Due to the increase in the stack required for the movement vector used in the construction of the grid raster line after the improved coding, the possible disadvantage of this scheme is that the construction process is more complicated, but the above method can be used to improve the points formed after the coding. The definition of motion vector: the quantity that changes in space-time position with magnitude and direction is called vector. Array position code notation mark image grid raster lines are accurately constructed, which makes the decoding of dot matrix notation mark image more accurate and reduces the error rate of arrangement and decoding during the decoding process.


## 2.1. Dot Matrix Code

The dot matrix code can be divided into positioning area and data area. The positioning area is distributed in the upper left, upper right, and lower left of the dot matrix code. The data area contains content data, error correction code data, and anti-counterfeiting data, which are interleaved in the middle area of the dot matrix code. The black dots seem to be arranged irregularly in the graph. In fact, the internal area of the dot matrix is distinct, and different areas represent different information.SNR per subframe (31 samples) [7]:(1)SNR=20log∑n=031x2n∑n=031x2n−xmn,where xn is the weighted audio signal before the audio source is encoded. Average signal-to-noise ratio [8]:(2)SNR¯=1N∑n=0N=1SNR.Suppose the real-time interpolation period isT, the cumulative number of coding steps of the audio source encoder is MK steps, and the workflow of the player can be summarized as follows [9]:(3)st=st−T+Δst,Δkpt=kpt−Δkpt−T.Accumulate the command position increment to the command position at timet–T, and get the command position at time t [10]:(4)φt=φt−T+Δφt.The average value is calculated by weighting the three color components of the red componentR, green component G, and blue component B of the image. The weighted average method transforms the gray image by [11]:(5)H=0.2R+0.55G+0.44B.Intercept according to the number of bits of the data, a single color component can be obtained [12]:(6)DR,G,B=F0,0F1,0⋯F0,N−1⋮⋮⋯⋮⋮⋮⋯⋮FN−1,0⋯⋯FN−1,N−1.


## 2.2. Image Parameters

Image parameters refer to some parameters of the dot matrix code image, including the side length of the inner matrix that controls the distance between the points; the side length of the outer matrix that controls the amount of information that a single matrix module can represent: DPI (dots per inch); and the length and width of the generated image. The specific parameter information is shown in Table1.Table 1
Specific parameter information.
NameContentDescriptionDefaultsInner matrix side lengthAn integer not less than 1, and must be an odd numberRepresents the side length of the inner matrix4Outer matrix side lengthAn integer not less than 1, and must be an odd numberRepresents the side length of the inner matrix4DPI of the generated imageA real number not less than 0Indicates the DPI of the generated image, which can control the size of the dot when printing400The length of the generated imageA real number not less than 0Indicates the length of the generated image, in millimeters30The width of the generated imageA real number not less than 0Indicates the width of the generated image, in millimeters20Although the dot matrix code is composed of code points, the internal structure can be divided into individual areas. Each area consists of a double-layer square matrix. Both the positioning area and the data area are composed of such areas. The function of the internal matrix is mainly to increase the distance between the point and the point. The specific implementation is that only the center point of the matrix represents specific information. It can be set to dark or light, and the other parts are set to light. For example, the side length of the inner matrix is 4 by default, and the distance between points is at least 3 points in diameter. It can be adjusted according to your own needs during specific use. The side length of the outer matrix affects the amount of data that a regional unit can represent. In principle, the larger the side length, the more data can be represented, but it is also affected by the specific expression rules. By default, the side length of the outer matrix is 4. The data bits that can be represented by each area are 4-bit binary data.The dot matrix pen uses noncarbon ink when writing on the dot matrix paper, which can be seen by the naked eye. But when the dot matrix pen is writing, the infrared camera shoots (most infrared cameras use LED infrared light-emitting diodes as the main material of infrared cameras) the position of the handwriting information point at a speed of 100 frames per second. The ink on the dot matrix paper is completely invisible to the infrared camera when shooting, and the infrared camera captures it. It is only the grayscale dot matrix pattern of dot matrix coding, and each image contains at least one dot matrix pattern with the size of 1.5 mm × 1.5 mm.The dot matrix image acquired by the infrared camera will also have noise, tilt, etc. The existence of noise will reduce the resolving power of the detector and limit the dynamic performance of the infrared system. If it is used directly, the dot matrix position code image will not be decoded correctly, and the handwriting position will be inaccurate. Therefore, it is necessary to preprocess the image before decoding to ensure the correct rate of decoding and decoding. The recognition process of the dot matrix position code starts when the dot matrix pen is written on the dot matrix paper, and the gray image of the dot matrix code of the pen tip movement is obtained as the writing process. Image processing is performed through the image recognition and decoding program of the dot matrix position code and then decoded according to the decoding algorithm, the position code is decoded into the position coordinates, and the position coordinates of the position points are finally recorded.The image recognition and decoding process of the dot matrix position code is shown in Figure1. In the entire lattice position code recognition and decoding process, the position code image processing is an important part of the whole recognition process. The quality of image processing will affect the location and decoding accuracy of handwriting information points. According to the size of the matrix in the matrix set, coding prediction is performed on the matrices in the matrix set in sequence according to the coding order, and the reconstruction matrix of the matrix is obtained.Figure 1
Image recognition and decoding process of dot matrix position code.


## 2.3. Dot Matrix Image Preprocessing

Because the position code dot image obtained from the dot matrix paper is affected by the environment and paper, it may contain some noise. In order to make the dot matrix image clearer to distinguish different dot codes, the image processing program must first obtain grayscale images that are processed for image processing. Image processing generally includes denoising and thresholding.The mean filtering algorithm is a linear filtering algorithm based on the field. The basic idea of the mean filtering is that the pixel value of a certain point in the image is determined by other pixel values in a certain field of that point, and the pixel values of other points in the field are summed and averaged, and the result is used as the new pixel value of the point. In the selection of fields, the most commonly used are 4 fields with a unit length from the center point and 8 fields with a unit length of 12 units [13].(7)gx,y=1M∑Sgx,y.Among them,s is the collection of all pixels in the pixel (x, y) field in the image, g(x, y) is the pixel value of a certain pixel in the image, and M is the number of pixels in all fields. The advantage of this algorithm is that, in the image denoising process, if the image contains more Gaussian noise, then the algorithm will get better results when denoising the image. Most of the noise contained in the dot matrix code image obtained by the digital pen is Gaussian white noise generated by the external environment. In addition, due to the idea of mean filtering, the pixels of each dot code of the position code image are new based on the field average value. Pixel value, this also avoids treating a certain pixel in the point code as noise. Therefore, in the process of position code image processing in this article, the average filter processing algorithm (during filtering, the average value of the sampled values of N cycles is calculated, and the algorithm is very simple) is used to eliminate noise, and then thresholding is performed.The two-channel low-band signal of the input stereo signal is added into a mono signalMLF, which is realized as follows [14]:(8)MLF=0.5∗Rn+Ln.


## 2.4. Optimization Method of Image Threshold Processing of Dot Matrix Code

When the traditional Otsu threshold processing method is used for the dot matrix code image, some dot codes in the binarized image may appear uneven or incomplete, which affects the decoding of the dot matrix code image and the reconstruction of grid raster lines. In order to improve the effect of bit matrix code image threshold processing, and at the same time to reduce the calculation time of threshold processing, this paper uses dynamic threshold segmentation method to binarize the bit matrix code image on the basis of studying the threshold processing of the bit matrix code image. When the two-dimensional Otsu threshold segmentation fast iterative algorithm is used to find the optimal threshold, the traditional Otsu threshold selection method for lattice code images is improved. The algorithm uses fast iterative search for the optimal threshold to avoid exhaustive search and does not need to traverse the entire solution. In addition, it has a significantly better effect than the original traditional Otsu algorithm in terms of the effect of the image processing of the lattice position code, and the running time is also relatively reduced.This article edits and records the communication project file of the ultrasonic sensor in Arduino through the connection of the ultrasonic sensor with the D1 mini development board with its own ESP8266 chip and Anoto software platform. First, you need to load the ESP8266 development kit with WIFI communication protocol in the Anoto software platform. Wireless network in the category of wireless local area network refers to “wireless compatibility certification,” which is essentially a commercial certification and a wireless networking technology.Suppose the gray level of theM × N image is f(m, n), then [15]:(9)gm,n=1N∑x,y∈Dfx,y.Among them,D is the 8 neighborhood of the pixel (m, n), and N is the number of pixels in neighborhood D.In the two-dimensional Otsu threshold segmentation method, the tracetrσ of the matrix σ is used as the distance measurement function between the target class and the background class [16,17]:(10)trσt,s=w0η−ηi2+η−ηj2+η−ηsi2+η1−ηi2.Find the deviations oft and s respectively and set them to zero, namely [18]:(11)∂trσt,s∂t=0,∂trσt,s∂s=0.By separately seeking partial derivatives, we can get the following [19]:(12)Δ1t,st+Δ2t,s=0,Δ1t,st+Δ2t,s=0,where(13)Δ1t,s=2Eμ0−μ1,Δ2t,s=Eμi2−μj2−μ02−μ12+2Fμ02−μ12,Δ3t,s=2μ0E1+2μ0G−E1−2μ0G,Δ4t,s=2μ0E1−2μ−EE−2μ0G.Here:(14)E=∫0spt,ydy,F=∫0sypt,ydy,G=∫0sypx,sdx.Among them, (t, s) is the optimal threshold vector [20].


## 2.5. Lattice Code Image Recognition and Decoding

In the recognition and decoding process of the bit matrix code image after threshold processing, because the pen tip and the paper surface may have a certain angle when the image is obtained, the horizontal grid raster lines of the obtained bit matrix code image are squeezed, resulting in two levels. An optical device composed of a large number of parallel slits of equal width and equal spacing is called a grating. The distance between the grating lines is smaller than the standard grid distance, so that the vertical grating lines have an angle with each other and may cross at a certain position in the vertical direction. However, in the decoding process, the displacement value of each point must be determined according to the direction and distance of the point to the reference point of the corresponding grid raster. Therefore, when identifying and decoding, it is necessary to re-establish the grid raster according to the characteristics of the defined symbol during encoding. When the grid raster line is determined, the displacement value of the point can be obtained according to the position of the point in the dot image relative to the raster reference point in the grid raster line, and then the decoding operation can be performed. After the coding is improved in this paper, due to the change of the dot matrix code image, the construction method of grid raster lines has also changed. The method of constructing grid raster lines based on Anoto dot matrix code is shown in Figure2.Figure 2
Image recognition and decoding process of dot matrix position code.


### 2.5.1. Anoto Dot Matrix Code Grid Raster Line Construction

The dot matrix code notation mark image obtained from dot matrix paper when writing is a subset of the dot pattern. The dot matrix code notation mark image is composed of multiple dot codes. The size of the notation mark image obtained at one time is about 3 mm × 3 mm. It contains approximately 8 to 10 dot codes in each direction. The obtained dot matrix code notation mark image is first subjected to denoising and binarization processing, so that each dot code is easier to distinguish.


### 2.5.2. Construction of Grid Raster Line of Dot Matrix Code Notation Mark Image

First of all, according to the position characteristics of the dot matrix code notation mark image symbol defined in the improved coding method, after looking for a pair of dot codes with the shortest distance in the horizontal or vertical direction, this article starts from the first code point in the vertical direction along. In the second vector search, other vectors are put into the stack with angles of 90 degrees, 135 degrees, 0 degrees, −135 degrees, −90 degrees, and −45 degrees [21].The program proceeds in sequence according to the above-mentioned detection of the improved code, until the detected grid raster reference point has been detected and recorded and determined, then the stack item vector element in the next stack is used to continue the detection until all the vectors in the stack. If the element is empty, the reference point and the information point of the dot matrix code notation mark image grid raster have been completely determined. Due to the increase in the stack required for the movement vector used in the construction of the grid raster line after the improved coding, the possible disadvantage of this scheme is that the construction process is more complicated, but the above method can be used to improve the points formed after the coding. The definition of motion vector: the quantity that changes in space-time position with magnitude and direction is called vector. Array position code notation mark image grid raster lines are accurately constructed, which makes the decoding of dot matrix notation mark image more accurate and reduces the error rate of arrangement and decoding during the decoding process.


## 2.5.1. Anoto Dot Matrix Code Grid Raster Line Construction

The dot matrix code notation mark image obtained from dot matrix paper when writing is a subset of the dot pattern. The dot matrix code notation mark image is composed of multiple dot codes. The size of the notation mark image obtained at one time is about 3 mm × 3 mm. It contains approximately 8 to 10 dot codes in each direction. The obtained dot matrix code notation mark image is first subjected to denoising and binarization processing, so that each dot code is easier to distinguish.


## 2.5.2. Construction of Grid Raster Line of Dot Matrix Code Notation Mark Image

First of all, according to the position characteristics of the dot matrix code notation mark image symbol defined in the improved coding method, after looking for a pair of dot codes with the shortest distance in the horizontal or vertical direction, this article starts from the first code point in the vertical direction along. In the second vector search, other vectors are put into the stack with angles of 90 degrees, 135 degrees, 0 degrees, −135 degrees, −90 degrees, and −45 degrees [21].The program proceeds in sequence according to the above-mentioned detection of the improved code, until the detected grid raster reference point has been detected and recorded and determined, then the stack item vector element in the next stack is used to continue the detection until all the vectors in the stack. If the element is empty, the reference point and the information point of the dot matrix code notation mark image grid raster have been completely determined. Due to the increase in the stack required for the movement vector used in the construction of the grid raster line after the improved coding, the possible disadvantage of this scheme is that the construction process is more complicated, but the above method can be used to improve the points formed after the coding. The definition of motion vector: the quantity that changes in space-time position with magnitude and direction is called vector. Array position code notation mark image grid raster lines are accurately constructed, which makes the decoding of dot matrix notation mark image more accurate and reduces the error rate of arrangement and decoding during the decoding process.


## 3. Collaborative Music Creation Results

After the above analysis, this paper uses the traditional Otsu threshold processing algorithm and the two-dimensional Otsu threshold segmentation fast iterative method to process the bitmap. The comparison effect of the algorithm is shown in Figure3.Figure 3
Algorithm comparison effect.In order to verify the running time of the algorithm for threshold processing on dot matrix images, this article conducted experiments in the experimental environment: Intel (R) Core(TM) i7-3632QM CPU @2.20 GHz 2.20 GHz. Table2 shows the time for the three types of threshold processing for the dot matrix image.Table 2
Three kinds of threshold processing time for bitmap images.
MethodThresholdTime (s)Iterative threshold method(175, 47)0.0105Traditional Otsu threshold(122, 70)0.0022The optimization method of this article(152, 77)0.0017From the above experimental data, it can be seen that, in terms of running time, iterative threshold processing needs to calculate the entire image to obtain the best threshold, and the threshold processing takes the most time. The two-dimensional Otsu threshold segmentation fast iterative algorithm avoids searching the entire space on the basis of Otsu running time is the least, and the quality of the processed image is better than the traditional Otsu threshold processing.The 2-dimensional Otsu thresholding fast iterative algorithm can automatically select ACELP (algebraic code-excited liner prediction) or lattice coding according to the content of the audio signal, can provide extremely superior sound quality at an extremely low code rate, and have good anti-error code performance. The fast iteration algorithm for 2D Otsu threshold segmentation and the code rate control of Otsu are shown in Table3.Table 3
Two-dimensional Otsu threshold segmentation fast iterative algorithm.
-AMR-WB+OtsuMono5 kbps∼35 kbps≥8 kbpsStereo6 kbps∼46 kbps≥16.1 kbpsIn order to test the performance and effect of the improved coding method in this paper on the accuracy of handwriting information point positioning, based on the above simulation experiments, this paper did two sets of experiments, each of which selected 20 handwriting information points; information to locate it. In order to test the positioning accuracy, this experiment calculates the error size according to the number of pixels of the handwriting information point error and analyzes the performance of the improved coding scheme in terms of positioning accuracy. The two groups of studies are shown in Figure4.Figure 4
Two groups of studies.In the first set of experiments, the average positioning error of the improved coding scheme is about 0.61 mm, and the average positioning error of the Anoto lattice code (Anoto Technology: Digital Paper, Digital Pen, and Anoto Software Platform) is about 0.77 mm. The positioning error of the improved coding is higher than that of the Anoto lattice. The coding positioning error is reduced by 0.16 mm on average. In the second set of experiments, the average positioning error of the improved coding is about 0.64 mm, and the average positioning error of the symbol image data of the Anoto dot matrix coding is about 0.79 mm. The positioning error of the improved coding is on average higher than that of the Anoto dot matrix code. It is approximately 0.15 mm.In order to test the overall performance of the improved coding scheme in this paper for handwriting information, on handwriting information, the location accuracy of handwriting information is tested in groups. Use 20 points as a group to test a total of 400 points in 20 groups. Twenty points can constitute a stroke, and the average error of the 20 points in the stroke is used as the overall error of the stroke to analyze the position accuracy of the handwriting information of a certain length. In this experiment, the average error is calculated for every 10 groups, and then the 20 groups of handwriting information errors are analyzed as a whole. The average error test data of 10 groups of handwriting information is shown in Table4.Table 4
10 Groups of handwriting information average error test data.
GroupsAMR-WB+EAAC+10.720.6520.750.6230.760.6640.690.6150.720.6560.780.6870.800.6180.770.6990.690.64100.780.69Average error0.750.65It can be seen from Table4 that the average error of the first 10 groups of handwriting information of the Anoto dot matrix code and the improved code are 0.74 mm and 0.63 mm, respectively, and the average error of the last 10 groups are 0.75 mm and 0.65 mm, respectively. It can be seen that when 20 points are used as a stroke, the position error of the stroke tends to be stable, the stroke error of the dot matrix code is about 0.75 mm, and the handwriting stroke error after the improved coding is about 0.64 mm. The improved coding method reduces the error of the original dot matrix code by about 0.11 mm as a whole.In this experiment, two sets of experiments are also done separately, and each set of experiments selects 20 points from the simulated dot matrix code paper to obtain its decoding time. The results of the study are shown in Figure5.Figure 5
Results of three groups of studies.In order to specifically analyze the performance of various schemes, through data calculation, this group of experiments respectively obtained the average time of the three schemes for handwriting information points. The average time of the Anoto and the traditional Otsu scheme is 9.4 ms, the improved coding and the traditional Otsu scheme average time of Otsu is 8.5 ms, and the average time of improved coding and fast iteration Otsu scheme is 7.6 ms. It can be seen from the experiment that the combination of improved coding and fast iteration is better than the other two.The sound quality comparison between the two is shown in Figure6. It can be seen from Figure 6 that, at low bit rates (≤24 kbps), the performance of AMR-WB+ is better than that of EAAC+.Figure 6
Comparison of sound quality between the two.
(a)(b)ITU-T’s P.862 objective evaluation standard software WB-PESQ (version 2015) was used to perform PESQ scoring on the coding quality of 20 test sequences at 10.4 kbps and 24 kbps coding rates. The test results are shown in Figure7. It can be seen that the average PESQ of this dot matrix coding matrix vectorization proposal under the above two code rates is slightly higher than that of AMR-WB+.Figure 7
Coding quality test results.
(a)(b)Then, the program was compiled to calculate the spectral distortion and compare the spectral distortion between the proposal and the Anoto lattice code at a coding rate of 12.65 kbps. The results are shown in Table5.Table 5
Spectrum of the proposal and Anoto lattice code at 12.65 kbps coding rate.
ParameterThis proposalAMR-WB+Total number of frames2493∗42493∗42–4 dB(%)9.379.17>4 dB(%)0.761.67Average spectral distortion (dB)1.068689321.10735518Because no matter what the codec, for different test sequences, the spectral distortion data will fluctuate within a certain range. Therefore, as long as the same test sequence and the same test conditions, the value of the spectral distortion is within the confidence interval. Inside, it is considered reasonable. Therefore, it can be seen from the above test results that the spectral distortion of the vector quantization part is reasonable.


## 4. Discussion

The data area of the dot matrix code mainly represents the content data, the error correction code words of the content data, and the data distributed in other areas except the positioning area [22]. The data area is the same as the positioning area, and it is also composed of a two-layer structure of square graphics.Rectangular coding uses the four corners of the rectangular frame of the coding sign to obtain the front-view image and then adopts the method of template matching to obtain the coding of the sign, so as to realize the detection and recognition of the rectangular coding sign. Usually, the coordinate system of the mark is determined by three specific points in the dot matrix, and then the mark code is obtained by the coordinates of the remaining points in the coordinate system. This research briefly analyzes the working principle and communication technology of ultrasonic sensor dot matrix coding, combining the design and realization of the two technologies, the program construction of communication, audio, control and other modules of music creation, and the programming commands of the program, including dot matrix, hardware connection, etc.Compared with other sensors, ultrasonic sensors have many advantages such as noncontact measurement objects, wide application environment, anti-electromagnetic interference, stable performance, affordable price, small size, and real-time data transmission. When the measured object does not cover the transmitter and receiver of the ultrasonic sensor at the same time, the ultrasonic sensor cannot perform data transmission. In the early design and creation of musical works, what kind of interactive means need to be considered.


## 5. Conclusion

When the traditional Otsu threshold processing method is used for the dot matrix coded image, some point codes in the binarized image may appear uneven or incomplete, which affects the decoding of the bit matrix code image and the grid raster line. In order to improve the effect of bit matrix code image threshold processing and reduce the calculation time of threshold processing, this paper uses dynamic threshold segmentation method to binarize the bit matrix code image based on the study of bit matrix coded images. In addition, the effect of image processing of the lattice position code is obviously better than the original traditional Otsu algorithm, and the running time is relatively reduced. The development of digital technology has indeed promoted the creation of electronic music.



---

*Source: 8321567-2022-09-30.xml*