1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
using namespace cv;
Point P11, P12;
Point P21, P22;
int cc1 = 0, cc2 = 0;
void on_mouse1 (int event, int x, int y, int flags, void *param);
void on_mouse2 (int event, int x, int y, int flags, void *param);
void hybridImage(cv::Mat img1, cv::Mat img2, int ksize, double sigma, cv::Mat& img12);
void Myalignment (cv::Mat img1, Point p11, Point p12, cv::Mat img2, Point p21, Point p22, cv::Mat& aligned_img1, cv::Mat& aligned_img2 );
int main (int argc, char *argv[])
{
int c;
int ksize = 61;
double sigma = 50;
cv::Mat img1 = cv::imread( "JunbinPicture.jpg"); // ( argv[1] );
cv::Mat img2 = cv::imread( "nutmeg.jpg"); // argv[2] );
cv::Mat aligned_img1, aligned_img2, img12;
cv::namedWindow ("Image 1", CV_WINDOW_AUTOSIZE);
//Set mouse handler for window 1
cv::setMouseCallback ("Image 1", on_mouse1);
cv::imshow ("Image 1", img1);
cv::namedWindow ("Image 2", CV_WINDOW_AUTOSIZE);
//Set mouse handler for window 2
cvSetMouseCallback ("Image 2", on_mouse2);
cv::imshow ("Image 2", img2);
cv::namedWindow ("Image Hybrid", CV_WINDOW_AUTOSIZE);
while (1) {
c = cvWaitKey (0);
if (c == 'c' || c == 'C' ) { //If press "c", then calculate the hybrid image
//call your alignment algorithm);
//
// Dispalay the aligned images
//
//Call your hybrid algorithm
//Display and write results
cout<< "Call your algorithms! " << endl;
}
if (c == '\x1b') // Press "ESC" to exit
return 1;
}
return 0;
}
| |