Skip to main content

Image Functions Library

Library for image pre-processing, with functions to handle and prepare images for machine learning and image processing. This library accounts for functions to load and plot a group of images, pre-processing, choose ROI regions (even polygonal), choose points, get image properties, align and transform images (including rotate, scale, etc.), filter signals and images (2D data), among others. All the functions with GUI (stands for graphical user interface) have an interface to interact with the user.

1. Functions to Load and Plot

  • load_gray_images: loads all images from a folder, in grayscale
  • load_color_images: loads all color images from a folder
  • plot_gray_images: prints all grayscale images from a variable 'I'
  • plot_color_images: prints all color images from a variable 'I'
  • plot_gray: prints a grayscale image
  • plot_bgr: prints a color image in BGR format
  • list_folders: list all folders inside a directory
  • list_images: list all images inside a folder
  • read_lsm: reading and mounting images of '.lsm' extension from Zeiss microscope

2. Pre-Processing for Machine Learning and Computer Vision *

2.1. Preparing Data for Artificial Intelligence (e.g. labeling) *

  • label_image_segments: label segments from all images in a given folders (with a GUI to interact with the mouse, very automated function!). It remenbers the images you previously segmented.*
  • label_sequence_from_image: label sequences in profiles acquried from images (interact with the mouse to choose the profile in the image and the points in the graph!) *
  • select_points_from_sequence: label points in a sequence interacting with the mouse (choose points in a sequence for labeling part of that sequence or for labeling points)

2.2. ROI and Handling (Most Important Ones)

  • polyroi: GUI to create a polygonal region of interest (ROI)
  • crop_image: GUI to create a rectangular crop in an image
  • crop_multiple: crops multiple images using the same crop from 1st image
  • crop_poly_multiple: polygonal crop multiple images based on 1st cropping
  • choose_points: GUI to interact with the user to choose points in an image
  • imchoose: function to choose images in a given set of images (with GUI)
  • imroiprop: getting properties from an image ROI
  • roi_stats: get statistics from a region choosen by the user, for images of multiple experiments (important!)
  • roi_stats_in_detph: choose a region, and get the detailed statistics of this region, as a function of a given direction defined by the user. Applications: statistics of pixels from a tumor, from surface to the depth, e.g. in microscope fluorescence of histological slides (see an example in the next gif image):

me

2.3. Image Alignment and Transformation

  • rotate2D: rotate points by an angle about a center
  • flat2im: transforms a flat vector into a 2D image
  • im2flat: transforms a 2D image in a flat vector
  • scale255: scales an image to the [0, 255] range
  • align_features: Align images with Feature-Based algorithm, from OpenCV (maybe not working)
  • align_ECC: image alignment using ECC algorithm from OpenCV (diffuse image)
  • imwarp: function to warp a set of images using a warp matrix (maybe not working)

3. Filtering Images and Signals

  • filter_finder: study and find which filter to use (for signals, 1D)
  • highpass_gauss: high-pass Gaussian filter for images (2D)
  • highpass_fft: high-pass image (2D) filter based on FFT
  • lowpass_fft: low-pass image (2D) filter based on FFT
  • filt_hist: filtering histograms with zero/null values (removing zeros)

4. Bonus Functions

  • beep: making 'beeps' to help warn when a long algorithm has finished
  • good_colormaps: visualizing the best Matplotlib colormaps in an image
  • improfile: finds the pixels' intensity profile between two points (GUI) (maybe not working)

5. Tutorials and Examples

Inside the tutorials folder there are some examples of using the functions of this library. In this folder, the files with name imex_name.py present an example of using the function indicated by the name part.

6. How to Install

You can install using pip:

pip install image-functions==0.1.12

OBS: some functions use the 'pynput' and 'windsound' libraries, which may be difficult to install and do not works on non-windows platforms. Comment on these library imports if there are problems during installation or loading.

If you have other versions of this library installed, please remove it first:

pip uninstall image-functions

pip install image-functions==0.1.12

7. Scientific Research

This work is the product of the research being conducted at two universities in Brazil:

Sao Paulo State University (Unesp)

  • Dept. of Electronic and Telecommunication Engineering
  • School of Engineering, Campus of Sao Joao da Boa Vista
  • website: https://www.sjbv.unesp.br/

University of São Paulo (USP)

Metadata

Release files for image-functions 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for image-functions 0.1.12
File Size Uploaded
image_functions-0.1.12.tar.gz 38.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for image-functions 0.1.12
File Interpreter ABI Platform
image_functions-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 78.6 kB

Release files / image_functions-0.1.12.tar.gz

Download URL image_functions-0.1.12.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4a2aa08cb1da9ea896a9e5f71e427e6211f06a17e31d01bbe920e66b1c2beebb
BLAKE2b-256 checksum
How to use checksums
6d5aedd39093ff9666bc48fdad537bcc8e7016146c3e903f7d7dd9368a06911a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.19

Release files / image_functions-0.1.12-py3-none-any.whl

Download URL image_functions-0.1.12-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb0c0fa67875a74130ff3ce6e3441e75018d9bb58c3326ed6a21322690d645ff
BLAKE2b-256 checksum
How to use checksums
efeab3c53273070409f5580c2614396de099819db90ed92da24c477c76f5fa32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page