// -*- c-basic-offset: 4 -*- /** @file FindLines.h * * @brief declaration of functions for finding lines * */ /*************************************************************************** * Copyright (C) 2009 by Tim Nugent * * timnugent@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef FINDLINES_H #define FINDLINES_H #include #include "LinesTypes.h" #include "vigra/stdimage.hxx" #include "panodata/Panorama.h" namespace HuginLines { /** detect and mark edges in an edge image using Canny's algorithm * @param input input image, on which the algorithm should run * @param scale scale factor in pixel (precondition: scale > 0) * @param threshold threshold for edge detection algorithm (precondition: threshold > 0) * @param resize_dimension maximum dimension on which the algorithm should work * @param size_factor contains the scale factor for transform from edge image to input image * @return image with the marked edges */ LINESIMPEX vigra::BImage* detectEdges(vigra::UInt8RGBImage input,double scale,double threshold,unsigned int resize_dimension, double &size_factor); /** @brief find straightish non-crossing lines * find straightish non-crossing lines in an edge map * using 8-neighborhood operations. (Points on the edges * of the image cannot be line points). * @param edge edge image (e.g. created with HuginLines::detectEdges * @param length_threshold minimum length of a line, given in ratio to longest images dimension (0=3, line 1 and 2 are horizontal and vertical lines) * @param numberOfCtrlPoints number of control points to create * @return HuginBase::CPVector with all control points */ LINESIMPEX HuginBase::CPVector GetControlPoints(const SingleLine line,const unsigned int imgNr, const unsigned int lineNr,const unsigned int numberOfCtrlPoints); /** searches for vertical control points in given image * @param pano panorama object in which is searched * @param imgNr number of image in which should be searched * @param image vigra image in which should be searched * @param nrLine maximal number of lines to return * @return HuginBase::CPVector with all vertical control points */ LINESIMPEX HuginBase::CPVector GetVerticalLines(const HuginBase::Panorama& pano,const unsigned int imgNr,vigra::UInt8RGBImage& image,const unsigned int nrLines); }; #endif