190 likes | 320 Vues
ImageMath is a powerful IDL-based tool designed for evaluating mathematical expressions involving scalar numbers, images, bands, and spectral profiles. It supports all standard IDL operators and extends common operator logic to image processing with component-wise application. Users can utilize functions for type casting, statistics, and complex calculations while handling dimensions appropriately. The application is particularly useful for processing spectral data, offering functionalities like masking, region extraction, and scaling of image profiles and bands, with relevant examples for practical usage.
E N D
imageMath a calculator for evaluating mathematical expressions with images, bands and spectral profiles Andreas Rabe andreas.rabe@geo.hu-berlin.de 22. Oktober 2012
Overview • imageMath evaluates mathematical expressions • arguments can be scalar numbers, images, bands or profiles • IDL based application for EnMAP-Box or ENVI
Understanding Operators • imageMath supports all IDL operators • extends the common operator logic to images 3
Understanding Operators What is a sensible operator logic? number + number = number 1 + 2 = 3
Understanding Operators What is a sensible operator logic? image + image = image • operator is applied component-wise
Understanding Operators What is a sensible operator logic? image + band + number = image + + replicate along missing dimensions + + • missing dimensions are replicated • operator is applied component-wise
Understanding Operators What is a sensible operator logic? Rules for argument pairs: image+image: no replication needed image+band: replicate band along image's spectral dimension image+profile: replication profile along image's spatial dimension image+number: replicate number along image's spatial and spectral dimension band+band: no replication needed band+profile: replicate band along profile's spectral dimension and replicate profile along band's spatial dimension band+number: replicate number along band's spatial dimension profile+profile: no replication needed profile+number: replicate number along profile's spectral dimension number+number: no replication needed
Understanding Data Types • imageMath supports all IDL data types • casting functions and data type postfixes casting functions and postfixes 1. = 1. versus float(1) = 1. 1b = 1bversus byte(1) = 1b integer and floating-point division 1/2 = 0 versus 1./2. = 0.5 overflows and underflows -1b = 255b (underflow) 10^5 = -31072 (overflow) 0-1b = -1 (no underflow, implicite type casting) If your calculated images are all black, or appear to be randomly generated, it is most likely an issue of data types.
Understanding Functions • imageMath functions can be arbitrary complex • from simple type casting functions like byte() or float() • to whole processing chains Set of predefined functions:
Understanding Functions Image in Image out Trigonometric and Miscellaneous Math functions take an input image, calculate something for each componentand return a result image of same size.
Understanding Functions Image in Band out Profile Statistics functions take an input image, calculate a profile-wise statistic for each profile, and return a result band of same spatial size.
Understanding Functions Image in Profile out Band Statistics functions take an input image, calculate a band-wise statistic for each band, and return a result profile of same spectral size.
Understanding Functions Image in Number out Band Statistics functions take an input image, calculate an image-wise statistic, and return a scalar number.
Usage Examples Masking an Image image*mask
Usage Examples Extracting Class-Specific Regions image*(class eq 1)
Usage Examples Scale Image Profiles between -10 and 10 float(image-spectralMinimum(image)) / spectralSpan(image) *20-10
Usage Examples Scale Image Bands between -10 and 10 float(image-spatialMinimum(image)) /spatialSpan(image) *20-10'
Usage Examples Spectral Similarity (root mean squared error) sqrt(spectralMean((image-profile)^2.))
Thank you very much for your attention. Any questions?