|
SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
|
#include <MedianFilter.h>
Public Member Functions | |
| MedianFilter (int box_width, int box_height) | |
| MedianFilter (const std::array< int, 2 > &box) | |
| auto | operator() (const VectorImage< T > &image, const VectorImage< T > &variance, T threshold=0) const -> std::pair< std::shared_ptr< VectorImage< T > >, std::shared_ptr< VectorImage< T > > > |
Private Member Functions | |
| std::vector< T > | getBox (const VectorImage< T > &img, int x, int y) const |
Static Private Member Functions | |
| static T | getMedian (std::vector< T > &data) |
| static int | clip (int position, int box_size, int image_size) |
Private Attributes | |
| int | m_box_width |
| int | m_box_height |
Functor that applies a median filter over a pair of image/variance image
| T | Pixel type of the filtered image |
A median filter takes as parameters the width and height of the smoothing box. Each pixel is computed as the median of the values of the pixels contained within a box centered at its coordinates iff the median value differs from the actual value by more than a given threshold.
If the value of the pixel is replaced, the value of the variance at the same coordinates is replaced also by the median of the variances contained within the box.
There is no padding. At the edges whe box size is symmetrically clipped to the number of available pixels.
Definition at line 41 of file MedianFilter.h.
|
inline |
|
inlineexplicit |
Constructor
| box | A two dimensional array where the first value corresponds to the width, and the second to the height. |
Definition at line 56 of file MedianFilter.h.
|
inlinestaticprivate |
Symmetrically clip the size of the smoothing box depending on the number of available pixels. This is a 1-D version that is applied to X and Y separately.
| position | Coordinate where the box will be centered |
| box_size | Size of the smoothing box |
| image_size | Image size |
Definition at line 127 of file MedianFilter.h.
Referenced by SourceXtractor::MedianFilter< T >::getBox().
|
inlineprivate |
Get the pixel values contained within a box centered at x,y
Definition at line 139 of file MedianFilter.h.
References std::back_inserter(), SourceXtractor::MedianFilter< T >::clip(), std::inserter(), SourceXtractor::MedianFilter< T >::m_box_height, SourceXtractor::MedianFilter< T >::m_box_width, x, and y.
Referenced by SourceXtractor::MedianFilter< T >::operator()().

|
inlinestaticprivate |
Convenience method to compute the median of a vector
| data | The vector on which to compute the median. It will be modified. |
Definition at line 107 of file MedianFilter.h.
References std::sort().
Referenced by SourceXtractor::MedianFilter< T >::operator()().

|
inline |
Call operator
| image | Image to filter |
| variance | Associated variance map |
| threshold | The pixel is replaced only if the median and the actual value differ by at least this value. Defaults to 0 (always replaced). |
Definition at line 71 of file MedianFilter.h.
References SourceXtractor::VectorImage< T >::create(), SourceXtractor::MedianFilter< T >::getBox(), SourceXtractor::MedianFilter< T >::getMedian(), std::make_pair(), x, and y.

|
private |
Definition at line 100 of file MedianFilter.h.
Referenced by SourceXtractor::MedianFilter< T >::getBox().
|
private |
Definition at line 100 of file MedianFilter.h.
Referenced by SourceXtractor::MedianFilter< T >::getBox().