Analyze the flux of images based on wavelength and frequency
Project description
Light-Distribution-Analysis
Overview
Light-Distribution-Analysis is a Python package designed for the analysis of light distribution in images. The package utilizes OpenCV, NumPy, and Matplotlib to enable in-depth yet simple analysis of the flux and power in images based on their wavelength and frequency representations.
Features
- Convert RGB images to wavelength and frequency representations.
- Calculate the flux and power of images.
- Save processed images in various forms, including original, wavelength, frequency, and power images.
- Calculate similarity scores based on flux and power.
- Plot power images.
- Export flux and power data to a CSV file for further analysis (feature planned).
Installation
To install Light-Distribution-Analysis, run the following command in your terminal:
pip install light-distribution-analysis
Usage
Comparing Flux of Two Images The package includes a function compare_flux that allows you to compare the flux of two images and obtain a similarity score.
Here's a simple example to demonstrate its usage:
1. Import the package:
import light_distribution_analysis as lda
2. Provide Paths to Images:
Provide the paths to the two images you want to compare.
image_path1 = "path/to/your/first/image.jpg"
image_path2 = "path/to/your/second/image.jpg"
3. Compare the Flux:
Use the compare_flux function to compare the flux of the two images.
similarity_score = lda.compare_flux(image_path1, image_path2)
4. Basic Image Processing
from light_distribution_analysis import process_single_image
process_single_image('path/to/image.jpg', 'output/directory/')
5. Flux Comparison
from light_distribution_analysis import compare_flux
similarity_score_flux = compare_flux('path/to/image1.jpg', 'path/to/image2.jpg')
print(f"Flux Similarity Score: {similarity_score_flux}")
6. Power Calculation and Comparison
from light_distribution_analysis import compare_power
similarity_score_power = compare_power('path/to/image1.jpg', 'path/to/image2.jpg')
print(f"Power Similarity Score: {similarity_score_power}")
Plotting Power Images The power images will be saved in the specified directory when you run compare_power.
Interpreting the Similarity Score:
A similarity score close to 1 indicates that the images are highly similar in terms of their flux, whereas a score close to 0 suggests they are dissimilar.
Project details
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
Hashes for light-distribution-analysis-0.1.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55b2ed6b352dbd41d8ad8b166481513bf35938d9bd27575ce3adcb309de061b4 |
|
MD5 | 8d4d83d4dfd3490ebd8071c1b345bfbe |
|
BLAKE2b-256 | bdacf63963e56e455bc80e76af592ef9d023296fa53797ec2dcb75f2332e4d0c |
Hashes for light_distribution_analysis-0.1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54120c1ba6f0f3b0bc435e8575047ac769b854477689ca8ad8c5850964d1c885 |
|
MD5 | e26109b99c7d868f79d304195f00c9c1 |
|
BLAKE2b-256 | 035417d2519e55c774d524ada725a16e7804f7cc3423345712c9225f4269f889 |