EasyImage - Pre-Processing Images¶
Purpose¶
The EasyImage library prepares images so that further processing gets better results:
Improve the image quality and the contrast between the background and the objects of interest with intensity transformations, thresholding and noise reduction.
Highlight or remove features with linear and non-linear (morphological) filtering.
Realign, resize, rotate and unwarp images, for example to compensate perspective effects.
Extract gradients, edges, corners, profiles and projections from an image.
Compute histograms and statistics, and quantify the image focus.
Combine several images with HDR fusion and image stitching.
Restrict the processing to an ROI and, for many functions, to an arbitrarily shaped
ERegion.
Processing an Image¶
Most EasyImage operations are static functions of the EasyImage .NET Python class. For example, to threshold an image:
Create a source and a destination image, such as
EImageBW8.NET Python objects.Give the destination image the same size as the source image.
Call
EasyImage::Threshold.NET Python with the source and destination images and, optionally, a threshold mode or value.
#include <eVision/EasyImage/EasyImage.h>
using namespace eVision;
// Images constructor
EImageBW8 srcImage;
EImageBW8 dstImage;
// ...
// Source and destination images must have the same size
dstImage.SetSize(&srcImage);
// Minimum residue thresholding (default method)
EasyImage::Threshold(&srcImage, &dstImage);
// Absolute thresholding (threshold = 110)
EasyImage::Threshold(&srcImage, &dstImage, 110);
// Relative thresholding (70% black, 30% white)
EasyImage::Threshold(&srcImage, &dstImage, EThresholdMode_Relative, 0, 255, 0.7f);
using eVision;
// Images constructor
EImageBW8 srcImage = new EImageBW8();
EImageBW8 dstImage = new EImageBW8();
// ...
// Source and destination images must have the same size
dstImage.SetSize(srcImage);
// Minimum residue thresholding (default method)
EasyImage.Threshold(srcImage, dstImage);
// Absolute thresholding (threshold = 110)
EasyImage.Threshold(srcImage, dstImage, 110);
// Relative thresholding (70% black, 30% white)
EasyImage.Threshold(srcImage, dstImage, unchecked((uint)EThresholdMode.Relative), 0, 255, 0.7f);
import eVision
# Image constructors
src_image = eVision.EImageBW8()
dst_image = eVision.EImageBW8()
# ...
# Source and destination images must have the same size
dst_image.SetSize(src_image)
# Minimum residue thresholding (default method)
eVision.EasyImage.Threshold(src_image, dst_image)
# Absolute thresholding (threshold = 110)
eVision.EasyImage.Threshold(src_image, dst_image, 110)
# Relative thresholding (70% black, 30% white)
eVision.EasyImage.Threshold(src_image, dst_image, eVision.EThresholdMode.Relative, 0, 255, 0.7)
Note
The more advanced operations use dedicated classes, such as ECannyEdgeDetector .NET Python, EHDRFusion .NET Python or EImageStitcher .NET Python.
Contents¶
Pixel Operations¶
Change the gray level of each pixel to clarify objects (gain, offset, normalization, lookup tables).
Transform a gray-level image into a binary or three-level image by classifying the pixel values.
Combine the pixels of two images, or of an image and a constant.
Overlay an image on top of a color image.
Filtering¶
Highlight features with linear combinations of neighboring pixels (convolution).
Highlight shapes or remove noise with morphological operations and median filtering.
Reduce the noise so that it does not influence the other operations.
Analyze textures or create features for a classifier.
Represent an image by its frequency components to perform specific filtering.
Geometric Operations¶
Realign, mirror, resize, rotate and unwarp images.
Remove interlacing artifacts by rebuilding or realigning frames.
Feature Extraction and Statistics¶
Generate a gradient direction or magnitude map from a gray-level image.
Find the edges in a gray-level image.
Find points of interest in a gray-level image.
Extract projections and profiles along lines, paths or contours.
Compute histograms, sliding window statistics and the image focus.
Image Composition¶
Fuse images taken at different exposures into a single image.
Combine partial images into a single image.
Quick Links¶
List of all Classes and Enumerations of the EasyImage library.
Code snippets for the EasyImage library.
Complete image processing programs in C++, C# and Python.
Image types, ROIs and other fundamental objects used by EasyImage.
Pre-process color images.
See also
Some eVision Studio samples illustrate several aspects of the EasyImage library:
Processing with ROI: Uses an ROI to process a specific part of an image.Circle warp: Unwarps the image of a CD to extract its text.Morphology gradient: Enhances the edges in an image with a morphological gradient.Sobel convolution: Extracts the edges in an image with a Sobel convolution.Histogram computation: Computes and compares the histograms of gray-level images.Equalization: Equalizes several images to make their contents more visible.Shading correction: Uniformizes the illumination of an image to increase its contrast.Scale and rotate: Scales and rotates an image.HDR fusion: Merges several images of different exposures.Image stitchingandImage stitching with learning: Stitch image patches automatically.