Celeste.cpp File Reference

#include <iostream>
#include <vigra/stdimage.hxx>
#include <vigra/resizeimage.hxx>
#include <vigra/inspectimage.hxx>
#include <vigra/copyimage.hxx>
#include <vigra/transformimage.hxx>
#include <vigra/initimage.hxx>
#include "vigra/colorconversions.hxx"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include "Gabor.h"
#include "Utilities.h"
#include "CelesteGlobals.h"
#include "Celeste.h"
#include "svm.h"
#include <stdio.h>

Include dependency graph for Celeste.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  celeste
namespace  std

Typedefs

typedef vigra::BRGBImage::PixelType RGB

Functions

bool loadSVMmodel (struct svm_model *&model, string &model_file)
 loads the SVM model from file
void destroySVMmodel (struct svm_model *&model)
 frees the resource of model
void prepareCelesteImage (vigra::UInt16RGBImage &rgb, vigra::UInt16RGBImage &luv, int &resize_dimension, double &sizefactor, bool verbose)
void prepareGaborImage (vigra::UInt16RGBImage &luv, float **&pixels)
vector< double > classifySVM (struct svm_model *model, int gNumLocs, int **&gLocations, int width, int height, int vector_length, float *&response, int gRadius, vigra::UInt16RGBImage &luv, bool needsMoreIndex=false)
void createGrid (int &gNumLocs, int **&gLocations, int gRadius, int width, int height)
void generateMask (vigra::BImage &mask, int &gNumLocs, int **&gLocations, std::vector< double > svm_responses, int gRadius, double threshold)
vigra::BImage getCelesteMask (struct svm_model *model, vigra::UInt16RGBImage &input, int radius, float threshold, int resize_dimension, bool adaptThreshold, bool verbose)
 calculates the mask using SVM
HuginBase::UIntSet getCelesteControlPoints (struct svm_model *model, vigra::UInt16RGBImage &input, HuginBase::CPointVector cps, int radius, float threshold, int resize_dimension, bool verbose)


Typedef Documentation

typedef vigra::BRGBImage::PixelType celeste::RGB
 

Definition at line 47 of file Celeste.cpp.


Function Documentation

vector<double> classifySVM struct svm_model *  model,
int  gNumLocs,
int **&  gLocations,
int  width,
int  height,
int  vector_length,
float *&  response,
int  gRadius,
vigra::UInt16RGBImage &  luv,
bool  needsMoreIndex = false
 

Definition at line 158 of file Celeste.cpp.

References celeste::svm_node::index, celeste::svm_get_nr_class(), celeste::svm_predict_probability(), and celeste::svm_node::value.

Referenced by celeste::getCelesteControlPoints(), and celeste::getCelesteMask().

void createGrid int &  gNumLocs,
int **&  gLocations,
int  gRadius,
int  width,
int  height
 

Definition at line 231 of file Celeste.cpp.

References celeste::CreateMatrix().

Referenced by celeste::getCelesteMask().

CELESTEIMPEX void celeste::destroySVMmodel struct svm_model *&  model  ) 
 

frees the resource of model

Parameters:
model SVM model struct to freeing

Definition at line 65 of file Celeste.cpp.

References celeste::svm_destroy_model().

Referenced by main(), PanoDetector::run(), and MainFrame::~MainFrame().

void generateMask vigra::BImage &  mask,
int &  gNumLocs,
int **&  gLocations,
std::vector< double >  svm_responses,
int  gRadius,
double  threshold
 

Definition at line 287 of file Celeste.cpp.

Referenced by celeste::getCelesteMask().

CELESTEIMPEX HuginBase::UIntSet celeste::getCelesteControlPoints struct svm_model *  model,
vigra::UInt16RGBImage &  input,
HuginBase::CPointVector  cps,
int  radius,
float  threshold,
int  resize_dimension,
bool  verbose = true
 

Definition at line 360 of file Celeste.cpp.

References celeste::classifySVM(), celeste::CreateMatrix(), celeste::DisposeMatrix(), celeste::prepareCelesteImage(), celeste::prepareGaborImage(), celeste::ProcessChannel(), HuginBase::ControlPoint::x1, and HuginBase::ControlPoint::y1.

Referenced by PanoOperation::CelesteOperation::GetInternalCommand(), main(), and CPEditorPanel::OnCelesteButton().

CELESTEIMPEX vigra::BImage celeste::getCelesteMask struct svm_model *  model,
vigra::UInt16RGBImage &  input,
int  radius,
float  threshold,
int  resize_dimension,
bool  adaptThreshold = false,
bool  verbose = true
 

calculates the mask using SVM

Parameters:
model struct svm_model which is used
input input image
radius radius for calculation of mask, smaller value results in higher resolution but longer calculation time
threshold thresold value, lower value will reject more values
resize_dimension the image is resized for calculation that the bigger dimension is small than resize_dimension
adaptThreshold if true then the threshold is changed, if the all values are higher than threshold
Returns:
vigra::BImage, which contains the masks

Definition at line 310 of file Celeste.cpp.

References celeste::classifySVM(), celeste::createGrid(), vigra_ext::destImageRange(), celeste::DisposeMatrix(), celeste::generateMask(), celeste::min(), celeste::prepareCelesteImage(), celeste::prepareGaborImage(), celeste::ProcessChannel(), vigra_ext::srcImageRange(), and threshold().

Referenced by PanoDetector::AnalyzeImage(), and main().

CELESTEIMPEX bool celeste::loadSVMmodel struct svm_model *&  model,
string model_file
 

loads the SVM model from file

Parameters:
model struct, which stores the SVM informations, if you don't need it, call destroySVMmodel
model_file filename of model file to load
Returns:
true, if loading of SVM file was sucessfull

Definition at line 50 of file Celeste.cpp.

References cout, and celeste::svm_load_model().

Referenced by MainFrame::GetSVMModel(), PanoDetector::LoadSVMModel(), and main().

void prepareCelesteImage vigra::UInt16RGBImage &  rgb,
vigra::UInt16RGBImage &  luv,
int &  resize_dimension,
double &  sizefactor,
bool  verbose
 

Definition at line 71 of file Celeste.cpp.

References cout, vigra_ext::destImage(), vigra_ext::destImageRange(), vigra_ext::srcImageRange(), and vigra_ext::transformImage().

Referenced by celeste::getCelesteControlPoints(), and celeste::getCelesteMask().

void prepareGaborImage vigra::UInt16RGBImage &  luv,
float **&  pixels
 

Definition at line 143 of file Celeste.cpp.

References celeste::CreateMatrix().

Referenced by celeste::getCelesteControlPoints(), and celeste::getCelesteMask().


Generated on Wed Jul 16 01:25:39 2014 for Hugintrunk by  doxygen 1.3.9.1