imgProcessor.filters package

Submodules

imgProcessor.filters.FourierFilter module

class imgProcessor.filters.FourierFilter.FourierFilter(img)[source]

Bases: object

http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_transforms/py_fourier_transform/py_fourier_transform.html

Tsai, D.-M., Wu, S.-C., & Li, W.-C. (2012). Defect detection of solar cells in electroluminescence images using Fourier image reconstruction. Solar Energy Materials and Solar Cells, 99, 250�262. doi:10.1016/j.solmat.2011.12.007

deleteArea(fromx, fromy, tox, toy)[source]
highPassFilter(threshold)[source]

remove all low frequencies by setting a square in the middle of the Fourier transformation of the size (2*threshold)^2 to zero threshold = 0...1

lowPassFilter(threshold)[source]

remove all high frequencies by setting boundary around a quarry in the middle of the size (2*threshold)^2 to zero threshold = 0...1

magnitudeSpectrum()[source]
reconstructImage()[source]

do inverse Fourier transform and return result

suppressValuesBiggerThanThresholdToZero(threshold)[source]
suppressValuesSmallerThanThresholdToZero(threshold)[source]

imgProcessor.filters.edgesFromBoolImg module

imgProcessor.filters.edgesFromBoolImg.edgesFromBoolImg(arr)[source]

takes a binary image (usually a mask) and returns the edges of the object inside

imgProcessor.filters.fastNaNmedianFilter module

imgProcessor.filters.fastNaNmedianFilter.fastNaNmedianFilter(arr, ksize=30, every=5)[source]

a fast 2d median filter for large kernel sizes that also works with nans the computation speed is increased because only ‘every’nsth position within the median kernel is evaluated

imgProcessor.filters.localizedMaximum module

imgProcessor.filters.localizedMaximum.localizedMaximum(img, thresh=0, min_increase=0, max_length=0, dtype=<type 'bool'>)[source]

Returns the local maximum of a given 2d array

thresh -> if given, ignore all values below that value

max_length -> limit length between value has to vary > min_increase

>>> a = np.array([[0,1,2,3,2,1,0],                       [0,1,2,2,3,1,0],                       [0,1,1,2,2,3,0],                       [0,1,1,2,1,1,0],                        [0,0,0,1,1,0,0]])
>>> print localizedMaximum(a, dtype=int)
[[0 1 1 1 0 1 0]
 [0 0 0 0 1 0 0]
 [0 0 0 1 0 1 0]
 [0 0 1 1 0 1 0]
 [0 0 0 1 0 0 0]]

imgProcessor.filters.medianThreshold module

imgProcessor.filters.medianThreshold.medianThreshold(img, threshold=0.1, size=3, condition='>', copy=True)[source]

set every the pixel value of the given [img] to the median filtered one of a given kernel [size] in case the relative [threshold] is exeeded condition = ‘>’ OR ‘<’

imgProcessor.filters.removeSinglePixels module

imgProcessor.filters.removeSinglePixels.removeSinglePixels[source]

img - boolean array remove all pixels that have no neighbour

imgProcessor.filters.standardDeviation module

imgProcessor.filters.standardDeviation.standardDeviation2d(img, ksize=5, blurred=None)[source]

calculate the spatial resolved standard deviation for a given 2d array

ksize -> kernel size

blurred(optional) -> with same ksize gaussian filtered image
setting this parameter reduces processing time