{'fraction_non_alphanumeric': 0.01925959232613909, 'fraction_numerical': 0.007419064748201439, 'mean_word_length': 4.764578833693305, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
High-speed Parallel Feature Extraction Algorithm of Wind Tunnel Image Based on GPU

In wind tunnel test, the serial feature extraction algorithm of wind tunnel image based on CPU is too slow to meet the execution speed requirements of wind tunnel test. To solve this problem, a high-speed parallel feature extraction algorithm of wind tunnel image based on GPU is proposed. The proposed algorithm is optimized in parallel from the CUDA kernel level and CUDA stream level to speed up feature extraction execution. In image pre-processing, a pixel is processed by a CUDA thread to achieve parallelization. In feature extraction, the image segmentation is introduced to parallelize 8-connected boundary tracking algorithm. And a CUDA thread is used to process an image block to parallelize feature extraction process. Furthermore, the proposed algorithm uses CUDA stream to asynchronous data transmission and data processing to achieve CUDA stream level parallelism. To verify the efficiency and effectiveness of the GPU-based algorithm, comparative experiment between CPU and GPU is conducted. The experimental results show that the performance of GPU-based parallel algorithm is far better than that of CPU-based serial algorithm. The GPU-based parallel algorithm can greatly improve the execution speed of feature extraction while ensuring the accuracy of feature data.


Introduction
With the development of industrial aerodynamics, people pay more and more attention to wind tunnel test [1]. Wind tunnel test refers to an aerodynamic experimental method of placing a model of object in a wind tunnel to study the gas flow, interaction with the model and understand the aerodynamic characteristics of the object. The method called VM (Vedeogrammetric Measurement) [2,3] is often used in wind tunnel test to measure the deformation and estimate the attitude of the target model. Firstly, one or more cameras are used to take the image of the marked points on the experimental model at the same time. And then the feature information of the mark points is extracted by the feature extraction algorithm so that we can measure the deformation and estimate the attitude of the target model. In the wind tunnel test, the experimental image is a gray-scale image containing a large number of white marked points, which are approximately circular irregular figures. The features extracted from the experimental image are perimeter, area and gray centroid of these white marked points. Figure 1 below shows an experimental sample whose resolution is 5120×5120. In the past few years, feature extraction algorithm based on CPU was often used. Due to the influence of CPU architecture, the algorithm can only be processed in a serialized or low concurrency way, which makes the image processing speed very limited. With the development of wind tunnel technology, the amount of wind tunnel test data is getting larger and larger. The processing speed of traditional feature extraction algorithm based on CPU has  This paper studies the traditional feature extraction algorithm of wind tunnel image based on CPU and conducts the parallel analysis of it. By using GPU and CUDA programming model [4,5,6] to accelerate and optimize the traditional feature extraction algorithm, a high-speed parallel feature extraction algorithm of wind tunnel image based on GPU is propose.

Feature Extraction Algorithm of Wind Tunnel Images Based on CPU
The process of wind tunnel image feature extraction includes two steps: image preprocessing and feature extraction. Image preprocessing includes three steps: binarization, expansion and corrosion. The purpose of image preprocessing is to generate the contour map of marker points according to the grayscale image. Binarization [7] is to transform grayscale image into binary image. Assuming that the threshold value of binarization is T, ( , ) f x y is input and ( , ) g x y is the output result of binarization, the binarization algorithm can be expressed as follows: Then, edge detection is needed for the generated binary image to generate the contour map. Edge detection algorithm includes two steps: expansion and corrosion [8]. The expansion is to use 8connected neighbourhood to check the internal hollow pixel of the marker points so that we can get regularizing contours of marked points. The expansion can be expressed as follows: After the expansion, the corrosion uses a 4-domain cross core to extract the contour map of the marked points. The corrosion can be expressed as follows: The feature extraction process includes two steps: 8-connected boundary tracking algorithm [9,10] to extract bounding boxes and feature extraction. 8-connected boundary tracking algorithm is used to track the boundary information of the contour map. Its idea is to start from a certain boundary pixel point of the contour and search out other pixel points of the contour according to a certain "detection criterion" until returning to the starting boundary point, so as to track the target boundary. When tracking the boundary, the 8-connected boundary tracking algorithm needs to set the tracking starting point, the initial tracking direction and the tracking direction rotation mode (clockwise or counter clockwise) [11]. In the tracking process, we save the maximum and minimum values of the pixels in the x and y directions to extract the bounding box of marked points. After getting the bounding box, we extract the area and gray centroid of the marked points on grayscale image according to the information of the bounding box. The area of marked points can be calculated by counting the number of pixels whose value is greater than the threshold value of binarization in the bounding box area of grayscale image. The area calculation formula is as follows.
The gray centroid algorithm [12] is used to calculate the gray centroid of the marked points. The gray centroid algorithm divides the weighted sum of coordinates and pixel values by the sum of pixels in bounding box area. Assuming that ( , ) w x y represents pixel weight, ( , ) f x y represents pixel value, D represents calculation area, the detailed calculation formula is as follows.
( , ) x y x y x y x y

Parallel Feature Extraction Algorithm of Wind Tunnel Images Based on GPU
The feature extraction algorithm based on CPU can only perform in a serial or low concurrent way. To improve the speed performance of the feature extraction algorithm, this paper adopts CUDA to design a parallel feature extraction algorithm of wind tunnel image based on GPU. In image preprocessing, each pixel is processed in exactly the same way while the processing between pixels is completely irrelevant. Obviously, they are highly parallelizable. Therefore, when using GPU for image preprocessing, a CUDA thread is used to process a pixel correspondingly so that we can process image data in parallel. We configure 128 CUDA threads into one CUDA block which processes an image block composed of 128 pixels in a row. Figure 2 below shows the correspondence between the CUDA thread and the image processing unit.

Figure 2.
Correspondence between the CUDA thread and the image processing unit. In feature extraction, the key to parallel feature extraction is parallel extraction of bounding box. After the bounding box extraction is completed, each bounding box is processed in the same way. According to the 8-connected boundary tracking algorithm, the key to parallel extraction of bounding box is to find the starting pixel point of the contour of the marker point in parallel. In this paper, a parallel feature extraction algorithm based on image segmentation is proposed. The algorithm divides the image into image blocks of the same size, and uses CUDA threads to parallelize image blocks at the same time. Figure 3 below shows the principle of parallel feature extraction.  When a contour of a marker point is divided into different image blocks, each image block will extract same bounding box. To solve this problem efficiently, we use preliminary screening and precise screening which are both based on the distribution characteristics of the repeated bounding box data in the GPU memory. Preliminary screening is to compare the current bounding box with that of its adjacent blocks which includes upper right blocks, right blocks, lower right blocks, and lower block. If the same data exists, the current bounding box will be discarded. Precise screening is to compare the current bounding box with the bounding boxes extracted from the image block in the lower half of its 9×9 neighbourhood. If the same data exists, the current bounding box will be discarded. After getting the bounding box, each bounding box is used to extract the area and gray centroid of the marked point on grayscale image by a CUDA thread so that we can extract the feature of all marked points in parallel. When using GPU to speed up the feature extraction process, the data transmission between CPU and GPU is very time-consuming. We can introduce CUDA stream [13] to solve this problem, improve the processing speed and realize the CUDA stream level parallelism. CUDA stream can asynchronize data transmission and data processing, and different CUDA streams can be executed concurrently to improve the utilization efficiency of GPU. By creating a reasonable number of CUDA streams, we can hide the  Figure 5 below shows the principle of CUDA stream parallelism.

Design and Analysis of Experiment
In order to verify the effectiveness of the parallel feature extraction algorithm based on CUDA, repeated test experiments on four kinds of wind tunnel test images were conducted. Figure 6 below shows 4 kinds of sample images and their information. (1 10 20 50 100) imgsize Speed t t t t t Figure 6 shows the execution speed comparison between CPU and GPU. We can see from the figure 6, the execution speed of GPU is far faster than that of CPU. The average execution speed of GPU reaches 1524.14M/s and the average acceleration ratio of GPU to CPU is 12.71.  Figure 6. Execution speed comparison between CPU and GPU. In order to explore whether the number of marked points in a sample affects the performance of the parallel feature extraction algorithm based on GPU, we conducted test experiments on sample 1 and sample3. Firstly, we set the 1/2, 3/4, and 4/4 of image data to zero to generate samples containing different numbers of marked points as shown in Figure 7.  Figure 8 by testing the execution time of the preprocessing and feature extraction when the number of the samples is 100. It can be seen from Figure 8 that the relationship between the parallel feature extraction algorithm on the GPU and the number of marked points in the sample image can be described as follows: 1) The number of feature points in a sample has almost no effect on the image pre-processing, because no matter whether there are marked points or not, the corresponding preprocessing operations must be performed.
2) The number of feature points in sample image has an effect on the feature extraction part. The more marked points in a sample, the slower the execution speed of the feature extraction. Because more   Figure 7. In order to explore the effect of CUDA stream on the performance of the algorithm based on GPU, we test the execution speed of four sample images when the number of CUDA stream is one, two and five. Figure 9 below shows the execution speed with different number of CUDA streams. It can be seen from Figure 9 that CUDA stream can improve the performance of the algorithm based on GPU. Different samples have different optimization effect, which is related to the proportion of data transmission time in the image execution process. If the proportion of data transmission time is too low, the transmission delay that can be hidden accounts for a low proportion of the total time. And the performance of the algorithm can be improved a little. If the proportion of data transmission is too high, the feature extraction process takes a short time and the transmission delay cannot be completely hidden. In order to verify the effectiveness of the algorithm based on GPU, we compare the feature data extracted by the CPU with the feature data extracted by the GPU. To calculate the number of feature points, mean square error of area, perimeter and gray centroid, we can get the algorithm validity test result as shown in Table 1. It can be seen that the GPU algorithm execution result is exactly the same as the CPU execution result, which can prove the effectiveness of the algorithm based on GPU. Table 1

Conclusion
In this paper, the feature extraction algorithm of wind tunnel image is studied. Aiming at solving the problem of low performance of serial feature extraction algorithm based on CPU, a high-speed parallel feature extraction algorithm of wind tunnel image based on GPU is proposed. The feature extraction process is accelerated by CUDA kernel-level and CUDA stream-level parallelization. The experimental verification shows that the performance of high-speed parallel feature extraction algorithm of wind tunnel image based on GPU is far superior to that of the serial feature extraction algorithm based on CPU. The average processing speed of the algorithm based on GPU reaches 1534M/s, which is 12.73 times higher than that of the algorithm based on CPU.