imgProcessor package

An image processing library based on OpenCV, numpy, scipy and skimage.

It includes (amongst other things) filters, interpolations, camera calibration, feature detectors, signal-to-noise estimations

Subpackages

Submodules

imgProcessor.exceptions module

exception imgProcessor.exceptions.EnoughImages[source]

Bases: exceptions.Exception

exception imgProcessor.exceptions.NothingFound[source]

Bases: exceptions.Exception

imgProcessor.imgIO module

various image input/output routines

imgProcessor.imgIO.imread(img, color=None, dtype=None, ignore_order=False)[source]

dtype = ‘noUint’, uint8, float, ‘float’, ...

imgProcessor.imgIO.imwrite(name, arr, **kwargs)[source]
imgProcessor.imgIO.out(img)[source]
imgProcessor.imgIO.out3d(sf)[source]

for surface plots sf = 3darray[i,j,x,y,z]

imgProcessor.signal module

imgProcessor.signal.getBackgroundPeak(fitParams)[source]
imgProcessor.signal.getBackgroundRange(fitParams)[source]

return minimum, average, maximum of the background peak

imgProcessor.signal.getSignalMinimum(fitParams, n_std=3)[source]
imgProcessor.signal.getSignalParameters(fitParams, n_std=3)[source]

return minimum, average, maximum of the signal peak

imgProcessor.signal.getSignalPeak(fitParams)[source]
imgProcessor.signal.hasBackground(fitParams)[source]

compare the height of putative bg and signal peak if ratio if too height assume there is no background

imgProcessor.signal.scaleParams(img, fitParams=None, backgroundToZero=False)[source]
imgProcessor.signal.scaleParamsFromReference(img, reference)[source]
imgProcessor.signal.scaleSignal(img, fitParams=None, backgroundToZero=False, reference=None)[source]

scale the image between...

backgroundToZero=True -> 0 (average background) and 1 (maximum signal) backgroundToZero=False -> signal+-3std

reference -> reference image – scale image to fit this one

returns: scaled image

imgProcessor.signal.signalMinimum(img, fitParams=None, n_std=3)[source]
imgProcessor.signal.signalPeakIndex(fitParams)[source]
imgProcessor.signal.signalRange(img, fitParams=None, nSigma=3)[source]

imgProcessor.tests module

Run all submodules as __main__ and execute their test procedure

Note there is a bug in pkgutil.walk_packages excluding all modules that have the same name as modules in the standard library, see http://bugs.python.org/issue14787 that’s why ‘os’ and ‘utils’ are not tested at the moment

imgProcessor.transformations module

various image transformation functions

imgProcessor.transformations.isColor(img)[source]
imgProcessor.transformations.rot90(img)[source]

rotate one or multiple grayscale or color images 90 degrees

imgProcessor.transformations.toColor(img)[source]
imgProcessor.transformations.toFloatArray(img)[source]

transform an unsigned integer array into a float array of the right size

imgProcessor.transformations.toGray(img)[source]

weights see https://en.wikipedia.org/wiki/Grayscale#Colorimetric_.28luminance-prese http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor

imgProcessor.transformations.toNoUintArray(arr)[source]

cast array to the next higher integer array if dtype=unsigned integer

imgProcessor.transformations.toUIntArray(img, dtype=None, cutNegative=True, cutHigh=True, range=None, copy=True)[source]

transform a float to an unsigned integer array of a fitting dtype adds an offset, to get rid of negative values

range = (min, max) - scale values between given range

cutNegative - all values <0 will be set to 0 cutHigh - set to False to rather scale values to fit

imgProcessor.transformations.transpose(img)[source]