OptimizedFunctionsList.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // This file is part of the Integrating Vision Toolkit (IVT).
3 //
4 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
5 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
6 //
7 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
8 // All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // 3. Neither the name of the KIT nor the names of its contributors may be
21 // used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
25 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
28 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // ****************************************************************************
35 // ****************************************************************************
36 // Filename: OptimizedFunctionsList.h
37 // Author: Florian Hecht
38 // Date: 2008
39 // ****************************************************************************
40 // Changes: Pedram Azad: added new functions
41 // ****************************************************************************
42 
43 
44 // ****************************************************************************
45 // Includes
46 // ****************************************************************************
47 
48 #include "Structs/Structs.h"
49 
50 
51 // ****************************************************************************
52 // Forward declarations
53 // ****************************************************************************
54 
55 class CByteImage;
56 class CShortImage;
57 class CIntImage;
58 struct Vec2d;
59 
60 
61 
62 // ****************************************************************************
63 // Macros
64 // ****************************************************************************
65 
66 // GaussianSmooth3x3
67 DECLARE_OPTIMIZED_FUNCTION_2(GaussianSmooth3x3, const CByteImage *pInputImage, CByteImage *pOutputImage)
68 
69 // GaussianSmooth3x3
70 DECLARE_OPTIMIZED_FUNCTION_2(GaussianSmooth5x5, const CByteImage *pInputImage, CByteImage *pOutputImage)
71 
72 // Prewitt filters
73 DECLARE_OPTIMIZED_FUNCTION_3(PrewittX, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
74 DECLARE_OPTIMIZED_FUNCTION_3(PrewittY, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
76 
77 // Sobel filters
78 DECLARE_OPTIMIZED_FUNCTION_3(SobelX, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
79 DECLARE_OPTIMIZED_FUNCTION_3(SobelY, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
81 
82 // Laplace filters
83 DECLARE_OPTIMIZED_FUNCTION_3(Laplace1, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
84 DECLARE_OPTIMIZED_FUNCTION_3(Laplace2, const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue)
85 
86 // Canny
87 DECLARE_OPTIMIZED_FUNCTION_4(Canny, const CByteImage *pInputImage, CByteImage *pOutputImage, int nLowThreshold, int nHighThreshold)
88 DECLARE_OPTIMIZED_FUNCTION_5(CannyList, const CByteImage *pInputImage, CVec2dArray &resultPoints, CVec2dArray &resultDirections, int nLowThreshold, int nHighThreshold)
89 
90 // Morphological filters
91 DECLARE_OPTIMIZED_FUNCTION_2(Erode3x3, const CByteImage *pInputImage, CByteImage *pOutputImage)
92 DECLARE_OPTIMIZED_FUNCTION_2(Dilate3x3, const CByteImage *pInputImage, CByteImage *pOutputImage)
93 
94 // Point operators
95 DECLARE_OPTIMIZED_FUNCTION_3(ThresholdBinarize, const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
96 DECLARE_OPTIMIZED_FUNCTION_3(ThresholdBinarizeInverse, const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
97 DECLARE_OPTIMIZED_FUNCTION_3(ThresholdFilter, const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
98 DECLARE_OPTIMIZED_FUNCTION_3(ThresholdFilterInverse, const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
99 DECLARE_OPTIMIZED_FUNCTION_2(CalculateHSVImage, const CByteImage *pInputImage, CByteImage *pOutputImage)
100 DECLARE_OPTIMIZED_FUNCTION_4(ApplyAffinePointOperation, const CByteImage *pInputImage, CByteImage *pOutputImage, float a, float b)
101 DECLARE_OPTIMIZED_FUNCTION_3(Amplify, const CByteImage *pInputImage, CByteImage *pOutputImage, float fFactor)
102 DECLARE_OPTIMIZED_FUNCTION_2(Invert, const CByteImage *pInputImage, CByteImage *pOutputImage)
103 DECLARE_OPTIMIZED_FUNCTION_8(FilterHSV2, const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char min_hue, unsigned int max_hue, unsigned int min_sat, unsigned int max_sat, unsigned int min_v, unsigned int max_v)
104 
105 // Logical operators
106 DECLARE_OPTIMIZED_FUNCTION_3(Or, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
107 DECLARE_OPTIMIZED_FUNCTION_3(Xor, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
108 DECLARE_OPTIMIZED_FUNCTION_3(And, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
109 
110 // Arithmetic operators
111 DECLARE_OPTIMIZED_FUNCTION_3(Add, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
112 DECLARE_OPTIMIZED_FUNCTION_3(AddWithSaturation, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
113 DECLARE_OPTIMIZED_FUNCTION_3(Subtract, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
114 DECLARE_OPTIMIZED_FUNCTION_3(SubtractWithSaturation, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
115 DECLARE_OPTIMIZED_FUNCTION_3(AbsoluteDifference, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
116 DECLARE_OPTIMIZED_FUNCTION_3(Average, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
117 DECLARE_OPTIMIZED_FUNCTION_3(Max, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
118 DECLARE_OPTIMIZED_FUNCTION_3(Min, const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
119 
120 // Min / Max
121 DECLARE_OPTIMIZED_FUNCTION_2(MaxValue, const CByteImage *pInputImage, unsigned char &max)
122 DECLARE_OPTIMIZED_FUNCTION_2(MaxValue_Short, const CShortImage *pInputImage, short &max)
123 DECLARE_OPTIMIZED_FUNCTION_2(MaxValue_Int, const CIntImage *pInputImage, int &max)
124 DECLARE_OPTIMIZED_FUNCTION_2(MinValue, const CByteImage *pInputImage, unsigned char &min)
125 DECLARE_OPTIMIZED_FUNCTION_2(MinValue_Short, const CShortImage *pInputImage, short &min)
126 DECLARE_OPTIMIZED_FUNCTION_2(MinValue_Int, const CIntImage *pInputImage, int &min)
127 DECLARE_OPTIMIZED_FUNCTION_3(MinMaxValue, const CByteImage *pInputImage, unsigned char &min, unsigned char &max)
128 DECLARE_OPTIMIZED_FUNCTION_3(MinMaxValue_Short, const CShortImage *pInputImage, short &min, short &max)
129 DECLARE_OPTIMIZED_FUNCTION_3(MinMaxValue_Int, const CIntImage *pInputImage, int &min, int &max)
130 
131 // PixelSum
132 DECLARE_OPTIMIZED_FUNCTION_2(PixelSum, const CByteImage *pImage, unsigned int &resultSum)
133 
134 // Conversion (grayscale, RGB24 (split))
135 DECLARE_OPTIMIZED_FUNCTION_3(ConvertImage, const CByteImage *pInputImage, CByteImage *pOutputImage, bool bFast)
136 
137 // Harris
138 DECLARE_OPTIMIZED_FUNCTION_5_RET(CalculateHarrisInterestPoints, const CByteImage *pInputImage, Vec2d *pInterestPoints, int nMaxPoints, float fQualityLevel, float fMinDistance)
139 
140 // Nearest Neighbor
141 DECLARE_OPTIMIZED_FUNCTION_3(NearestNeighbor_TrainGPU, const float *pData, int nDimension, int nDataSets)
142 DECLARE_OPTIMIZED_FUNCTION_4(NearestNeighbor_ClassifyGPU, const float *pQuery, int nDimension, int &nResult, float &fResultError)
143 DECLARE_OPTIMIZED_FUNCTION_5(NearestNeighbor_ClassifyBundleGPU, const float *pQueries, int nDimension, int nQueries, int *pResults, float *pResultErrors)
144 DECLARE_OPTIMIZED_FUNCTION_0(NearestNeighbor_CleanupGPU)
145 
146 // optimized function for the StereoVision class
147 //DECLARE_OPTIMIZED_FUNCTION_8(StereoVision, const CByteImage *pLeftImage, const CByteImage *pRightImage, CByteImage *pDepthImage, int nWindowSize, int d1, int d2, int d_step, int nErrorThreshold)
unsigned int PixelSum(const CByteImage *pImage)
Returns the sum of all pixel values of a grayscale CByteImage.
unsigned char MaxValue(const CByteImage *pImage)
Returns the maximum value within a grayscale CByteImage.
bool AddWithSaturation(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage...
#define DECLARE_OPTIMIZED_FUNCTION_0(name)
bool MinMaxValue(const CByteImage *pImage, unsigned char &min, unsigned char &max)
Computes the minimum and maximum value within a grayscale CByteImage.
bool ApplyAffinePointOperation(const CByteImage *pInputImage, CByteImage *pOutputImage, float a, float b)
Applies an affine point operation to a CByteImage and writes the result to a CByteImage.
bool CalculateGradientImageSobel(const CByteImage *pInputImage, CByteImage *pOutputImage)
Applies a combined Sobel filter for both x- and y-direction to a CByteImage and stores the result in ...
bool Laplace2(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the Laplace2 operator and writes the result to a CShortImage.
bool Max(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the maximum of the corresponding pixels in two instances of CByteI...
bool ThresholdFilterInverse(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
Performs inverse threhold filtering to a CByteImage and writes the result to a CByteImage.
bool ThresholdFilter(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
Performs threhold filtering to a CByteImage and writes the result to a CByteImage.
bool SobelX(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the SobelX operator and writes the result to a CShortImage.
bool PrewittX(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the PrewittX operator and writes the result to a CShortImage.
#define DECLARE_OPTIMIZED_FUNCTION_8(name, p1, p2, p3, p4, p5, p6, p7, p8)
unsigned char MinValue(const CByteImage *pImage)
Returns the minimum value within a grayscale CByteImage.
bool Invert(const CByteImage *pInputImage, CByteImage *pOutputImage)
Calculates the inverted image of a CByteImage and writes the result to a CByteImage.
bool SobelY(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the SobelY operator and writes the result to a CShortImage.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Definition: ByteImage.h:80
bool CalculateHSVImage(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0)
Computes the HSV image for a RGB CByteImage and writes the result to a CByteImage.
bool Xor(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Applies the bitwise operator XOR to two instance of CByteImage and writes the result to a CByteImage...
bool ConvertImage(const CByteImage *pInputImage, CByteImage *pOutputImage, bool bFast=false, const MyRegion *pROI=0)
Converts a grayscale CByteImage to an RGB CByteImage image and vice versa.
bool ThresholdBinarizeInverse(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
Performs inverse threshold binarization to a CByteImage and writes the result to a CByteImage...
bool SubtractWithSaturation(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances o...
bool Average(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the average of the corresponding pixels in two instances of CByteI...
#define DECLARE_OPTIMIZED_FUNCTION_2(name, p1, p2)
bool AbsoluteDifference(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the absolute value of the difference between the corresponding pix...
#define DECLARE_OPTIMIZED_FUNCTION_5_RET(name, p1, p2, p3, p4, p5)
bool Canny(const CByteImage *pInputImage, CByteImage *pOutputImage, int nLowThreshold, int nHighThreshold)
Applies the Canny edge detector to a CByteImage and writes the result to a CByteImage.
bool Min(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the minimum of the corresponding pixels in two instances of CByteI...
Data structure for the representation of single channel images of the data type signed short...
Definition: ShortImage.h:54
GLubyte GLubyte GLubyte a
Definition: glext.h:5166
bool Subtract(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the difference between the corresponding pixels in two instances o...
bool Amplify(const CByteImage *pInputImage, CByteImage *pOutputImage, float fFactor)
Multiplies each byte value of a CByteImage with a floating point factor and writes the result to a CB...
bool PrewittY(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the PrewittY operator and writes the result to a CShortImage.
bool ThresholdBinarize(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char nThreshold)
Performs threshold binarization to a CByteImage and writes the result to a CByteImage.
GLubyte GLubyte b
Definition: glext.h:5166
static bool Dilate3x3(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI)
bool FilterHSV2(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char min_hue, unsigned char max_hue, unsigned char min_sat, unsigned char max_sat, unsigned char min_v, unsigned char max_v, const MyRegion *pROI=0)
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale...
bool Add(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Sets each pixel in a CByteImage to the sum of the corresponding pixels in two instances of CByteImage...
bool Laplace1(const CByteImage *pInputImage, CShortImage *pOutputImage, bool bAbsoluteValue=true)
Filters a CByteImage with the Laplace1 operator and writes the result to a CShortImage.
bool GaussianSmooth5x5(const CFloatMatrix *pInputImage, CFloatMatrix *pOutputImage, float fVariance)
Applies a 5x5 Gaussian filter to a CFloatMatrix and writes the result to a CFloatMatrix.
#define DECLARE_OPTIMIZED_FUNCTION_4(name, p1, p2, p3, p4)
int CalculateHarrisInterestPoints(const CByteImage *pInputImage, Vec2d *pInterestPoints, int nMaxPoints, float fQualityLevel=0.01f, float fMinDistance=5.0f)
Computes interest points within a CByteImage by applying the Harris corner detector.
Data structure for the representation of a 2D vector.
Definition: Math2d.h:82
bool Or(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Applies the bitwise operator OR to two instance of CByteImage and writes the result to a CByteImage...
Data structure for the representation of single channel images of the data type signed int...
Definition: IntImage.h:55
static bool Erode3x3(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI)
#define DECLARE_OPTIMIZED_FUNCTION_3(name, p1, p2, p3)
bool And(const CByteImage *pInputImage1, const CByteImage *pInputImage2, CByteImage *pOutputImage)
Applies the bitwise operator AND to two instance of CByteImage and writes the result to a CByteImage...
bool GaussianSmooth3x3(const CByteImage *pInputImage, CByteImage *pOutputImage)
Applies a 3x3 Gaussian filter to a CByteImage and writes the result to a CByteImage.
bool CalculateGradientImagePrewitt(const CByteImage *pInputImage, CByteImage *pOutputImage)
Applies a combined Prewitt filter for both x- and y-direction to a CByteImage and stores the result i...
#define DECLARE_OPTIMIZED_FUNCTION_5(name, p1, p2, p3, p4, p5)


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28