A method and device for modeling an oilfield scene, an electronic device, and a storage medium
By preprocessing and feature fusion of oilfield scene images, combined with stereo matching and semantic segmentation, the problems of low efficiency and high cost of traditional measurement methods are solved, and high-precision, low-cost oilfield scene modeling is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2024-12-09
- Publication Date
- 2026-06-09
AI Technical Summary
Existing manual field measurement methods are inefficient and costly, while airborne lidar measurement is greatly affected by environmental factors and is expensive, limiting its widespread application.
By preprocessing the left and right images of the oilfield scene, including normalization, random cropping and translation, a cost volume is constructed to calculate the disparity value. Combined with stereo matching and semantic segmentation, the UNet structure is used for feature fusion and semantic segmentation to train the oilfield semantic segmentation model.
It achieves high-precision oilfield scene modeling, reduces costs and benefits, minimizes investment in expensive equipment and manpower, adapts to scene changes under different lighting conditions and angles, and improves the robustness and generalization ability of the model.
Smart Images

Figure CN122176149A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image processing and computer vision technology, and specifically relates to a method, apparatus, electronic device and storage medium for oilfield scene modeling. Background Technology
[0002] In the field of oil exploration and development, oilfield scene modeling is a crucial technology. It provides 3D visualization support for oilfield monitoring, management, and decision-making, helping to improve the efficiency and safety of oilfield management and development.
[0003] Traditional measurement methods are divided into manual field measurement and airborne lidar measurement. Manual field measurement requires surveyors to physically go to the oilfield and collect data using measuring instruments. This method is not only time-consuming but also requires a large manpower investment, resulting in low efficiency. Airborne lidar technology, by emitting a laser beam towards the target area and receiving the reflected signal, can accurately measure the three-dimensional coordinates of the target, offering extremely high measurement accuracy. However, the equipment is expensive and maintenance costs are high, limiting its widespread application in some projects. Furthermore, its measurement performance can be affected by adverse weather conditions, and it may even malfunction. In summary, existing manual field measurement methods have drawbacks such as high labor costs, low efficiency, and the high cost of airborne lidar measurements due to their susceptibility to environmental factors. Summary of the Invention
[0004] To address the aforementioned issues, this application provides a method, apparatus, electronic device, and storage medium for oilfield scene modeling, thereby resolving the problems existing in the prior art.
[0005] This invention discloses the following technical solution: a method for modeling an oilfield scene, comprising: preprocessing a left image of an oilfield scene, a right image of an oilfield scene, and multiple disparity ground truth maps to obtain a preprocessed left image of an oilfield scene, a preprocessed right image of an oilfield scene, and multiple preprocessed disparity ground truth maps; extracting features from the preprocessed left image of the oilfield scene and the preprocessed right image of the oilfield scene to obtain a feature map of the left image of the oilfield scene and a feature map of the right image of the oilfield scene; constructing a cost body based on the feature map of the left image of the oilfield scene and the feature map of the right image of the oilfield scene, and calculating the disparity ground truth map through the cost body. The difference is calculated to obtain multiple disparity maps; the disparity maps are validated using multiple preprocessed disparity ground truth maps, and disparity maps with the same features as the multiple preprocessed disparity ground truth maps are selected to obtain multiple network disparity ground truth maps; feature fusion is performed on the multiple network disparity ground truth maps to obtain disparity feature maps; a UNet structure is composed based on the feature fusion module to perform semantic segmentation on the disparity feature maps to obtain semantic segmentation maps; based on the semantic segmentation maps and the loss function, the oilfield semantic segmentation model to be trained is trained to obtain the oilfield semantic segmentation model.
[0006] Optionally, the preprocessing of the left image, right image, and disparity ground truth map of the oilfield scene to obtain a preprocessed left image, a preprocessed right image, and multiple preprocessed disparity ground truth maps includes: normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left image and a normalized right image; randomly cropping the normalized left image, the normalized right image, and the disparity ground truth map to obtain the preprocessed left image, the cropped right image, and the cropped disparity ground truth map; randomly translating the cropped right image to obtain the preprocessed right image, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the multiple preprocessed disparity ground truth maps.
[0007] Optionally, the step of normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left and right oilfield scene image includes: normalizing the pixel values of the left and right images of the oilfield scene to the [0,1] interval to obtain the normalized left and right oilfield scene images.
[0008] Optionally, the step of randomly cropping the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map to obtain the preprocessed oilfield scene left image, the cropped oilfield scene right image, and the cropped disparity ground truth map includes: randomly selecting starting points in the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map; establishing a cropping coordinate system based on the starting points, with the image width of the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map as the x-axis and the image height of the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map as the y-axis; and cropping the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map based on the cropping coordinate system and the cropping parameters to obtain the preprocessed oilfield scene left image, the cropped oilfield scene right image, and the cropped disparity ground truth map.
[0009] Optionally, the step of randomly translating the cropped right image of the oilfield scene to obtain the preprocessed right image of the oilfield scene, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map, includes: randomly generating the horizontal and vertical translation distances of the cropped right image of the oilfield scene to create a translation matrix; based on the translation matrix, displacing the cropped right image of the oilfield scene to obtain the preprocessed right image of the oilfield scene, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map.
[0010] Optionally, the step of extracting features from the preprocessed left image and the preprocessed right image of the oilfield scene to obtain feature maps of the left and right images of the oilfield scene includes: extracting features from the preprocessed left image and the preprocessed right image of the oilfield scene to obtain a preliminary extracted left image and a preliminary extracted right image of the oilfield scene; and performing depth extraction on the preliminary extracted left image and the preliminary extracted right image of the oilfield scene to obtain feature maps of the left and right images of the oilfield scene.
[0011] Optionally, the step of constructing a cost body based on the feature map of the left image and the feature map of the oilfield scene, and calculating the disparity value through the cost body to obtain multiple disparity maps, includes: shifting the pixel value of the feature map of the right image of the oilfield scene by a set number of pixels, subtracting it from the pixel value of the feature map of the left image of the oilfield scene, and stacking the subtraction results to construct a cost body, and calculating the disparity value through the cost body to obtain multiple disparity maps.
[0012] This application also provides a method and apparatus for oilfield scene modeling, comprising: a preprocessing unit for preprocessing a left image of an oilfield scene, a right image of an oilfield scene, and multiple disparity ground truth maps to obtain a preprocessed left image of an oilfield scene, a preprocessed right image of an oilfield scene, and multiple preprocessed disparity ground truth maps; a feature extraction unit for extracting features from the preprocessed left image of an oilfield scene and the preprocessed right image of an oilfield scene to obtain a feature map of the left image of an oilfield scene and a feature map of the right image of an oilfield scene; and a disparity unit for constructing a cost body based on the feature map of the left image of an oilfield scene and the feature map of the right image of an oilfield scene, and calculating the disparity value through the cost body to obtain multiple disparity maps. The system includes: a comparison unit for verifying the disparity map using multiple preprocessed disparity ground truth maps, filtering out disparity maps with the same features as the multiple preprocessed disparity ground truth maps, and obtaining multiple network disparity ground truth maps; a feature fusion unit for performing feature fusion on the multiple network disparity ground truth maps to obtain a disparity feature map; a semantic segmentation unit for constructing a UNet structure based on the feature fusion module, and performing semantic segmentation on the disparity feature map using the UNet structure to obtain a semantic segmentation map; and a model building unit for training the oilfield semantic segmentation model to be trained based on the semantic segmentation map and a loss function to obtain the oilfield semantic segmentation model.
[0013] This application also provides an electronic device, including: a memory and a processor, wherein the memory stores a computer-executable program, and the processor is configured to execute the computer-executable program to implement the method described in any one of this application.
[0014] This application also provides a computer storage medium storing a computer executable program, which, when run, performs the method described in any one of this application.
[0015] This application provides a method, apparatus, electronic device, and storage medium for oilfield scene modeling. The method includes: preprocessing a left image of an oilfield scene, a right image of an oilfield scene, and multiple disparity ground truth maps to obtain a preprocessed left image of an oilfield scene, a preprocessed right image of an oilfield scene, and multiple preprocessed disparity ground truth maps; extracting features from the preprocessed left image of the oilfield scene and the preprocessed right image of the oilfield scene to obtain a feature map of the left image of the oilfield scene and a feature map of the right image of the oilfield scene; and constructing a cost body based on the feature maps of the left image of the oilfield scene and the right image of the oilfield scene. Disparity values are calculated using the cost body to obtain multiple disparity maps. These disparity maps are then validated using multiple preprocessed ground truth disparity maps, and disparity maps with the same features as the preprocessed ground truth disparity maps are selected to obtain multiple network disparity ground truth maps. Feature fusion is performed on these multiple network disparity ground truth maps to obtain disparity feature maps. A UNet structure is constructed based on the feature fusion module, and semantic segmentation is performed on the disparity feature maps using the UNet structure to obtain semantic segmentation maps. Based on the semantic segmentation maps and a loss function, the oilfield semantic segmentation model to be trained is trained to obtain the oilfield semantic segmentation model. In this application, the combination of stereo matching and semantic segmentation enables the model to utilize depth information to assist semantic segmentation, thereby more accurately identifying and classifying objects in the scene. This method improves accuracy in both stereo matching and semantic segmentation, meeting the high-precision requirements of oilfield 3D modeling. Furthermore, this method does not only treat stereo matching and semantic segmentation as two independent tasks, but also achieves multi-scale fusion of information from the two tasks through the network structure, thus fully utilizing the complementarity between stereo matching and semantic segmentation. This fusion makes the model more comprehensive and accurate in understanding complex oilfield scenarios. Furthermore, preprocessing the left and right images of the oilfield scene, as well as the disparity ground truth map (e.g., normalization, random cropping, and translation), improves the model's robustness and generalization ability. This preprocessing helps the model better adapt to oilfield scenes under different lighting conditions, angles, and scales. Finally, compared to traditional manual field measurement methods and airborne lidar technology, this method is more cost-effective. It does not require expensive equipment or a large workforce, and can complete large-scale oilfield scene modeling tasks in a shorter time. Attached Figure Description
[0016] Figure 1 This is a flowchart of a method for modeling an oilfield scene in Embodiment 1. Figure 2 This is the semantic segmentation graph network structure diagram in this embodiment two; Figure 3 This is a diagram of the Resnet34 network structure in this second embodiment; Figure 4This is a flowchart illustrating the construction process of the cost body in Embodiment 2. Figure 5 This is a schematic diagram of feature fusion in Embodiment 2. Figure 6 This is a diagram illustrating the effect of random cropping in Example 2 of this embodiment; Figure 7 This is a diagram showing the effect of random translation in Embodiment 2. Detailed Implementation
[0017] First Embodiment Implementing any technical solution of the embodiments of this application does not necessarily require achieving all of the above advantages at the same time.
[0018] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Figure 1 This is a flowchart of a method for modeling an oilfield scene in this embodiment; as shown below. Figure 1The method for modeling an oilfield scene includes: preprocessing a left image, a right image, and multiple disparity ground truth maps of the oilfield scene to obtain a preprocessed left image, a preprocessed right image, and multiple preprocessed disparity ground truth maps; extracting features from the preprocessed left image and the preprocessed right image to obtain a feature map of the left image and a feature map of the right image; constructing a cost body based on the feature maps of the left and right images to calculate the disparity value. Multiple disparity maps are generated. The disparity maps are validated using multiple preprocessed disparity ground truth maps, and disparity maps with the same features as the preprocessed disparity ground truth maps are selected to obtain multiple network disparity ground truth maps. Feature fusion is performed on the multiple network disparity ground truth maps to obtain a disparity feature map. A UNet structure is formed based on the feature fusion module, and semantic segmentation is performed on the disparity feature map using the UNet structure to obtain a semantic segmentation map. Based on the semantic segmentation map and a loss function, the oilfield semantic segmentation model to be trained is trained to obtain the oilfield semantic segmentation model. In this embodiment, the combination of stereo matching and semantic segmentation enables the model to utilize depth information to assist semantic segmentation, thereby more accurately identifying and classifying objects in the scene. This method improves accuracy in both stereo matching and semantic segmentation, meeting the high-precision requirements of oilfield 3D modeling. Moreover, this method does not only treat stereo matching and semantic segmentation as two independent tasks, but also achieves multi-scale fusion of information from the two tasks through the network structure, thereby fully utilizing the complementarity between stereo matching and semantic segmentation. This fusion makes the model more comprehensive and accurate in understanding complex oilfield scenes. Furthermore, preprocessing the left and right images of the oilfield scene and the disparity ground truth map (such as normalization, random cropping, and translation) improves the model's robustness and generalization ability. This preprocessing helps the model better adapt to oilfield scenes under different lighting conditions, angles, and scales. Finally, compared with traditional manual field measurement methods and airborne lidar technology, this method is more cost-effective. It does not require expensive equipment and a large amount of manpower, while being able to complete large-scale oilfield scene modeling tasks in a shorter time.
[0020] In this embodiment, disparity values are calculated by constructing a cost body based on the preprocessed feature maps of the left and right images of the oilfield scene. The construction of the cost body involves comparing the right image feature map with the left image feature map under different disparities, resulting in a series of difference maps, which are stacked together to form the cost body. The cost body is used to calculate disparity values using methods such as weighted summation, resulting in multiple disparity maps. This process is essentially the process of solving for the optimal disparity in stereo matching technology. By comparing and verifying with the preprocessed disparity ground truth map, disparity maps with the same or similar features as the disparity maps generated by the network are selected as the network disparity ground truth maps. This step further ensures the accuracy and reliability of the stereo matching results. The selected multiple network disparity ground truth maps are fused to obtain a disparity feature map, which is used to improve the accuracy of subsequent semantic segmentation. Throughout the method, stereo matching and semantic segmentation are jointly optimized. The depth information obtained from stereo matching can provide important contextual clues for semantic segmentation, helping to more accurately identify and classify objects in the scene. Meanwhile, the results of semantic segmentation can also, in turn, optimize the accuracy of stereo matching, because classification and edge information help to better determine the boundaries and shapes of objects. In summary, this embodiment fully demonstrates the application of stereo matching technology in oilfield scene modeling by constructing a cost volume, performing disparity estimation, verifying and filtering disparity maps, and using the disparity maps for feature fusion and joint optimization.
[0021] Optionally, the preprocessing of the left image, right image, and disparity ground truth map of the oilfield scene to obtain a preprocessed left image, a preprocessed right image, and multiple preprocessed disparity ground truth maps includes: normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left image and a normalized right image; randomly cropping the normalized left image, the normalized right image, and the disparity ground truth map to obtain the preprocessed left image, the cropped right image, and the cropped disparity ground truth map; randomly translating the cropped right image to obtain the preprocessed right image, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the multiple preprocessed disparity ground truth maps. In this embodiment, normalizing the pixel values of the left and right images of the oilfield scene eliminates differences between images caused by factors such as lighting and shooting conditions, improving data consistency. This is crucial for subsequent tasks such as stereo matching and semantic segmentation, as they require processing images with similar data distributions and characteristics. Furthermore, randomly cropping the normalized image and disparity ground truth map can simulate oilfield scenes at different scales and perspectives, increasing the diversity of training data and helping the model learn more robust feature representations, thus improving its generalization ability across different oilfield scenes. In addition, randomly translating the cropped right image and adjusting the disparity ground truth map accordingly can simulate subtle changes in the camera's viewpoint in the real world. Finally, the entire preprocessing process is essentially a form of data augmentation. Through normalization, cropping, and translation, a large number of training samples can be generated without additional data collection. This not only saves time and cost but also improves the training efficiency of the model.
[0022] Optionally, the step of normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left and right oilfield scene image includes: normalizing the pixel values of the left and right images of the oilfield scene to the [0,1] interval to obtain the normalized left and right oilfield scene images. In this embodiment, the normalization process ensures that the pixel values of different images have the same scale and range, which is beneficial for subsequent image processing and feature extraction. Standardized data can improve the convergence speed and stability of the algorithm. Moreover, by limiting the pixel values to the [0,1] range, the risk of numerical overflow during the calculation process can be reduced, and the complexity of subsequent calculations (such as feature extraction, cost volume construction, etc.) may be reduced. In addition, in deep learning models, normalized input data can speed up model training, improve model convergence performance, and to some extent enhance the model's generalization ability. This is because normalization allows the network to avoid processing large variations in input data during training, resulting in a more stable and smoother gradient descent process. Finally, normalization also makes the model more robust to changes in environmental factors such as lighting and brightness, as the normalization process eliminates the influence of these factors to some extent.
[0023] Optionally, the step of normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left oilfield scene right image further includes: modifying the data types of the normalized left oilfield scene image, the normalized right oilfield scene image, and the disparity ground truth map to float32. In this embodiment, float32 provides higher computational precision compared to other data types. This is particularly important for floating-point operations in deep learning, especially when performing complex image processing and 3D modeling. High-precision data types help reduce computational errors and improve the stability and reliability of the model. In addition, unifying the data type of all input data to float32 can simplify the data processing flow and avoid computational errors or performance bottlenecks caused by inconsistent data types. Furthermore, although float32 occupies less memory space than float64, it optimizes memory utilization efficiency while ensuring sufficient precision. This is crucial for deep learning models that need to process large amounts of data, effectively reducing memory consumption and improving computational efficiency. Finally, most deep learning frameworks and libraries natively support the float32 data type and have optimized it. Changing the data type to float32 ensures model compatibility and performance advantages on these frameworks, facilitating model training, validation, and deployment.
[0024] Optionally, the step of randomly cropping the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map to obtain the preprocessed oilfield scene left image, the cropped oilfield scene right image, and the cropped disparity ground truth map includes: randomly selecting starting points in the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map; establishing a cropping coordinate system based on the starting points, with the image width of the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map as the x-axis and the image height of the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map as the y-axis; and cropping the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map based on the cropping coordinate system and the cropping parameters to obtain the preprocessed oilfield scene left image, the cropped oilfield scene right image, and the cropped disparity ground truth map. In this embodiment, by randomly cropping the normalized image and disparity ground truth map, the amount of training data for the model can be significantly increased, enabling the model to learn more diverse features and thus improving its generalization ability. Furthermore, cropping the image to a smaller size can significantly reduce the computational load during training. This not only speeds up training but also reduces the demand for computing resources, allowing the model to run on more hardware. Additionally, random cropping helps the model learn features from different regions of the image, rather than relying solely on specific parts. This effectively prevents overfitting during training and improves the model's robustness. Finally, due to the diversity of random cropping, the model needs to learn more feature combinations during training, enabling it to better understand and represent image content. This diverse learning helps improve the model's accuracy in oilfield scene modeling tasks, particularly in stereo matching and semantic segmentation.
[0025] Optionally, the cutting parameters include: cutting height and cutting width.
[0026] Optionally, the step of randomly translating the cropped right image of the oilfield scene to obtain the preprocessed right image of the oilfield scene, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map, includes: randomly generating translation distances in the horizontal and vertical directions of the cropped right image of the oilfield scene to create a translation matrix; based on the translation matrix, displacing the cropped right image of the oilfield scene to obtain the preprocessed right image of the oilfield scene, and adding the randomly translated pixel values to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map. In this embodiment, randomly translating the cropped right image of the oilfield scene and adjusting the pixel values in the corresponding disparity ground truth map can greatly enrich the diversity of training data. This diversity is crucial for training deep learning models and helps improve the model's generalization ability and robustness. In addition, by randomly generating translation distances in the horizontal and vertical directions, the model can learn more information about the changes of objects under different viewpoints, enabling the model to better adapt and recognize when processing new scenes or images from different viewpoints. Furthermore, in practical applications, oilfield scenes may exhibit perspective differences due to variations in shooting angle, position, or camera movement. Random translation simulates these real-world variations, enabling the model to learn how to maintain stable performance under such conditions during training. Finally, by adjusting the translation pixel values accordingly in the disparity ground truth map, it is ensured that the model learns more accurate disparity information during training.
[0027] Optionally, the step of extracting features from the preprocessed left and right images of the oilfield scene to obtain feature maps for the left and right images of the oilfield scene includes: extracting features from the preprocessed left and right images of the oilfield scene to obtain preliminary extracted left and right images of the oilfield scene; and performing depth extraction on the preliminary extracted left and right images of the oilfield scene to obtain feature maps for the left and right images of the oilfield scene. In this embodiment, by performing two feature extraction processes—first preliminary extraction, then further depth extraction—more layers and richer image features can be extracted from the preprocessed oilfield scene image. This helps to improve the accuracy of the disparity map by performing disparity estimation based on more detailed feature information when constructing the cost body. In addition, the depth extraction stage usually includes more complex network structures (such as residual blocks, global average pooling, etc.), which can further enhance the nonlinear expressive power of the feature map, enabling the feature map to better represent complex scene and object information in the image. Furthermore, through multi-level feature extraction, the network can learn features at different scales, thus exhibiting stronger robustness when handling oilfield scenes with varying scales. This helps to stably extract effective image features under different lighting conditions, occlusion, and viewpoint changes. Finally, this method provides a solid foundation for subsequent stereo matching and semantic segmentation tasks at the feature extraction stage. Obtaining depth feature maps not only helps to more accurately calculate disparity values but also provides more contextual information for semantic segmentation. This sharing and complementarity at the feature level promotes mutual assistance and joint progress between stereo matching and semantic segmentation, improving the accuracy and efficiency of overall oilfield scene modeling.
[0028] Optionally, the step of extracting features from the preprocessed left and right images of the oilfield scene to obtain preliminary extracted left and right images of the oilfield scene includes: extracting local features from the preprocessed left and right images of the oilfield scene based on convolutional layers to generate local feature maps of the preprocessed left and right images of the oilfield scene; enhancing the nonlinearity of the local feature maps of the preprocessed left and right images of the oilfield scene based on activation functions to obtain enhanced local feature maps of the left and right images of the oilfield scene; performing logical operations on the enhanced local feature maps of the left and right images of the oilfield scene based on residual blocks to obtain optimized left and right images of the oilfield scene; and reducing the dimensionality of the optimized left and right images of the oilfield scene based on pooling layers to obtain preliminary extracted left and right images of the oilfield scene. In this embodiment, the method constructs a multi-task learning framework that integrates stereo matching and semantic segmentation into a unified network. This design fully utilizes the auxiliary role of depth information obtained from stereo matching in semantic segmentation, while the results of semantic segmentation can also supervise stereo matching in reverse, thereby improving the accuracy and efficiency of the entire modeling process. Compared with traditional methods that process the two tasks independently, this multi-task learning framework has higher computational efficiency and better performance. Furthermore, the complementarity of depth information and pixel-level classification information is fully utilized in this method. Stereo matching technology provides scene depth information by calculating disparity maps, while semantic segmentation technology assigns category labels to each pixel in the image. The combination of these two types of information not only improves the accuracy of semantic segmentation but also enhances the estimation accuracy of disparity maps, thus achieving more refined and accurate oilfield scene modeling. In addition, a multi-scale feature fusion strategy is adopted to fuse feature maps at different levels. This strategy can capture information at different scales in the image, helping to improve the model's adaptability and robustness to complex scenes. Compared with traditional single-branch network structures, multi-scale feature fusion significantly improves the model's generalization ability and accuracy. Finally, by automating multiple steps such as data preprocessing, feature extraction, disparity estimation, and semantic segmentation, the need for manual intervention is greatly reduced, improving the efficiency and consistency of modeling. At the same time, the automated data processing workflow also helps reduce modeling costs and improve the feasibility of modeling.
[0029] Optionally, the kernel size of the convolutional layer is set to 3×3.
[0030] Optionally, the step of extracting features from the preprocessed left and right images of the oilfield scene to obtain preliminary extracted left and right images of the oilfield scene includes: inputting the preprocessed left and right images of the oilfield scene into a residual block layer, respectively, to perform feature sampling on the preprocessed left and right images of the oilfield scene based on the residual block layer, obtaining sampled left and right images of the oilfield scene; and converting the sampled left and right images of the oilfield scene into fixed-length feature vectors for the left and right images based on global average pooling, to obtain preliminary extracted left and right images of the oilfield scene. In this embodiment, stereo matching and semantic segmentation are integrated into the same network. This design not only reduces computational costs but also improves the mutual promotion of tasks through shared feature representations and joint optimization. The depth information provided by stereo matching helps semantic segmentation to more accurately identify and classify objects, while the category information provided by semantic segmentation can optimize the disparity map of stereo matching. Furthermore, the feature fusion module effectively fuses disparity maps and semantic feature maps, enabling the two tasks to share and utilize each other's information, thereby improving the accuracy of stereo matching and semantic segmentation. This fusion strategy enhances the model's ability to model complex oilfield scenarios. Additionally, fusing feature maps at different levels improves the model's ability to recognize targets at different scales. This strategy makes the model more robust when handling targets of different sizes and shapes, improving overall modeling accuracy and generalization ability. Finally, the efficient convolutional neural network structure of ResNet34 and SPP is employed in the feature extraction stage, effectively extracting key features from the image. Simultaneously, techniques such as residual blocks and global average pooling are used to sample and transform features, generating fixed-length feature vectors, providing high-quality input data for subsequent disparity estimation and semantic segmentation. In the feature fusion stage, advanced techniques such as the SE attention module are used to weight and fuse feature maps, further improving the model's performance.
[0031] Optionally, the step of performing depth extraction on the initially extracted left and right images of the oilfield scene to obtain feature maps of the left and right images of the oilfield scene includes: dividing the local feature maps of the preprocessed left and right oilfield scene images into grid cells of a set size to obtain gridded left and right oilfield scene images; performing pooling operations on the gridded left and right oilfield scene images to obtain several pooled left and right oilfield scene images; stitching the several pooled left oilfield scene images together to obtain a feature map of the left oilfield scene image; and stitching the several pooled right oilfield scene images together to obtain a feature map of the right oilfield scene image. In this embodiment, dividing the local feature maps of the preprocessed left and right oilfield scene images into grid cells of a set size and performing pooling operations can significantly enhance the feature representation capability. This meshing and pooling operation extracts multi-level information from images, including edges, textures, and higher-level semantic information, providing richer information for subsequent feature fusion and semantic segmentation. Furthermore, pooling reduces the spatial dimensionality of feature maps, lowering computational cost while preserving important feature information. This method enhances the robustness of features to small-scale image changes, making the model less sensitive to input image variations and improving its generalization ability. In addition, pooling and stitching the meshed images to form the left and right image feature maps of the oilfield scene achieves effective fusion of multi-scale information. Information at different scales is complementary, helping the model understand and analyze images from multiple perspectives, thereby improving the accuracy of stereo matching and semantic segmentation. Finally, through meshing and pooling operations, the original image is transformed into a more compact and efficient feature map, reducing the amount of data required for subsequent processing. This not only reduces computational complexity but also improves overall processing speed, enabling the method to perform well in real-time applications. Simultaneously, the smaller feature map makes model training easier and converges faster, reducing training time and computational resource requirements.
[0032] Optionally, the step of constructing a cost body based on the feature maps of the left and right images of the oilfield scene to calculate disparity values and obtain multiple disparity maps includes: shifting the pixel values of the feature map of the right image of the oilfield scene by a set number of pixels, subtracting them from the pixel values of the feature map of the left image of the oilfield scene, and stacking the subtraction results to construct a cost body, thereby calculating disparity values and obtaining multiple disparity maps. In this embodiment, by shifting the pixel values of the feature map of the right image of the oilfield scene and subtracting them from the pixel values of the feature map of the left image, and stacking these differences to construct the cost body, multiple disparity maps can be calculated efficiently. This method has relatively low computational complexity and can quickly find the optimal disparity matching point, improving the efficiency of disparity estimation. Moreover, the method of constructing the cost body fully considers the disparity changes between the left and right images. By performing shifting and subtraction operations on the feature maps, the influence of factors such as illumination changes and noise interference on disparity estimation can be effectively reduced, enhancing the robustness of the system. Furthermore, the disparity map calculated based on the cost volume exhibits high accuracy. Each unit in the cost volume stores the matching cost corresponding to the disparity value. By comparing these cost values, the disparity value of each pixel can be accurately determined, thereby generating a high-quality disparity map. Additionally, in a multi-task deep learning framework based on stereo matching and semantic segmentation, this method provides rich depth information for subsequent semantic segmentation tasks. The disparity map calculated using the cost volume can provide more accurate scene structure information to the semantic segmentation module, promoting information fusion between stereo matching and semantic segmentation tasks, and further improving the accuracy and effectiveness of modeling.
[0033] Optionally, the step of shifting the pixel values of the right image feature map of the oilfield scene by a set number of pixels and then subtracting them from the pixel values of the left image feature map of the oilfield scene includes: setting the parallax range to... ; Translate the pixel values of the feature map of the right image of the oilfield scene sequentially After each pixel, subtract the pixel value from the feature map of the left image of the oilfield scene; where, The minimum parallax value is the minimum parallax value between corresponding points from two camera viewpoints. The maximum disparity value is defined as the maximum disparity between corresponding points from two camera perspectives. In this embodiment, by shifting the pixel values of the right image feature map of the oilfield scene one by one within the disparity range and subtracting them from the pixel values of the left image feature map, the constructed cost volume can meticulously reflect the similarity or difference under different disparity values. This meticulous subtraction operation ensures the accuracy of disparity calculation, providing a solid foundation for subsequent stereo matching and 3D modeling. Furthermore, by setting a disparity range... This method can search for optimal solutions over a wide range of disparity variations, maintaining strong robustness when dealing with oilfield scenes with varying depths and complex structures. Even under challenging conditions such as occlusion and lighting variations, it can still accurately estimate disparity values. Furthermore, although this method requires multiple translation and subtraction operations, this process can be completed efficiently with the support of modern computing devices and GPU acceleration. Through parallel processing and optimization algorithms, large amounts of image data can be processed in a short time, improving overall modeling efficiency. Finally, the cost volume constructed by this method not only contains disparity information but also implicitly includes depth information within the scene. This depth information provides crucial support for subsequent semantic segmentation, enabling deep learning and semantic segmentation modules to more effectively utilize this depth information to improve the accuracy and robustness of semantic segmentation. By combining stereo matching and semantic segmentation tasks, more efficient and accurate oilfield scene modeling can be achieved.
[0034] Optionally, the step of shifting the pixel values of the right image feature map of the oilfield scene by a set number of pixels, subtracting them from the pixel values of the left image feature map of the oilfield scene, and stacking the subtraction results to construct a cost body includes: setting the shapes of the left image feature map and the right image feature map of the oilfield scene to be... The pixel values of the right image feature map of the oilfield scene are sequentially shifted. After each pixel, the value is subtracted from the pixel value of the feature map of the left image of the oilfield scene, and the shape of the constructed cost volume is... ;in, is the batch size, i.e., the number of image pairs processed simultaneously; m is the height of the feature maps of the left and right oilfield scenes; n is the width of the feature maps of the left and right oilfield scenes; d is the candidate disparity. The candidate disparity refers to the difference between pixels in two different views that correspond to the same object or spatial point but have different positional coordinates (such as x-axis coordinates). In this embodiment, a rich cost volume is constructed by traversing a preset disparity range and successively shifting the pixel values of the right image feature map by different distances and subtracting them from the left image feature map. This cost volume contains the difference information between the left and right images under multiple disparities, which helps to more accurately estimate the disparity value of each pixel, thereby improving the accuracy of stereo matching. Moreover, by considering multiple disparity levels when constructing the cost volume, this method realizes the utilization of multi-scale information of the image. This helps the model capture and understand the features of the image at different scales, and thus can more comprehensively understand and classify objects in the scene in subsequent processing (such as semantic segmentation).
[0035] Optionally, the cost body calculates the disparity value using the following formula to obtain multiple disparity maps: ;in, The disparity values of the disparity map, and the candidate disparities within the disparity range. The weighted average is used to arrive at the result; The weighting coefficient represents the reliability or probability of the current disparity value d. Minimum depth; Maximum depth; Cost volume similarity represents the degree of similarity between corresponding regions in the left and right images for each pixel and each candidate disparity value d. In this embodiment, disparity values are calculated using cost volumes, candidate disparities within the disparity range are weighted, and a weighting coefficient (σ) is used to evaluate the reliability or probability of the disparity values. This weighting method helps reduce errors and improve the accuracy of disparity maps, thereby reconstructing 3D scenes more accurately. Furthermore, the introduction of cost volume similarity (V) considers the similarity between corresponding regions in the left and right images. This similarity metric effectively handles noise and anomalies in the image, making the algorithm more robust to changes in image quality. In addition, the formula considers the minimum and maximum depth parameters, allowing the algorithm to automatically adjust the depth range according to the specific scene, thus adapting more flexibly to depth changes in different environments and objects. Finally, multiple disparity maps can be obtained simultaneously through a single calculation. These disparity maps cover different disparity ranges and depth information, providing rich data support for subsequent semantic segmentation and 3D reconstruction. Moreover, since the construction of the cost volume and the calculation of disparity values can be processed in parallel, this method has high computational efficiency.
[0036] Optionally, the depth D can be calculated based on the following formula: ;in For depth, The baseline length is the distance between the centers of the two camera lenses in a stereo camera. Focal length is the distance from the center of the camera lens to the image plane. The candidate disparity is used. In this embodiment, this method directly uses the calculated disparity value d, combined with the baseline length B and focal length f of the binocular camera, to calculate the depth D corresponding to each pixel. Since the disparity value is carefully calculated, this method can significantly improve the accuracy of depth estimation. Furthermore, the depth calculation formula... This method is highly concise and computationally efficient, making it suitable for real-time or large-scale data processing scenarios. This efficient computational approach gives it a significant advantage in practical applications. Furthermore, the baseline length B and focal length f in the formula can be adjusted according to different stereo camera configurations, giving the method excellent versatility and flexibility. Whether using a fixed-focal-length or variable-focal-length stereo camera, the values of B and f can be adjusted to suit different application scenarios. Finally, the accurately calculated depth information can serve as the basis for subsequent processing (such as 3D reconstruction and object recognition). Since the accuracy of depth information directly affects the performance of subsequent processing, this high-precision depth estimation method is crucial for improving the performance of the entire processing flow.
[0037] Optionally, feature fusion is performed on the multiple network disparity ground truth maps based on the following formula to obtain a disparity feature map; ;in, This is the disparity feature map of the i-th layer; The first part represents the disparity feature map. layer, For the feature map of the previous layer (the (i-1)th layer) The convolution operation performed; for Weights calculated by the SE attention module; For the feature map of the oilfield scene in the i-th layer, it is the feature map of the left image of the oilfield scene or the feature map of the right image of the oilfield scene. for Weights calculated by the SE attention module; This is the ground truth disparity map of the disparity network at layer i. In this embodiment, by combining disparity feature maps from different layers ( Ri and Di ), and through convolution operations Conv ( Fi -1) The previous layer feature map information is passed, enabling the fusion of multi-scale information. This fusion helps capture detailed information and global context in the scene, thereby improving the accuracy of the final semantic segmentation and disparity estimation. Furthermore, the Squeeze-and-Excitation (SE) attention module is used to calculate weights for the disparity feature map of each layer. WR and WD This allows the model to adaptively emphasize important features and suppress unimportant ones. This attention mechanism optimizes feature representation and improves the effectiveness and efficiency of feature fusion. Furthermore, through convolutional operations... Conv ( Fi-1) Fusing the feature maps of the previous layer not only conveys the semantic information of the previous layer but also enhances the expressive power of the feature maps of the current layer. This feature transfer and fusion between layers helps to construct richer and more hierarchical feature representations.
[0038] Optionally, the disparity feature map can be semantically segmented using the UNet structure based on the following formula to obtain a semantic segmentation map: ;in, This indicates a splicing operation. express The transpose convolution operation.
[0039] Optionally, the loss function is defined based on the following steps, using the segmentation map loss function. Disparity map loss function The weighted calculation yields the loss function. In this embodiment, by fusing disparity features and semantic features at different levels, the complementarity of multi-scale information is utilized, helping the network capture richer information at different scales, thereby improving modeling accuracy and generalization ability. Furthermore, using the UNet structure for semantic segmentation, layer-by-layer upsampling through concatenation and transposed convolutions allows the network to progressively recover the spatial information of the image, thus outputting an accurate semantic segmentation map. In addition, the loss function is obtained by weighted calculation of the segmentation map loss function and the disparity map loss function. This design allows the network to simultaneously optimize both semantic segmentation and stereo matching tasks. By adjusting the weights of the two loss functions, the performance of the two tasks can be balanced, achieving optimal overall modeling results.
[0040] Optionally, the segmentation map loss function is calculated based on the following formula.
[0041] ;in, and Let represent the true label and predicted label of pixel i in category c, respectively. In this embodiment, multi-scale information fusion is achieved by concatenating (concat operation) the disparity feature map with features from different levels of semantic segmentation. This fusion method fully utilizes the complementarity between stereo matching and semantic segmentation tasks, improving the accuracy of semantic segmentation. Especially in complex environments such as oil field scenes, multi-scale information is crucial for accurately identifying and classifying objects in the scene. Furthermore, using transposed convolution (ConvTranspose) for upsampling, combined with the concatenation operation, can effectively transfer high-resolution information from low-level feature maps and semantic information from high-level feature maps. This design enables the network to more accurately recover the detailed information of the image, improving the boundary accuracy of the segmentation results. In addition, using the cross-entropy loss function as the loss function for the segmentation map can directly measure the difference between the predicted label and the true label. The cross-entropy loss function has a strong penalty for misclassification, which helps the network converge to the optimal solution quickly, thereby improving the accuracy of segmentation.
[0042] Optionally, the following formula can be used to calculate the... :
[0043] ; and This represents the true disparity value and the predicted disparity value of pixel i.
[0044] Optionally, based on the above The segmentation map loss function and the training loss function are weighted and fused according to the following formula to train the oilfield semantic segmentation model and obtain the oilfield semantic segmentation model:
[0045] Where L is the training loss function; For segmentation graph loss function; The weighted values of the segmentation graph loss function are determined based on the scale of the segmentation graph loss function. for ; This is the weighted value of the parallax loss function, determined based on the size of the parallax loss function.
[0046] This application also provides a method and apparatus for oilfield scene modeling, comprising: a preprocessing unit for preprocessing a left image of an oilfield scene, a right image of an oilfield scene, and multiple disparity ground truth maps to obtain a preprocessed left image of an oilfield scene, a preprocessed right image of an oilfield scene, and multiple preprocessed disparity ground truth maps; a feature extraction unit for extracting features from the preprocessed left image of an oilfield scene and the preprocessed right image of an oilfield scene to obtain a feature map of the left image of an oilfield scene and a feature map of the right image of an oilfield scene; and a disparity unit for constructing a cost body based on the feature map of the left image of an oilfield scene and the feature map of the right image of an oilfield scene, and calculating the disparity value through the cost body to obtain multiple disparity maps. The system includes: a comparison unit for verifying the disparity map using multiple preprocessed disparity ground truth maps, filtering out disparity maps with the same features as the multiple preprocessed disparity ground truth maps, and obtaining multiple network disparity ground truth maps; a feature fusion unit for performing feature fusion on the multiple network disparity ground truth maps to obtain a disparity feature map; a semantic segmentation unit for constructing a UNet structure based on the feature fusion module, and performing semantic segmentation on the disparity feature map using the UNet structure to obtain a semantic segmentation map; and a model building unit for training the oilfield semantic segmentation model to be trained based on the semantic segmentation map and a loss function to obtain the oilfield semantic segmentation model.
[0047] This application also provides an electronic device, including: a memory and a processor, wherein the memory stores a computer-executable program, and the processor is configured to execute the computer-executable program to implement the method described in any one of the embodiments.
[0048] This application also provides a computer storage medium storing a computer executable program, which, when run, implements the method described in any one of the embodiments.
[0049] Second Embodiment Figure 2 This is the semantic segmentation graph network structure diagram in this embodiment, such as... Figure 2 As shown, input the left image of the oilfield scene to be preprocessed and the right image of the oilfield scene to be preprocessed at the input point on the left. This is done through... Figure 3 The ResNet34 network architecture diagram shown is used for feature extraction, obtaining feature maps for the left and right images of the oilfield scene. After feature extraction, Spatial Pyramid Pooling (SPP) further processes the feature maps, obtaining feature maps for the left and right images of the oilfield scene to enhance the model's ability to perceive features at different scales. Then, through methods such as... Figure 4 The structure shown in the cost volume construction flowchart captures the feature maps of the left and right images of the oilfield scene from different perspectives (or different time points) of R and L, and within a set parallax range of... Within, the pixel values of the feature map of the right image of the oilfield scene are sequentially shifted. After each pixel, the value is subtracted from the pixel value of the feature map of the left image of the oilfield scene to construct a 4D cost volume. The disparity value is then calculated using this cost volume to obtain a disparity map. The disparity map is then compared with the preprocessed disparity ground truth map to select the network disparity ground truth map. Figure 5 The feature fusion diagram shown illustrates that the network disparity ground truth map is input as a depth feature map into a system such as... Figure 5 In the network shown, a disparity feature map is obtained by fusing three layers. Finally, a UNet structure consisting of three feature fusion modules (Decoder 1, Decoder 2, and Decoder 3) is used to perform semantic segmentation on the fused feature map, resulting in a semantic segmentation map. Based on this semantic segmentation map and the loss function, the oilfield semantic segmentation model is trained to obtain the desired model.
[0050] Figure 6 This is a diagram illustrating the random cropping effect in Example 2; for example... Figure 6 As shown: Using the Random Crop technique, starting points are randomly selected in the left image, right image, and disparity ground truth map of the normalized oilfield scene. Based on these starting points, a cropping coordinate system is established with the image width of each image as the x-axis and the image height as the y-axis. Based on the cropping coordinate system and cropping parameters, the left image, right image, and disparity ground truth map of the normalized oilfield scene are cropped to obtain the preprocessed left image, the cropped right image, and the cropped disparity ground truth map.
[0051] Figure 7 This is a diagram illustrating the effect of random translation in Embodiment 2. Figure 7 As shown, Random Translation Transformations are applied to the cropped left image and the cropped right image of the oilfield scene to randomly generate horizontal and vertical translation distances in the cropped right image of the oilfield scene to create a translation matrix. Based on the translation matrix, the cropped right image of the oilfield scene is displaced to obtain the preprocessed right image of the oilfield scene, and the randomly translated pixel values are added to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map.
[0052] For example, this embodiment uses the PyTorch framework for construction and is trained and validated on the US3D dataset provided by DFC2019 on the Ubuntu 22.04 operating system using an RTX3090 GPU. The US3D dataset uses 3838 sets of images to form the training set and the remaining 454 sets of images to form the validation set. Each set of images contains one left image and one right image as input, and a disparity ground truth map is used to calculate the loss and evaluate the network accuracy. The pixels of the disparity map correspond one-to-one with the left image, and the original resolution of all images is 1024×1024. During data preprocessing, the pixel values are first normalized to the range [0,1], and then randomized to 512×512 image patches using Random Crop. Random TranslationTransformations are applied to the right image patch and the disparity image patch with a probability of 30%. The right image patch is shifted by randomly selecting a value in the range [-30,30], and all pixel values of the disparity image patch are added to this random value. Training was performed using the Adam optimizer with default parameters. The training epochs were set to 80, the initial learning rate to 0.001 (halved every 10 epochs), λ_1 and λ_2 to 1, the batch size to 4, and the disparity range to [-96, 96]. Image OMA287_023_024 from the dataset was selected for validation. For the stereo matching branch, its EPE (mean endpoint error) was 1.1296, and D1-Error (percentage of pixels with an error greater than 3) was 4.15%. The original image, the ground truth disparity map, the network-output disparity map, and the pseudo-color map showing the difference between the network and the ground truth map are shown. The pseudo-color map uses the viridis colormap shown. To facilitate coloring, the difference was limited to [0, 6]. Smaller differences indicate a pixel color closer to blue, and larger differences indicate a pixel color closer to yellow. For the semantic segmentation branch, the IOU was 0.7422, and the F1 score was 0.8520. The ground truth segmentation map and the network-output segmentation map are shown. Next, images from dataset JAX_068_018_016 were selected for validation. For the stereo matching branch, the EPE was 0.9080 and the D1-Error was 4.03%. The original image and disparity ground truth map, the network-output disparity map, and the pseudo-color map showing the difference between the network and the ground truth map are provided. For the semantic segmentation branch, the IOU was 0.8362 and the F1 score was 0.9048. The segmentation ground truth map and the network-output segmentation map are provided.
[0053] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0054] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A method for modeling an oilfield scene, characterized in that, include: The left image, the right image, and multiple disparity ground truth maps of the oilfield scene are preprocessed to obtain the preprocessed left image, the preprocessed right image, and multiple preprocessed disparity ground truth maps of the oilfield scene. Feature extraction is performed on the preprocessed left image and the preprocessed right image of the oilfield scene respectively to obtain the feature map of the left image and the feature map of the right image of the oilfield scene. Based on the feature maps of the left and right images of the oilfield scene, a cost body is constructed to calculate the disparity value through the cost body, thereby obtaining multiple disparity maps. The disparity map is verified by multiple preprocessed disparity ground truth maps, and the disparity map with the same features as the multiple preprocessed disparity ground truth maps is selected to obtain multiple network disparity ground truth maps. Feature fusion is performed on the disparity ground truth maps of the multiple networks to obtain a disparity feature map; A UNet structure is composed of feature fusion modules to perform semantic segmentation on the disparity feature map, thereby obtaining a semantic segmentation map. Based on the semantic segmentation graph and loss function, the semantic segmentation model of the oilfield to be trained is trained to obtain the semantic segmentation model of the oilfield.
2. The method for oilfield scene modeling according to claim 1, characterized in that, The process of preprocessing the left image, right image, and disparity ground truth map of the oilfield scene to obtain a preprocessed left image, a preprocessed right image, and multiple preprocessed disparity ground truth maps includes: The pixel values of the left and right images of the oilfield scene are normalized respectively to obtain the normalized left and right images of the oilfield scene. The left image of the normalized oilfield scene, the right image of the normalized oilfield scene, and the disparity ground truth map are randomly cropped to obtain the preprocessed left image of the oilfield scene, the cropped right image of the oilfield scene, and the cropped disparity ground truth map. The right image of the cropped oilfield scene is randomly shifted to obtain the preprocessed right image of the oilfield scene, and the randomly shifted pixel value is added to the cropped disparity ground truth map to obtain the multiple preprocessed disparity ground truth maps.
3. The method for oilfield scene modeling according to claim 2, characterized in that, The step of normalizing the pixel values of the left and right images of the oilfield scene to obtain a normalized left and right oilfield scene image includes: The pixel values of the left and right images of the oilfield scene are normalized to the [0,1] interval to obtain the normalized left and right images of the oilfield scene.
4. The method for oilfield scene modeling according to claim 2, characterized in that, The step of randomly cropping the normalized left image of the oilfield scene, the normalized right image of the oilfield scene, and the disparity ground truth map to obtain the preprocessed left image of the oilfield scene, the cropped right image of the oilfield scene, and the cropped disparity ground truth map includes: Randomly select starting points in the left image of the normalized oilfield scene, the right image of the normalized oilfield scene, and the disparity truth map, respectively; Based on the starting point, a clipping coordinate system is established with the image widths of the left image of the normalized oilfield scene, the right image of the normalized oilfield scene, and the disparity truth map as the x-axis, and the image heights of the left image of the normalized oilfield scene, the right image of the normalized oilfield scene, and the disparity truth map as the y-axis. Based on the cropping coordinate system and cropping parameters, the normalized oilfield scene left image, the normalized oilfield scene right image, and the disparity ground truth map are cropped respectively to obtain the preprocessed oilfield scene left image, the cropped oilfield scene right image, and the cropped disparity ground truth map.
5. The method for oilfield scene modeling according to claim 2, characterized in that, The process of randomly shifting the right image of the cropped oilfield scene to obtain the preprocessed right image of the oilfield scene, and adding the randomly shifted pixel values to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map, includes: Randomly generate the horizontal and vertical translation distances of the right image of the cropped oilfield scene to create a translation matrix; Based on the translation matrix, the right image of the cropped oilfield scene is shifted to obtain the preprocessed right image of the oilfield scene, and the randomly shifted pixel values are added to the cropped disparity ground truth map to obtain the preprocessed disparity ground truth map.
6. The method for oilfield scene modeling according to claim 1, characterized in that, The step of extracting features from the preprocessed left and right images of the oilfield scene to obtain feature maps of the left and right images of the oilfield scene includes: Feature extraction is performed on the preprocessed left image and the preprocessed right image of the oilfield scene respectively to obtain the preliminary extracted left image and the preliminary extracted right image of the oilfield scene; Depth extraction is performed on the preliminary extracted left and right images of the oilfield scene to obtain feature maps of the left and right images of the oilfield scene.
7. The method for oilfield scene modeling according to claim 1, characterized in that, The cost body is constructed based on the feature maps of the left and right images of the oilfield scene to calculate disparity values, resulting in multiple disparity maps, including: After shifting the pixel value of the right image feature map of the oilfield scene by a set number of pixels, subtract it from the pixel value of the left image feature map of the oilfield scene, and stack the results of the subtraction to construct a cost volume, so as to calculate the disparity value through the cost volume and obtain multiple disparity maps.
8. A method and apparatus for modeling an oilfield scene, characterized in that, include: Preprocessing unit: preprocesses the left image of the oilfield scene, the right image of the oilfield scene, and multiple disparity ground truth maps to obtain preprocessed left image of the oilfield scene, preprocessed right image of the oilfield scene, and multiple preprocessed disparity ground truth maps; Feature extraction unit: used to extract features from the preprocessed left image of the oilfield scene and the preprocessed right image of the oilfield scene to obtain feature maps of the left image of the oilfield scene and the right image of the oilfield scene; The disparity unit is used to construct a cost body based on the feature map of the left image and the feature map of the right image of the oilfield scene, so as to calculate the disparity value through the cost body and obtain multiple disparity maps. Comparison unit: used to verify the disparity map by using multiple preprocessed disparity ground truth maps, and filter out the disparity maps with the same features as the multiple preprocessed disparity ground truth maps to obtain multiple network disparity ground truth maps; Feature fusion unit: used to perform feature fusion on the disparity ground truth maps of the multiple networks to obtain a disparity feature map; Semantic segmentation unit: used to compose a UNet structure based on the feature fusion module, so as to perform semantic segmentation on the disparity feature map through the UNet structure to obtain a semantic segmentation map; The model building unit is used to train the oilfield semantic segmentation model to be trained based on the semantic segmentation graph and the loss function, so as to obtain the oilfield semantic segmentation model.
9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer-executable program, and the processor is configured to execute the computer-executable program to implement the method of any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer-executable program, which, when run, implements the method described in any one of claims 1-7.