ppwwyyxx / OpenPano

Automatic Panorama Stitching From Scratch
MIT License
1.86k stars 553 forks source link

How to run the CYLINDER mode #9

Closed tianboguangding closed 8 years ago

tianboguangding commented 8 years ago

hi, thanks for your shared panarama-stitching

when I run the image-stitching as followed:

wqy@wqy-Precision-T3600:~/Desktop/panorama-master/src$ ./image-stitching ../data/apartment/small-01.jpg ../data/apartment/small-02.jpg [init_config@main.cc:271] Run with camera estimation mode. sh: 1: convert: not found sh: 1: gm: not found sh: 1: convert: not found sh: 1: gm: not found sh: 1: convert: not found sh: 1: gm: not found

[CImg] * CImgIOException * [instance(0,0,0,0,(nil),non-shared)] CImg::load(): Failed to recognize format of file '../data/apartment/small-01.jpg'. terminate called after throwing an instance of 'cimg_library::CImgIOException' what(): [instance(0,0,0,0,(nil),non-shared)] CImg::load(): Failed to recognize format of file '../data/apartment/small-01.jpg'. Aborted (core dumped)

So how do I use it? Thanks very much!

ppwwyyxx commented 8 years ago

To read jpeg file you need to install libjpeg-dev (name may be different on different platforms).

tianboguangding commented 8 years ago

I have installed the libjpeg-dev, bue the same question is occurred

ppwwyyxx commented 8 years ago

It's my fault. The latest commit should fix this. Install imagemagick can also solve your problem.

tianboguangding commented 8 years ago

Thanks !It worked . Sorry,but one more question, How to switch the different mode in the config.cfg? For example :the occurred global playground Image

ppwwyyxx commented 8 years ago

Just set one of 'CYLINDER', 'ESTIMATE_CAMERA', 'TRANS' to 1 in config.cfg and run the program.

tianboguangding commented 8 years ago

Q1:No matter which mode was set to one , the running result of your apartment images is rectangle all the time,but not spherical(circular image)?

Q2:And when I test myself's pictures(only two 490*653 images),error is as followed: error: Result too large. Something must be wrong!

Thanks!

ppwwyyxx commented 8 years ago

The mode is for different kind of algorithm. The spherical example is not a mode, just something fun. And it's easy to convert the 360 degree rectangle panorama to a spherical one.

It's likely that your images doesn't overlap enough (you can look at the example images to see what kind of overlap is needed). You can also post your log here.

tianboguangding commented 8 years ago

Thanks very much! i Compiled your project successfully in vs 2015y,but could not run it; the error log of running is as followed:

[init_config@:267] Run with cylinder mode. 无效参数 - /github 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 无效参数 - /github 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 无效参数 - /github 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

[CImg] * CImgIOException * [instance(0,0,0,0,0000000000000000,non-shared)] CImg::load(): Failed to recognize format of file 'D:/github/panorama/1/panorama-master/src/build/Debug/976.jpg'.

it seems the same error with the linux's. After i installed the window's version of imagemagick (ImageMagick-6.9.3-8-Q8-x64-dll.exe), set the path of include/lib/dll ,but ... the error log of running is below:

[init_config@:267] Run with cylinder mode. convert.exe: unable to load module C:\Program Files\ImageMagick-6.9.3-Q8\modules\coders\IM_MOD_RL_JPEG_.dll': 找不到指定的模块。 @ error/module.c/OpenModule/1300. convert.exe: no decode delegate for this image formatJPEG' @ error/constitute.c/ReadImage/501. convert.exe: no images defined C:\\Users\\wqy\\AppData\\Local\\Temp\\8080G08i.pnm' @ error/convert.c/ConvertImageCommand/3252. 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 convert.exe: unable to load moduleC:\Program Files\ImageMagick-6.9.3-Q8\modules\coders\IM_MOD_RLJPEG.dll': 找不到指定的模块。 @ error/module.c/OpenModule/1300. convert.exe: no decode delegate for this image format JPEG' @ error/constitute.c/ReadImage/501. convert.exe: no images definedC:\Users\wqy\AppData\Local\Temp\qoQWk2uW.pnm' @ error/convert.c/ConvertImageCommand/3252. 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 convert.exe: unable to load module C:\Program Files\ImageMagick-6.9.3-Q8\modules\coders\IM_MOD_RL_JPEG_.dll': 找不到指定的模块。 @ error/module.c/OpenModule/1300. convert.exe: no decode delegate for this image formatJPEG' @ error/constitute.c/ReadImage/501. convert.exe: no images defined `C:\Users\wqy\AppData\Local\Temp\2e66imMG.pnm' @ error/convert.c/ConvertImageCommand/3252. 'gm.exe' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

[CImg] * CImgIOException * [instance(0,0,0,0,0000000000000000,non-shared)] CImg::load(): Failed to recognize format of file 'D:/github/panorama/1/panorama-master/src/build/Debug/976.jpg'.

ppwwyyxx commented 8 years ago

Seems like you're not compiling with the latest commit 877327042a8729498188e0d494d17b8546a3f72f? convert or gm will only be used when CImg cannot use libjpeg.

Also it could be easier if you just use png files. png reader/writer are already included in the project.

tianboguangding commented 8 years ago

Thanks for your reply! But After plus the #define cim_use_jpeg in the .c file (imgio.cc), the project even can not to be compilied successfully ! And the errors error of compiling is as followed:

....... 1>jpeg.lib(jerror.obj) : error LNK2001: unresolved external symbol __imp___iob_func 1>D:\github\panorama\1\panorama-master\src\build\Debug\image_stitching.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

The used jpeg version is jpeg-9a. Link->Input->Additional Dependencies : D:\jpeg-9a\x64\Debug\jpeg.lib

ppwwyyxx commented 8 years ago

That looks like a problem with your jpeg library. Unfortunately I've no idea where to find a jpeg library for windows.

Some google search suggest the reason is that your jpeg library is probably built with an old version of visual studio: http://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-sdl2

tianboguangding commented 8 years ago

Thanks for your help! Now it worked!

Have you considered a parallel algorithm(eg:cuda for sift) of stitching img in order to improve the speed?

ppwwyyxx commented 8 years ago

Right now it is parallel across the images in most steps. Cuda will definitely make it faster but I won't have time for that in the near future.

tianboguangding commented 8 years ago

Thanks for your reply :)