00001
00002
00003 #ifdef _CH_
00004 #define WIN32
00005 #error "The file needs cvaux, which is not wrapped yet. Sorry"
00006 #endif
00007
00008
00009
00010 #include "vigra/bordertreatment.hxx"
00011 #include "vigra/stdconvolution.hxx"
00012 #include "vigra/recursiveconvolution.hxx"
00013 #include "vigra/multi_array.hxx"
00014 #include "vigra/imageiterator.hxx"
00015 #include "vigra/stdimage.hxx"
00016 #include "vigra/convolution.hxx"
00017
00018 #include "vigra/fftw3.hxx"
00019 #include "vigra/basicimage.hxx"
00020
00021 #include "vigra/inspectimage.hxx"
00022 #include "vigra/transformimage.hxx"
00023
00024
00025 #include "stllcv/iplvfftw.hxx"
00026 #include "stllcv/vimageoperation.hxx"
00027
00028
00029 #include "stllcv/iplvbasicimageoperation.hxx"
00030
00031 #include "stllcv/iplvbasicimage.hxx"
00032
00033
00034
00035
00036
00037
00038
00039 #include "stllcv/iplvinspectimage.hxx"
00040
00041 #include "vigra/localminmax.hxx"
00042
00043
00044
00045
00046 #ifndef _EiC
00047 #include "cv.h"
00048 #include "highgui.h"
00049
00050 #include <stdio.h>
00051 #include <conio.h>
00052 #include <stdlib.h>
00053 #include <string.h>
00054 #include <assert.h>
00055 #include <math.h>
00056 #include <float.h>
00057 #include <limits.h>
00058 #include <time.h>
00059 #include <ctype.h>
00060 #endif
00061
00062 #ifdef _EiC
00063 #define WIN32
00064 #endif
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 static const bool is_modal = true;
00075
00076
00077
00078
00079
00080 #define DebugFileRead 1
00081 #define DebugShowImage 1
00082 #define SelfResize 0
00083
00084 #define SMOOTHBorder 1
00085
00086 #define SMOOTHPhase 1
00087 #define SMOOTHPhaseAverage 0
00088
00089
00090
00091 #define PEXFFT float
00092
00093
00094
00095 #define PEXORGIMG unsigned char
00096
00097
00098
00099
00100 #define TileLen 50
00101
00102
00103
00104
00105
00106
00107 #if !DebugFileRead
00108 #define Filename argv[1]
00109 #define Filename2 argv[2]
00110 #define OutImageName argv[3]
00111 #endif
00112
00113
00114 int main( int argc, char** argv )
00115 {
00116
00117 const char* input_name;
00118
00119
00120 input_name =0;
00121
00122 #if DebugFileRead
00123 const char* Filename = input_name ? input_name : (char*)"lena.jpg";
00124 const char* Filename2 = input_name ? input_name : (char*)"lena2.jpg";
00125 #endif
00126
00127
00128 CiplvBasicImage<PEXORGIMG> image1org(Filename);
00129 CiplvBasicImage<PEXORGIMG> image1(Filename);
00130 CiplvBasicImage<PEXORGIMG> image2org(Filename2);
00131 CiplvBasicImage<PEXORGIMG> image2(Filename2);
00132
00133 int width1=image1org.width();
00134 int height1=image1org.height();
00135 CiplvBasicImage<PEXORGIMG> imageCorrelation(width1,height1);
00136 int xmax, ymax;
00137
00138 #if DebugShowImage
00139 bool is_modal = true;
00140 char winName[]="srcImg";
00141 cvNamedWindow( winName, 1 );
00142 showIplvBasicImag<PEXORGIMG>(&image1,winName);
00143 showIplvBasicImag<PEXORGIMG>(&image2,winName);
00144 #endif
00145
00146 phaseOnlyCorrelation(image1, image2,imageCorrelation , xmax, ymax , true, 6.0 );
00147
00148
00149
00150
00151 std::cout << "xmax " << xmax << " ymax " << ymax << std::endl;
00152
00153
00154 CiplvBasicImage<PEXORGIMG> image3(width1,height1);
00155 iplvTileImageNoCycle<PEXORGIMG>(&image1org,&image2org,
00156 &image3,
00157 TileLen,xmax,ymax
00158 );
00159
00160 #if DebugShowImage
00161 showIplvBasicImag<PEXORGIMG>(&image1,winName);
00162 showIplvBasicImag<PEXORGIMG>(&image2,winName);
00163 showIplvBasicImag<PEXORGIMG>(&imageCorrelation,winName);
00164 showIplvBasicImag<PEXORGIMG>(&image3,winName);
00165 cvDestroyWindow("srcImg");
00166 #endif
00167
00168 }
00169
00170
00171
00172
00173