As noted in #52 which revises the filtering process which differs somewhat from processing DNA images we need to first
apply a Median difference which...
shifts the lines so that the median of height differences (between vertical neighbour pixels) becomes zero. Therefore
it better preserves large features while it is more sensitive to completely bogus lines.
Options
Scikit-image has
skimage.filters.median()
function which "Return[s] the local median of an image." and it has two "behaviour"/methods, rank which uses the
native skimge.filters.rank.median() and ndimage which calls SciPy
scipy.ndimage.median_filter()
which "Calculate[s] a multidimensional median filter.". This functions has the option axes which...
If None, input is filtered along all axes. Otherwise, input is filtered along the specified axes. When axes is
specified, any tuples used for size, origin, and/or mode must match the length of axes. The ith entry in any of these
tuples corresponds to the ith entry in axes.
The function also notes...
For 2-dimensional images with uint8, float32 or float64 dtypes the specialised function
scipy.signal.medfilt2d
may be faster. It is however limited to constant mode with cval=0.
cval is a value to fill past edges if the mode is constant which adds a fixed value beyond the boundaries, it
defaults to 0.0.
Checking scipy.signal.medfilt2d it
takes a 2-d array as input and then requires the kernel-size which is "the size of the median filter window in eeach
dimension. Elements of kernel_size should be odd". Whether this permits 0 as a parameter so that the kernel only
extends in the vertical plane will require investigating.
Regardless I think we might be able to use these functions to perform the required median difference filter to the
image but I will have to construct some simple examples (i.e. tests!) to check that they are doing what we require. If
not we'll have to develop the function from scratch.
As noted in #52 which revises the filtering process which differs somewhat from processing DNA images we need to first
apply a Median difference which...
Options
Scikit-image has
skimage.filters.median()function which "Return[s] the local median of an image." and it has two "
behaviour"/methods,rankwhich uses thenative
skimge.filters.rank.median()andndimagewhich calls SciPyscipy.ndimage.median_filter()which "Calculate[s] a multidimensional median filter.". This functions has the option
axeswhich...The function also notes...
cvalis a value to fill past edges if themodeis constant which adds a fixed value beyond the boundaries, itdefaults to
0.0.Checking
scipy.signal.medfilt2dittakes a 2-d array as input and then requires the
kernel-sizewhich is "the size of the median filter window in eeachdimension. Elements of
kernel_sizeshould be odd". Whether this permits0as a parameter so that the kernel onlyextends in the vertical plane will require investigating.
Regardless I think we might be able to use these functions to perform the required
median differencefilter to theimage but I will have to construct some simple examples (i.e. tests!) to check that they are doing what we require. If
not we'll have to develop the function from scratch.