Skip to main content

This Python module provides utility functions for various image processing tasks, such as image conversion, display, normalization, and enhancement. It leverages the power of libraries like cv2 and numpy to handle and manipulate image data.

Project description

Overview

This Python module provides utility functions for various image processing tasks, such as image conversion, display, normalization, and enhancement. It leverages the power of libraries like cv2 and numpy to handle and manipulate image data.

Functions

open_img Purpose: Convert the image to a specified color space. Inputs: Image data (or path), desired color space, and data type specifications. Output: Image converted to the specified color space.

display Purpose: Display images with their labels. Inputs: Multiple images and labels, display size and layout specifications. Output: None, this displays the image.

normalize_img Purpose: Normalize an image. Inputs: Image data. Output: Normalized image.

flatten_unflatten Purpose: Flatten or reshape an image. Inputs: Image data, operation type (flatten or reshape), and desired shape if reshaping. Output: Flattened or reshaped image.

binary Purpose: Convert an image to a binary format based on a threshold. Inputs: Image data and threshold value. Output: Binarized image.

img2blocs Purpose: Split an image into blocks/blocs of a certain size. Inputs: Image data, block size, and padding type. Output: List of blocks/blocs.

resize_img Purpose: Resize an image to the specified dimensions. Inputs: Image data and desired dimensions (width & height). Output: Resized image.

rotate_img Purpose: Rotate an image by a specified angle. Inputs: Image data and rotation angle. Output: Rotated image.

enhance_img Purpose: Enhance an image by adding noise, applying blur, and adjusting contrast. Inputs: Image data, and specifications for noise, blur, and contrast adjustments. Output: Enhanced image.

Requirements

cv2 numpy matplotlib

Usage First, make sure you have the required libraries installed:

bash Copy code pip install opencv-python numpy matplotlib To use the functions in your code:

Copy code
import cv2
import numpy as np
from YOUR_MODULE_NAME import FUNCTION_NAME

# Load an image
image = cv2.imread("path_to_image.jpg")

# Use any of the provided functions
processed_image = FUNCTION_NAME(image, ...other_args)
Replace YOUR_MODULE_NAME with the name of this module and FUNCTION_NAME with the name of the function you wish to use.

Contribution

Feel free to fork this module and contribute by submitting a pull request. Ensure any new features or changes are well-documented and include relevant tests.

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

image-processing-lib-0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

image_processing_lib-0.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file image-processing-lib-0.2.tar.gz.

File metadata

  • Download URL: image-processing-lib-0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for image-processing-lib-0.2.tar.gz
Algorithm Hash digest
SHA256 16f1cbfd87b5d75e85b85aa724ef4d7a45b991d543e9e81da52da578afcabf81
MD5 95cb46413a8a9bca1730d09b44575745
BLAKE2b-256 2b22596f6d3ffb466af1c3534fef52bdcb299249b992fde7b784003ad900fdcd

See more details on using hashes here.

File details

Details for the file image_processing_lib-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for image_processing_lib-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7631d9ee9e7c4f3aaa7cef7a6f8d526bc6d731eebbe951ca7836716d1a2263a1
MD5 93293c0f5399662ce290852ec387e2f6
BLAKE2b-256 ba3109706934a3f1b2805116f8d122d9be61d901b19abc0a6bb21c711f7fe023

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page