Hugin trunk 0.1
Loading...
Searching...
No Matches
Utilities.h
Go to the documentation of this file.
1/* Import from Gabor API
2
3Copyright (c) 2002-3 Adriaan Tijsseling
4
5
6 All Rights Reserved
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22/*
23 Author: Adriaan Tijsseling (AGT)
24 Copyright: (c) Copyright 2002-3 Adriaan Tijsseling. All rights reserved.
25 Description: Probably useful...
26*/
27
28#ifndef __UTILITIES__
29#define __UTILITIES__
30
31#include <fstream>
32#include <iostream>
33#include <stdio.h>
34#ifdef _WIN32
35#include "direct.h"
36#else
37#include <unistd.h>
38#endif
39
40namespace celeste
41{
42enum
43{
44 kLeft = 0,
45 kRight
46};
47
48void Permute( int* array, size_t size );
49int cmp(const void *s1, const void *s2); // for qsort() function
50
51float Heavyside( float a );
52
53float Sigmoid( float act );
54float Sigmoid( float beta, float a_pot );
55float Sigmoid( float beta, float a_pot, float thresh );
56
57int **CreateMatrix( int val, int row, int col );
58void ResetMatrix( int ** matrix, int val, int row, int col );
59void DisposeMatrix( int** matrix, int row );
60
61float **CreateMatrix( float val, int row, int col );
62void ResetMatrix( float ** matrix, float val, int row, int col );
63void DisposeMatrix( float** matrix, int row );
64
65float ReturnDistance( float *pat1, float *pat2, int size );
66
67void GetStreamDefaults( void );
68void AdjustStream( std::ostream &os, int precision, int width, int pos, bool trailers );
69void SetStreamDefaults( std::ostream &os );
70
71void SkipComments( std::ifstream* infile );
72void FileCreateError( char* filename );
73void FileOpenError( char* filename );
74
75double SafeAbs( double val1, double val2 );
76float SafeAbs( float val1, float val2 );
77int SafeAbs( int val1, int val2 );
78double SafeAbs( double val );
79float SafeAbs( float val );
80int SafeAbs( int val );
81}; // namespace
82#endif
83
void DisposeMatrix(int **matrix, int row)
void FileCreateError(char *filename)
double SafeAbs(double val1, double val2)
void AdjustStream(std::ostream &os, int precision, int width, int pos, bool trailers)
float Heavyside(float a)
Definition Utilities.cpp:75
int ** CreateMatrix(int val, int row, int col)
float ReturnDistance(float *pat1, float *pat2, int size)
int cmp(const void *s1, const void *s2)
Definition Utilities.cpp:66
float Sigmoid(float act)
Definition Utilities.cpp:82
void ResetMatrix(int **matrix, int val, int row, int col)
void SkipComments(std::ifstream *infile)
void FileOpenError(char *filename)
void GetStreamDefaults(void)
void Permute(int *array, size_t size)
Definition Utilities.cpp:46
void SetStreamDefaults(std::ostream &os)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41