|
A recursive method for visiting pixels of a segment in an image. More...
#include <SegmentProber.h>
Public Types | |
typedef S | src_t |
typedef D | dst_t |
typedef C | conf_t |
Public Member Functions | |
SegmentProber (const Channel &s) | |
SegmentProber (const Channel &s, Channel &d) | |
void | setDst (Channel &d) |
Set new target channel. Needed in multichannel operations. | |
virtual void | init () |
Fills the segment having intensity between min and max. More... | |
void | scan () |
A convenience function for traversing a whole image. More... | |
void | probe (int i, int j, bool HORIZONTAL) |
Start probings. | |
bool | isValidPixel (int i, int j) const |
Returns isValidSegment(i,j) and !isVisited(i,j). | |
virtual bool | isValidSegment (int i, int j) const =0 |
Application dependent, to be redefined. Assumes checked coordinates. More... | |
Public Attributes | |
ProberControl & | control |
conf_t | conf |
const Channel & | src |
Channel * | dst |
Protected Member Functions | |
virtual bool | isValidMove (int i0, int j0, int i, int j) const |
Application dependent, to be redefined. Note: assumes checked coordinates. More... | |
virtual void | update (int i, int j) |
Application dependent operation performed in each segment location (i,j). | |
virtual void | visit (int i, int j) |
Visiting a single pixel when not coming from any direction. More... | |
virtual void | clear () |
Called before processing each segment. Compare with init(), which is called once for each image. More... | |
virtual bool | isVisited (int i, int j) const |
Experimental. | |
template<int DI, int DJ> | |
bool | move (int &i, int &j) |
Try to move; change coords in success, else keep them intact. | |
void | scanHorzProbeVert (int i, int j) |
A semi-recursive approach that turns the 2D recursion to 1D traversal + 1D recursion. More... | |
void | scanVertProbeHorz (int i, int j) |
Protected Attributes | |
SimpleProberControl | basicControl |
A recursive method for visiting pixels of a segment in an image.
A helper class applied by FloodFillOp and SegmentAreaOp.
S | - storage type of the source image data (int by default, but should be floating-type, if src is). |
D | - storage type of the destination image data |
C | - configuration type, |
|
inlineprotectedvirtual |
Called before processing each segment. Compare with init(), which is called once for each image.
Application dependent initialisation for statistics updated with update(int i, int j) function.
Reimplemented in DopplerSegmentProber, SuperProber, SegmentStatisticsProber< T, D >, and SizeProber.
|
inlinevirtual |
Fills the segment having intensity between min and max.
Called after src and dst have been set, but before processing. See clear().
Reimplemented in DopplerSegmentProber.
|
inlineprotectedvirtual |
Application dependent, to be redefined. Note: assumes checked coordinates.
Application dependent. Assumes checked coordinates.
Reimplemented in DopplerSegmentProber.
|
pure virtual |
Application dependent, to be redefined. Assumes checked coordinates.
Determines if the current position is within a segment. The criterion of "segment" depends on the application.
Note: does not check coordinates, assumes them to be checked by the calling scope.
Implemented in DopplerSegmentProber, SuperProber, SegmentStatisticsProber< T, D >, SizeProber, and FillProber.
|
inline |
A convenience function for traversing a whole image.
Applicable in cases where probing parameters are not spatically ("dynamically") changing.
|
inlineprotected |
A semi-recursive approach that turns the 2D recursion to 1D traversal + 1D recursion.
s * the horizontal direction is handled sequentially whereas the vertical direction handled recursively. Compared to fully recursive approach, this technique preserves the speed but offers smaller consumption of memory.
Scan right. Note than i may wrap beyond image width.
Scan left
Scan again, continuing one step above and below.
|
inlineprotected |
Scan DOWN. Note than j may wrap beyond image height.
Scan UP
Scan again, continuing one step above and below.
|
inlineprotectedvirtual |
Visiting a single pixel when not coming from any direction.
Visiting means
i0 | - current i coordinate (always valid) |
j0 | - current j coordinate (always valid) |
Mark visited
Reimplemented in DopplerSegmentProber, SizeProber, and FillProber.