You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#include "BlobProperties.h"
/**
- FUNCI�: GetPerimeter- FUNCIONALITAT: Get perimeter from chain code. Diagonals sum sqrt(2) and horizontal and vertical codes 1- PAR�METRES: - - RESULTAT: - - RESTRICCIONS: - - AUTOR: rborras- DATA DE CREACI�: 2008/04/30- MODIFICACI�: Data. Autor. Descripci�.- NOTA: Algorithm derived from "Methods to estimate area and perimeters of blob-like objects: A comparison", L.Yang*/#define SQRT2 1.414213562
/**
- FUNCI�: GetPerimeter- FUNCIONALITAT: Get blob area, ie. external contour area minus internal contours area- PAR�METRES: - - RESULTAT: - - RESTRICCIONS: - - AUTOR: rborras- DATA DE CREACI�: 2008/04/30- MODIFICACI�: Data. Autor. Descripci�.*/float CBlobProperties::GetArea(){ float area; t_contourList::iterator itContour;
area = m_externalContour.GetArea();
itContour = m_internalContours.begin(); while (itContour != m_internalContours.end() ) { area += (*itContour).GetArea(); itContour++; } return area;}
/**
- FUNCI�: GetPerimeter- FUNCIONALITAT: Get blob perimeter, ie. sum of the lenght of all the contours- PAR�METRES: - - RESULTAT: - - RESTRICCIONS: - - AUTOR: rborras- DATA DE CREACI�: 2008/04/30- MODIFICACI�: Data. Autor. Descripci�.*/float CBlobProperties::GetPerimeter(){ float perimeter; t_contourList::iterator itContour;
perimeter = m_externalContour.GetPerimeter();
itContour = m_internalContours.begin(); while (itContour != m_internalContours.end() ) { perimeter += (*itContour).GetPerimeter(); itContour++; } return perimeter;}
|