Skip to the main content

Original scientific paper

https://doi.org/10.17794/rgn.2026.4.1

DIGITALNI PETROGRAFSKI PRISTUP PROCJENI KARBONATNIH LEŽIŠTA U MATLAB-U

Nita Ariyanti ; Geological Engineering Department, Universitas Gadjah Mada, Yogyakarta; Geophysical Engineering Department, Institut Teknologi Sepuluh Nopember, Surabaya.
Sugeng Sapto Surjono ; Geological Engineering Department, Universitas Gadjah Mada, Yogyakarta.
Salahuddin Husein ; Geological Engineering Department, Universitas Gadjah Mada, Yogyakarta. *
Marsha Khairia Alfany ; Geophysical Engineering Department, Institut Teknologi Sepuluh Nopember, Surabaya.
Firman Syaifuddin ; Geophysical Engineering Department, Institut Teknologi Sepuluh Nopember, Surabaya.
M. Irfan Mashudi ; Pertamina EP Cepu, Indonesia.

* Corresponding author.


Full text: english pdf 3.900 Kb

page 1-12

downloads: 2

cite

Download JATS file


Abstract

Poroznost je ključni parametar u karakterizaciji karbonatnih ležišta jer izravno utječe na skladištenje fluida i ponašanje toka. Konvencionalne tehnike za procjenu poroznosti, poput analize jezgre i bušotinske karotaže, često zahtijevaju mnogo posla te su dugotrajne i skupe. U ovome je radu predložena automatizirana metoda za procjenu poroznosti pomoću tehnika analize petrografskih podataka i slika korištenjem računalnoga programa MATLAB. Fotografije tankih presjeka karbonatnih stijena obrađuju se postupcima segmentacije slike, uočavanja značajki i klasifikacije kako bi se kvantitativno odredila poroznost. Proces procjene oslanja se na RGB analizu slike, u kojoj se za precizno razlikovanje pornih područja koriste razlike u intenzitetu boje između stijenske matrice i pornih prostora. Pristupom RGB analize slike u MATLAB- u postiže se točnost od 60,9 % u usporedbi s podatcima rutinske analize jezgre (RCAL), što upućuje na snažnu korelaciju između procijenjenih i izmjerenih vrijednosti poroznosti. Ova metoda digitalne petrografije pokazuje veću točnost i konzistentnost od konvencionalne ručne analize slike, na koju često utječu ljudska interpretacija i subjektivnost. Automatizacijom procesa obrade slike metoda omogućuje objektivnu, brzu i isplativu procjenu poroznosti. Unatoč nedostatku složenih računalnih algoritama tehnika digitalne petrografije temeljena na MATLAB-u pruža pouzdanu i učinkovitu alternativu za preliminarnu karakterizaciju karbonatnih ležišta, posebice u slučajevima kada su laboratorijski podatci ili podatci iz karotažnih mjerenja ograničeni.

Keywords

digitalna petrografija; analiza slika; karakterizacija karbonatnih ležišta

Hrčak ID:

349838

URI

https://hrcak.srce.hr/349838

Publication date:

21.7.2026.

Article data in other languages: english

Visits: 18 *




1. Introduction

Carbonate reservoirs exhibit significant variety, leading to the considerable complexity of their reservoir rocks (Ahr, 2008; Choquette et al., 1970; Flügel, 2010; Lucia, 1995; Moore, 2001). The quality of carbonate rock reservoirs necessitates investigation due to the interrelated regulatory factors (Choquette et al., 1970; Flügel, 2010; Lucia, 1995; Slatt, 2006). The quality of carbonate rock reservoirs is influenced by various factors, including depositional facies, sedimentary environment, and diagenetic processes. In carbonate reservoirs with limited core and well-log data, digital image analysis provides an efficient alternative for petrophysical characterization (Kharitontseva et al., 2021). Further comprehensive research on these parameters is required to better explore carbonate reservoir zones (Ezeakacha et al., 2018; Saenger et al., 2016; Blunt et al., 2013). The increasing application of AI-based image classification, particularly in complex carbonate systems, reflects the growing role of digital petrography in reservoir studies (Basso et al., 2025). Recent advances in digital reservoir characterization increasingly combine image-based analysis with artificial intelligence for more accurate reservoir evaluation. For example, Zhang et al. (2024) demonstrated the application of a neural network–assisted fracture identification system integrated with an analytic hierarchy process for tight carbonate reservoir assessment. The assessment of carbonate reservoirs is essential in hydrocarbon exploration and production, as it evaluates the potential for oil and gas extraction by examining the reservoir's characteristics, including porosity, permeability, and saturation. The RGB-based petrographic image analysis conducted in MATLAB provides a rapid, non-destructive approach for estimating carbonate rock porosity through colour-based segmentation of thin-section images. The image is subsequently segmented into binary format using the RGB colour attributes to characterize pore structures directly from standard petrographic images without requiring advance depth data or 3D structural information especially 3D physical porosity measurements. This approach enhances efficiency in large-scale thin-section evaluation and offers a cost-effective alternative for preliminary porosity assessment, particularly in early stage reservoir characterization. To contextualize this approach, several previous studies have explored digital and colour based methods for carbonate analysis.

Previous research has demonstrated that RGB-based image segmentation can be a valid approximation when validated against core or log data (Hearn et al., 1984; García-Lamont et al., 2020). Recent studies highlight that image-based rock typing provides valuable microscale information for reservoir characterization (Wang et al., 2024). Furthermore, the results can also be validated with Routine Core Analysis (RCAL) data, which provides reliable laboratory-measured porosity values to assess the accuracy of image-based estimations. However, most existing RGB based studies primarily focus on qualitative visualization or limited statistical comparison, often relying on grayscale conversion or partial colour segmentation. In contrast, the present study introduces a quantitative RGB colour attribute approach directly implemented in MATLAB to differentiate matrix and pore spaces in carbonate rocks. This method expands previous applications by integrating full-spectrum colour analysis for pixel-based porosity estimation, enabling rapid, non-destructive, and cost-efficient evaluation of carbonate textures using standard thin-section images without requiring 3D imaging or machine learning models.

2. Data and Materials

2.1. Core and RCAL Data

The primary dataset for validating image-based porosity estimations derived from petrographic thin-section analysis were these samples, which were collected from carbonate intervals in the North-East Java Basin. The carbonate samples analyzed in this study were obtained from the Prupuh Formation, which represents an Early Miocene carbonate sequence. This formation is part of the regional carbonate platform development that characterizes the lower to middle Miocene stratigraphy of East Java. The sampled interval occurs at an approximate subsurface depth of 800-1200 meters, corresponding to shallow-marine depositional settings typically dominated by bioclastic and micritic limestones. Lithologically, the core material primarily consists of packstone to grainstone textures, composed of bioclastic fragments, foraminifera, and peloidal grains, cemented by fine-grained calcite spar (Hidayat et al., 2022). In an effort to ascertain the fundamental petrophysical properties of specified carbonate rock core samples, including porosity, permeability, grain density, and fluid saturation, Routine Core Analysis (RCAL) was carried out to analyze a total of 31 core plugs samples. These measurements are used as ground-truth data to verify the porosity estimations that are based on images. As a consequence of the heterogenity of carbonate rocks, RCAL is essential for the calibration of digital analysis results and the provision of valuable insight into reservoir quality.

2.2. Thin Sections

Petrographic thin sections were prepared from core plug samples obtained from the same intervals as those employed for Routine Core Analysis (RCAL). However, the plugs for the thin sections are physically different from the ones the RCA data originates from. These thin sections facilitate the use of light microscopy to observe the rock's pore structures, mineral composition, and texture in detail. In this investigation, the thin-section images were additionally employed for digital image processing, employing RGB colour-based analysis to visually estimate porosity. Prior to RGB-based image analysis, the petrographic thin sections were initially evaluated using the Nodule petrography method, a conventional point-counting technique that provides a baseline estimation of visual porosity through manual microscopic interpretation. Petrographic data and porosity values derived from petrographic analysis are presented in Table 1.

image1.png

Table 1. Petrographic porosity in fraction and photomicrographs used as inputs for MATLAB modelling

3. Methodology

3.1. Workflow

In this study, the porosity of carbonate rock samples is estimated from petrographic thin-section images using an RGB-based image analysis approach implemented in MATLAB. As the images are treated as RGB frameworks, image processing operations are performed based on specific colour components that correspond to various features within the sample. MATLAB’s image processing toolbox provides a comprehensive set of functions for image enhancement, segmentation, colour detection and feature extraction (Duth & Deepa, 2018). In this case, these tools facilitate the identification of pore spaces in petrographic images through channel specific processing and colour thresholding techniques (Dias et al., 2020). The RGB-based image segmentation technique follows a similar approach to that employed by Kuang et al. (2022), in which differences in colour intensity between matrix and pore spaces are used to delineate porosity. Luo et al. (2023) demonstrated that 2D thin-section images can be effectively used to infer 3D petrophysical properties, supporting the reliability of image-based porosity estimation.

The porosity of carbonate rock samples was estimated from petrographic thin-section images in this investigation using an RGB-based image analysis approach in MATLAB. The images were processed as RGB frameworks, with colour components corresponding to pore and textural features. Enhancement, segmentation, and feature extraction were facilitated by MATLAB's Image Processing Toolbox (Dias et al., 2020; Duth & Deepa, 2018). The workflow commenced with the production of thin-sections from 31 carbonate core plugs of the Prupuh Kujang Formation. Thin-section images were acquired under transmitted light using a petrographic microscope equipped with a high resolution digital camera. MATLAB was used to ingest these images and preprocess them through noise reduction (median filter) and contrast enhancement (histogram equalization). In order to determine the most responsive colour component for pore detection, each image was decomposed into its Red, Green, and Blue channels. Pore segmentation was performed by utilizing Otsu thresholding and binary conversion (imbinarize) to differentiate between the solid matrix (white pixels) and pore spaces (black pixels). It should be noted that under plane polarization light (PPL), pores often appear dark or black due to the absence of transmitted light, whereas opaque minerals may also exhibit similar tones. When blue resin impregnation is used, pores are instead represented by bright blue regions, allowing more precise differentiation from opaque minerals. Noise was eliminated and the continuity of the pore boundary was enhanced through morphological filtering (imopen, imclose, imfill). Following this, regionprops was employed to label and quantify pore regions, and label2rgb was employed to illustrate their visual distribution. The ratio of pore pixels to total image pixels was used to calculate porosity (fr). A high R² value was obtained, confirming a strong agreement with RCAL data, and the correlation between digital and laboratory porosity values was assessed using linear regression with polyfit and corrcoef. The automated MATLAB-based procedure guarantees the objective and reproducible quantification of pore structures, and it is consistent with the most recent advancements in AI-assisted carbonate petrography (Kuang et al., 2022; Luo et al., 2023; Faria et al., 2025).

However, in order to validate the porosity values predicted using this RGB-based method, a benchmarking process was conducted by comparing the predicted results with laboratory-measured porosity from RCAL. This comparison was further assessed using a linear regression to express the correlation between laboratory-measured porosity values and those derived from images. The coefficient of determination (R²) was used to indicate the strength of the correlation. Automatic classification through MATLAB-based routines is in line with recent advancements employing one-class models and convolutional neural networks for carbonate thin-section analysis (Faria et al., 2025).

image2.png

Figure 1. Image processing workflow for porosity estimation in petrographic samples using MATLAB.

3.2. Depth Map

In the field of petrographic image analysis, a depth map is a visual aid that is employed to simulate changes in depth or elevation by referencing the grayscale intensity or RGB values of an image. Despite the fact that petrographic images are two-dimensional, a depth map can be produced computationally by designating pseudo-depth values to varying pixel intensities. Typically, darker areas (e.g. pore spaces) are interpreted as "deeper" and lighter areas (e.g. matrix minerals) as "shallower". This is accomplished in MATLAB by converting the RGB image to grayscale and subsequently mapping the grayscale values to a surface or 3D geometry using functions such as surf, imagesc, or mesh. The RGB image is converted to grayscale using rgb2gray to initiate the procedure. The grayscale intensity is subsequently interpreted as a height value, with the "depth" of each pixel determined by its luminance. The contrast between the matrix and pore zones is improved by plotting these values in 3D using a colourmap (e.g. 'jet' or 'parula'). This artificial depth map aids in the qualitative evaluation of heterogeneity and texture in carbonate rocks by illustrating the spatial distribution and relative geometry of porosity features, despite the fact that it does not represent actual geological depth. This method is especially beneficial in educational environments and preliminary digital rock characterization, as it provides a user-friendly approach to analyzing the pore distribution in carbonate reservoir samples.

image3.png

Figure 2. Petrographic image workflow for RGB-based analysis (Sample NA-24). The figure illustrates the same thin-section area at identical magnification and scale across three panels: (a) the original transmitted-light thin-section image; (b) the annotated image with descriptive mineral labels and a scale bar; and (c) the pseudo-depth map visualization generated from RGB intensity variations.

The depth map image depicts the variety of pore depths in a carbonate rock thin section on a colour-coded RGB scale. In this illustration, the blue areas correspond to the highest or deepest pore spaces, suggesting zones with the highest pore volume and possible reservoir quality. The green and yellow sections show intermediate pore depths, whilst the red parts represent the shallowest or least porous zones. This colour gradient, which ranges from red (low pore depth) to blue (high pore depth), provides a straightforward visual assessment of pore distribution and connection. This map allows researchers to identify heterogeneous pore structures and estimate the rock's porosity, which is critical for evaluating reservoir performance.

3.3. Petrographic Analysis

The thin-section analysis in Figure 2 (from sample number NA-24) reveals that the rock is predominantly composed of skeletal grains, which constitute approximately 63% of the total composition. These skeletal grains include foraminiferal taxa such as Nummulites (D-H, 1–5) and Spiroclypeus (A-G, 4–15), appearing brownish to dark brown in colour, with grain sizes ranging from 0.125 mm to 1 mm. Dolomite crystals account for around 7% of the composition, characterized by colourless, fine-sized subhedral crystals (<1 mm) with three directional cleavages, low relief, and weak pleochroism (monochroic). Under cross-polarized light (XPL), these dolomites exhibit gray interference colours, typically of the fourth order, with inclined extinction and no twinning (G-I, 6–7). The matrix is dominated by microcrystalline calcite or micrite, making up 19% of the sample. It appears as fine, brownish-dark grains with subrounded to angular shapes and low relief, measuring less than 0.06 mm. Under XPL, it shows dark brown interference colours of the first order (H-J, 2-4). The remaining 11% is composed of other constituents, including blank or pore spaces observed in areas such as H, 10-11, contributing to the porosity of the sample.

In the original transmitted-light images, pore spaces are visible as dark or opaque regions interspersed between skeletal grains and within micritic zones, appearing irregular in shape. These dark zones correspond to areas of lower RGB intensity and are therefore detected as black regions after binary segmentation. Under crossed nicols, these pores remain dark, indicating true voids rather than mineral phases. The processed images in MATLAB clearly differentiate the pore structures through enhanced contrast and thresholding, where pore spaces are represented by dark (black) pixels, and the solid matrix by bright (white) pixels. Based on both petrographic and digital interpretation, the pores can be classified into several types: (1) intercrystalline pores, which occur between dolomite crystals; (2) moldic pores, formed by the dissolution of skeletal fragments; (3) vuggy pores, represented by irregular, larger cavities; and (4) microfracture pores, characterized by thin, elongated voids cutting across grains or matrix. These pore types collectively control the connectivity and heterogeneity of the carbonate reservoir, and their distinction enhances the interpretability and accuracy of the image-based porosity estimation.

3.4. Binary Segmentation

Binary segmentation is a critical phase of digital petrography that facilitates the separation of pore spaces from the solid carbonate matrix. In order to identify and quantify pore regions, binary segmentation was implemented on petrographic thin-section images in this investigation. The RGB image was initially converted to grayscale using MATLAB's rgb2gray function, which reduced the image to pixel intensity values that ranged from black (0) to white (255). This conversion simplifies the dataset while maintaining the essential textural and luminance variations necessary for further analysis. The grayscale image was subsequently converted to a binary image using thresholding techniques, either Otsu's adaptive method (graythresh) by Otsu (1979) or manual threshold adjustment, contingent upon the quality of the image's contrast. The carbonate matrix is depicted as white pixels (value = 1), while pore spaces are represented as black pixels (value = 0) in the resulting binary output. This procedure effectively separates the pore framework from the surrounding solid material, enabling precise quantitative and visual differentiation. Post-segmentation, the bwlabel and regionprops functions of MATLAB were implemented to identify and characterize individual pore geometries, including their shape, spatial distribution, and area. The ratio of black pixels (pores) to the total number of pixels in the image was used to calculate porosity, which was expressed as a percentage. The binary segmentation method offers a rapid, objective, and reproducible method for directly estimating porosity from thin-section images, making it an efficient alternative when laboratory or core analysis data are scarce. This method, as illustrated in Figure 3, demonstrates that binary segmentation not only improves pore–matrix contrast but also establishes a consistent framework for quantitative comparison with Routine Core Analysis (RCAL) results. Moreover, it facilitates the identification of micro-scale pore variability that may otherwise be disregarded in traditional petrographic evaluations, thereby facilitating a more thorough assessment of the quality of carbonate reservoirs. Binary segmentation with picture thresholding is a simple yet effective approach for carbonate reservoir assessment via image-based porosity estimation, as shown as Figure 3.

image4.png

Figure 3. Comparative petrographic analysis and binary image segmentation for quantitative porosity evaluation in carbonate thin section (Sample NA-024).

3.5. Pore Space Segmentation

Pore space segmentation is a critical stage in the digital quantification of porosity, during which individual pore regions are extracted, classified, and measured from the binary image. In order to eliminate minor artifacts, bridge discontinuities, and improve the specification of the pore boundary, morphological operations such as imopen, imclose, and imfill were implemented. This refinement guarantees the precise separation of interconnected or irregularly shaped pore structures that are frequently observed in carbonate rocks as a result of diagenetic alteration and recrystallization. The quantitative parameters, including pore area, perimeter, aspect ratio, and spatial distribution, were extracted by labelling and analyzing the segmented pore regions using MATLAB's bwlabel and regionprops functions. The resulting images effectively demonstrate the heterogeneity of pore systems, emphasizing regions with greater porosity and potential reservoir quality. Subsequently, the total pore area was compared to the total image area to determine porosity, resulting in a digital value that was cross-validated against Routine Core Analysis (RCAL) measurements. The segmentation procedure's reliability for quantitative pore characterization is confirmed by the close correspondence between these datasets. The integration of threshold-based and morphological segmentation techniques, as illustrated in Figure 4, enables the efficient and reproducible estimation of pore space geometry, thereby offering valuable insight into the microstructural heterogeneity of carbonate reservoir rocks. This method is predicated on the premise that pore spaces exhibit significantly lower intensity values than the adjacent minerals, which allows for precise segmentation based on colour or brightness, as shown as Figure 4.

image5.png

Figure 4. Petrographic Image, Annotated Description, and Pore Space Segmentation of Carbonate Sample NA-1.

Three primary stages comprise the RGB image analysis conducted with MATLAB: Binary Segmentation, Pore Space Segmentation, and Depth Map generation. The pseudo Depth Map serves as an initial foundation for pore identification by illustrating the intensity contrast and textural variation within the carbonate thin section. In this visualization, colour gradations correspond to relative pixel intensity values, where cooler colours (blue to green) represent lower intensity zones (interpreted as pore spaces or voids), and warmer colours (yellow to red) indicate denser mineral regions. A colour legend and scale bar were included to facilitate the interpretation of these variations in grayscale depth intensity. The pore space segmentation image depicts the spatial distribution and delineation of pore spaces, as determined by digital image processing of the carbonate thin section. Coloured regions denote segmented pore spaces, with each unique colour representing an individual pore or pore cluster identified through a connected-component labeling method. The colour variations do not represent pore type, size, or porosity magnitude, but are exclusively used to visually differentiate individual pores and avoid overlap. The white or light-toned background indicates the non-porous carbonate rock matrix. Larger continuous coloured regions denote interconnected pores or macropores, which can substantially influence effective porosity, whereas smaller isolated coloured patches represent micropores or discrete pore spaces. Quantitative porosity measurements are derived from the ratio of the total pore pixel area to the overall image area, rather than from the colour information itself.

The analysis is limited by the microscope’s optical and pixel resolution, as only pores that are visibly resolved in thin-section images can be quantified. Micropores smaller than 1-2 µm remain undetected, causing underestimation compared to high-resolution 3D or micro-CT methods. In addition, the RGB-based segmentation may misclassify opaque minerals, stains, or poorly illuminated areas as pores due to similar low-intensity values. Over-segmentation and uneven lighting can further affect accuracy; thus, the method performs best on well-prepared thin sections with uniform illumination and strong optical contrast between pores and the matrix.

4. Results and Discussion

4.1. Correlation Analysis (RCAL vs MATLAB)

Building upon this single-sample comparison, porosity values estimated through MATLAB image processing were systematically compared against laboratory measurements from a total of 31 carbonate thin-section samples. The results, as summarized in Table 2, illustrate the correlation and discrepancies between the digital estimations and experimental data, thereby offering valuable insight into the image-based porosity assessment's accuracy.

A linear regression analysis was used to determine the relationship between porosity values acquired from MATLAB image processing and Routine Core Analysis (RCAL) laboratory data. The scatter plot shows a significant positive correlation, with a regression equation of y = 0.477x0.505 and a coefficient of determination (R²) of 0.609. The strong R² value suggests that image-based calculations employing RGB segmentation techniques in MATLAB can explain 60.9% of the variance in laboratory-measured porosity. Recent segmentation models by Vieira de Mello et al. (2025) also achieved high correlation (R² > 0.88) between predicted and measured values, consistent with the accuracy obtained in this research. The slope is significantly more than one, indicating that MATLAB consistently underestimates porosity values. Nonetheless, the tight clustering of data points around the regression line demonstrates that the image-based method is a viable and efficient option for predicting porosity, which is especially useful in scenarios requiring rapid or cost-effective analysis for reservoir characterization.

Table 2. Comparison of predicted porosity in fraction from MATLAB and measured porosity from RCAL

image6.png

*Predicted Porosity (MATLAB)

**Measured Porosity (RCAL)

Despite the promising accuracy, some restrictions should be noted. The pattern of underestimating at increasing porosity levels suggests a nonlinearity caused by picture quality difficulties, segmentation thresholds, or differences in pore morphology that RGB-based approaches cannot fully capture. As a result, while the MATLAB-based approach is an effective preliminary tool, it may benefit from further calibration with advanced image enhancement or machine learning approaches to improve pore space recognition and account for complicated textures. Furthermore, the method's applicability should be verified across a variety of lithologies and depositional textures to provide greater reliability. Integrating this methodology with existing digital rock physics approaches could improve reservoir characterization efforts by allowing for quick porosity estimation over bigger datasets at low cost and time.

Recent advancements in digital imaging and quantitative petrography have improved the characterization of pore systems in carbonate reservoirs. Multiscale imaging approaches integrating thin-section and SCAL data have demonstrated significant improvements in understanding pore heterogeneity and connectivity (Sulieman et al., 2024). These studies emphasize the importance of digital petrography as a complementary tool for reservoir evaluation, providing a non-destructive and efficient method for porosity estimation.

image7.png

Figure 5. (a) Linear regression correlation between MATLAB-based image analysis and RCAL porosity measurements; (b) Linear regression correlation between RCAL porosity and petrographic porosity.

Figure 5a shows a link between porosity measured from RCAL core samples and porosity approximated via MATLAB-based petrographic image processing. Since carbonate rocks have complex and varied pore systems, the linear regression reveals a poor connection (R² = 0.102), suggesting that the relationship is nonlinear. A far better fit is offered by the power-law regression (R² = 0.609), indicating that pore shape is a key factor in regulating porosity visible in thin-section pictures. This demonstrates that, when its nonlinear behaviour and pore geometry restrictions are appropriately taken into consideration, petrographic image analysis can approximate actual porosity.

Figure 5b shows the scatter diagram depicting the correlation between petrographic porosity obtained through RGB-based image analysis (x-axis) and porosity determined via Routine Core Analysis (RCAL) (y-axis). Each location corresponds to a distinct carbonate sample. Overall, the distribution of data points exhibits considerable dispersion, suggesting a tenuous correlation between the two methodologies. The regression line, represented as y = 1.510x, indicates that RCAL porosity values are typically greater than those derived from thin-section image analysis. This is expected, as RCAL measurements encompass micro-pores and interconnected pore networks that are not detectable in two-dimensional petrographic images. The negative R² value (−0.355) further suggests that the linear model fails to adequately characterize the relationship between the datasets, indicating a weak statistical correlation. This behaviour suggests that the current image segmentation method could underestimate porosity in samples exhibiting more intricate pore architectures. The overall scatter indicates that analyzing thin-section images in isolation is inadequate for predicting core-scale porosity in heterogeneous carbonate rocks, and that enhancements in thresholding, segmentation, or the application of supplementary techniques are necessary to increase accuracy.

Figure 7 displays a scatter diagram comparing porosity values derived from Matlab image analysis (x-axis) and petrographic thin-section analysis (y-axis). The regression line presents the equation y = 0.611x, suggesting that petrographic porosity increases at a slower rate than Matlab porosity and is typically lower for the same samples. The coefficient of determination, R² = 0.723, indicates a moderate correlation, suggesting that approximately 72.3% of the variability in petrographic porosity is accounted for by the Matlab-derived porosity. The extensive dispersion of data points around the trend line indicates variability between the two methods, likely affected by factors such as grain heterogeneity, image resolution, pore-type variations, or segmentation errors. Overall, the plot indicates a modest yet positive correlation between the two porosity measurement methods, suggesting that they do not exhibit a firm correspondence and should be interpreted cautiously in reservoir characterization.

The scatter diagram depicts the correlation between petrographic porosity obtained from thin-section image analysis and laboratory-measured RCAL porosity. Overall, the data reveal a feeble and statistically insignificant correlation, as evidenced by the poorly defined trend line and the negative coefficient of determination (R² = -0.355). Although the regression slope (1.510) indicates that RCAL porosity generally increases more swiftly than petrographic porosity, the significant scatter illustrates that thin-section measurements do not consistently serve as reliable predictors of core-scale porosity. This discrepancy highlights the inherent limitations of 2D petrographic observations, which detect only pore features evident within a single plane and frequently underestimate micropores, moldic pores, or interconnected pore networks that exist in three dimensions. Conversely, RCAL measurements encompass the entire pore network at the particle scale, rendering them a more accurate reflection of the actual reservoir porosity. Consequently, the figure underscores the variability of carbonate pore structures and emphasizes that petrographic porosity alone is inadequate for precise quantitative porosity assessment without supplementary calibration or laboratory data.

4.2. Outlier sample analysis

image8.png

Figure 6. Pore structure characterization and porosity estimation of thin-section sample NA-22 using RGB-based petrographic image analysis.

In Figure 6, the porosity prediction of sample NA-22 using RGB-based petrographic image analysis resulted in a value of 0.0083, which is relatively close to the manual petrographic analysis that reported a porosity of 0. However, this value remains significantly lower than the porosity measured though Routine Core Analysis (RCAL), which reached 0.036. This discrepancy is expected, considering that porosity in RCAL, particularly using helium gas porosimetry, employs a more advanced and sensitive method. This technique relies on the principle of Boyle’s law which states that the volume of gas varies inversely with pressure under isothermal conditions (Pal et al., 2018). Therefore, it is reasonable that the results do not perfectly match, as RCAL porosity measurements can detect micro-scale and connected pores that are often not visible or accessible in thin-section image analysis. Helium porosimetry is grounded in Boyle’s law and is widely regarded as a benchmark for porosity measurement due to its ability to quantify effective pore volume with high accuracy. As such, while the digital prediction aligns with the trend observed in manual petrography, further calibration is necessary to bring it closer to the benchmark RCAL values.

4.3. Discussion

image9.png

Figure 7. Representative petrographic thin-section photomicrographs provided as substitutes for unavailable samples. The selected images depict comparable lithofacies and pore structures, ensuring consistency in visual-based porosity estimation and maintaining dataset representativeness for the MATLAB analysis.

The findings of this investigation indicate that digital petrography based on RGB and MATLAB offers a dependable and effective method for estimating porosity in carbonate rocks, marking a significant improvement over traditional methods. The proposed image analysis approach is capable of accurately representing up to 72.3% of the variance observed in RCAL data, as evidenced by the strong correlation between image-derived porosity and laboratory-measured values (R² = 0.723), as shown in Figure 7. This high level of agreement confirms that the automated image segmentation and pore quantification techniques employed in this study are capable of replicating porosity trends that are typically obtained from more complex laboratory analyses. The superiority of this automated method is clearly demonstrated when compared to the manual estimation results presented in Figure 5. The manual petrographic porosity data exhibits a lack of correlation with RCAL measurements (R² = -0.355), highlighting the severe limitations and subjectivity inherent in visual point-counting. While the manual method failed to capture any meaningful trend, the MATLAB-based approach in Figure 7 successfully aligned with the physical measurements. Nevertheless, despite the strong correlation in Figure 7, the porosity values derived from MATLAB tend to underestimate porosity at higher ranges. This underestimation is likely the result of the inherent limitations of 2D thin-section imagery, which is unable to fully capture connected or micro-scale pores that are visible in helium porosimetry measurements. Helium gas methodologies are particularly sensitive to micro-porosity, as noted by Pal et al. (2018), because the gas can penetrate small pore throats that are not resolved in digital image analysis.

Furthermore, minor discrepancies between the predicted and measured porosity may be influenced by variations in image quality, illumination, and segmentation thresholds. However, the RGB-based segmentation algorithm's robustness is substantiated by the drastic improvement in correlation coefficient from -0.355 to 0.723. In comparison to manual visual estimation, the objectivity and reproducibility of petrographic interpretations are improved by the technique's capacity to differentiate between matrix and pore spaces through grayscale intensity mapping. Additionally, this method offers a comprehensive visualization of spatial heterogeneity and pore geometry. In comparison to previous digital petrography studies (e.g. Kuang et al., 2022; Faria et al., 2025; Basso et al., 2025), the accuracy of 72.3% attained in this research is within the same performance range as more complex machine learning or deep learning approaches. This discovery implies that simpler MATLAB-based procedures can achieve comparable accuracy while being computationally efficient, provided they are calibrated correctly. Consequently, the RGB-based method is a practical alternative for preliminary reservoir characterization, particularly in data-limited situations. Overall, the digital petrography framework developed in this study illustrates that image-based porosity estimation is not only feasible but also highly prospective for facilitating the assessment of reservoir quality in carbonate rocks.

6. Conclusions

This research assessed the application of RGB-based MATLAB image processing techniques to determine porosity in carbonate rocks and contrasted the findings with petrographic observations and Routine Core Analysis (RCAL) measurements from 31 samples. The porosity values derived from MATLAB typically align with the overall trend observed in the RCAL data, although they tend to systematically underestimate, especially in samples exhibiting higher porosity or more intricate pore architectures. Regression analysis reveals that the correlation between image-derived porosity and laboratory measurements is nonlinear, with a power-law model offering a superior fit compared to a linear model. The modest correlations among petrographic, MATLAB, and RCAL porosity underscore the limitations of 2D thin-section imaging, which is unable to comprehensively characterize micropores or three-dimensional pore connectivity as determined by helium porosimetry. Despite these limitations, the MATLAB workflow provides a consistent and practicable method for initial porosity estimation, particularly when rapid or cost-effective assessments are required. Overall, the findings indicate that digital petrography can serve as a complementary tool but cannot supplant laboratory measurements. Future advancements in segmentation, calibration, or machine learning techniques may improve the precision of image-based porosity predictions in heterogeneous carbonate reservoirs.

References

Ahr, W. M. (2008). Geology of carbonate reservoirs: The identification, description, and characterization of hydrocarbon reservoirs in carbonate rocks. John Wiley & Sons.https://doi.org/10.1002/9780470370650

Basso, M., Souza, J. P. P., Chinelatto, G. F., Mansini, L. A. A., & Vidal, A. C. (2025). Petrographic image classification of complex carbonate rocks from the Brazilian pre-salt using convolutional neural networks. Scientific Reports, 15, 30700.https://doi.org/10.1038/s41598-025-30700-5

Blunt, M. J., Bijeljic, B., Dong, H., Gharbi, O., Iglauer, S., Mostaghimi, P., Paluszny, A., & Pentland, C. (2013). Pore-scale imaging and modeling. Advances in Water Resources, 51, 197–216. DOI: 10.1016/j.advwatres.2012.03.003

Choquette, P. W., & Pray, L. C. (1970). Geologic nomenclature and classification of porosity in sedimentary carbonates. AAPG Bulletin, 54(2), 207-250. DOI: 10.1306/5D25C98B-16C1-11D7-8645000102C1865D

Dias, B. M., Velázquez Fernandez, V., Lucena, R. F., & Azevedo Sobrinho, J. M. (2020). Petrographic microscope digital image processing technique for texture and microstructure interpretation of earth materials. Earth Science Research, 9(1), 58.https://doi.org/10.5539/esr.v9n1p58

Duth, S., & Mary Deepa, M. (2018). Color detection in RGB-modeled images using MATLAB. International Journal of Engineering & Technology, 7(2), 29–33.https://doi.org/10.14419/ijet.v7i2.31.13391

Ezeakacha, C., Rabbani, A., Salehi, S., & Ghalambor, A. (2018). Integrated image processing and computational techniques to characterize formation damage (SPE-189509-MS). Paper presented at the SPE International Conference and Exhibition on Formation Damage Control. https://doi.org/10.2118/189509-MS

Faria, E. L., Barbosa, R., Coelho, J. M., & Matos, T. F. (2025). Automatic classification of carbonatic thin sections by computer vision techniques and one-vs-all models. Artificial Intelligence in Geosciences, 6(1), 100117.https://doi.org/10.1016/j.aiig.2025.100117

Flügel, E. (2004). Microfacies of carbonate rocks: Analysis, interpretation and application. Springer.https://doi.org/10.5860/choice.42-3437

Gonzalez, R. C., & Woods, R. E. (2019). Digital image processing (4th ed.). Pearson Education. ISBN 9789353062989

García-Lamont, F., Cervantes, J., Lopez-Chau, A., & Ruiz Castilla, J. S. (2020). Color image segmentation using saturated RGB colors and decoupling the intensity from the hue. Multimedia Tools and Applications, 79(7). DOI: 10.1007/s11042-019-08278-6

Hearn, C. L., Ebanks W. J. Jr., Tye, R. S., Ranganathan, V. (1984). Geological factors influencing reservoir performance of the Hartzog Draw Field, Wyoming. Journal of Petroleum Technology. 36(8). 1335-1344. DOI: 10.2118/12016-pa

Hidayat, F. I., Yogi, A., Sabra, E., Ramli, T., Firdaus, M., Saleh, H. M., Arviallyn, G. G., & Wibowo, A. S. (2022). Source Rock Characterization of the Eocene–Miocene, Central Deep, North East Java Basin. Jurnal Geologi dan Sumberdaya Mineral, 23(3). https://doi.org/10.33332/jgsm.geologi.v23i3.697

Kharitontseva, P., Gardiner, A., Tugarova, M., Chernov, D., Maksimova, E., Churochkin, I., & Rukavishnikov, V. (2021). An Integrated Approach for Formation Micro-Image Rock Typing Based on Petrography Data: A Case Study in Shallow Marine Carbonates. Geosciences, 11(6), 235.https://doi.org/10.3390/geosciences11060235

Kuang, H., Ye, X., & Qing, Z. (2022). Porosity of the porous carbonate rocks in the Jingfengqiao-Baidiao area based on finite automata. Royal Society Open Science, 9(1), 211844. https://doi.org/10.1098/rsos.211844

Lucia F. J. (1995). Rock-fabric/petrophysical classification of carbonate pore space for reservoir characterization. AAPG Bulletin. 79(9). OSTI ID: 159905

Luo, C., Wan, H., Chen, J., Huang, X., Cui, S., Qin, J., Yan, Z., Qiao, D., & Shi, Z. (2023). Estimation of 3D permeability from pore network models constructed using 2D thin-section images in sandstone reservoirs. Energies, 16(19), 6976. https://doi.org/10.3390/en16196976

Moore, C. H. (2001). Carbonate Reservoirs: Porosity Evolution and Diagenesis in a Sequence Stratigraphic Framework. Elsevier, Amsterdam, Netherlands; New York.. 1st ed. Developments in Sedimentology, Vol. 55. ISBN: 978-0444508386.

Otsu, N. (1979). A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man, and Cybernetics, 9(1), 62–66.https://doi.org/10.1109/TSMC.1979.4310076

Pal, A., Garia, S., Ravi, K., & Nair, A. M. (2018). Porosity estimation by digital image analysis. ONGC Bulletin, 53(2), 59.

Saenger, E. H., Vialle, S., Lebedev, M., & Uribe, D. (2016). Digital Carbonate Rock Physics. Solid Earth Discussions. DOI: 10.5194/se-7-1185-2016

Slatt, R. M. (2006). Stratigraphic Reservoir Characterization for Petroleum Geologists, Geophysicists, and Engineers. Elsevier. Vol. 61, 1st ed. ISBN: 978-1493302383

Sulieman, H., Jouini, M. S., Alsuwaidi, M., Al-Shalabi, E. W., & Al Jallad, O. A. (2024). Multiscale investigation of pore structure heterogeneity in carbonate rocks using digital imaging and SCAL measurements: A case study from Upper Jurassic limestones, Abu Dhabi, UAE. PLOS ONE, 19(2): e0295192. DOI:10.1371/journal.pone.0295192

Vieira de Mello, J. P., Cuglieri, M. A. A., de Figueiredo, L. P., Bordignon, F., Albuquerque, M. R., Surmas, R., & de Paula, B. C. (2025). Deep mineralogical segmentation of thin section images based on QEMSCAN maps. arXiv preprint arXiv:2505.17008.https://doi.org/10.48550/arXiv.2505.17008

Wang, Y. (2024). Image-based microscale rock typing and its application. Journal of Petroleum Exploration and Production Technology, 14, 2055–2071. DOI: 10.1007/s13202-024-01804-9

Zhang, J., Xia, Y., Zhao, C., & He, Y. (2024). Tight carbonate reservoir evaluation case study based on neural network assisted fracture identification and analytic hierarchy process. Journal of Petroleum Exploration and Production Technology, 14, 1825–1842. DOI: 10.1007/s13202-024-01810-x

Funding

Appreciation is also offered to the Indonesia Endowment Fund for Education (LPDP) through the BPI (Beasiswa Pendidikan Indonesia) program for their generous financial support during the PhD program. Without the assistance of both institutions, this research would not have been possible.

Author’s contribution

Nita Ariyanti (Dr candidate): conceptualization, data curation, investigation, software, validation, visualization, and writing original draft. Sugeng Sapto Surjono (Prof Dr): supervision. Salahuddin Husein (PhD): supervision. Firman Syaifuddin (Dr): software, validation, and error analysis. Marsha Khairia Alfany (BE): data curation and methodology. M. Irfan Mashudi (BE): writing, review & editing.

All authors have read and agreed to the published version of the manuscript.

Acknowledgements

The author would like to convey his heartfelt appreciation to Pertamina for giving access to core data and laboratory analyses, which were critical to the completion of this study.


This display is generated from NISO JATS XML with jats-html.xsl. The XSLT engine is libxslt.