Fawkes API
Fawkes Development Version
|
Threshold filter. More...
#include <>>
Public Member Functions | |
FilterThreshold (unsigned char min=128, unsigned char min_replace=0, unsigned char max=127, unsigned char max_replace=255) | |
Constructor. More... | |
void | set_thresholds (unsigned char min, unsigned char min_replace, unsigned char max, unsigned char max_replace) |
Set new thresholds. More... | |
virtual void | apply () |
Apply the filter. More... | |
![]() | |
Filter (const char *name, unsigned int max_num_buffers=1) | |
Constructor. More... | |
virtual | ~Filter () |
Destructor. More... | |
virtual void | set_src_buffer (unsigned char *buf, ROI *roi, orientation_t ori=ORI_HORIZONTAL, unsigned int buffer_num=0) |
Set source buffer with orientation. More... | |
virtual void | set_src_buffer (unsigned char *buf, ROI *roi, unsigned int buffer_num) |
Set source buffer. More... | |
virtual void | set_dst_buffer (unsigned char *buf, ROI *roi) |
Set the destination buffer. More... | |
virtual void | set_orientation (orientation_t ori, unsigned int buffer_num) |
Set the orientation to apply the filter in. More... | |
virtual const char * | name () |
Get filter name. More... | |
void | shrink_region (ROI *r, unsigned int n) |
This shrinks the regions as needed for a N x N matrix. More... | |
Additional Inherited Members | |
![]() | |
unsigned int | _max_num_buffers |
Maximum number of buffers. More... | |
char * | _name |
Filter name. More... | |
unsigned char ** | src |
Source buffers, dynamically allocated by Filter ctor. More... | |
unsigned char * | dst |
Destination buffer. More... | |
ROI ** | src_roi |
Source ROIs, dynamically allocated by Filter ctor. More... | |
ROI * | dst_roi |
Destination ROI. More... | |
orientation_t * | ori |
Orientations, one for each source image. More... | |
Threshold filter.
Implementation for threshold filter, this filter will luminance values below a given threshold to the given min_replace value, values above a given max threshold will be set to the max_replace value
Definition at line 37 of file threshold.h.
firevision::FilterThreshold::FilterThreshold | ( | unsigned char | min = 128 , |
unsigned char | min_replace = 0 , |
||
unsigned char | max = 127 , |
||
unsigned char | max_replace = 255 |
||
) |
Constructor.
min | minimum value |
min_replace | values below min are replaced with this value |
max | maximum value |
max_replace | values above max are replaced with this value |
Definition at line 62 of file threshold.cpp.
|
virtual |
Apply the filter.
Apply the filter to the given source and destination buffers with given width and height and orientation (ori may be ignored for some filters).
Implements firevision::Filter.
Definition at line 97 of file threshold.cpp.
References firevision::Filter::dst, firevision::Filter::dst_roi, firevision::ROI::height, firevision::ROI::line_step, firevision::ROI::pixel_step, firevision::Filter::src, firevision::Filter::src_roi, firevision::ROI::start, firevision::ROI::width, fawkes::upoint_t::x, and fawkes::upoint_t::y.
void firevision::FilterThreshold::set_thresholds | ( | unsigned char | min, |
unsigned char | min_replace, | ||
unsigned char | max, | ||
unsigned char | max_replace | ||
) |
Set new thresholds.
min | minimum value |
min_replace | values below min are replaced with this value |
max | maximum value |
max_replace | values above max are replaced with this value |
Definition at line 86 of file threshold.cpp.