-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.m
28 lines (23 loc) · 873 Bytes
/
main.m
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
clear; clc; close all;
%% Setup VLFeat toolbox.
%----------------------
addpath('modelspecific');
cd vlfeat-0.9.20/toolbox;
feval('vl_setup');
cd ../..;
%% read images
imgpath = 'Imgs\'; img_format = '*.jpg';
outpath = [imgpath, 'results\'];%results
dir_folder = dir(strcat(imgpath, img_format));
path1 = sprintf('%s%s',imgpath, dir_folder(1).name); %
path2 = sprintf('%s%s',imgpath, dir_folder(2).name); %
img1 = im2double(imread(path1)); % ´ýÆ´½Óͼ
img2 = im2double(imread(path2)); % »ù׼ͼ
%% detect features and align images
fprintf('> feature matching and image alignment...');tic;
[warped_img1, warped_img2] = registerTexture(img1, img2);
fprintf('done (%fs)\n', toc);
%% iterative seam estimation
fprintf('> seam estimation and image blending...');tic;
blendTexture(warped_img1, warped_img2);
fprintf('done (%fs)\n', toc);