visops Namespace Reference
Detailed Description
Visual routines operators, used in DualCoding.
|
Enumerations |
enum | Connectivity_t { FourWayConnect,
EightWayConnect
} |
| Connectivity used by oldlabelcc and neighborsum. More...
|
Functions |
void | fillExteriorHelper (const Sketch< uint > ®ions, Sketch< bool > &result, std::vector< bool > &processed, const int x, const int y) |
Sketch< bool > | non_bounds (const Sketch< bool > &im, int offset) |
| Returns a copy of im except that its pixels within offset from boundaries are removed.
|
|
template<class T> |
DualCoding::Sketch< T > | copy (const Sketch< T > &other) |
| Returns a deep copy of the sketch: actually copies the pixels.
|
Sketch< bool > | zeros (SketchSpace &space) |
| Returns an all-zero Sketch<bool> in the specified sketch space.
|
Sketch< bool > | zeros (const SketchRoot &sketch) |
| Returns an all-zero Sketch<bool> of same size as parent sketch.
|
|
Sketch< bool > | colormask (const Sketch< uchar > &src, const std::string &colorname) |
| Returns all the pixels of the named color.
|
Sketch< bool > | colormask (const Sketch< uchar > &src, color_index cindex) |
| Returns all the pixels with the specified color index.
|
Sketch< uchar > | neighborSum (const Sketch< bool > &im, Connectivity_t connectivity=EightWayConnect) |
| For each pixel, calculate the sum of its neighbors.
|
Sketch< bool > | fillin (const Sketch< bool > &im, int iter, uchar min_thresh, uchar max_thresh, bool remove_only=false) |
| Produces a filled in image based on the Sketch, using 8-way connectivity.
|
|
Sketch< uint > | bdist (const Sketch< bool > &dest, const Sketch< bool > &obst, const uint maxdist=(uint)-1) |
| Calculates the distance from each pixel in the image to the closest true pixel in destination dest, using the wavefront algorithm. Obstacles indicated by true values in pixels of obst. Note: use maxdist=width+height if you want the result to be viewable with the jetMapScaled colormap.
|
Sketch< uint > | edist (const Sketch< bool > &dest) |
| Euclidean distance to the nearest true pixel in dest.
|
Sketch< uint > | labelcc (const Sketch< bool > &source, int minarea=1) |
| Connected components labeling using CMVision. Components numbered sequentially from 1.
|
Sketch< uint > | oldlabelcc (const Sketch< bool > &source, Connectivity_t connectivity=EightWayConnect) |
| Old connected-components code written using pure sketch primitives.
|
Sketch< uint > | areacc (const Sketch< bool > &source, Connectivity_t connectivity=EightWayConnect) |
| Each pixel of the result is the area of that connected component.
|
Sketch< uint > | areacc (const Sketch< uint > &labels) |
| Each pixel of the result is the area of that connected component.
|
Sketch< bool > | minArea (const Sketch< bool > &sketch, int minval=5) |
| Low-pass filter by eliminating small regions.
|
|
Sketch< bool > | edge (const Sketch< bool > &im) |
| Simple edge finding. Use SUSAN for more sophisticated edge detection.
|
Sketch< bool > | horsym (const Sketch< bool > &sketch, int minskip=3, int maxskip=80) |
| Horizontal symmetry points.
|
Sketch< bool > | versym (const Sketch< bool > &sketch, int minskip=3, int maxskip=80) |
| Vertical symmetry points.
|
Sketch< bool > | skel (const Sketch< bool > &sketch) |
| returns a skeleton of sketch, with pixel values corresponding to distance of symmetry
|
|
Sketch< bool > | seedfill (const Sketch< bool > &borders, size_t index) |
| Fills a region bounded by borders, starting at position given by index.
|
Sketch< bool > | fillExterior (const Sketch< bool > &borders) |
| Fills the exterior of region bounded by borders, starting from the edges of the sketch; border pixels are not filled.
|
Sketch< bool > | fillInterior (const Sketch< bool > &borders) |
| Fills the interior of region bounded by borders, i.e., pixels not reachable from the edges of the sketch; border pixels are not filled.
|
|
Sketch< bool > | leftHalfPlane (const Shape< LineData > &ln) |
| Half-plane functions fill in the half plane on one side of a line.
|
Sketch< bool > | rightHalfPlane (const Shape< LineData > &ln) |
| Half-plane functions fill in the half plane on one side of a line.
|
Sketch< bool > | topHalfPlane (const Shape< LineData > &ln) |
| Half-plane functions fill in the half plane on one side of a line.
|
Sketch< bool > | bottomHalfPlane (const Shape< LineData > &ln) |
| Half-plane functions fill in the half plane on one side of a line.
|
|
Sketch< uchar > | susan_edges (const Sketch< uchar > &im, int brightness) |
| Runs the SUSAN edge detector on a grayscale image.
|
Sketch< bool > | susan_edge_points (const Sketch< uchar > &im, int brightness) |
| Returns a Sketch<bool> indicating edge points found by SUSAN.
|
Sketch< uint > | convolve (const Sketch< uchar > &sketch, Sketch< uchar > &kernel, int i, int j, int width, int height) |
| Convolves a kernel with an image.
|
Sketch< uint > | templateMatch (const Sketch< uchar > &sketch, Sketch< uchar > &kernel, int i, int j, int width, int height) |
| Convolves a kernel with an image, normalizing the kernel to zero mean.
|
|
template<class T> |
Sketch< T > | max (const Sketch< T > &src, const T value) |
| Max of each pixel with a constant.
|
template<class T> |
Sketch< T > | max (const Sketch< T > &src, const int value) |
| Max of each pixel with a constant.
|
template<class T> |
Sketch< T > | max (const Sketch< T > &arg1, const Sketch< T > &arg2) |
| Pixel-wise max of two sketches.
|
template<class T> |
Sketch< T > | min (const Sketch< T > &src, const T value) |
| Min of each pixel with a constant.
|
template<class T> |
Sketch< T > | min (const Sketch< T > &src, const int value) |
| Min of each pixel with a constant.
|
template<class T> |
Sketch< T > | min (const Sketch< T > &arg1, const Sketch< T > &arg2) |
| Pixel-wise min of two sketches.
|
|
template<typename T> |
Sketch< T > | mask (const Sketch< T > &A, const Sketch< bool > &B) |
| Returns pixels of A masked by bool sketch B.
|
template<typename T> |
Sketch< T > | ifNot (const Sketch< T > &A, const Sketch< T > &B) |
| Result holds non-zero pixels of A, with zero pixels filled in by B.
|
template<typename T, typename Tv> |
Sketch< T > | maskedAssign (const Sketch< T > &sketch, const Sketch< bool > &mask, const Tv value) |
| Returns a result where pixels of sketch for which mask is true have been replaced by value.
|
template<typename T> |
Sketch< T > | maskedAssign (const Sketch< T > &sketch, const Sketch< bool > &mask, const Sketch< T > &value) |
| Returns a result where pixels of sketch for which mask is true have been replaced by corresponding pixels of value.
|
Enumeration Type Documentation
Connectivity used by oldlabelcc and neighborsum.
- Enumerator:
-
FourWayConnect |
|
EightWayConnect |
|
Definition at line 21 of file visops.h.
Function Documentation
Each pixel of the result is the area of that connected component.
Definition at line 288 of file visops.cc.
Sketch< uint > areacc |
( |
const Sketch< bool > & |
source, |
|
|
Connectivity_t |
connectivity | |
|
) |
| | |
Each pixel of the result is the area of that connected component.
Definition at line 283 of file visops.cc.
Referenced by minArea().
Sketch< uint > bdist |
( |
const Sketch< bool > & |
dest, |
|
|
const Sketch< bool > & |
obst, |
|
|
const uint |
maxdist | |
|
) |
| | |
Calculates the distance from each pixel in the image to the closest true pixel in destination dest, using the wavefront algorithm. Obstacles indicated by true values in pixels of obst. Note: use maxdist=width+height if you want the result to be viewable with the jetMapScaled colormap.
Definition at line 35 of file visops.cc.
Half-plane functions fill in the half plane on one side of a line.
Definition at line 561 of file visops.cc.
Sketch< bool > colormask |
( |
const Sketch< uchar > & |
src, |
|
|
color_index |
cindex | |
|
) |
| | |
Sketch< bool > colormask |
( |
const Sketch< uchar > & |
src, |
|
|
const std::string & |
colorname | |
|
) |
| | |
Sketch< uint > convolve |
( |
const Sketch< uchar > & |
sketch, |
|
|
Sketch< uchar > & |
kernel, |
|
|
int |
istart, |
|
|
int |
jstart, |
|
|
int |
width, |
|
|
int |
height | |
|
) |
| | |
Convolves a kernel with an image.
Definition at line 642 of file visops.cc.
Sketch< bool > fillExterior |
( |
const Sketch< bool > & |
borders |
) |
|
Fills the exterior of region bounded by borders, starting from the edges of the sketch; border pixels are not filled.
Definition at line 470 of file visops.cc.
Referenced by fillInterior().
void visops::fillExteriorHelper |
( |
const Sketch< uint > & |
regions, |
|
|
Sketch< bool > & |
result, |
|
|
std::vector< bool > & |
processed, |
|
|
const int |
x, |
|
|
const int |
y | |
|
) |
| | |
Sketch< bool > fillin |
( |
const Sketch< bool > & |
im, |
|
|
int |
iter, |
|
|
uchar |
min_thresh, |
|
|
uchar |
max_thresh, |
|
|
bool |
remove_only = false | |
|
) |
| | |
Sketch< bool > fillInterior |
( |
const Sketch< bool > & |
borders |
) |
|
Fills the interior of region bounded by borders, i.e., pixels not reachable from the edges of the sketch; border pixels are not filled.
Definition at line 487 of file visops.cc.
Sketch< bool > horsym |
( |
const Sketch< bool > & |
sketch, |
|
|
int |
minskip = 3 , |
|
|
int |
maxskip = 80 | |
|
) |
| | |
Horizontal symmetry points.
Returns non-zero values along points of horizontal symmetry, with each of these values equal to the distance to the symmetric points. - Parameters:
-
| sketch | The sketch to which to apply the function. |
| minskip | The min accepted distance between pixels for symmetry. |
| maxskip | The max accepted distance between pixels for symmetry. |
Definition at line 363 of file visops.cc.
Referenced by skel().
Sketch<T> visops::ifNot |
( |
const Sketch< T > & |
A, |
|
|
const Sketch< T > & |
B | |
|
) |
| | [inline] |
Result holds non-zero pixels of A, with zero pixels filled in by B.
Equivalent to writing maskedAssign(A,A==0,B)
Definition at line 193 of file visops.h.
Sketch< uint > labelcc |
( |
const Sketch< bool > & |
sketch, |
|
|
int |
minarea | |
|
) |
| | |
Connected components labeling using CMVision. Components numbered sequentially from 1.
Definition at line 125 of file visops.cc.
Referenced by minArea().
Half-plane functions fill in the half plane on one side of a line.
Definition at line 491 of file visops.cc.
Referenced by rightHalfPlane().
Sketch<T> visops::mask |
( |
const Sketch< T > & |
A, |
|
|
const Sketch< bool > & |
B | |
|
) |
| | [inline] |
Returns pixels of A masked by bool sketch B.
Definition at line 179 of file visops.h.
Sketch<T> visops::maskedAssign |
( |
const Sketch< T > & |
sketch, |
|
|
const Sketch< bool > & |
mask, |
|
|
const Sketch< T > & |
value | |
|
) |
| | [inline] |
Returns a result where pixels of sketch for which mask is true have been replaced by corresponding pixels of value.
Definition at line 224 of file visops.h.
Sketch<T> visops::maskedAssign |
( |
const Sketch< T > & |
sketch, |
|
|
const Sketch< bool > & |
mask, |
|
|
const Tv |
value | |
|
) |
| | [inline] |
Returns a result where pixels of sketch for which mask is true have been replaced by value.
Definition at line 208 of file visops.h.
Sketch<T> visops::max |
( |
const Sketch< T > & |
arg1, |
|
|
const Sketch< T > & |
arg2 | |
|
) |
| | [inline] |
Pixel-wise max of two sketches.
Definition at line 63 of file visops.h.
Referenced by LineData::balanceEndPointVert(), DualCoding::countBorderPixelFit(), DualCoding::drawHist(), ParticleShapeEvaluator::evaluate(), LineData::extractLine(), SketchData::findMinPlus(), DualCoding::findRadialDistancesFromPoint(), LineData::getBoundingBox(), SphereData::isMatchFor(), EllipseData::isMatchFor(), max(), SketchData::max(), DualCoding::pickMove(), EllipseData::render(), LineData::setDrawCoords(), and TargetData::update_derived_properties().
Sketch<T> visops::max |
( |
const Sketch< T > & |
src, |
|
|
const int |
value | |
|
) |
| | [inline] |
Max of each pixel with a constant.
Definition at line 56 of file visops.h.
Sketch<T> visops::max |
( |
const Sketch< T > & |
src, |
|
|
const T |
value | |
|
) |
| | [inline] |
Max of each pixel with a constant.
Definition at line 47 of file visops.h.
Referenced by max().
Sketch<T> visops::min |
( |
const Sketch< T > & |
arg1, |
|
|
const Sketch< T > & |
arg2 | |
|
) |
| | [inline] |
Pixel-wise min of two sketches.
Definition at line 87 of file visops.h.
Referenced by DualCoding::countBorderPixelFit(), ParticleShapeEvaluator::evaluate(), LineData::extractLine(), LineData::getBoundingBox(), BaseData::increaseConfidence(), min(), SketchData::min(), SketchData::minPlus(), TargetData::perpendicularDistanceFrom(), DualCoding::pickMove(), LineData::setDrawCoords(), SketchSpace::setTmat(), and ViewerConnection::writeBigString().
Sketch<T> visops::min |
( |
const Sketch< T > & |
src, |
|
|
const int |
value | |
|
) |
| | [inline] |
Min of each pixel with a constant.
Definition at line 81 of file visops.h.
Sketch<T> visops::min |
( |
const Sketch< T > & |
src, |
|
|
const T |
value | |
|
) |
| | [inline] |
Min of each pixel with a constant.
Definition at line 72 of file visops.h.
Referenced by min().
Sketch< bool > minArea |
( |
const Sketch< bool > & |
sketch, |
|
|
int |
minval | |
|
) |
| | |
Sketch< uchar > neighborSum |
( |
const Sketch< bool > & |
im, |
|
|
Connectivity_t |
connectivity = EightWayConnect | |
|
) |
| | |
Sketch< bool > non_bounds |
( |
const Sketch< bool > & |
im, |
|
|
int |
offset | |
|
) |
| | |
Sketch< uint > oldlabelcc |
( |
const Sketch< bool > & |
source, |
|
|
Connectivity_t |
connectivity = EightWayConnect | |
|
) |
| | |
Half-plane functions fill in the half plane on one side of a line.
Definition at line 522 of file visops.cc.
Sketch< bool > seedfill |
( |
const Sketch< bool > & |
borders, |
|
|
size_t |
index | |
|
) |
| | |
Sketch< bool > susan_edge_points |
( |
const Sketch< uchar > & |
im, |
|
|
int |
brightness | |
|
) |
| | |
Returns a Sketch<bool> indicating edge points found by SUSAN.
Definition at line 622 of file visops.cc.
Sketch< uchar > susan_edges |
( |
const Sketch< uchar > & |
im, |
|
|
int |
brightness | |
|
) |
| | |
Runs the SUSAN edge detector on a grayscale image.
Definition at line 591 of file visops.cc.
Sketch< uint > templateMatch |
( |
const Sketch< uchar > & |
sketch, |
|
|
Sketch< uchar > & |
kernel, |
|
|
int |
istart, |
|
|
int |
jstart, |
|
|
int |
width, |
|
|
int |
height | |
|
) |
| | |
Convolves a kernel with an image, normalizing the kernel to zero mean.
Definition at line 661 of file visops.cc.
Sketch< bool > versym |
( |
const Sketch< bool > & |
sketch, |
|
|
int |
minskip = 3 , |
|
|
int |
maxskip = 80 | |
|
) |
| | |
Vertical symmetry points.
Returns non-zero values along points of vertical symmetry, with each of these values equal to the distance to the symmetric points. - Parameters:
-
| sketch | The sketch to which to apply the function. |
| minskip | The min accepted distance between pixels for symmetry. |
| maxskip | The max accepted distance between pixels for symmetry. |
Definition at line 388 of file visops.cc.
Referenced by skel().
Returns an all-zero Sketch<bool> of same size as parent sketch.
Definition at line 18 of file visops.cc.
Returns an all-zero Sketch<bool> in the specified sketch space.
Definition at line 12 of file visops.cc.
Referenced by DualCoding::drawHist(), TargetData::extractLineTarget(), fillExterior(), DualCoding::findRadialDistancesFromPoint(), MapBuilder::getCamLines(), MapBuilder::getCamPolygons(), MapBuilder::getCamTargets(), horsym(), labelcc(), leftHalfPlane(), susan_edge_points(), topHalfPlane(), and versym().
|