效果
鼠标选择bounding box 左上角位置
生成的图。该脚本以bounding box大小为基准,调整大图的大小。贴到论文里比较好看
文件存放形式
以图片1.jpg
为例,原图存放在root
文件夹,用3种方法的处理结果存放在method1
,method2
,method3
子文件夹,matlab代码drawcompare.m
放在root
文件夹。
——root:1.jpg drawcompare.m
|————method1: 1.jpg
|————method2: 1.jpg
|————method3: 1.jpg
代码
drawcompare.m
用法:
1. 按照文件存放形式放好待比较图像
2. 运行函数代码(若报错“方框数量太多”,请减少方框数量,重新运行函数)
函数参数分别为:
imname:图像文件名
fixw:(正方形)方框边长(默认为40)
margine:留白大小(默认为10)
nbox:方框数量(默认为2)
3. 点击图像选择方框左上角,按下回车确认(若报错“超出了图像范围”,请重新运行函数,小心的选择位置)
4. 生成的图像会保存在该代码所在目录
function []=drawcompare(imname,fixw,margine,nbox)
%input:
% imname: string image filename eg: 'street.jpg'
% fixw: bounding box size for zoom in
% margine: margine between picture elements
% nbox: number of bounding boxs
%usage:
% 1.put the origine image in the root dir
% 2.put the images (to be compared, having same file name as the origine
% image) in different sub dir,
% 3.click the image and press enter to confirm your bounding boxs (2 box in
% this program)
% 4.new image will be save to root dir
%------------------sub dir, modify by user---------------------------------
me_dir = './ME';
pan_dir = './PAN';
xu_dir = './XU';
sun_dir = './SUN';
ori_dir = '.';
method_dir_list=