Functions | Variables
contrib/gel/gevd/gevd_contour.cxx File Reference
#include "gevd_contour.h"
#include <vcl_iostream.h>
#include <vcl_cstdlib.h>
#include <vcl_vector.h>
#include <vcl_algorithm.h>
#include <vxl_config.h>
#include <vnl/vnl_math.h>
#include <vdgl/vdgl_digital_curve.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 <gevd/gevd_pixel.h>

Go to the source code of this file.

Functions

bool DetectJunction (vtol_vertex_2d &end, int &index, vtol_edge_2d_sptr &weaker, vtol_edge_2d_sptr &stronger, const int maxSpiral, const gevd_bufferxy &edgels, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap)
 Check that end point of a weak contour touches another stronger contour at an internal pixel.
void BreakCycle (vtol_vertex_2d &junction, const int index, vtol_edge_2d &stronger, vtol_edge_2d_sptr &split, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Break the cycle at given index, and create new cycle from/to and not including index pixel.
void BreakChain (vtol_vertex_2d &junction, const int index, vtol_edge_2d &stronger, vtol_edge_2d_sptr &longer, vtol_edge_2d_sptr &shorter, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Break the edge at given index, and create two subchains from it.
void LoopChain (vtol_vertex_2d &junction, const int index, vtol_edge_2d &chain, vtol_edge_2d_sptr &straight, vtol_edge_2d_sptr &curled, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Break the chain at given index, and create a loop.
int NumConnectedRays (vtol_vertex_2d &v)
 Find number of rays connected to a vertex.
vtol_vertex_2d_sptr DetectTouch (const vtol_vertex_2d &end, const int maxSpiral, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Detect touching another junction or end point, from an end point of a dangling chain.
vtol_edge_2d_sptr DanglingEdge (vtol_vertex_2d &v)
 Find dangling edges connected to vertex.
void MergeEndPtsOfChain (vtol_vertex_2d &endpt, vtol_vertex_2d &other, vtol_edge_2d &common, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Merge 2 end points of a same chain.
void MergeEndPtTouchingEndPt (vtol_vertex_2d &end1, vtol_vertex_2d &end2, vtol_edge_2d_sptr &merge, vtol_edge_2d_sptr &longer, vtol_edge_2d_sptr &shorter, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Merge 2 touching chains into 1, deleting the 2 touching end points and their chains.
void MergeEndPtTouchingJunction (vtol_vertex_2d &endpt, vtol_vertex_2d &junction, vbl_array_2d< vtol_edge_2d_sptr > &edgeMap, vbl_array_2d< vtol_vertex_2d_sptr > &vertexMap)
 Merge an end point into a touching junction.

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 gevd_contour.cxx.


Function Documentation

void BreakChain ( vtol_vertex_2d junction,
const int  index,
vtol_edge_2d stronger,
vtol_edge_2d_sptr longer,
vtol_edge_2d_sptr shorter,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Break the edge at given index, and create two subchains from it.

Update the chain map accordingly.

Definition at line 625 of file gevd_contour.cxx.

void BreakCycle ( vtol_vertex_2d junction,
const int  index,
vtol_edge_2d stronger,
vtol_edge_2d_sptr split,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Break the cycle at given index, and create new cycle from/to and not including index pixel.

Update the chain map accordingly.

Definition at line 547 of file gevd_contour.cxx.

vtol_edge_2d_sptr DanglingEdge ( vtol_vertex_2d v)

Find dangling edges connected to vertex.

Definition at line 860 of file gevd_contour.cxx.

bool DetectJunction ( vtol_vertex_2d end,
int &  index,
vtol_edge_2d_sptr weaker,
vtol_edge_2d_sptr stronger,
const int  maxSpiral,
const gevd_bufferxy edgels,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap 
)

Check that end point of a weak contour touches another stronger contour at an internal pixel.

Localize the junction to pixel accuracy by searching for shortest distance from end point to chain. Gaussian smoothing can put local maximum change in filter response 1 pixel away from this junction location. Update junction map.

Definition at line 428 of file gevd_contour.cxx.

vtol_vertex_2d_sptr DetectTouch ( const vtol_vertex_2d end,
const int  maxSpiral,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Detect touching another junction or end point, from an end point of a dangling chain.

Definition at line 836 of file gevd_contour.cxx.

void LoopChain ( vtol_vertex_2d junction,
const int  index,
vtol_edge_2d chain,
vtol_edge_2d_sptr straight,
vtol_edge_2d_sptr curled,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Break the chain at given index, and create a loop.

Update the chain map accordingly.

Definition at line 708 of file gevd_contour.cxx.

void MergeEndPtsOfChain ( vtol_vertex_2d endpt,
vtol_vertex_2d other,
vtol_edge_2d common,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Merge 2 end points of a same chain.

Update global maps.

Definition at line 874 of file gevd_contour.cxx.

void MergeEndPtTouchingEndPt ( vtol_vertex_2d end1,
vtol_vertex_2d end2,
vtol_edge_2d_sptr merge,
vtol_edge_2d_sptr longer,
vtol_edge_2d_sptr shorter,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Merge 2 touching chains into 1, deleting the 2 touching end points and their chains.

Smooth away short kinks is delayed for later. Update global maps.

Definition at line 890 of file gevd_contour.cxx.

void MergeEndPtTouchingJunction ( vtol_vertex_2d endpt,
vtol_vertex_2d junction,
vbl_array_2d< vtol_edge_2d_sptr > &  edgeMap,
vbl_array_2d< vtol_vertex_2d_sptr > &  vertexMap 
)

Merge an end point into a touching junction.

Update global maps.

Definition at line 981 of file gevd_contour.cxx.

int NumConnectedRays ( vtol_vertex_2d v)

Find number of rays connected to a vertex.

Definition at line 821 of file gevd_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 28 of file gevd_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 31 of file gevd_contour.cxx.

const int FRAME = 4

Definition at line 60 of file gevd_contour.cxx.

const vxl_byte HALFPI = 2

Definition at line 26 of file gevd_contour.cxx.

const int INVALID = -1

Definition at line 22 of file gevd_contour.cxx.

const int MINLENGTH = 3

Definition at line 59 of file gevd_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 55 of file gevd_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 36 of file gevd_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 45 of file gevd_contour.cxx.

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

Definition at line 54 of file gevd_contour.cxx.

const vxl_byte TWOPI = 8

Definition at line 26 of file gevd_contour.cxx.