Added utility function for angle_to object

This commit is contained in:
Philip Rosedale 2013-01-24 17:41:17 -08:00
commit 2a320d149e
554 changed files with 54317 additions and 55441 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -1,99 +1,99 @@
#ifndef BLOBCONTOUR_H_INCLUDED #ifndef BLOBCONTOUR_H_INCLUDED
#define BLOBCONTOUR_H_INCLUDED #define BLOBCONTOUR_H_INCLUDED
#include "list" #include "list"
#include <opencv/cv.h> #include <opencv/cv.h>
//#include "cxtypes.h" //AO //#include "cxtypes.h" //AO
#include <opencv/cxcore.h> // #include <opencv/cxcore.h> //
//! Type of chain codes //! Type of chain codes
typedef unsigned char t_chainCode; typedef unsigned char t_chainCode;
//! Type of list of chain codes //! Type of list of chain codes
typedef CvSeq* t_chainCodeList; typedef CvSeq* t_chainCodeList;
//! Type of list of points //! Type of list of points
typedef CvSeq* t_PointList; typedef CvSeq* t_PointList;
//! Max order of calculated moments //! Max order of calculated moments
#define MAX_MOMENTS_ORDER 3 #define MAX_MOMENTS_ORDER 3
//! Blob contour class (in crack code) //! Blob contour class (in crack code)
class CBlobContour class CBlobContour
{ {
friend class CBlob; friend class CBlob;
friend class CBlobProperties; //AO friend class CBlobProperties; //AO
public: public:
//! Constructors //! Constructors
CBlobContour(); CBlobContour();
CBlobContour(CvPoint startPoint, CvMemStorage *storage ); CBlobContour(CvPoint startPoint, CvMemStorage *storage );
//! Copy constructor //! Copy constructor
CBlobContour( CBlobContour *source ); CBlobContour( CBlobContour *source );
~CBlobContour(); ~CBlobContour();
//! Assigment operator //! Assigment operator
CBlobContour& operator=( const CBlobContour &source ); CBlobContour& operator=( const CBlobContour &source );
//! Add chain code to contour //! Add chain code to contour
void AddChainCode(t_chainCode code); void AddChainCode(t_chainCode code);
//! Return freeman chain coded contour //! Return freeman chain coded contour
t_chainCodeList GetChainCode() t_chainCodeList GetChainCode()
{ {
return m_contour; return m_contour;
} }
bool IsEmpty() bool IsEmpty()
{ {
return m_contour == NULL || m_contour->total == 0; return m_contour == NULL || m_contour->total == 0;
} }
//! Return all contour points //! Return all contour points
t_chainCodeList GetContourPoints(); t_chainCodeList GetContourPoints();
protected: protected:
CvPoint GetStartPoint() const CvPoint GetStartPoint() const
{ {
return m_startPoint; return m_startPoint;
} }
//! Clears chain code contour //! Clears chain code contour
void ResetChainCode(); void ResetChainCode();
//! Computes area from contour //! Computes area from contour
double GetArea(); double GetArea();
//! Computes perimeter from contour //! Computes perimeter from contour
double GetPerimeter(); double GetPerimeter();
//! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS) //! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS)
double GetMoment(int p, int q); double GetMoment(int p, int q);
//! Crack code list //! Crack code list
t_chainCodeList m_contour; t_chainCodeList m_contour;
private: private:
//! Starting point of the contour //! Starting point of the contour
CvPoint m_startPoint; CvPoint m_startPoint;
//! All points from the contour //! All points from the contour
t_PointList m_contourPoints; t_PointList m_contourPoints;
//! Computed area from contour //! Computed area from contour
double m_area; double m_area;
//! Computed perimeter from contour //! Computed perimeter from contour
double m_perimeter; double m_perimeter;
//! Computed moments from contour //! Computed moments from contour
CvMoments m_moments; CvMoments m_moments;
//! Pointer to storage //! Pointer to storage
CvMemStorage *m_parentStorage; CvMemStorage *m_parentStorage;
}; };
#endif //!BLOBCONTOUR_H_INCLUDED #endif //!BLOBCONTOUR_H_INCLUDED

View file

@ -1,22 +1,22 @@
/************************************************************************ /************************************************************************
BlobLibraryConfiguration.h BlobLibraryConfiguration.h
FUNCIONALITAT: Configuració del comportament global de la llibreria FUNCIONALITAT: Configuració del comportament global de la llibreria
AUTOR: Inspecta S.L. AUTOR: Inspecta S.L.
MODIFICACIONS (Modificació, Autor, Data): MODIFICACIONS (Modificació, Autor, Data):
FUNCTIONALITY: Global configuration of the library FUNCTIONALITY: Global configuration of the library
AUTHOR: Inspecta S.L. AUTHOR: Inspecta S.L.
MODIFICATIONS (Modification, Author, Date): MODIFICATIONS (Modification, Author, Date):
**************************************************************************/ **************************************************************************/
//! Indica si es volen fer servir les MatrixCV o no //! Indica si es volen fer servir les MatrixCV o no
//! Use/Not use the MatrixCV class //! Use/Not use the MatrixCV class
//#define MATRIXCV_ACTIU //#define MATRIXCV_ACTIU
//! Uses/not use the blob object factory //! Uses/not use the blob object factory
//#define BLOB_OBJECT_FACTORY //#define BLOB_OBJECT_FACTORY
//! Show/not show blob access errors //! Show/not show blob access errors
//#define _SHOW_ERRORS //AO: Only works for WIN. //#define _SHOW_ERRORS //AO: Only works for WIN.

View file

@ -1,70 +1,70 @@
//! Disable warnings referred to 255 character truncation for the std:map //! Disable warnings referred to 255 character truncation for the std:map
#pragma warning( disable : 4786 ) #pragma warning( disable : 4786 )
#ifndef BLOB_PROPERTIES_H_INCLUDED #ifndef BLOB_PROPERTIES_H_INCLUDED
#define BLOB_PROPERTIES_H_INCLUDED #define BLOB_PROPERTIES_H_INCLUDED
#include <opencv/cxcore.h> #include <opencv/cxcore.h>
#include "BlobLibraryConfiguration.h" #include "BlobLibraryConfiguration.h"
#include "BlobContour.h" #include "BlobContour.h"
#ifdef BLOB_OBJECT_FACTORY #ifdef BLOB_OBJECT_FACTORY
//! Object factory pattern implementation //! Object factory pattern implementation
#include "..\inspecta\DesignPatterns\ObjectFactory.h" #include "..\inspecta\DesignPatterns\ObjectFactory.h"
#endif #endif
//! Type of labelled images //! Type of labelled images
typedef unsigned int t_labelType; typedef unsigned int t_labelType;
//! Max order of calculated moments //! Max order of calculated moments
#define MAX_MOMENTS_ORDER 3 #define MAX_MOMENTS_ORDER 3
//! Blob class //! Blob class
class CBlobProperties class CBlobProperties
{ {
typedef std::list<CBlobContour> t_contourList; typedef std::list<CBlobContour> t_contourList;
public: public:
CBlobProperties(); CBlobProperties();
virtual ~CBlobProperties(); virtual ~CBlobProperties();
//! Get blob area //! Get blob area
double GetArea(); double GetArea();
//! Get blob perimeter //! Get blob perimeter
double GetPerimeter(); double GetPerimeter();
//! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS) //! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS)
double GetMoment(int p, int q); double GetMoment(int p, int q);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Blob contours // Blob contours
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//! Contour storage memory //! Contour storage memory
CvMemStorage *m_storage; CvMemStorage *m_storage;
//! External contour of the blob (crack codes) //! External contour of the blob (crack codes)
CBlobContour m_externalContour; CBlobContour m_externalContour;
//! Internal contours (crack codes) //! Internal contours (crack codes)
t_contourList m_internalContours; t_contourList m_internalContours;
private: private:
//! Computed area from blob //! Computed area from blob
double m_area; double m_area;
//! Computed perimeter from blob //! Computed perimeter from blob
double m_perimeter; double m_perimeter;
// Computed moment from the blob // Computed moment from the blob
double m_moment[MAX_MOMENTS_ORDER*MAX_MOMENTS_ORDER]; double m_moment[MAX_MOMENTS_ORDER*MAX_MOMENTS_ORDER];
}; };
#endif //!BLOB_PROPERTIES_H_INCLUDED #endif //!BLOB_PROPERTIES_H_INCLUDED

View file

@ -1,171 +1,171 @@
/************************************************************************ /************************************************************************
BlobResult.h BlobResult.h
FUNCIONALITAT: Definició de la classe CBlobResult FUNCIONALITAT: Definició de la classe CBlobResult
AUTOR: Inspecta S.L. AUTOR: Inspecta S.L.
MODIFICACIONS (Modificació, Autor, Data): MODIFICACIONS (Modificació, Autor, Data):
FUNCTIONALITY: Definition of the CBlobResult class FUNCTIONALITY: Definition of the CBlobResult class
AUTHOR: Inspecta S.L. AUTHOR: Inspecta S.L.
MODIFICATIONS (Modification, Author, Date): MODIFICATIONS (Modification, Author, Date):
**************************************************************************/ **************************************************************************/
#if !defined(_CLASSE_BLOBRESULT_INCLUDED) #if !defined(_CLASSE_BLOBRESULT_INCLUDED)
#define _CLASSE_BLOBRESULT_INCLUDED #define _CLASSE_BLOBRESULT_INCLUDED
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#include "BlobLibraryConfiguration.h" #include "BlobLibraryConfiguration.h"
#include <math.h> #include <math.h>
#include <opencv/cxcore.h> #include <opencv/cxcore.h>
#ifdef MATRIXCV_ACTIU #ifdef MATRIXCV_ACTIU
#include "matrixCV.h" #include "matrixCV.h"
#else #else
// llibreria STL // llibreria STL
#include "vector" #include "vector"
//! Vector de doubles //! Vector de doubles
typedef std::vector<double> double_stl_vector; typedef std::vector<double> double_stl_vector;
#endif #endif
#include <vector> // vectors de la STL #include <vector> // vectors de la STL
#include <functional> #include <functional>
#include "blob.h" #include "blob.h"
#include "BlobOperators.h" #include "BlobOperators.h"
#include "ComponentLabeling.h" #include "ComponentLabeling.h"
/************************************************************************** /**************************************************************************
Filtres / Filters Filtres / Filters
**************************************************************************/ **************************************************************************/
//! accions que es poden fer amb els filtres //! accions que es poden fer amb els filtres
//! Actions performed by a filter (include or exclude blobs) //! Actions performed by a filter (include or exclude blobs)
#define B_INCLUDE 1L #define B_INCLUDE 1L
#define B_EXCLUDE 2L #define B_EXCLUDE 2L
//! condicions sobre els filtres //! condicions sobre els filtres
//! Conditions to apply the filters //! Conditions to apply the filters
#define B_EQUAL 3L #define B_EQUAL 3L
#define B_NOT_EQUAL 4L #define B_NOT_EQUAL 4L
#define B_GREATER 5L #define B_GREATER 5L
#define B_LESS 6L #define B_LESS 6L
#define B_GREATER_OR_EQUAL 7L #define B_GREATER_OR_EQUAL 7L
#define B_LESS_OR_EQUAL 8L #define B_LESS_OR_EQUAL 8L
#define B_INSIDE 9L #define B_INSIDE 9L
#define B_OUTSIDE 10L #define B_OUTSIDE 10L
/************************************************************************** /**************************************************************************
Excepcions / Exceptions Excepcions / Exceptions
**************************************************************************/ **************************************************************************/
//! Excepcions llençades per les funcions: //! Excepcions llençades per les funcions:
#define EXCEPTION_BLOB_OUT_OF_BOUNDS 1000 #define EXCEPTION_BLOB_OUT_OF_BOUNDS 1000
#define EXCEPCIO_CALCUL_BLOBS 1001 #define EXCEPCIO_CALCUL_BLOBS 1001
/** /**
Classe que conté un conjunt de blobs i permet extreure'n propietats Classe que conté un conjunt de blobs i permet extreure'n propietats
o filtrar-los segons determinats criteris. o filtrar-los segons determinats criteris.
Class to calculate the blobs of an image and calculate some properties Class to calculate the blobs of an image and calculate some properties
on them. Also, the class provides functions to filter the blobs using on them. Also, the class provides functions to filter the blobs using
some criteria. some criteria.
*/ */
class CBlobResult class CBlobResult
{ {
public: public:
//! constructor estandard, crea un conjunt buit de blobs //! constructor estandard, crea un conjunt buit de blobs
//! Standard constructor, it creates an empty set of blobs //! Standard constructor, it creates an empty set of blobs
CBlobResult(); CBlobResult();
//! constructor a partir d'una imatge //! constructor a partir d'una imatge
//! Image constructor, it creates an object with the blobs of the image //! Image constructor, it creates an object with the blobs of the image
CBlobResult(IplImage *source, IplImage *mask, uchar backgroundColor); CBlobResult(IplImage *source, IplImage *mask, uchar backgroundColor);
//! constructor de còpia //! constructor de còpia
//! Copy constructor //! Copy constructor
CBlobResult( const CBlobResult &source ); CBlobResult( const CBlobResult &source );
//! Destructor //! Destructor
virtual ~CBlobResult(); virtual ~CBlobResult();
//! operador = per a fer assignacions entre CBlobResult //! operador = per a fer assignacions entre CBlobResult
//! Assigment operator //! Assigment operator
CBlobResult& operator=(const CBlobResult& source); CBlobResult& operator=(const CBlobResult& source);
//! operador + per concatenar dos CBlobResult //! operador + per concatenar dos CBlobResult
//! Addition operator to concatenate two sets of blobs //! Addition operator to concatenate two sets of blobs
CBlobResult operator+( const CBlobResult& source ) const; CBlobResult operator+( const CBlobResult& source ) const;
//! Afegeix un blob al conjunt //! Afegeix un blob al conjunt
//! Adds a blob to the set of blobs //! Adds a blob to the set of blobs
void AddBlob( CBlob *blob ); void AddBlob( CBlob *blob );
#ifdef MATRIXCV_ACTIU #ifdef MATRIXCV_ACTIU
//! Calcula un valor sobre tots els blobs de la classe retornant una MatrixCV //! Calcula un valor sobre tots els blobs de la classe retornant una MatrixCV
//! Computes some property on all the blobs of the class //! Computes some property on all the blobs of the class
double_vector GetResult( funcio_calculBlob *evaluador ) const; double_vector GetResult( funcio_calculBlob *evaluador ) const;
#endif #endif
//! Calcula un valor sobre tots els blobs de la classe retornant un std::vector<double> //! Calcula un valor sobre tots els blobs de la classe retornant un std::vector<double>
//! Computes some property on all the blobs of the class //! Computes some property on all the blobs of the class
double_stl_vector GetSTLResult( funcio_calculBlob *evaluador ) const; double_stl_vector GetSTLResult( funcio_calculBlob *evaluador ) const;
//! Calcula un valor sobre un blob de la classe //! Calcula un valor sobre un blob de la classe
//! Computes some property on one blob of the class //! Computes some property on one blob of the class
double GetNumber( int indexblob, funcio_calculBlob *evaluador ) const; double GetNumber( int indexblob, funcio_calculBlob *evaluador ) const;
//! Retorna aquells blobs que compleixen les condicions del filtre en el destination //! Retorna aquells blobs que compleixen les condicions del filtre en el destination
//! Filters the blobs of the class using some property //! Filters the blobs of the class using some property
void Filter(CBlobResult &dst, void Filter(CBlobResult &dst,
int filterAction, funcio_calculBlob *evaluador, int filterAction, funcio_calculBlob *evaluador,
int condition, double lowLimit, double highLimit = 0 ); int condition, double lowLimit, double highLimit = 0 );
void Filter(CBlobResult &dst, void Filter(CBlobResult &dst,
int filterAction, funcio_calculBlob *evaluador, int filterAction, funcio_calculBlob *evaluador,
int condition, double lowLimit, double highLimit = 0 ) const; int condition, double lowLimit, double highLimit = 0 ) const;
//! Retorna l'enèssim blob segons un determinat criteri //! Retorna l'enèssim blob segons un determinat criteri
//! Sorts the blobs of the class acording to some criteria and returns the n-th blob //! Sorts the blobs of the class acording to some criteria and returns the n-th blob
void GetNthBlob( funcio_calculBlob *criteri, int nBlob, CBlob &dst ) const; void GetNthBlob( funcio_calculBlob *criteri, int nBlob, CBlob &dst ) const;
//! Retorna el blob enèssim //! Retorna el blob enèssim
//! Gets the n-th blob of the class ( without sorting ) //! Gets the n-th blob of the class ( without sorting )
CBlob GetBlob(int indexblob) const; CBlob GetBlob(int indexblob) const;
CBlob *GetBlob(int indexblob); CBlob *GetBlob(int indexblob);
//! Elimina tots els blobs de l'objecte //! Elimina tots els blobs de l'objecte
//! Clears all the blobs of the class //! Clears all the blobs of the class
void ClearBlobs(); void ClearBlobs();
//! Escriu els blobs a un fitxer //! Escriu els blobs a un fitxer
//! Prints some features of all the blobs in a file //! Prints some features of all the blobs in a file
void PrintBlobs( char *nom_fitxer ) const; void PrintBlobs( char *nom_fitxer ) const;
//Metodes GET/SET //Metodes GET/SET
//! Retorna el total de blobs //! Retorna el total de blobs
//! Gets the total number of blobs //! Gets the total number of blobs
int GetNumBlobs() const int GetNumBlobs() const
{ {
return(m_blobs.size()); return(m_blobs.size());
} }
private: private:
//! Funció per gestionar els errors //! Funció per gestionar els errors
//! Function to manage the errors //! Function to manage the errors
void RaiseError(const int errorCode) const; void RaiseError(const int errorCode) const;
//! Does the Filter method job //! Does the Filter method job
void DoFilter(CBlobResult &dst, void DoFilter(CBlobResult &dst,
int filterAction, funcio_calculBlob *evaluador, int filterAction, funcio_calculBlob *evaluador,
int condition, double lowLimit, double highLimit = 0) const; int condition, double lowLimit, double highLimit = 0) const;
protected: protected:
//! Vector amb els blobs //! Vector amb els blobs
//! Vector with all the blobs //! Vector with all the blobs
Blob_vector m_blobs; Blob_vector m_blobs;
}; };
#endif // !defined(_CLASSE_BLOBRESULT_INCLUDED) #endif // !defined(_CLASSE_BLOBRESULT_INCLUDED)

View file

@ -1,30 +1,30 @@
#if !defined(_COMPONENT_LABELING_H_INCLUDED) #if !defined(_COMPONENT_LABELING_H_INCLUDED)
#define _CLASSE_BLOBRESULT_INCLUDED #define _CLASSE_BLOBRESULT_INCLUDED
#include "vector" #include "vector"
#include "BlobContour.h" #include "BlobContour.h"
#include "blob.h" #include "blob.h"
//! definició de que es un vector de blobs //! definició de que es un vector de blobs
typedef std::vector<CBlob*> Blob_vector; typedef std::vector<CBlob*> Blob_vector;
bool ComponentLabeling( IplImage* inputImage, bool ComponentLabeling( IplImage* inputImage,
IplImage* maskImage, IplImage* maskImage,
unsigned char backgroundColor, unsigned char backgroundColor,
Blob_vector &blobs ); Blob_vector &blobs );
void contourTracing( IplImage *image, IplImage *mask, CvPoint contourStart, t_labelType *labels, void contourTracing( IplImage *image, IplImage *mask, CvPoint contourStart, t_labelType *labels,
bool *visitedPoints, t_labelType label, bool *visitedPoints, t_labelType label,
bool internalContour, unsigned char backgroundColor, bool internalContour, unsigned char backgroundColor,
CBlobContour *currentBlobContour ); CBlobContour *currentBlobContour );
CvPoint tracer( IplImage *image, IplImage *mask, CvPoint P, bool *visitedPoints, CvPoint tracer( IplImage *image, IplImage *mask, CvPoint P, bool *visitedPoints,
short initialMovement, short initialMovement,
unsigned char backgroundColor, short &movement ); unsigned char backgroundColor, short &movement );
#endif //!_CLASSE_BLOBRESULT_INCLUDED #endif //!_CLASSE_BLOBRESULT_INCLUDED

View file

@ -1,172 +1,172 @@
/************************************************************************ /************************************************************************
Blob.h Blob.h
FUNCIONALITAT: Definició de la classe CBlob FUNCIONALITAT: Definició de la classe CBlob
AUTOR: Inspecta S.L. AUTOR: Inspecta S.L.
MODIFICACIONS (Modificació, Autor, Data): MODIFICACIONS (Modificació, Autor, Data):
FUNCTIONALITY: Definition of the CBlob class and some helper classes to perform FUNCTIONALITY: Definition of the CBlob class and some helper classes to perform
some calculations on it some calculations on it
AUTHOR: Inspecta S.L. AUTHOR: Inspecta S.L.
MODIFICATIONS (Modification, Author, Date): MODIFICATIONS (Modification, Author, Date):
**************************************************************************/ **************************************************************************/
//! Disable warnings referred to 255 character truncation for the std:map //! Disable warnings referred to 255 character truncation for the std:map
#pragma warning( disable : 4786 ) #pragma warning( disable : 4786 )
#ifndef CBLOB_INSPECTA_INCLUDED #ifndef CBLOB_INSPECTA_INCLUDED
#define CBLOB_INSPECTA_INCLUDED #define CBLOB_INSPECTA_INCLUDED
#include <opencv/cxcore.h> #include <opencv/cxcore.h>
#include "BlobLibraryConfiguration.h" #include "BlobLibraryConfiguration.h"
#include "BlobContour.h" #include "BlobContour.h"
#ifdef BLOB_OBJECT_FACTORY #ifdef BLOB_OBJECT_FACTORY
//! Object factory pattern implementation //! Object factory pattern implementation
#include "..\inspecta\DesignPatterns\ObjectFactory.h" #include "..\inspecta\DesignPatterns\ObjectFactory.h"
#endif #endif
//! Type of labelled images //! Type of labelled images
typedef unsigned int t_labelType; typedef unsigned int t_labelType;
//! Blob class //! Blob class
class CBlob class CBlob
{ {
typedef std::list<CBlobContour> t_contourList; typedef std::list<CBlobContour> t_contourList;
public: public:
CBlob(); CBlob();
CBlob( t_labelType id, CvPoint startPoint, CvSize originalImageSize ); CBlob( t_labelType id, CvPoint startPoint, CvSize originalImageSize );
~CBlob(); ~CBlob();
//! Copy constructor //! Copy constructor
CBlob( const CBlob &src ); CBlob( const CBlob &src );
CBlob( const CBlob *src ); CBlob( const CBlob *src );
//! Operador d'assignació //! Operador d'assignació
//! Assigment operator //! Assigment operator
CBlob& operator=(const CBlob &src ); CBlob& operator=(const CBlob &src );
//! Adds a new internal contour to the blob //! Adds a new internal contour to the blob
void AddInternalContour( const CBlobContour &newContour ); void AddInternalContour( const CBlobContour &newContour );
//! Retrieves contour in Freeman's chain code //! Retrieves contour in Freeman's chain code
CBlobContour *GetExternalContour() CBlobContour *GetExternalContour()
{ {
return &m_externalContour; return &m_externalContour;
} }
//! Retrieves blob storage //! Retrieves blob storage
CvMemStorage *GetStorage() CvMemStorage *GetStorage()
{ {
return m_storage; return m_storage;
} }
//! Get label ID //! Get label ID
t_labelType GetID() t_labelType GetID()
{ {
return m_id; return m_id;
} }
//! > 0 for extern blobs, 0 if not //! > 0 for extern blobs, 0 if not
int Exterior( IplImage *mask, bool xBorder = true, bool yBorder = true ); int Exterior( IplImage *mask, bool xBorder = true, bool yBorder = true );
//! Compute blob's area //! Compute blob's area
double Area(); double Area();
//! Compute blob's perimeter //! Compute blob's perimeter
double Perimeter(); double Perimeter();
//! Compute blob's moment (p,q up to MAX_CALCULATED_MOMENTS) //! Compute blob's moment (p,q up to MAX_CALCULATED_MOMENTS)
double Moment(int p, int q); double Moment(int p, int q);
//! Compute extern perimeter //! Compute extern perimeter
double ExternPerimeter( IplImage *mask, bool xBorder = true, bool yBorder = true ); double ExternPerimeter( IplImage *mask, bool xBorder = true, bool yBorder = true );
//! Get mean grey color //! Get mean grey color
double Mean( IplImage *image ); double Mean( IplImage *image );
//! Get standard deviation grey color //! Get standard deviation grey color
double StdDev( IplImage *image ); double StdDev( IplImage *image );
//! Indica si el blob està buit ( no té cap info associada ) //! Indica si el blob està buit ( no té cap info associada )
//! Shows if the blob has associated information //! Shows if the blob has associated information
bool IsEmpty(); bool IsEmpty();
//! Retorna el poligon convex del blob //! Retorna el poligon convex del blob
//! Calculates the convex hull of the blob //! Calculates the convex hull of the blob
t_PointList GetConvexHull(); t_PointList GetConvexHull();
//! Pinta l'interior d'un blob d'un color determinat //! Pinta l'interior d'un blob d'un color determinat
//! Paints the blob in an image //! Paints the blob in an image
void FillBlob( IplImage *imatge, CvScalar color, int offsetX = 0, int offsetY = 0 ); void FillBlob( IplImage *imatge, CvScalar color, int offsetX = 0, int offsetY = 0 );
//! Join a blob to current one (add's contour //! Join a blob to current one (add's contour
void JoinBlob( CBlob *blob ); void JoinBlob( CBlob *blob );
//! Get bounding box //! Get bounding box
CvRect GetBoundingBox(); CvRect GetBoundingBox();
//! Get bounding ellipse //! Get bounding ellipse
CvBox2D GetEllipse(); CvBox2D GetEllipse();
//! Minimun X //! Minimun X
double MinX() double MinX()
{ {
return GetBoundingBox().x; return GetBoundingBox().x;
} }
//! Minimun Y //! Minimun Y
double MinY() double MinY()
{ {
return GetBoundingBox().y; return GetBoundingBox().y;
} }
//! Maximun X //! Maximun X
double MaxX() double MaxX()
{ {
return GetBoundingBox().x + GetBoundingBox().width; return GetBoundingBox().x + GetBoundingBox().width;
} }
//! Maximun Y //! Maximun Y
double MaxY() double MaxY()
{ {
return GetBoundingBox().y + GetBoundingBox().height; return GetBoundingBox().y + GetBoundingBox().height;
} }
private: private:
//! Deallocates all contours //! Deallocates all contours
void ClearContours(); void ClearContours();
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Blob contours // Blob contours
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//! Contour storage memory //! Contour storage memory
CvMemStorage *m_storage; CvMemStorage *m_storage;
//! External contour of the blob (crack codes) //! External contour of the blob (crack codes)
CBlobContour m_externalContour; CBlobContour m_externalContour;
//! Internal contours (crack codes) //! Internal contours (crack codes)
t_contourList m_internalContours; t_contourList m_internalContours;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Blob features // Blob features
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//! Label number //! Label number
t_labelType m_id; t_labelType m_id;
//! Area //! Area
double m_area; double m_area;
//! Perimeter //! Perimeter
double m_perimeter; double m_perimeter;
//! Extern perimeter from blob //! Extern perimeter from blob
double m_externPerimeter; double m_externPerimeter;
//! Mean gray color //! Mean gray color
double m_meanGray; double m_meanGray;
//! Standard deviation from gray color blob distribution //! Standard deviation from gray color blob distribution
double m_stdDevGray; double m_stdDevGray;
//! Bounding box //! Bounding box
CvRect m_boundingBox; CvRect m_boundingBox;
//! Bounding ellipse //! Bounding ellipse
CvBox2D m_ellipse; CvBox2D m_ellipse;
//! Sizes from image where blob is extracted //! Sizes from image where blob is extracted
CvSize m_originalImageSize; CvSize m_originalImageSize;
}; };
#endif //CBLOB_INSPECTA_INCLUDED #endif //CBLOB_INSPECTA_INCLUDED

View file

@ -43,8 +43,8 @@
#ifndef __OPENCV_CALIB3D_HPP__ #ifndef __OPENCV_CALIB3D_HPP__
#define __OPENCV_CALIB3D_HPP__ #define __OPENCV_CALIB3D_HPP__
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/features2d/features2d.hpp" #include "OpenCV/Headers/features2d/features2d.hpp"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View file

@ -43,10 +43,10 @@
#ifndef __OPENCV_CONTRIB_HPP__ #ifndef __OPENCV_CONTRIB_HPP__
#define __OPENCV_CONTRIB_HPP__ #define __OPENCV_CONTRIB_HPP__
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "OpenCV/Headers/imgproc/imgproc.hpp"
#include "opencv2/features2d/features2d.hpp" #include "OpenCV/Headers/features2d/features2d.hpp"
#include "opencv2/objdetect/objdetect.hpp" #include "OpenCV/Headers/objdetect/objdetect.hpp"
#ifdef __cplusplus #ifdef __cplusplus
@ -976,9 +976,9 @@ namespace cv
CV_EXPORTS bool initModule_contrib(); CV_EXPORTS bool initModule_contrib();
} }
#include "opencv2/contrib/retina.hpp" #include "OpenCV/Headers/contrib/retina.hpp"
#include "opencv2/contrib/openfabmap.hpp" #include "OpenCV/Headers/contrib/openfabmap.hpp"
#endif #endif

View file

@ -43,12 +43,12 @@
#ifndef __OPENCV_HYBRIDTRACKER_H_ #ifndef __OPENCV_HYBRIDTRACKER_H_
#define __OPENCV_HYBRIDTRACKER_H_ #define __OPENCV_HYBRIDTRACKER_H_
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/core/operations.hpp" #include "OpenCV/Headers/core/operations.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "OpenCV/Headers/imgproc/imgproc.hpp"
#include "opencv2/features2d/features2d.hpp" #include "OpenCV/Headers/features2d/features2d.hpp"
#include "opencv2/video/tracking.hpp" #include "OpenCV/Headers/video/tracking.hpp"
#include "opencv2/ml/ml.hpp" #include "OpenCV/Headers/ml/ml.hpp"
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -52,8 +52,8 @@
#ifndef __OPENCV_OPENFABMAP_H_ #ifndef __OPENCV_OPENFABMAP_H_
#define __OPENCV_OPENFABMAP_H_ #define __OPENCV_OPENFABMAP_H_
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/features2d/features2d.hpp" #include "OpenCV/Headers/features2d/features2d.hpp"
#include <vector> #include <vector>
#include <list> #include <list>

View file

@ -72,7 +72,7 @@
* Author: Alexandre Benoit * Author: Alexandre Benoit
*/ */
#include "opencv2/core/core.hpp" // for all OpenCV core functionalities access, including cv::Exception support #include "OpenCV/Headers/core/core.hpp" // for all OpenCV core functionalities access, including cv::Exception support
#include <valarray> #include <valarray>
namespace cv namespace cv

View file

@ -46,8 +46,8 @@
#ifndef __OPENCV_CORE_HPP__ #ifndef __OPENCV_CORE_HPP__
#define __OPENCV_CORE_HPP__ #define __OPENCV_CORE_HPP__
#include "opencv2/core/types_c.h" #include "OpenCV/Headers/core/types_c.h"
#include "opencv2/core/version.hpp" #include "OpenCV/Headers/core/version.hpp"
#ifdef __cplusplus #ifdef __cplusplus
@ -4732,7 +4732,7 @@ protected:
#endif // __cplusplus #endif // __cplusplus
#include "opencv2/core/operations.hpp" #include "OpenCV/Headers/core/operations.hpp"
#include "opencv2/core/mat.hpp" #include "OpenCV/Headers/core/mat.hpp"
#endif /*__OPENCV_CORE_HPP__*/ #endif /*__OPENCV_CORE_HPP__*/

View file

@ -44,7 +44,7 @@
#ifndef __OPENCV_CORE_C_H__ #ifndef __OPENCV_CORE_C_H__
#define __OPENCV_CORE_C_H__ #define __OPENCV_CORE_C_H__
#include "opencv2/core/types_c.h" #include "OpenCV/Headers/core/types_c.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View file

@ -40,4 +40,4 @@
// //
//M*/ //M*/
#include "opencv2/core/cuda_devptrs.hpp" #include "OpenCV/Headers/core/cuda_devptrs.hpp"

View file

@ -45,8 +45,8 @@
#ifdef __cplusplus #ifdef __cplusplus
#include "opencv2/core/core_c.h" #include "OpenCV/Headers/core/core_c.h"
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#if defined _MSC_VER && _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4714 ) //__forceinline is not inlined #pragma warning( disable: 4714 ) //__forceinline is not inlined

View file

@ -45,8 +45,8 @@
#ifdef __cplusplus #ifdef __cplusplus
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/core/cuda_devptrs.hpp" #include "OpenCV/Headers/core/cuda_devptrs.hpp"
namespace cv { namespace gpu namespace cv { namespace gpu
{ {

View file

@ -181,7 +181,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
# pragma GCC diagnostic ignored "-Wshadow" # pragma GCC diagnostic ignored "-Wshadow"
# endif # endif
# include <Eigen/Core> # include <Eigen/Core>
# include "opencv2/core/eigen.hpp" # include "OpenCV/Headers/core/eigen.hpp"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -45,7 +45,7 @@
#ifdef __cplusplus #ifdef __cplusplus
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
namespace cv namespace cv
{ {

View file

@ -100,7 +100,7 @@
#ifndef __OPENCV_CORE_WIMAGE_HPP__ #ifndef __OPENCV_CORE_WIMAGE_HPP__
#define __OPENCV_CORE_WIMAGE_HPP__ #define __OPENCV_CORE_WIMAGE_HPP__
#include "opencv2/core/core_c.h" #include "OpenCV/Headers/core/core_c.h"
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -43,8 +43,8 @@
#ifndef __OPENCV_FEATURES_2D_HPP__ #ifndef __OPENCV_FEATURES_2D_HPP__
#define __OPENCV_FEATURES_2D_HPP__ #define __OPENCV_FEATURES_2D_HPP__
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/flann/miniflann.hpp" #include "OpenCV/Headers/flann/miniflann.hpp"
#ifdef __cplusplus #ifdef __cplusplus
#include <limits> #include <limits>

View file

@ -45,10 +45,10 @@
#ifdef __cplusplus #ifdef __cplusplus
#include "opencv2/core/types_c.h" #include "OpenCV/Headers/core/types_c.h"
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/flann/flann_base.hpp" #include "OpenCV/Headers/flann/flann_base.hpp"
#include "opencv2/flann/miniflann.hpp" #include "OpenCV/Headers/flann/miniflann.hpp"
namespace cvflann namespace cvflann
{ {

View file

@ -45,8 +45,8 @@
#ifdef __cplusplus #ifdef __cplusplus
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/flann/defines.h" #include "OpenCV/Headers/flann/defines.h"
namespace cv namespace cv
{ {

View file

@ -44,7 +44,7 @@
#define __OPENCV_GPU_COMMON_HPP__ #define __OPENCV_GPU_COMMON_HPP__
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include "opencv2/core/cuda_devptrs.hpp" #include "OpenCV/Headers/core/cuda_devptrs.hpp"
#ifndef CV_PI #ifndef CV_PI
#define CV_PI 3.1415926535897932384626433832795 #define CV_PI 3.1415926535897932384626433832795

View file

@ -40,4 +40,4 @@
// //
//M*/ //M*/
#include "opencv2/core/cuda_devptrs.hpp" #include "OpenCV/Headers/core/cuda_devptrs.hpp"

View file

@ -49,10 +49,10 @@
#include <iosfwd> #include <iosfwd>
#endif #endif
#include "opencv2/core/gpumat.hpp" #include "OpenCV/Headers/core/gpumat.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "OpenCV/Headers/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp" #include "OpenCV/Headers/objdetect/objdetect.hpp"
#include "opencv2/features2d/features2d.hpp" #include "OpenCV/Headers/features2d/features2d.hpp"
namespace cv { namespace gpu { namespace cv { namespace gpu {

View file

@ -40,4 +40,4 @@
// //
//M*/ //M*/
#include "opencv2/core/gpumat.hpp" #include "OpenCV/Headers/core/gpumat.hpp"

View file

@ -43,7 +43,7 @@
#ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__ #ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__
#define __OPENCV_GPU_STREAM_ACCESSOR_HPP__ #define __OPENCV_GPU_STREAM_ACCESSOR_HPP__
#include "opencv2/gpu/gpu.hpp" #include "OpenCV/Headers/gpu/gpu.hpp"
#include "cuda_runtime_api.h" #include "cuda_runtime_api.h"
namespace cv namespace cv

View file

@ -32,7 +32,7 @@
#import <Accelerate/Accelerate.h> #import <Accelerate/Accelerate.h>
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <ImageIO/ImageIO.h> #import <ImageIO/ImageIO.h>
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
/////////////////////////////////////// CvAbstractCamera ///////////////////////////////////// /////////////////////////////////////// CvAbstractCamera /////////////////////////////////////

View file

@ -43,8 +43,8 @@
#ifndef __OPENCV_HIGHGUI_HPP__ #ifndef __OPENCV_HIGHGUI_HPP__
#define __OPENCV_HIGHGUI_HPP__ #define __OPENCV_HIGHGUI_HPP__
#include "opencv2/core/core.hpp" #include "OpenCV/Headers/core/core.hpp"
#include "opencv2/highgui/highgui_c.h" #include "OpenCV/Headers/highgui/highgui_c.h"
#ifdef __cplusplus #ifdef __cplusplus

Some files were not shown because too many files have changed in this diff Show more