## 2 Materials and Methods
### Procedures  
Conventional core analysis is commonly used to analyze matrix porosity and permeability in tight sand rocks, because sampling makes it difficult to contain fractures in samples. A total of 62 non-fractured samples were used to perform conventional core analysis using a SL-5 rock permeability analyzer. It was done with a temperature and pressure of 24 \({}^{\circ}\)C and 91.5 KPa, respectively, following the standard SY/T 5336-1996 of China. Before the experiments, every core was cut into three parts for casting thin sections, SEM, and high-pressure mercury injection experiments. Fresh sections and polished samples were coated with gold and then observed by a FEI Quanta 200F SEM (20 KV, high vacuum mode), and all of the experiments were done at China University of Geosciences in Beijing. Based on casting thin sections and SEM, the pore structure, including both micron pores and nano-pores, were analyzed using the Matlab software. Using Matlab to quantitatively analyze the tight sandstones in different research areas, we first needed to convert the cast image and scanning electron microscope image into a binary image, and the image binarization then required setting the gray value of pixels on the image to 0 or 255. The entire image presents a clear black-and-white effect, and the binary image displays the internal structure of the image to the greatest extent. Corresponding to the reservoir sandstone image, the point where the pixel is 0 is black, and represents the particle. The point where the pixel is 255 is white, and represents the pore area. First, the image is binarized by the built-in application 'Color Thresholder' in Matlab (Figure 2). H is the whole color space of the image, and the entire image range is controlled when the red void space is removed from the color disk. S and V are respectively saturated. Figure 1: The location map of the study area. After pretreatment of casting thin sections images and SEM images, corresponding binary images are obtained (Figure 3d-f), and the parameters such as image porosity, particle size, pore throat distribution, and average pore radius are further calculated. The function'size' in Matlab can identify and extract the pixels in the binary image. Through the built-in function 'bwarea', the total number of image points '\(N_{p}\)' (the sum of all of the black and white pixels) can be obtained, respectively. Meanwhile, the pixels of pores '\(N_{a}\)' can also be identified by function'size'. So, porosity '\(P\)' is the ratio of white pixels to the total pixels:  
\[P=\frac{N_{a}}{N_{p}}\times 100\% \tag{1}\]  
Furthermore, for the distribution of pore radius, the built-in function 'bwlabel' in Matlab can identify areas of the same pixel value and determine the boundary of the area. Based on this principle, the void area (black or white pixel value connected area) can be determined. Apply the function 'bwlabel' for each connected area (pore area and non-pore area) to find the maximum and minimum values of the \(X\) and \(Y\) axes for each region; \(x_{\text{max}}\), \(x_{\text{min}}\), \(y_{\text{max}}\), and \(y_{\text{min}}\) are calculated so that the diameter '\(d\)' for each particle or pore is the average of the differences in the \(X\) and \(Y\) directions. The size of the radius \(d\):  
\[d=\frac{(x_{\text{max}}-x_{\text{min}})+(y_{\text{max}}-y_{\text{min}})}{2} \tag{2}\]  
The results are displayed as shown in Figure 3g-i. Different colors represent different particle sizes. Most of the aperture recognition results are relatively good, but sometimes, there is noise generated during the image binarization process. Thus, some pores were divided into smaller parts, some long pores were divided into several parts, and some smaller pores were also merged into larger pores, which is also the main error of the experiment. Error and accuracy will be discussed later.