Classes | Defines | Functions | Variables
contrib/brl/bseg/sdet/sdet_contour.cxx File Reference
#include "sdet_contour.h"
#include <vcl_iostream.h>
#include <vcl_cstdlib.h>
#include <vcl_vector.h>
#include <vcl_cmath.h>
#include <vcl_algorithm.h>
#include <vul/vul_timer.h>
#include <vxl_config.h>
#include <vnl/vnl_math.h>
#include <vdgl/vdgl_digital_curve_sptr.h>
#include <vdgl/vdgl_digital_curve.h>
#include <vdgl/vdgl_edgel_chain_sptr.h>
#include <vdgl/vdgl_edgel_chain.h>
#include <vdgl/vdgl_interpolator.h>
#include <vdgl/vdgl_interpolator_linear.h>
#include <vtol/vtol_vertex_2d.h>
#include <vtol/vtol_edge_2d.h>
#include <btol/btol_vertex_algs.h>
#include <btol/btol_edge_algs.h>
#include <bdgl/bdgl_curve_algs.h>
#include <gevd/gevd_bufferxy.h>
#include <gevd/gevd_pixel.h>

Go to the source code of this file.

Classes

struct  sdet_contour_edge
 A container to support sorting of edge lengths. More...

Defines

#define WARN(x, y)

Functions

void ErasePixel (vcl_vector< int > &xloc, vcl_vector< int > &yloc)
 Delete the last pixel added to iloc and jloc.
void fill_cycle_gap (vdgl_edgel_chain_sptr const &ec)
vtol_vertex_2d_sptr get_vertex_at_index (vtol_edge_2d_sptr &e, int index)
bool find_vertex (vtol_vertex_2d_sptr &v, vcl_vector< vtol_vertex_2d_sptr > &vertices)
bool find_edge (vtol_edge_2d_sptr &e, vcl_vector< vtol_edge_2d_sptr > &edges)
void print_edge_lookup_table (vcl_vector< vtol_edge_2d_sptr > &edges)
vtol_edge_2d_sptr DanglingEdge (vtol_vertex_2d_sptr const &v)
 If there is only one edge connected to v then return it, otherwise return null.
vtol_edge_2d_sptr DigitalEdge (vtol_vertex_2d_sptr const &vs, vtol_vertex_2d_sptr const &ve)
 Generate an Edge with a vdgl_digital_curve representing a straight line between the specified vertices.
void EqualizeElements (double *elmts, int n, double v1, double v2)
 Convolve array elements with [1 0 1]/2, replacing center pixel by average of 2 neighbors.

Variables

const int INVALID = -1
const vxl_byte TWOPI = 8
const vxl_byte HALFPI = 2
const int DIS []
const int DJS []
const int RIS []
const int RJS []
const int RNS [] = { 4, 8, 12, 20, 24, 28, 36, 44, 48}
const float RGS []
const int MINLENGTH = 3
const int FRAME = 4

Detailed Description

Definition in file sdet_contour.cxx.


Define Documentation

#define WARN (   x,
 
)
Value:
vcl_cerr << "Warning: edgel "<<i<<" is at ("<<x<<','<<y\
                           <<") which is outside of edge map of size "\
                           <<edgeMap->rows()<<'x'<<edgeMap->cols()<<'\n'

Function Documentation

vtol_edge_2d_sptr DanglingEdge ( vtol_vertex_2d_sptr const &  v)

If there is only one edge connected to v then return it, otherwise return null.

Definition at line 1335 of file sdet_contour.cxx.

vtol_edge_2d_sptr DigitalEdge ( vtol_vertex_2d_sptr const &  vs,
vtol_vertex_2d_sptr const &  ve 
)

Generate an Edge with a vdgl_digital_curve representing a straight line between the specified vertices.

Definition at line 2075 of file sdet_contour.cxx.

void EqualizeElements ( double *  elmts,
int  n,
double  v1,
double  v2 
)

Convolve array elements with [1 0 1]/2, replacing center pixel by average of 2 neighbors.

This will make the spacing between pixels almost equal and prune away small zig-zags.

Definition at line 2411 of file sdet_contour.cxx.

void ErasePixel ( vcl_vector< int > &  xloc,
vcl_vector< int > &  yloc 
)

Delete the last pixel added to iloc and jloc.

Definition at line 291 of file sdet_contour.cxx.

void fill_cycle_gap ( vdgl_edgel_chain_sptr const &  ec)

Definition at line 809 of file sdet_contour.cxx.

bool find_edge ( vtol_edge_2d_sptr e,
vcl_vector< vtol_edge_2d_sptr > &  edges 
)

Definition at line 983 of file sdet_contour.cxx.

bool find_vertex ( vtol_vertex_2d_sptr v,
vcl_vector< vtol_vertex_2d_sptr > &  vertices 
)

Definition at line 973 of file sdet_contour.cxx.

vtol_vertex_2d_sptr get_vertex_at_index ( vtol_edge_2d_sptr e,
int  index 
)

Definition at line 963 of file sdet_contour.cxx.

void print_edge_lookup_table ( vcl_vector< vtol_edge_2d_sptr > &  edges)

Definition at line 993 of file sdet_contour.cxx.


Variable Documentation

const int DIS[]
Initial value:
 { 1, 1, 0,-1,-1,-1, 0, 1, 
                    1, 1, 0,-1,-1,-1, 0, 1, 
                    1, 1, 0,-1,-1,-1, 0, 1}

Definition at line 41 of file sdet_contour.cxx.

const int DJS[]
Initial value:
 { 0, 1, 1, 1, 0,-1,-1,-1,
                    0, 1, 1, 1, 0,-1,-1,-1,
                    0, 1, 1, 1, 0,-1,-1,-1}

Definition at line 44 of file sdet_contour.cxx.

const int FRAME = 4

Definition at line 79 of file sdet_contour.cxx.

const vxl_byte HALFPI = 2

Definition at line 39 of file sdet_contour.cxx.

const int INVALID = -1

Definition at line 35 of file sdet_contour.cxx.

const int MINLENGTH = 3

Definition at line 78 of file sdet_contour.cxx.

const float RGS[]
Initial value:
 { 1.f, 1.414213f, 2.f, 2.236067f, 2.828427f, 
                      3.f, 3.162277f, 3.605551f, 4.f}

Definition at line 74 of file sdet_contour.cxx.

const int RIS[]
Initial value:
 { 1, 0,-1, 0, 
                    1,-1,-1, 1, 
                    2, 0,-2, 0,
                    2, 1,-1,-2,
                    -2,-1, 1, 2,
                    2,-2,-2, 2,
                    3, 0,-3, 0,
                    3, 1,-1,-3,
                    -3,-1, 1, 3,
                    3, 2,-2,-3,
                    -3,-2, 2, 3,
                    4, 0,-4, 0}

Definition at line 49 of file sdet_contour.cxx.

const int RJS[]
Initial value:
 { 0, 1, 0,-1, 
                    1, 1,-1,-1,
                    0, 2, 0,-2,
                    1, 2, 2, 1,
                    -1,-2,-2,-1,
                    2, 2,-2,-2,
                    0, 3, 0,-3,
                    1, 3, 3, 1,
                    -1,-3,-3,-1,
                    2, 3, 3, 2,
                    -2,-3,-3,-2,
                    0, 4, 0,-4}

Definition at line 61 of file sdet_contour.cxx.

const int RNS[] = { 4, 8, 12, 20, 24, 28, 36, 44, 48}

Definition at line 73 of file sdet_contour.cxx.

const vxl_byte TWOPI = 8

Definition at line 39 of file sdet_contour.cxx.