File size: 1,467 Bytes
528ba5c
3be49b0
 
528ba5c
 
 
3be49b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
528ba5c
3be49b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: oxygen_level_intensity_mapper
app_file: app.py
sdk: gradio
sdk_version: 4.36.1
---
# Oxygen Level Heatmap Generator

This Python script processes an image to generate a heatmap representing oxygen levels based on the intensity of the image. The image is divided into a 32x32 grid, and the intensity of each grid cell is calculated, normalized, and mapped to oxygen levels using a provided mapping table.

## Features

- Divide an image into a 32x32 grid.
- Calculate the intensity of each grid cell.
- Normalize the intensity values.
- Map the normalized intensities to oxygen levels based on a provided table.
- Generate and save a heatmap showing the oxygen levels.

## Requirements

- Python 3.x
- NumPy
- Pillow
- Matplotlib
- SciPy

## Installation

You can install the required Python libraries using `pip`:

```bash
pip install -r requirements.txt 
```

## Usage

1. **Prepare the image:**
   Place your image file in the `Raw_Images` directory or any directory of your choice.

2. **Run the script:**
   Update the `image_path` variable in the script to point to your image file and run the script.

3. **Output:**
   The generated heatmap will be saved in the `Heatmap_Images` directory with the filename `{image_name}_heatmap.jpg`.


## Run Script

To run the script you can just run following command in terminal;

```python
python main.py
```

Make sure the current working directory shall be the Folder named 'Oxygen-Level-Intensity-Mapper/'