Python-based steel fiber concrete fiber order statistics and analysis method
Through Python-based CT image processing and three-dimensional reconstruction technology, automated analysis of fiber orientation of steel fiber concrete is realized, solving the accuracy and destructive problems of fiber distribution analysis in the existing technology, and providing efficient and intuitive fiber distribution quantification. Analytical methods.
Patent Information
- Application Number
- CN202410518852.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-09-24
AI Technical Summary
It is difficult to quantitatively analyze the internal fiber orientation of steel fiber concrete with existing technology, and traditional methods rely on third-party modeling software and cannot achieve automated and high-precision fiber distribution analysis.
Using a Python-based method, CT image processing and three-dimensional reconstruction technology are used to automatically complete the reading, calculation, interpolation and visualization of fiber orientation, providing a steel fiber concrete fiber order statistics and analysis method that does not require third-party modeling software. , including image processing, fiber three-dimensional reconstruction, specified direction analysis and three-dimensional visualization.
It improves the accuracy and intuitiveness of fiber orientation distribution analysis of steel fiber concrete, avoids the problems of sample destruction and fiber redistribution in traditional methods, and achieves non-destructive and efficient quantitative analysis of fiber distribution.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The invention relates to a Python-based steel fiber concrete fiber sequence statistics and analysis method, belonging to the field of high-performance materials. Technical Background
[0002] With the development of society, people have higher and higher requirements for concrete. Especially in recent years, with the development of various large-span bridges and high-rise buildings, ordinary concrete has been unable to meet the demand. Steel fiber concrete (SFRC) is a new type of composite material that can be cast and sprayed by adding an appropriate amount of short steel fibers to ordinary concrete. It has been rapidly developed at home and abroad in recent years. It overcomes the shortcomings of concrete such as low tensile strength, low ultimate elongation, and brittleness. It has excellent tensile, bending, shear, crack resistance, fatigue resistance, high toughness and other properties. It has been used in engineering fields such as hydraulic engineering, roads and bridges, and construction.
[0003] A large amount of fibers significantly increases the cost of steel fiber concrete. Therefore, from a cost perspective, the actual application of steel fiber concrete should minimize the fiber volume content. The orientation and distribution of steel fibers have a great influence on the mechanical properties of steel fiber concrete components, especially the tensile properties and toughness. Therefore, the study of steel fiber orientation and distribution is crucial to improving the performance of steel fiber concrete.
[0004] Industrial CT computer tomography scanning technology is developed on the basis of traditional CT technology. It uses multi-angle projection, all-round scanning, detection equipment reception and image reconstruction technology to obtain clear images of the detection level. The use of non-destructive testing technology, especially industrial CT computer tomography scanning technology, has many advantages such as high precision and good sustainability. In addition to two-dimensional analysis of CT scanning test technology, the application of three-dimensional visualization technology to three-dimensional reconstruction of concrete scanned images can more intuitively display the internal structure of concrete and provide effective information for studying the distribution and arrangement of steel fibers in concrete. Python language is a powerful programming language with a wide range of data analysis libraries that can process and analyze various types of data and has powerful visualization capabilities.
[0005] In general, due to the high fiber content, the evaluation of steel fiber orientation in research is usually done by naked eye observation, and the orientation and distribution of steel fibers inside concrete cannot be evaluated; the index for evaluating fiber orientation is usually the average orientation index of all fibers in steel fiber concrete, which lacks analytical basis for concrete components with different local stress conditions. The use of traditional modeling software to analyze steel fiber concrete specimens can observe the general distribution of steel fibers inside, but it is impossible to quantitatively analyze the orientation of steel fibers inside the specimens. In this case, it is particularly important to propose a statistical and analytical method for fiber sequence identification in steel fiber concrete. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a Python-based steel fiber concrete fiber sequence identification statistics and analysis method, which can automatically complete the reading, calculation, interpolation, storage and visualization process of the internal fiber orientation characteristics of steel fiber concrete without relying on third-party modeling software, so as to facilitate the statistics and quantitative analysis of the internal fiber orientation of steel fiber concrete.
[0007] The present invention adopts the following technical solution:
[0008] A Python-based steel fiber concrete fiber sequence statistics and analysis method, the steps are as follows:
[0009] (1) After obtaining the CT grayscale image of steel fiber concrete, the image is processed by position adjustment, interference information removal, binarization, watershed segmentation, Boolean operation and other image processing methods. The above methods improve the accuracy of CT images when the CT image accuracy is low, ensuring that the steel fibers are effectively distinguished from concrete materials and can be accurately extracted. The steel fibers are reconstructed in three dimensions, and the three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table as an endpoint information table.
[0010] (2) Configure the program running environment and install the third-party function library provided by the program. Read the steel fiber endpoint information in the Excel file through the Python script file. Calculate the fiber midpoint coordinates and the fiber head and tail end coordinate increments through the Python script file. The fiber midpoint coordinates are used to locate the fiber position, and the fiber endpoint coordinates are used to calculate the fiber orientation. Finally, these fiber three-dimensional information are integrated.
[0011] (3) Users can customize the specified direction according to the main force direction of the steel fiber concrete structure, calculate the cosine value of each fiber and the specified direction through the Python script file, and calculate the absolute value of the cosine value and the angle value formed with the specified direction through the cosine value, which is used to quantitatively analyze the orientation of steel fibers in concrete specimens.
[0012] (4) The user can define the number of grids and the area of steel bars to be removed to effectively distinguish steel fibers from steel bars. By running a python script to read the information in the Excel table and generate a three-dimensional homogeneous graph of the fiber orientation value, the orientation distribution of the steel fibers inside the specimen can be observed intuitively.
[0013] (5) When studying the distribution law of steel fibers along a stress curve that needs to be studied separately, the user can customize the curve function that needs to be studied separately in the space and draw a three-dimensional stereogram of the fiber orientation values in each grid along the curve by running a python script.
[0014] The Python-based steel fiber concrete fiber sequence statistics and analysis method of the present invention, the specific steps of step (1) are as follows:
[0015] (11) Binarize the obtained steel fiber concrete CT grayscale image, distinguish different materials by grayscale values within different thresholds, assign a specific value to the pixel points within a specific grayscale value, and define them as the same material;
[0016] (12) Use the watershed segmentation method to distinguish the boundaries of different materials in the CT grayscale image and accurately and comprehensively identify all materials;
[0017] (13) For reinforced steel fiber concrete materials, the Boolean operation of three-dimensional graphics is used to divide the steel bar area, and then the difference set is taken from the steel in the watershed result in step (12) to accurately distinguish the steel fiber from the steel bar, and obtain a binary image after removing the steel bar;
[0018] Since the image processed by the watershed segmentation method does not remove the steel bars, and the program will identify all the pixels with the grayscale value of steel as steel fibers, the Boolean operation of three-dimensional graphics is used to divide a certain area around the steel bars, perform a separate binary processing, and then take the difference set with the steel in the watershed result to obtain the above binary image after removing the steel bars;
[0019] (14) The binary image obtained in step (13) after removing the steel bars is used to obtain the three-dimensional coordinate information of the fiber endpoints, and the three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table as a three-dimensional endpoint information table.
[0020] The Python-based steel fiber concrete fiber sequence statistics and analysis method of the present invention, in step (2), calculates the fiber midpoint coordinates and the fiber head and tail end coordinate increments through a Python script file, and integrates the fiber three-dimensional information, specifically comprising the following steps:
[0021] Import the pandas library to read data from Excel tables, establish efficient indexes, flexibly query and filter data, and write the results to new Excel tables; import the numpy library to perform operations on array structure data; import the library functions in math;
[0022] Read the data in the Excel table through the pd.read_Excel() function;
[0023] The pd.DataFrame() function is used to store the calculated coordinates of the midpoint of each fiber and the coordinate increments of the fiber's beginning and end.
[0024] The iloc() function is used to calculate the midpoint coordinate value and endpoint coordinate increment of each fiber in the for loop function;
[0025] Write the data into a new Excel using the to_Excel() function and merge the tables using the pd.concat() function.
[0026] The Python-based steel fiber concrete fiber sequence statistics and analysis method of the present invention, the specific steps of step (3) are as follows:
[0027] Define the specified direction through the np.array() function; calculate the cosine value of the angle between the fiber and the specified direction through the np.dot() function and the np.linalg.norm() function;
[0028] The cosine value is limited to the range of [-1,1] by the np.clip() function to prevent the overflow of the arccosine function; the absolute value of the cosine value is calculated by the math.acos(abs()) function;
[0029] The math.degrees() function is used to calculate the angle between the fiber and the specified direction; the apply() function is used to add the result to the data table;
[0030] Write the data into a new Excel file using the to_Excel() function.
[0031] The Python-based steel fiber concrete fiber sequence statistics and analysis method of the present invention, step (4) specifically includes the following steps:
[0032] The information in the Excel table is read by running the python script, and a three-dimensional homogeneous graph of the fiber orientation value is generated. The specific steps include the following:
[0033] Import the pandas library to read data from Excel tables, establish efficient indexes, flexibly query and filter data, and write the results to a new Excel table; import the numpy library to operate on array structure data; import scipy.interpolate to call the Rbf function to interpolate missing grids; import the matplotlib.pyplot library to visualize data;
[0034] The Excel file is read through the pd.read_Excel() function to obtain the three-dimensional coordinates of the fiber center point and the corresponding cosine value; the user enters the number of grids required to be divided along the x, y, and z directions to define the steel bar area; a list is created to store the coordinates and values of the grid center point;
[0035] The value in each grid is stored through the np.zeros() function; each grid is traversed through the for loop function to calculate the average cosine value of the fiber in the grid; the if judgment function is used to determine whether the grid is within the steel bar range, and the grid within the steel bar range is assigned a value of 0; the if judgment function and the np.isnan() function are used to determine whether there is a fiber orientation value in the grid; the Rbf() function is used to interpolate and fill the grid that is not within the steel bar range and does not contain fibers; the to_Excel() function is used to store the grid data in a new Excel table.
[0036] Set the maximum range of the data to prevent the interpolated data from exceeding the maximum range of the data; divide the space into a specified number of grids through np.meshgrid(); define the data to be visualized through the plt.figure() function; specify the visualization voxel color, viewing angle, and scale through the ax.voxels() function; set the coordinate axis label through the set_xlabel() function; set the color bar through the colorbar() function; and achieve three-dimensional visualization through plt.show().
[0037] In step (5) of the Python-based steel fiber concrete fiber sequence statistics and analysis method of the present invention, a three-dimensional stereogram of the fiber orientation values in each grid of the extension curve is drawn by running a python script, which specifically includes the following steps:
[0038] Import the pandas library to read data from Excel tables, establish efficient indexes, flexibly query and filter data, and write the results to a new Excel table; import the numpy library to operate on array structure data; import scipy.interpolate to call the Rbf function to interpolate missing grids; import the matplotlib.pyplot library to visualize data;
[0039] The Excel file is read through the pd.read_Excel() function to obtain the three-dimensional coordinates of the fiber center point and the corresponding cosine value; the user inputs the number of grids required to be divided along the x, y, and z directions to define the steel bar area; the specified curve is defined through the def curve() function; a list is created to store the coordinates and values of the grid center point;
[0040] The value in each grid is stored through the np.zeros() function; each grid is traversed through the for loop function to calculate the average cosine value of the fiber in the grid; the if judgment function is used to determine whether the grid is within the steel bar range, and the grid within the steel bar range is assigned a value of 0; the if judgment function and the np.isnan() function are used to determine whether there is a fiber orientation value in the grid; the Rbf() function is used to interpolate and fill the grid that is not within the steel bar range and does not contain fibers; the if judgment function is used to determine whether the straight line intersects with the current grid, and the data of the intersecting grid is stored in a list of grid center point coordinates and values; the to_Excel() function is used to store the grid data in a new Excel table;
[0041] Set the maximum range of the data to prevent the interpolated data from exceeding the maximum range of the data; divide the space into a specified number of grids through np.meshgrid(); define the data to be visualized through the plt.figure() function; specify the visualization voxel color, viewing angle, and scale through the ax.voxels() function; set the coordinate axis label through the set_xlabel() function; set the color bar through the colorbar() function; and achieve three-dimensional visualization through plt.show().
[0042] Beneficial Effects
[0043] The Python-based steel fiber concrete fiber sequence statistics and analysis method proposed in the present invention improves the accuracy of the analysis of steel fiber orientation distribution in steel fiber concrete, improves the situation in which the specimen needs to be cut and damaged when analyzing the steel fiber orientation in the past, and has both high accuracy and intuitiveness in the analysis of steel fiber orientation inside concrete, which facilitates quantitative analysis thereof and has broad application potential.
[0044] Non-destructive evaluation: Compared with the traditional physical cutting method, the present invention does not destroy the sample and is suitable for detecting the steel fibers inside the overall structure of the specimen. At the same time, for the damaged components, it avoids the redistribution of the fiber orientation caused by external forces in the traditional cutting method, and provides an effective tool for analyzing the orientation of steel fibers inside the damaged components.
[0045] High efficiency and accuracy: Through a series of image processing technologies, the interference factors during analysis are greatly reduced, steel fibers can be effectively distinguished from steel bars, avoiding the influence of steel bars on fiber identification, and greatly improving the accuracy of data analysis. The efficient identification of fibers can also realize the quantitative analysis of the distribution of steel fibers inside the specimen.
[0046] Intuitive 3D representation: The 3D reconstruction model provides users with an intuitive image of the steel fiber orientation distribution, which helps to better understand the relationship between the steel fiber distribution inside the material and the structural performance.
[0047] Wide application potential: This method is not only applicable to steel fiber reinforced concrete, but can also be extended to the internal structure analysis of other composite materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a flow chart of the specific steps of CT image processing and three-dimensional reconstruction of the present invention.
[0049] Figure 2 This is a flowchart of the specific steps of calculating and integrating the three-dimensional fiber information using the Python script of the present invention.
[0050] Figure 3 This is a flowchart of the specific steps for the Python script of the present invention to calculate the angle information between the fiber and the specified direction.
[0051] Figure 4 A flowchart of the specific steps for the Python script of the present invention to generate a three-dimensional homogeneous graph of fiber orientation values.
[0052] Figure 5 A flowchart of the specific steps for the Python script of the present invention to draw a three-dimensional stereogram of the fiber orientation values in each grid along the curve.
[0053] Figure 6 (a) is a grayscale image of the CT scan of the specimen of the present invention. (b) is a schematic diagram of the binarization result of the specimen of the present invention. (c) is a schematic diagram of the watershed segmentation method of the specimen of the present invention. (d) is a result diagram of the watershed segmentation method of the specimen of the present invention. (e) is a schematic diagram of the three-dimensional reconstruction of the steel bars of the specimen of the present invention. (f) is a schematic diagram of the three-dimensional reconstruction of the steel bars and steel fibers of the specimen of the present invention.
[0054] Figure 7 The Python script of the present invention draws a three-dimensional homogeneous schematic diagram of fiber orientation values.
[0055] Figure 8 (a) is a three-dimensional graph of the fiber orientation values in each grid along the straight line drawn by the Python script of the present invention. (b) is a three-dimensional graph of the fiber orientation values in each grid along the curved line drawn by the Python script of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose and technical solution of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] A magnetic field was used to orient the steel fibers inside a 100mm×100mm×515mm reinforced steel fiber ultra-high performance concrete rectangular beam. A 100mm×100mm×50mm test block was cut out at the end of the beam and CT scanned. The CT grayscale image obtained is shown in the figure below. Figure 6 (a) is shown. A Python-based steel fiber concrete fiber sequence statistics and analysis method is performed on the specimen, including the following steps:
[0058] Step 1: If Figure 1 As shown in the figure, after obtaining the CT grayscale image of steel fiber concrete, a series of image processing and three-dimensional reconstruction are required, and the three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table.
[0059] Furthermore, the step 1 specifically includes the following steps:
[0060] (1) Binarization is performed on the acquired CT grayscale image, that is, pixels within a specific grayscale value are assigned a specific value to identify them as the same material. In this operation, pixels with a grayscale value range of 0 to 41 are judged as pores and assigned a value of 1; pixels with a grayscale value range of 51 to 117 are judged as ultra-high performance concrete cementitious materials and assigned a value of 2; pixels with a grayscale value range of 122 to 255 are judged as steel and assigned a value of 3. Figure 6 As shown in (b), light blue represents pores, dark blue represents cementitious materials, and red represents steel.
[0061] (2) Since the controversial part of the transition between different materials is not selected after the binary processing, the watershed segmentation method is used to fill the entire image with the boundary of the same gray value between different materials. The result of the watershed segmentation method is as follows Figure 6 (d)
[0062] (3) Since the image processed by the watershed segmentation method does not remove the steel bars, and the program will identify all pixels with grayscale values of steel as steel fibers, the Boolean operation of three-dimensional graphics is used to divide a certain area around the steel bars, such as Figure 6 As shown in (e), the binary processing is performed separately, and then the difference set is taken with the steel in the watershed result in (12) to obtain the binary image after removing the steel bars;
[0063] (4) The three-dimensional reconstruction technology is used for the results of (13). The fiber reconstruction results are as follows Figure 6 (f) The three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table.
[0064] Step 2: If Figure 2As shown, the fiber midpoint coordinates and the fiber head and tail end coordinate increments are calculated through a Python script file, and the fiber three-dimensional information is integrated.
[0065] Furthermore, the step 2 specifically includes the following steps:
[0066] (1) Import related modules;
[0067] import pandas as pd
[0068] import numpy as np
[0069] import math
[0070] The first line of code imports the pandas library, which is used to read data from Excel tables, establish efficient indexes, flexibly query and filter data, and write the results to a new Excel table;
[0071] The second line of code imports the numpy library, which is used to operate on array structure data;
[0072] The third line of code imports the library functions in math.
[0073] (2) Read the data in the Excel table; create a list to store the calculated coordinates of the midpoint of each fiber and the coordinate increments of the fiber's beginning and end:
[0074] df = pd.read_Excel("*.xlsx")
[0075] result_df=pd.DataFrame(columns=['ID','X','Y','Z')
[0076] (3) Calculate the midpoint coordinate value and endpoint coordinate increment of each fiber, and write the results into a new Excel file:
[0077]
[0078]
[0079] The first to eighth lines of code use the iloc() function in a for loop function to calculate the midpoint coordinate value and endpoint coordinate increment of each fiber; the ninth line of code writes the data into a new Excel using the to_Excel() function; the tenth to twelfth lines of code merge the tables using the pd.concat() function.
[0080] Step 3: If Figure 3 As shown, the angle information between the fiber and the specified direction is calculated through the Python script file.
[0081] Furthermore, the step three specifically includes the following steps:
[0082] (1) Define a specified direction and calculate the cosine of the angle formed with the direction:
[0083] def calculate_cosine_value(direction_vector):y_axis=np.array([1,0,0])
[0084] cosine_value=np.dot(direction_vector,y_axis) / (np.linalg.norm(direction_vector)*np.linalg.norm(y_axis))
[0085] return cosine_value
[0086] The first line of code defines the unit vector (1, 0, 0) in the specified direction; the second line of code calculates the cosine value of the angle between the fiber and the specified direction through the np.dot() function and the np.linalg.norm() function.
[0087] (2) Calculate the angle between the fiber and the specified direction:
[0088] def cosine_to_angle(cosine_value)
[0089] cosine_value=np.clip(cosine_value,-1,1)
[0090] angle_rad=math.acos(abs(cosine_value))
[0091] angle_deg=math.degrees(angle_rad)
[0092] The first line of code defines the angle function; the second line of code uses the np.clip() function to limit the cosine value to the range of [-1,1] to prevent overflow of the arccosine function; the third line of code uses the math.acos(abs()) function to calculate the absolute value of the cosine value; and the fourth line of code uses the math.degrees() function to calculate the angle between the fiber and the specified direction.
[0093] (3) Write the results to a new Excel file:
[0094] result1['Angle_Degrees']=result1['Cosine_Value'].apply(cosine_to_angle)
[0095] result1['Absolute_Cosine_Value']=result1['Cosine_Value'].apply(abs)
[0096] result1.to_Excel("* / final.xlsx",index=False)
[0097] Step 4: If Figure 4 As shown in the figure, the information in the Excel table is read by running the python script, and a three-dimensional homogeneous diagram of the fiber orientation value is generated.
[0098] Furthermore, the step 4 specifically includes the following steps:
[0099] (1) Import related modules:
[0100] import numpy as np
[0101] import pandas as pd
[0102] import matplotlib.pyplot as plt
[0103] from scipy.interpolate import Rbf
[0104] The first line of code imports the pandas library, which is used to read data from Excel tables, establish efficient indexes, flexibly query and filter data, and write the results to a new Excel table; the second line of code imports the numpy library, which is used to operate on array structure data; the third line of code imports the matplotlib.pyplot library, which is used to visualize data; the fourth line of code imports scipy.interpolate, which is used to call the Rbf function to interpolate missing grids;
[0105] (2) Read the Excel file to obtain data information and define the grid and reinforcement area;
[0106] df=pd.read_Excel("* / final.xlsx",sheet_name='Sheet1',usecols=['XCoord[nm]','Y Coord[nm]','Z Coord[nm]','Absolute_Cosine_Value'])
[0107] coords=df.iloc[:,:3].to_numpy()
[0108] values=df.iloc[:,3].to_numpy()
[0109] d1,d2,d3=7,30,30
[0110] y_center,z1_center,z2_center=750,750,1750; radius=150
[0111] in_cylinder=((coords[:,1]-y_center)**2+(coords[:,2]-z1_center)**2<=
[0112] radius**2)|((coords[:,1]-y_center)**2+(coords[:,2]-z2_center)**2<=radius**2)
[0113] grid_data = []
[0114] The first line of code reads the Excel file to obtain the three-dimensional coordinates of the fiber center point and the corresponding cosine value; the fourth line of code allows the user to input the number of grids required along the x, y, and z directions; the fifth and sixth lines of code define the reinforcement area.
[0115] (3) Grid division and interpolation;
[0116] Divide the space into d1*d2*d3 grids and determine the coordinate range of each grid:
[0117] x_min,y_min,z_min=coords.min(axis=0)
[0118] x_max,y_max,z_max=coords.max(axis=0)
[0119] x_step=(x_max-x_min) / d1; y_step=(y_max-y_min) / d2; z_step=(z_max-z_min) / d3
[0120] The np.zeros() function is used to store the values in each grid; the for loop function is used to traverse each grid and calculate the average cosine value of the fibers in the grid:
[0121]
[0122] The if judgment function is used to determine whether the grid is within the steel bar range. For the grid within the steel bar range, a value of 0 is assigned; the if judgment function and the np.isnan() function are used to determine whether there is a fiber orientation value in the grid; the Rbf() function is used to interpolate and fill the grid that is not within the steel bar range and does not contain fibers;
[0123]
[0124] Add the mesh center point coordinates and values to the list:
[0125] grid_data.append([x_center_grid,y_center_grid,z_center_grid,mean_values[i,j,k]])
[0126] grid_df=pd.DataFrame(grid_data,columns=['x_center','y_center','z_center',
[0127] 'mean_value'])
[0128] Store the grid data into a new Excel table via the to_Excel() function:
[0129] grid_df.to_Excel("* / result.xlsx",index=False)
[0130] (5) Display a three-dimensional mean graph;
[0131] Set the maximum range of the data to prevent the interpolated data from exceeding the maximum range of the data:
[0132] max_val=1.0
[0133] min_val=0
[0134] mean_values[mean_values>max_val]=1.0
[0135] mean_values[mean_values <min_val]=0
[0136] Divide the space into a specified number of grids through np.meshgrid(); define the data to be visualized through the plt.figure() function; specify the color, viewing angle, and scale of the visualized voxels through the ax.voxels() function; set the axis labels through the set_xlabel() function; set the color bar through the colorbar() function; and achieve three-dimensional visualization through plt.show():
[0137] x,y,z=np.meshgrid(np.arange(d1+1),np.arange(d2+1),np.arange(d3+1),indexing='ij')
[0138] fig = plt.figure()
[0139] cmap=plt.cm.jet
[0140] ax=fig.add_subplot(projection='3d')
[0141] norm = plt.Normalize(0,1)
[0142] ax.voxels(x,y,z,mean_values,edgecolor='None',
[0143] facecolors=cmap(norm(mean_values)))
[0144] ax.set_box_aspect([np.ptp(coords[:,i])for iin range(3)])
[0145] ax.set_xlabel('X axis')
[0146] ax.set_ylabel('Y axis')
[0147] ax.set_zlabel('Z axis')
[0148] fig.colorbar(plt.cm.ScalarMappable(norm,cmap=plt.colormaps["jet"]),shrink=0.8)
[0149] plt.show()
[0150] The three-dimensional homogeneous diagram of the fiber orientation cosine value drawn by this method is shown in Figure 7 shown.
[0151] Step 5: If Figure 5 As shown in the figure, a three-dimensional graph of the fiber orientation values in each grid along the curve is drawn by running the python script.
[0152] Furthermore, the step five specifically includes the following steps:
[0153] (1) Import related modules:
[0154] The code here is the same as step 4 (1);
[0155] (2) Read the Excel file through the pd.read_Excel() function to obtain the three-dimensional coordinates of the fiber center point and the corresponding cosine value; the user inputs the number of grids required to be divided along the x, y, and z directions to define the steel bar area; define the specified curve through the defcurve() function; create a list to store the coordinates and values of the grid center point;
[0156] …
[0157] Function definition specifies the curve
[0158] def curve(y,z):
[0159] return 0.0018*y**2-4.1224*y+3008.4
[0160] …
[0161] The rest of the code is the same as step 4 (2).
[0162] (3) Store the value in each grid through the np.zeros() function; traverse each grid through the for loop function and calculate the average cosine value of the fiber in the grid; determine whether the grid is within the steel bar range through the if judgment function, and assign a value of 0 to the grid within the steel bar range; determine whether there is a fiber orientation value in the grid through the if judgment function and the np.isnan() function; interpolate and fill the grid that is not within the steel bar range and does not contain fibers through the Rbf() function; determine whether the straight line intersects with the current grid through the if judgment function, and store the data of the intersecting grid in the list created in (2); store the grid data in a new Excel table through the to_Excel() function;
[0163] …
[0164] Determine whether the line intersects the current grid
[0165] if z_range[0]<=curve(y_center_grid,z_center_grid)<=z_range[1]:
[0166] curve_intersections.append((x_center_grid,y_center_grid,z_center_grid,mean_values[i,j,k]))
[0167] ”'
[0168] Read the center point coordinates and fiber orientation cosine value of the grid on the curve
[0169] grid_df=pd.DataFrame(curve_intersections, columns=['x_center','y_center',
[0170] 'z_center','mean_value'])
[0171] The rest of the code is the same as step 4 (3).
[0172] (4) Set the maximum range of the data to prevent the interpolated data from exceeding the maximum range of the data; divide the space into a specified number of grids using np.meshgrid(); define the data to be visualized using the plt.figure() function; specify the color, viewing angle, and scale of the visualization voxels using the ax.voxels() function; set the axis label using the set_xlabel() function; set the color bar using the colorbar() function; and achieve three-dimensional visualization using plt.show().
[0173] The rest of the code is the same as step 4 (4).
[0174] When defining a specified straight line, a three-dimensional graph of the fiber orientation values in each grid along the curve is drawn. Figure 8 (a) When defining a specified curve, a three-dimensional graph of the fiber orientation values in each grid along the curve is drawn as shown in Figure 8 (b) as shown.
[0175] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A Python-based steel fiber concrete fiber sequence statistics and analysis method, characterized in that: The steps include: (1) After obtaining the CT grayscale image of steel fiber concrete, the image is adjusted, interference information is removed, binarization is performed, watershed segmentation method and Boolean operation image processing method are used to perform three-dimensional reconstruction of the steel fiber, and the three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table as an endpoint information table; (2) Configure the program running environment and install the third-party function library provided by the program to read the steel fiber endpoint information in the Excel endpoint information table through the Python script file; The fiber midpoint coordinates and the fiber head and tail end coordinate increments are calculated through Python script files, and integrated to form the fiber three-dimensional information; (3) In the Excel endpoint information table, the specified direction is customized according to the main force direction of the steel fiber concrete structure. The cosine value of each fiber and the specified direction is calculated through the Python script file. The absolute value of the cosine value and the angle formed with the specified direction are calculated through the cosine value to quantitatively analyze the orientation of steel fibers in the concrete specimen. (4) Customize the number of grid divisions and the steel bar area to be removed in the Excel endpoint information table, generate a three-dimensional homogeneous graph of the fiber orientation value by running a python script, and visually observe the distribution of steel fiber orientation inside the specimen; (5) When studying the distribution law of steel fibers along a stress curve that needs to be studied separately, a curve function that needs to be studied separately in a custom space is used to draw a three-dimensional stereogram of the fiber orientation values in each grid along the curve by running a python script.
2. The Python-based steel fiber concrete fiber sequence statistics and analysis method according to claim 1 is characterized by: In step (1), the steps of extracting the three-dimensional coordinate information of the fiber endpoints are as follows: (11) Binarizing the obtained steel fiber concrete CT grayscale image, and distinguishing different materials by grayscale values within different thresholds; (12) Use the watershed segmentation method to distinguish the boundaries of different materials in the CT grayscale image; (13) For reinforced steel fiber concrete materials, a Boolean operation of three-dimensional graphics is used to divide the steel bar area, and then a difference set is taken from the steel material in the watershed result in step (12) to distinguish the steel fiber from the steel bar, and a binary image after removing the steel bar is obtained; (14) The binary image obtained in step (13) after removing the steel bars is reconstructed to obtain the three-dimensional coordinate information of the fiber endpoints, and the three-dimensional coordinate information of the fiber endpoints is extracted into an Excel table as a three-dimensional endpoint information table.
3. The Python-based steel fiber concrete fiber sequence statistics and analysis method according to claim 1 is characterized by: In step (2), the midpoint coordinate value and endpoint coordinate increment of each fiber are calculated through a script loop and merged into a three-dimensional position information table to obtain a fiber three-dimensional coordinate increment information table.
4. The Python-based steel fiber concrete fiber sequence statistics and analysis method according to claim 1 is characterized by: In step (3), a specified direction is defined by a function, and the cosine value of the angle formed by the fiber and the defined specified direction is calculated; the cosine value is limited to the range of [-1,1], and the absolute value of the cosine value is calculated by a function; the angle formed by the fiber and the specified direction is calculated by a function; the result is added to a data table by a function, and the data is written into a new Excel table as a fiber three-dimensional orientation information table.
5. The Python-based steel fiber concrete fiber sequence statistics and analysis method according to claim 1, characterized in that: The steps for visualizing the data of the fiber three-dimensional orientation information table through a script in step (4) are as follows: Read the fiber 3D orientation information table data through the function to obtain the 3D coordinates of the fiber center point and the corresponding cosine value; input the number of grids required to be divided along the x, y, and z directions to define the steel bar area; create a list to store the grid center point coordinates and values; Store the values in each grid through functions; Each grid is traversed by a loop function to calculate the average cosine value of the fibers in the grid; Use the judgment function to determine whether the grid is within the steel bar range, and assign a value of 0 to the grid within the steel bar range; Use the judgment function to determine whether there is a fiber orientation value in the grid; The mesh that is not within the reinforcement range and does not contain fibers is interpolated and filled by the function; The mesh data is stored in a new Excel table through a function as a fiber three-dimensional mesh information table; Set the maximum range of the data to prevent the interpolated data from exceeding the maximum range of the data; Divide the space into a specified number of grids through a function; Define the data you want to visualize through functions; Specify the visualization voxel color, viewing angle, scale, axis label, and color bar through functions. The data can be visualized.
6. The Python-based steel fiber concrete fiber sequence statistics and analysis method according to claim 1, characterized in that: Step (5) reads the fiber three-dimensional orientation information table data through a function; inputs the number of grids required to be divided along the x, y, and z directions to define the steel bar area; Specify the curve through function definition; create a list to store the coordinates and values of the grid center point; Store the values in each grid through functions; Each grid is traversed by a loop function to calculate the average cosine value of the fibers in the grid; The if judgment function is used to determine whether the grid is within the steel bar range. For the grid within the steel bar range, a value of 0 is assigned. The judgment function is used to determine whether there is a fiber orientation value in the grid. The mesh that is not within the reinforcement range and does not contain fibers is interpolated and filled by the function; The judgment function is used to determine whether the straight line intersects with the current grid, and the data of the intersecting grid is stored in a list of grid center point coordinates and values as a fiber orientation extension curve distribution table; Visualize the orientation distribution of fibers along the curve.
Citation Information
Cited By
Method for establishing mesoscopic finite element model of single-layer reinforced ultra-high performance concrete structure
CN119358339A
