No project description provided
Project description
(https://github.com/RipunjayS109/thermaPy/assets/145184045/75d6f8a0-1d6f-4c2b-9ff1-3d7bc4619d0c)
thermaPy: Thermal Image Processing for Python
What's New in thermaPy v0.0.2
We are pleased to announce the release of thermaPy v0.0.2, introducing a significant enhancement to streamline thermal image analysis workflows.
Introducing detect_temperature_regions Function:
thermaPy v0.0.2 introduces the powerful detect_temperature_regions function, designed to expedite the identification and analysis of specific temperature zones within your thermal images. This function offers the following functionalities:
- Efficient Temperature Region Detection: Accurately pinpoint areas exceeding a user-defined detection temperature threshold.
- Informative Bounding Box Generation: Create bounding boxes around the detected temperature regions, providing valuable visual context for further analysis.
- Convenient Excel Output: Effortlessly export the temperature matrix as an Excel file for seamless data manipulation and exploration within spreadsheet software.
Enhanced Workflow Efficiency:
The detect_temperature_regions function empowers you to:
- Define a Detection Temperature: Specify the temperature of interest for region identification.
- Locate Target Regions: Efficiently identify image areas exceeding the defined detection temperature.
- Visualize Results: Generate bounding boxes around the detected regions for clear visualization and improved understanding.
- Export Temperature Data: Effortlessly export the temperature matrix to an Excel file, facilitating further analysis and data manipulation.
This innovative functionality streamlines temperature-based object detection and analysis, significantly enhancing the efficiency of your thermal image processing workflows.
Example Usage:
The following code snippet demonstrates how to effectively utilize the detect_temperature_regions function:
import thermaPy
# Replace placeholders with your specific data
image_path = "path/to/your/thermal_image.jpg"
min_temperature = 20.0 # Degrees Celsius (or your preferred unit)
max_temperature = 40.0 # Degrees Celsius (or your preferred unit)
detection_temperature = 30.0 # Degrees Celsius (temperature threshold)
output_excel_path = "temperature_data.xlsx" # Output file path
thermaPy.detect_temperature_regions(image_path, min_temperature, max_temperature, detection_temperature, output_excel_path)
print("Temperature regions identified and results saved!")
This code effectively:
- Loads the specified thermal image.
- Defines the minimum, maximum, and detection temperature values.
- Invokes the
detect_temperature_regionsfunction to identify regions exceeding the detection temperature threshold. - Generates bounding boxes around the identified regions and displays the original image with the boxes superimposed for visualization.
- Saves the temperature matrix as an Excel file for further analysis and data manipulation.
We encourage you to explore the detect_temperature_regions function and leverage its capabilities to enhance your thermal image processing workflows.
User Guide
thermaPy is a Python library designed for efficient extraction of temperature information from RGB thermal images. It provides a single, user-friendly function (imgtotempmat) to convert an RGB thermal image into a corresponding temperature matrix. This matrix offers pixel-wise temperature data, enabling further analysis and visualization of thermal features within the image.
Key Features:
- Simple and Intuitive API: The
imgtotempmatfunction requires only the image path, minimum temperature, and maximum temperature for operation. - Temperature Matrix Generation: Creates a NumPy array representing the temperature distribution across the image.
- Flexibility with Temperature Units: Supports temperature values in degrees Celsius, Fahrenheit, or Kelvin (as defined by the user).
Installation
Method 1: Using pip
Bash
pip install thermaPy
Method 2: Manual Installation
- Clone this repository.
- Navigate to the project directory.
- Run:
Bash
python setup.py install
Usage
-
Import the library:
Python
import thermaPy -
Utilize the
imgtotempmatfunction:Python
temperature_matrix = thermaPy.imgtotempmat(image_path, min_temperature, max_temperature)
Parameters:
image_path(str): The file path to the RGB thermal image (supports common formats like PNG, JPG, BMP, etc.).min_temperature(float): The minimum temperature value represented in the image (unit depends on user convention).max_temperature(float): The maximum temperature value represented in the image (same unit asmin_temperature).
Return Value:
The function returns a NumPy array representing the temperature matrix, where each element corresponds to the temperature of the corresponding pixel in the original image.
Example:
Python
import thermaPy
# Replace with your actual image path and temperature range
image_path = "path/to/your/thermal_image.jpg"
min_temperature = 20.0 # Degrees Celsius (or your preferred unit)
max_temperature = 40.0 # Degrees Celsius (or your preferred unit)
temperature_matrix = thermaPy.imgtotempmat(image_path, min_temperature, max_temperature)
# Access individual temperature values via matrix indexing
temperature = temperature_matrix[100, 200]
print("Temperature at (100, 200):", temperature, "°C")
# Further Processing (Optional):
# The temperature matrix can be used for visualization, data analysis, and other applications.
Additional Notes:
- The library assumes a linear relationship between grayscale intensity and temperature within the specified minimum and maximum values. If your image employs a different calibration, the calculation in the
imgtotempmatfunction might require adjustment.
By leveraging thermaPy, you can streamline the process of extracting temperature data from thermal images, enabling more efficient analysis and exploration of thermal features within your research or engineering projects.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thermaPy-0.0.2.tar.gz.
File metadata
- Download URL: thermaPy-0.0.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
877194d3693c9819d2a58c1cf3aa84f8fdbb271fb3f8e4a8e2a1485d2a669b0f
|
|
| MD5 |
b27ab51b83122e644a0ae2482b335cad
|
|
| BLAKE2b-256 |
200dc35f44f6e1edb63c9aa3a9cf440519261fd2bdf9ee67db2ad043b0617de0
|
File details
Details for the file thermaPy-0.0.2-py3-none-any.whl.
File metadata
- Download URL: thermaPy-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7172013d0e47925ae0012cbddc90e293a2d98eb3d092aadc0dab9fc3384895d
|
|
| MD5 |
e46ceb9b8e4fc5c45806a2e0b3ec6e2b
|
|
| BLAKE2b-256 |
cc5d68a9263e18deb5ab3d6ed1f3ea712bae0cb6f35335b28d150b3d27459cd8
|