After binarizing the concrete images, calculate the horizontal and vertical binary gradient of each pixel in the image using this equation. Calculate the binary gradient direction and size of each point using this equation. Then determine the size of the image segmentation block represented as n.
To divide the image into square blocks of n by n, set a segmentation line for every n pixels along the horizontal axis and the vertical axis. Classify pixels into the appropriate gradient's statistical angle interval of each direction based on the binary gradient direction of each pixel in the block. To obtain the gradient statistical value of that interval, sum the binary gradient of the pixels in the gradient statistical angle interval of each direction in the counterclockwise direction.
Record the results obtained for the gradient statistical angle interval directional gradient statistics. Next, divide samples into precise calculation areas where each area consists of four adjacent blocks. Calculate the statistical value of the directional gradient within the angle interval for each block in the specified calculation area.
Then generate the feature vector with the directional gradient's statistics as a component. Combine the directional gradient feature vectors derived from each calculation area to obtain the directional gradient feature vector of the image. As the block size is expanded to a certain extent, the directional gradient features in each block of concrete image samples with different vibration states exhibit significant differences.