25 #include <Base/Common/BIASpragma.hh>
27 #define _CRT_SECURE_NO_DEPRECATE
30 #include <Base/Image/Image.hh>
31 #include "CorrespondenceMap.hh"
38 template <
class StorageType>
44 template <
class StorageType>
47 unsigned int height) {
48 if (!this->IsEmpty()) this->Release();
49 this->Init(width, height, 2);
51 ifstream thefile(filename.c_str());
52 StorageType** IDA=this->GetImageDataArray();
53 cout<<
"Loading correspondences from file "<<filename<<
" ";
54 for (
unsigned int y=0; y<height; y++) {
55 if (y%50==0) cout<<y*100/width<<
"% "<<flush;
56 for (
unsigned int x=0; x<width; x++) {
57 thefile >> (IDA[y][2*x]);
58 thefile >> (IDA[y][2*x+1]);
59 if (!thefile.good())
return -1;
70 template class BIASImage_EXPORT CorrespondenceMap<type>
77 #ifdef BUILD_IMAGE_INT
80 #ifdef BUILD_IMAGE_CHAR
83 #ifdef BUILD_IMAGE_SHORT
86 #ifdef BUILD_IMAGE_USHORT
89 #ifdef BUILD_IMAGE_UINT
92 #ifdef BUILD_IMAGE_DOUBLE
int Read(const std::string filename, unsigned int width=720, unsigned int height=576)
read from ascii file vector as two doubles each line, starting with first image column, then second
The image template class for specific storage types.