Ajout affichage ROI + Interface simplifiée
Problème d'échelle avec les resize ASIFT a regler
|
@ -10,7 +10,7 @@ ASIFT_matcher::ASIFT_matcher(): _verb(0), _nb_refs(0), _resize_imgs(false)
|
|||
|
||||
// }
|
||||
|
||||
bool ASIFT_matcher::addReference(const char* image, int num_tilts = 1)
|
||||
bool ASIFT_matcher::addReference(const char* image, unsigned int num_tilts)
|
||||
{
|
||||
///// Read input
|
||||
float * iarr1;
|
||||
|
@ -125,7 +125,7 @@ bool ASIFT_matcher::addReference(const char* image, int num_tilts = 1)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ASIFT_matcher::match(const char* image, int num_tilts = 1)
|
||||
bool ASIFT_matcher::match(const char* image, unsigned int num_tilts)
|
||||
{
|
||||
if(_nb_refs<=0)
|
||||
{
|
||||
|
@ -227,7 +227,7 @@ bool ASIFT_matcher::match(const char* image, int num_tilts = 1)
|
|||
|
||||
//// Match ASIFT keypoints
|
||||
|
||||
int num_matchings;
|
||||
int num_matchings = 0;
|
||||
|
||||
for(unsigned int i = 0; i<_nb_refs;i++)
|
||||
{
|
||||
|
@ -256,6 +256,104 @@ bool ASIFT_matcher::match(const char* image, int num_tilts = 1)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ASIFT_matcher::match(vector<float>& image, unsigned int w, unsigned int h, unsigned int num_tilts)
|
||||
{
|
||||
if(image.size()!=w*h)
|
||||
{
|
||||
cerr<<"Error : Input image size doesn't correspond with parameters"<<endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
///// Compute ASIFT keypoints
|
||||
asift_keypoints keys;
|
||||
int num_keys = 0;
|
||||
|
||||
time_t tstart, tend;
|
||||
tstart = time(0);
|
||||
|
||||
num_keys = compute_asift_keypoints(image, w, h, num_tilts, _verb, keys, _siftParam);
|
||||
|
||||
tend = time(0);
|
||||
cout<< "Keypoints computation accomplished in " << difftime(tend, tstart) << " seconds." << endl;
|
||||
cout<<" "<< num_keys <<" ASIFT keypoints found in Input image"<< endl;
|
||||
|
||||
//// Match ASIFT keypoints
|
||||
|
||||
int num_matchings = 0;
|
||||
|
||||
for(unsigned int i = 0; i<_nb_refs;i++)
|
||||
{
|
||||
matchingslist matchings;
|
||||
|
||||
cout << "Matching the keypoints..." << endl;
|
||||
tstart = time(0);
|
||||
try
|
||||
{
|
||||
num_matchings = compute_asift_matches(num_tilts, _num_tilts[i], w, h, _size_refs[i].first, _size_refs[i].second, _verb, keys, _keys[i], matchings, _siftParam);
|
||||
}
|
||||
catch(const bad_alloc& ba)
|
||||
{
|
||||
cerr<<"ERROR: ASIFT_matcher::match - ";
|
||||
cerr << ba.what() << endl;
|
||||
}
|
||||
// cout<< _keys[i].size()<< " " << _keys[i][0].size() <<" "<< _keys[i][0][0].size()<<endl;
|
||||
|
||||
tend = time(0);
|
||||
cout << "Keypoints matching accomplished in " << difftime(tend, tstart) << " seconds." << endl;
|
||||
|
||||
_num_matchings.push_back(num_matchings);
|
||||
_matchings.push_back(matchings);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ASIFT_matcher::computeROI(int& x, int& y, unsigned int& h, unsigned int& w, int zoom) const
|
||||
{
|
||||
if(getNbMatch()==0)
|
||||
{
|
||||
cerr<<"Error : cannot compute ROI without matchs"<<endl;
|
||||
return;
|
||||
}
|
||||
|
||||
pair<int,int> upLe, doRi; //UpLeft / DownRight
|
||||
//Initialisation
|
||||
for(unsigned int i=0;i<_matchings.size();i++)
|
||||
{
|
||||
if(getNbMatchs()[i]!=0)
|
||||
{
|
||||
upLe = make_pair(_matchings[i][0].first.x,_matchings[i][0].first.y);
|
||||
doRi = make_pair(_matchings[i][0].first.x,_matchings[i][0].first.y);
|
||||
}
|
||||
}
|
||||
|
||||
//Compute ROI
|
||||
for(unsigned int i=0;i<_matchings.size();i++)
|
||||
{
|
||||
for(unsigned int j=0;j<_matchings[i].size();j++)
|
||||
{
|
||||
keypoint kp = _matchings[i][j].first;
|
||||
if(kp.x<upLe.first)
|
||||
upLe.first = kp.x;
|
||||
if(kp.y<upLe.second)
|
||||
upLe.second=kp.y;
|
||||
if(kp.x>doRi.first)
|
||||
doRi.first=kp.x;
|
||||
if(kp.y>doRi.second)
|
||||
doRi.second=kp.y;
|
||||
}
|
||||
}
|
||||
x=upLe.first; //Système de coordonée ? (devrait etre bon)
|
||||
y=upLe.second;
|
||||
h=doRi.second-y;
|
||||
w=doRi.first-x;
|
||||
|
||||
// x=zoom*upLe.first; //Système de coordonée ? (devrait etre bon)
|
||||
// y=zoom*upLe.second;
|
||||
// h=zoom*(doRi.second-upLe.second);
|
||||
// w=zoom*(doRi.first-upLe.first);
|
||||
}
|
||||
|
||||
void ASIFT_matcher::print() const
|
||||
{
|
||||
for(unsigned int i=0; i< _keys.size();i++)
|
||||
|
@ -283,4 +381,14 @@ void ASIFT_matcher::print() const
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int ASIFT_matcher::getNbMatch() const
|
||||
{
|
||||
unsigned int res = 0;
|
||||
for (unsigned int i=0;i<_num_matchings.size();i++)
|
||||
{
|
||||
res+=_num_matchings[i];
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -36,14 +36,17 @@ public:
|
|||
ASIFT_matcher();
|
||||
// virtual ~ASIFT_matcher();
|
||||
|
||||
bool addReference(const char* image, int num_tilts);
|
||||
bool match(const char* image, int num_tilts);
|
||||
bool addReference(const char* image, unsigned int num_tilts=1);
|
||||
bool match(const char* image, unsigned int num_tilts =1);
|
||||
bool match(vector<float>& image, unsigned int w, unsigned int h, unsigned int num_tilts =1);
|
||||
void print() const;
|
||||
|
||||
void computeROI(int& x, int& y, unsigned int& h, unsigned int& w, int zoom =1) const;
|
||||
|
||||
void setResizeImg(bool resize_imgs){ _resize_imgs=resize_imgs;}
|
||||
|
||||
const vector < int >& getNbMatch()const{ return _num_matchings;}
|
||||
const vector< matchingslist >& getMatch()const{ return _matchings;}
|
||||
const vector < unsigned int >& getNbMatchs() const{ return _num_matchings;}
|
||||
unsigned int getNbMatch() const;
|
||||
const vector< matchingslist >& getMatch() const{ return _matchings;}
|
||||
|
||||
protected:
|
||||
//QUESCEQUESAI
|
||||
|
@ -61,7 +64,7 @@ protected:
|
|||
vector< asift_keypoints > _keys;
|
||||
|
||||
//Matchs
|
||||
vector < int > _num_matchings;
|
||||
vector < unsigned int > _num_matchings;
|
||||
vector< matchingslist > _matchings;
|
||||
|
||||
siftPar _siftParam;
|
||||
|
|
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/demo_ASIFT.dir/fproj.cpp.o
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/demo_ASIFT.dir/frot.cpp.o
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/demo_ASIFT.dir/orsa.cpp.o
Normal file
|
@ -6,6 +6,10 @@
|
|||
|
||||
#IncludeRegexTransform:
|
||||
|
||||
/home/harle/catkin_ws/src/BaxterInterface/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.cpp
|
||||
ASIFT_matcher.hpp
|
||||
/home/harle/catkin_ws/src/BaxterInterface/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.hpp
|
||||
|
||||
/home/harle/catkin_ws/src/BaxterInterface/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.hpp
|
||||
stdio.h
|
||||
-
|
||||
|
@ -146,7 +150,3 @@ string.h
|
|||
vector
|
||||
-
|
||||
|
||||
/home/harle/catkin_ws/src/BaxterInterface/ASIFT_tests/demo_ASIFT_src/test_ASIFT.cpp
|
||||
ASIFT_matcher.hpp
|
||||
/home/harle/catkin_ws/src/BaxterInterface/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.hpp
|
||||
|
||||
|
|
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/test_ASIFT.dir/fproj.cpp.o
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/test_ASIFT.dir/frot.cpp.o
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/CMakeFiles/test_ASIFT.dir/orsa.cpp.o
Normal file
Before Width: | Height: | Size: 412 KiB After Width: | Height: | Size: 522 KiB |
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 000
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [0.5665910387, -0.8235039121, 0.02856399138, -0.004725561405]
|
||||
- [-0.612495359, -0.444094245, -0.6539340461, 0.05318802529]
|
||||
- [0.5512023495, 0.3530178583, -0.7560121439, 0.398670845]
|
||||
- [0, 0, 0, 1]
|
Before Width: | Height: | Size: 402 KiB After Width: | Height: | Size: 552 KiB |
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 001
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.6442421126, -0.7648185729, 0.00215661327, 0.1005236514]
|
||||
- [-0.5078681912, 0.4256891629, -0.7489049586, -0.03211180135]
|
||||
- [0.5718583747, -0.4835713879, -0.6626739108, 0.4744785946]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 002
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [0.5931860286, 0.8050635925, -0.001716825525, -0.1530651462]
|
||||
- [0.5488091651, -0.4059313336, -0.7307723672, -0.09305480426]
|
||||
- [-0.5890151405, 0.4325417487, -0.6826190738, 0.5348952909]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 003
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.4033631815, 0.9148985892, -0.01608462887, -0.04515121073]
|
||||
- [0.6287289807, 0.2643387569, -0.7313172297, -0.168069378]
|
||||
- [-0.6648293109, -0.3050993168, -0.6818477794, 0.5964581417]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 004
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.9985837435, 0.05141800958, -0.0136636575, 0.09960909748]
|
||||
- [0.04448102767, 0.6659832775, -0.7446393169, -0.1074251457]
|
||||
- [-0.02918810413, -0.7441924902, -0.6673272002, 0.5639220715]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 005
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.2314201876, -0.9583649151, 0.1672763771, 0.09835545579]
|
||||
- [0.7484075924, -0.06552319445, 0.6599945353, -0.0974700766]
|
||||
- [-0.6215551242, 0.2779269699, 0.7324109687, 0.5499983612]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 006
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.9945932359, 0.06416141072, 0.0816554258, 0.1218390655]
|
||||
- [-0.03089262028, -0.933506626, 0.357226854, 0.06690798951]
|
||||
- [0.09914605993, 0.3527728626, 0.93044149, 0.2360881003]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 007
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.03028468063, -0.4076156195, 0.9126512723, 0.05370078927]
|
||||
- [-0.6648925807, 0.6899748614, 0.2860988409, 0.00863761359]
|
||||
- [-0.7463247914, -0.5981506477, -0.2919162695, 0.5950621033]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 006
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [0.02063568325, -0.5653102458, -0.8246202123, 0.0403687505]
|
||||
- [0.8210674394, 0.4801939642, -0.3086454546, -0.1745029756]
|
||||
- [0.5704580865, -0.6706996964, 0.4740669666, 0.4630312508]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 009
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.9994394457, 0.006264701471, -0.03288689451, 0.1238992921]
|
||||
- [0.03112213929, -0.1881441717, -0.9816481972, 0.01594317069]
|
||||
- [-0.01233721043, -0.9821214406, 0.1878437358, 0.4121166041]
|
||||
- [0, 0, 0, 1]
|
|
@ -1,8 +0,0 @@
|
|||
Book cMo for training image 010
|
||||
rows: 4
|
||||
cols: 4
|
||||
data:
|
||||
- [-0.4708977952, -0.8758554817, 0.1055103862, 0.1637869872]
|
||||
- [0.5260415703, -0.1827654425, 0.8305883814, -0.07876409183]
|
||||
- [-0.7081917345, 0.4466250868, 0.5468002369, 0.3485744882]
|
||||
- [0, 0, 0, 1]
|
BIN
ASIFT_tests/demo_ASIFT_src/demo_ASIFT
Executable file
BIN
ASIFT_tests/demo_ASIFT_src/io_png/libs/png/libpng.a
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/io_png/libs/zlib/libzlib.a
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/libMatch/libMatch.a
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/libNumerics/libNumerics.a
Normal file
BIN
ASIFT_tests/demo_ASIFT_src/results/res.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
ASIFT_tests/demo_ASIFT_src/test/000.png
Normal file
After Width: | Height: | Size: 509 KiB |
BIN
ASIFT_tests/demo_ASIFT_src/test/train_image_000.png
Normal file
After Width: | Height: | Size: 412 KiB |
BIN
ASIFT_tests/demo_ASIFT_src/test/train_image_001.png
Normal file
After Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 418 KiB |
Before Width: | Height: | Size: 411 KiB After Width: | Height: | Size: 411 KiB |
Before Width: | Height: | Size: 404 KiB After Width: | Height: | Size: 404 KiB |
Before Width: | Height: | Size: 459 KiB After Width: | Height: | Size: 459 KiB |
Before Width: | Height: | Size: 508 KiB After Width: | Height: | Size: 508 KiB |
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
Before Width: | Height: | Size: 474 KiB After Width: | Height: | Size: 474 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 471 KiB After Width: | Height: | Size: 471 KiB |
BIN
ASIFT_tests/demo_ASIFT_src/test_ASIFT
Executable file
|
@ -1,56 +1,143 @@
|
|||
#include "ASIFT_matcher.hpp"
|
||||
|
||||
int main()//int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if ((argc !=2) && (argc != 3) && (argc != 4)) {
|
||||
std::cerr << " ******************************************************************************* " << std::endl
|
||||
<< " *************************** ASIFT image matching **************************** " << std::endl
|
||||
<< " ******************************************************************************* " << std::endl
|
||||
<< "Usage: " << argv[0] << " imgIn.png [Tilt number option] [Resize option: 0/1] " << std::endl
|
||||
<< "- imgIn.png: input image (in PNG format). " << std::endl
|
||||
<< "- [Tilt number option: 1..n]. " << std::endl
|
||||
<< "- [Resize option: 0/1]. 1: input images resize to 800x600 (default). 0: no resize. " << std::endl
|
||||
<< " ******************************************************************************* " << std::endl
|
||||
<< " ********************* Jean-Michel Morel, Guoshen Yu, 2010 ******************** " << std::endl
|
||||
<< " ******************************************************************************* " << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////// Input
|
||||
float * iarr1;
|
||||
size_t w1, h1;
|
||||
if (NULL == (iarr1 = read_png_f32_gray(argv[1], &w1, &h1))) {
|
||||
std::cerr << "Unable to load image file " << argv[1] << std::endl;
|
||||
return 1;
|
||||
}
|
||||
std::vector<float> ipixels1(iarr1, iarr1 + w1 * h1);
|
||||
free(iarr1); /*memcheck*/
|
||||
|
||||
///// Resize the images to area wS*hW in remaining the apsect-ratio
|
||||
///// Resize if the resize flag is not set or if the flag is set unequal to 0
|
||||
float wS = IM_X;
|
||||
float hS = IM_Y;
|
||||
|
||||
float zoom1=0;
|
||||
int wS1=0, hS1=0;
|
||||
vector<float> ipixels1_zoom;
|
||||
|
||||
int flag_resize = 1;
|
||||
if (argc == 4)
|
||||
{
|
||||
flag_resize = atoi(argv[3]);
|
||||
}
|
||||
|
||||
if ((argc==2) || (argc == 3) || (flag_resize != 0))
|
||||
{
|
||||
cout << "WARNING: The input images is resized to " << wS << "x" << hS << " for ASIFT. " << endl
|
||||
<< " But the results will be normalized to the original image size." << endl << endl;
|
||||
|
||||
float InitSigma_aa = 1.6;
|
||||
|
||||
float fproj_p, fproj_bg;
|
||||
char fproj_i;
|
||||
float *fproj_x4, *fproj_y4;
|
||||
int fproj_o;
|
||||
|
||||
fproj_o = 3;
|
||||
fproj_p = 0;
|
||||
fproj_i = 0;
|
||||
fproj_bg = 0;
|
||||
fproj_x4 = 0;
|
||||
fproj_y4 = 0;
|
||||
|
||||
float areaS = wS * hS;
|
||||
|
||||
// Resize image 1
|
||||
float area1 = w1 * h1;
|
||||
zoom1 = sqrt(area1/areaS);
|
||||
|
||||
wS1 = (int) (w1 / zoom1);
|
||||
hS1 = (int) (h1 / zoom1);
|
||||
|
||||
int fproj_sx = wS1;
|
||||
int fproj_sy = hS1;
|
||||
|
||||
float fproj_x1 = 0;
|
||||
float fproj_y1 = 0;
|
||||
float fproj_x2 = wS1;
|
||||
float fproj_y2 = 0;
|
||||
float fproj_x3 = 0;
|
||||
float fproj_y3 = hS1;
|
||||
|
||||
/* Anti-aliasing filtering along vertical direction */
|
||||
if ( zoom1 > 1 )
|
||||
{
|
||||
float sigma_aa = InitSigma_aa * zoom1 / 2;
|
||||
GaussianBlur1D(ipixels1,w1,h1,sigma_aa,1);
|
||||
GaussianBlur1D(ipixels1,w1,h1,sigma_aa,0);
|
||||
}
|
||||
|
||||
// simulate a tilt: subsample the image along the vertical axis by a factor of t.
|
||||
ipixels1_zoom.resize(wS1*hS1);
|
||||
fproj (ipixels1, ipixels1_zoom, w1, h1, &fproj_sx, &fproj_sy, &fproj_bg, &fproj_o, &fproj_p,
|
||||
&fproj_i , fproj_x1 , fproj_y1 , fproj_x2 , fproj_y2 , fproj_x3 , fproj_y3, fproj_x4, fproj_y4);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipixels1_zoom.resize(w1*h1);
|
||||
ipixels1_zoom = ipixels1;
|
||||
wS1 = w1;
|
||||
hS1 = h1;
|
||||
zoom1 = 1;
|
||||
}
|
||||
|
||||
std::string refData[] = {
|
||||
"book_training/train_image_000.png",
|
||||
"book_training/train_image_001.png",
|
||||
"book_training/train_image_002.png",
|
||||
"book_training/train_image_003.png",
|
||||
"adam1.png",
|
||||
"train_image_003.png"};
|
||||
"book_training/train_image_001.png"};
|
||||
|
||||
ASIFT_matcher matcher;
|
||||
matcher.setResizeImg(true);
|
||||
matcher.addReference(refData[0].c_str(), 1);
|
||||
matcher.addReference(refData[1].c_str(), 2);
|
||||
matcher.addReference(refData[2].c_str(), 3);
|
||||
matcher.addReference(refData[0].c_str(), 7);
|
||||
matcher.addReference(refData[1].c_str(), 7);
|
||||
// matcher.print();
|
||||
matcher.match(refData[5].c_str(), 4);
|
||||
// matcher.match(refData[3].c_str(), 4);
|
||||
if(argc>2)
|
||||
matcher.match(ipixels1_zoom, wS1, hS1, atoi(argv[2]));
|
||||
else
|
||||
matcher.match(ipixels1_zoom, wS1, hS1);
|
||||
|
||||
vector<unsigned int> NbMatch = matcher.getNbMatchs();
|
||||
cout<<"Nb match : "<<NbMatch.size()<<endl;
|
||||
for(unsigned int i=0; i<NbMatch.size(); i++)
|
||||
{
|
||||
cout<<" "<<NbMatch[i]<<endl;
|
||||
}
|
||||
|
||||
int x =0,y=0;
|
||||
unsigned int h=1,w=1;
|
||||
matcher.computeROI(x,y,h,w, zoom1); //ATTENTION ne pas oublie le resize -> besoin du coef zoom
|
||||
|
||||
|
||||
// ///////////////// Output image containing line matches (the two images are concatenated one above the other)
|
||||
// int band_w = 20; // insert a black band of width band_w between the two images for better visibility
|
||||
float *opixelsASIFT = new float[w1*h1];
|
||||
/////////////////////////////////////////////////////////////////// Copy image to output
|
||||
for(int j = 0; j < (int) h1; j++)
|
||||
for(int i = 0; i < (int) w1; i++) opixelsASIFT[j*w1+i] = ipixels1[j*w1+i];
|
||||
//////////////////////////////////////////////////////////////////// Draw ROI
|
||||
draw_square(opixelsASIFT, x, y, w, h, 255, w1, h1);
|
||||
///////////////////////////////////////////////////////////////// Save imgOut
|
||||
write_png_f32("./results/res.png", opixelsASIFT, w1, h1, 1);
|
||||
|
||||
// int wo = MAX(w1,w2);
|
||||
// int ho = h1+h2+band_w;
|
||||
|
||||
// float *opixelsASIFT = new float[wo*ho];
|
||||
|
||||
// for(int j = 0; j < (int) ho; j++)
|
||||
// for(int i = 0; i < (int) wo; i++) opixelsASIFT[j*wo+i] = 255;
|
||||
|
||||
// /////////////////////////////////////////////////////////////////// Copy both images to output
|
||||
// for(int j = 0; j < (int) h1; j++)
|
||||
// for(int i = 0; i < (int) w1; i++) opixelsASIFT[j*wo+i] = ipixels1[j*w1+i];
|
||||
|
||||
// for(int j = 0; j < (int) h2; j++)
|
||||
// for(int i = 0; i < (int) (int)w2; i++) opixelsASIFT[(h1 + band_w + j)*wo + i] = ipixels2[j*w2 + i];
|
||||
|
||||
// //////////////////////////////////////////////////////////////////// Draw matches
|
||||
// matchingslist::iterator ptr = matchings.begin();
|
||||
// for(int i=0; i < (int) matchings.size(); i++, ptr++)
|
||||
// {
|
||||
// draw_line(opixelsASIFT, (int) (zoom1*ptr->first.x), (int) (zoom1*ptr->first.y),
|
||||
// (int) (zoom2*ptr->second.x), (int) (zoom2*ptr->second.y) + h1 + band_w, 255.0f, wo, ho);
|
||||
// }
|
||||
|
||||
// ///////////////////////////////////////////////////////////////// Save imgOut
|
||||
// write_png_f32(argv[3], opixelsASIFT, wo, ho, 1);
|
||||
|
||||
// delete[] opixelsASIFT; /*memcheck*/
|
||||
delete[] opixelsASIFT; /*memcheck*/
|
||||
|
||||
// /////////// Output image containing line matches (the two images are concatenated one aside the other)
|
||||
// int woH = w1+w2+band_w;
|
||||
|
|