This project automates the process of extracting resistivity data from terrameter reading images, where the raw numerical data is unavailable. Instead of manually identifying colours and entering resistivity values into GIS, this script:
- Overlays a grid on the image and extracts the most frequent color per cell.
- Converts colors to HEX values for further processing.
- Outputs structured data (CSV & Excel heatmap) for analysis.
- Prepares for GIS integration, where HEX colors will be replaced with resistivity values and georeferenced.
The uploaded files are inclusive of the input image file as sample along with the python script written in Jupyter Notebook.
This is the first step in streamlining geophysical data analysis, ultimately generating depth-based resistivity rasters in GIS.
This project relies on some specialized Python modules:
-
- Used for creating an Excel-based heatmap of the extracted resistivity values.
- The
PatternFill
function applies colours to Excel cells based on HEX values.
-
- Used for image processing and colour extraction.
- Loads the terrameter image and converts it to RGB format for analysis.
-
- Helps find the most frequent colour in each grid cell.
- Ensures that the extracted colour represents the dominant resistivity reading.
These modules allow us to efficiently process images, extract meaningful data, and visualize results.
- 📥 Input: An image of terrameter readings (from slides, reports, etc.).
- 🖼 Processing:
- Divides the image into a structured grid.
- Identifies the most common color in each grid cell.
- Converts colors to HEX format.
- 📊 Output:
- A CSV file mapping Grid_X, Grid_Z, and HEX colors.
- A color-coded Excel heatmap for visualization.
- 🌍 Next Steps:
- Replace HEX colors with resistivity values using a reference chart.
- Georeference the extracted data in GIS for spatial analysis.
- Python Imaging Library (Pillow): Pillow Documentation
- Excel Automation (openpyxl): openpyxl Documentation
- Efficient Data Counting (collections.Counter): Python Collections Documentation
#geophysics #resistivity #GIS #PythonImageProcessing #imageanalysis #imaging #depthvisualization #heatmap #terrameter #automateddataextraction #openpyxl #colourextraction #imagetocells #soilresistivity #excel #Pillow #geospatialanalysis #subsurfaceimaging #subsurface #earthresistivity #RGB #coloranalysis
This project is a work in progress! Feel free to contribute, suggest improvements, or fork the repo. 🚀