Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | List of all members
findArrow Class Reference

#include <findArrow.h>

Static Public Member Functions

static void boundig_box (Mat &src_tresh, Mat &dst)
 FIND THE BOUDING BOX. More...
 
static vector< RotatedRect > boundig_box_small (Mat &src_tresh, Mat &threshold_output, vector< vector< Point > > contours, cv::Point &src_centre)
 FIND THE SMALLEST BOUNDING BOX. More...
 
static Point calculate_center_contour (Point2f contour[], unsigned int size_contour)
 
static void closing (Mat &src, Mat &dest, unsigned int erosion_size)
 Morphological operation Closing. More...
 
static void descritor (Mat &img_object, Mat &img_scene)
 Find discriptors (Match points) More...
 
static int find_arrow (cv::Mat frame, cv::Point &center_point)
 
static vector< vector< Point > > find_contours (Mat &src, Mat &dest, const unsigned int &line_thinckness)
 Find Counturs. More...
 
static void multiplymatrixbool (Mat &src, Mat &matbol)
 
static void Opening (Mat &src, Mat &dest, unsigned int erosion_size)
 Morphological operation OPENING. More...
 
static void ProcessEdges (Mat &src, Mat &dest)
 Boundig box BW. More...
 
static void ProcessMyImage (Mat &src, Mat &dest)
 
static vector< double > sort_points (Point2f rect_points[])
 SORTE POINTS helper validate_lengths. More...
 
static bool validate_contour_Area_Length (vector< Point > contours, vector< double > bbox_points, const double bbca_min=BBCA_MIN, const double bbca_max=BBCA_MAX, const double bbcl_min=BBCL_MIN, const double bbcl_max=BBCL_MAX, const double cacl_min=CACL_MIN, const double cacl_max=CACL_MAX)
 
static bool validate_convexHull (vector< Point > contours, const unsigned short convex_hull_corners=CONVEX_HULL_CORNERS)
 
static bool validate_corners_arrow (vector< Point > contours, const unsigned short convex_arrow_corners=CONVEX_ARROW_CORNERS)
 
static bool validate_lengths (Point2f rect_points[], const unsigned short max_length=VAL_MAX_LENGTH, const unsigned short min_length=VAL_MIN_LENGTH, const float min_relation_length=VAL_MIN_RELATION_LENGTH, const float max_relation_length=VAL_MAX_RELATION_LENGTH)
 

Static Public Attributes

static const double AREA_MIN = 500
 
static const double BBCA_MAX = 1.9
 
static const double BBCA_MIN = 1.3
 
static const double BBCL_MAX = 35
 
static const double BBCL_MIN = 7
 
static const double CACL_MAX = 22
 
static const double CACL_MIN = 4
 
static const unsigned short CONVEX_ARROW_CORNERS = 7
 
static const unsigned short CONVEX_HULL_CORNERS = 5
 
static const unsigned int EROSION_SIZE =1
 
static const unsigned int EROSION_SIZE_MIN =1
 
static bool found_new_point =false
 
static const unsigned int LINE_THICKNESS = 2
 
static const unsigned int MAX_THRESH = 255
 
static const unsigned int THRESH = 100
 
static const unsigned short VAL_MAX_LENGTH = 500
 
static const float VAL_MAX_RELATION_LENGTH = 3.1
 
static const unsigned short VAL_MIN_LENGTH = 100
 
static const float VAL_MIN_RELATION_LENGTH = 1.3
 

Static Protected Member Functions

static double angle (cv::Point pt1, cv::Point pt2, cv::Point pt0)
 
static float innerAngle (float px1, float py1, float px2, float py2, float cx1, float cy1)
 
static void setLabel (cv::Mat &im, const std::string label, std::vector< cv::Point > &contour)
 

Detailed Description

Definition at line 75 of file findArrow.h.

Member Function Documentation

double findArrow::angle ( cv::Point  pt1,
cv::Point  pt2,
cv::Point  pt0 
)
staticprotected

Helper function to find a cosine of angle between vectors from pt0->pt1 and pt0->pt2

Definition at line 438 of file findArrow.cpp.

void findArrow::boundig_box ( Mat &  src_tresh,
Mat &  dst 
)
static

FIND THE BOUDING BOX.

FIND THE BOUDING BOX

Parameters
MatSrc Matix BW
MatOupt Matrix BW
Returns
Matrix "Opening" // not implemented yet
Precondition
requires the source matrix with contours to compute the boundig_box of with one and the output matrix
Postcondition
void!

Find contours

Approximate contours to polygons + get bounding rects and circles

Draw polygonal contour + bonding rects + circles

Show in a window

Definition at line 151 of file findArrow.cpp.

vector< RotatedRect > findArrow::boundig_box_small ( Mat &  src_tresh,
Mat &  threshold_output,
vector< vector< Point > >  contours,
cv::Point &  src_centre 
)
static

FIND THE SMALLEST BOUNDING BOX.

FIND THE SMALLEST BOUNDING BOX

Parameters
MatSrc Matix BW
MatOupt Matrix BW
Returns
// not implemented yet
Precondition
requires the source matrix with contours to compute the boundig_box of with one and the output matrix
Postcondition
void!

Find contours

Approximate contours to polygons + get bounding rects and circles

Find the rotated rectangles and ellipses for each contour

THIS FUNCTION MUST END HERE

Draw contours + rotated rects + ellipses

Start state machine

validate_contour_Area_Length

verify lengths

validate_number of arrow corners

Find the convex hull object for each contour convexHull

Definition at line 613 of file findArrow.cpp.

Point findArrow::calculate_center_contour ( Point2f  contour[],
unsigned int  size_contour 
)
static

Calculates the center of an contour

Parameters
Point2fcontour
contoursize
Returns
Center Point
Precondition
Contour must be greater than 1 point;

Definition at line 86 of file findArrow.cpp.

void findArrow::closing ( Mat &  src,
Mat &  dest,
unsigned int  erosion_size 
)
static

Morphological operation Closing.

Morphological operation closing Imput: 1-Src Matix 2-Oupt Matrix 3-number of erosions Output: -Matrix "closing"

Definition at line 132 of file findArrow.cpp.

void findArrow::descritor ( Mat &  img_object,
Mat &  img_scene 
)
static
int findArrow::find_arrow ( cv::Mat  frame,
cv::Point &  center_point 
)
static

Main function to processec image and return the position of object Find arrow

Find a arrow on a image and return his position

Parameters
Mat& img_scene to compute
bool& use_descritor?? (not implemented yet)
intcam_number (optional)
Returns
Point(no implemented yet!) position of arrow
Precondition
requires a camera conected to the computer to get the image
Postcondition
Point in pixies of the object, maybe will be necessary to return the iamge size! or the distance to the center of the image in percentage!

Create a obj "cap" that will get the video from the camera

Loop cycle:

  1. send the cap data into frame
  2. BRG to GRAY
  3. Histogram Equalization
  4. Adaptative Threshold Otsu
  5. Opening
  6. find countours
  7. Boundig box

PARA VERIFICAR OS CANTOS, É NECESSARIO PRIMEIRO, SABER A QUE CADA PONTO PERTENCE O VERTICE,

ASSIM, DEVE-SE ORDENAR

****EXIT*** wait for 'esc' key press for 10ms. If 'esc' key is pressed, break loop

Destroy all Windows

Definition at line 473 of file findArrow.cpp.

vector< vector< Point > > findArrow::find_contours ( Mat &  src,
Mat &  dest,
const unsigned int &  line_thinckness 
)
static

Find Counturs.

Find Counturs Imput: 1-Src Matix 2-Oupt Matrix 3-line_thinckness 4-Erosion size Output: -Mariz with the coutours!

Find Counturs

Parameters
Mat& src
Mat& dest2
constunsigned int & line_thinckness
constunsigned int & erosion_size_min
Returns
Void!
Precondition
Postcondition
Point in pixies of the object, maybe will be necessary to return the iamge size! or the distance to the center of the image in percentage!

Definition at line 566 of file findArrow.cpp.

float findArrow::innerAngle ( float  px1,
float  py1,
float  px2,
float  py2,
float  cx1,
float  cy1 
)
staticprotected
static void findArrow::multiplymatrixbool ( Mat &  src,
Mat &  matbol 
)
static
void findArrow::Opening ( Mat &  src,
Mat &  dest,
unsigned int  erosion_size 
)
static

Morphological operation OPENING.

Morphological operation OPENING Imput: 1-Src Matix 2-Oupt Matrix 3-number of erosions Output: -Matrix "Opening"

Definition at line 112 of file findArrow.cpp.

static void findArrow::ProcessEdges ( Mat &  src,
Mat &  dest 
)
static

Boundig box BW.

static void findArrow::ProcessMyImage ( Mat &  src,
Mat &  dest 
)
static
void findArrow::setLabel ( cv::Mat &  im,
const std::string  label,
std::vector< cv::Point > &  contour 
)
staticprotected

Helper function to display text in the center of a contour

Definition at line 452 of file findArrow.cpp.

vector< double > findArrow::sort_points ( Point2f  rect_points[])
static

SORTE POINTS helper validate_lengths.

Definition at line 330 of file findArrow.cpp.

static bool findArrow::validate_contour_Area_Length ( vector< Point >  contours,
vector< double >  bbox_points,
const double  bbca_min = BBCA_MIN,
const double  bbca_max = BBCA_MAX,
const double  bbcl_min = BBCL_MIN,
const double  bbcl_max = BBCL_MAX,
const double  cacl_min = CACL_MIN,
const double  cacl_max = CACL_MAX 
)
static
bool findArrow::validate_convexHull ( vector< Point >  contours,
const unsigned short  convex_hull_corners = CONVEX_HULL_CORNERS 
)
static

Definition at line 382 of file findArrow.cpp.

bool findArrow::validate_corners_arrow ( vector< Point >  contours,
const unsigned short  convex_arrow_corners = CONVEX_ARROW_CORNERS 
)
static

Definition at line 369 of file findArrow.cpp.

bool findArrow::validate_lengths ( Point2f  rect_points[],
const unsigned short  max_length = VAL_MAX_LENGTH,
const unsigned short  min_length = VAL_MIN_LENGTH,
const float  min_relation_length = VAL_MIN_RELATION_LENGTH,
const float  max_relation_length = VAL_MAX_RELATION_LENGTH 
)
static

Validate the size and relation height/width of bounding box of the arrow

Parameters
arraywith 4 Points (corners of rectangle)
(optional)const unsigned short max_length
(optional)const unsigned short min_length
(optional)const float min_relation_length
(optional)const float max_relation_length
Returns
bool whith the validation of the bounding box
Precondition
Point2f array with 4 points

Definition at line 344 of file findArrow.cpp.

Member Data Documentation

const double findArrow::AREA_MIN = 500
static

Definition at line 106 of file findArrow.h.

const double findArrow::BBCA_MAX = 1.9
static

Definition at line 101 of file findArrow.h.

const double findArrow::BBCA_MIN = 1.3
static

Definition at line 100 of file findArrow.h.

const double findArrow::BBCL_MAX = 35
static

Definition at line 103 of file findArrow.h.

const double findArrow::BBCL_MIN = 7
static

Definition at line 102 of file findArrow.h.

const double findArrow::CACL_MAX = 22
static

Definition at line 105 of file findArrow.h.

const double findArrow::CACL_MIN = 4
static

Definition at line 104 of file findArrow.h.

const unsigned short findArrow::CONVEX_ARROW_CORNERS = 7
static

Definition at line 112 of file findArrow.h.

const unsigned short findArrow::CONVEX_HULL_CORNERS = 5
static

Definition at line 109 of file findArrow.h.

const unsigned int findArrow::EROSION_SIZE =1
static

Definition at line 87 of file findArrow.h.

const unsigned int findArrow::EROSION_SIZE_MIN =1
static

Definition at line 88 of file findArrow.h.

bool findArrow::found_new_point =false
static

Definition at line 83 of file findArrow.h.

const unsigned int findArrow::LINE_THICKNESS = 2
static

Definition at line 91 of file findArrow.h.

const unsigned int findArrow::MAX_THRESH = 255
static

Definition at line 90 of file findArrow.h.

const unsigned int findArrow::THRESH = 100
static

Definition at line 89 of file findArrow.h.

const unsigned short findArrow::VAL_MAX_LENGTH = 500
static

Definition at line 94 of file findArrow.h.

const float findArrow::VAL_MAX_RELATION_LENGTH = 3.1
static

Definition at line 97 of file findArrow.h.

const unsigned short findArrow::VAL_MIN_LENGTH = 100
static

Definition at line 95 of file findArrow.h.

const float findArrow::VAL_MIN_RELATION_LENGTH = 1.3
static

Definition at line 96 of file findArrow.h.


The documentation for this class was generated from the following files:


arrow_detection
Author(s): César Sousa
autogenerated on Mon Mar 2 2015 01:31:21