Page 3 of 3
Re: Fisheye 235° to equirectangular
Posted: 2018-07-18T15:35:12-07:00
by fmw42
jumpjack wrote: ↑2018-07-18T11:52:40-07:00
Yes this solves the issue about unary operator.
The "^M" error remains, but I don't get why as I left the file in UNIX format as downloaded and just replaced the calls to IM executables as said.
How could you replace the calls to convert.exe in my script without saving the file again. If opened it and edited it and saved it again on Windows, then you have changed the line endings. Perhaps I misunderstand where you made changes to add .exe?
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T01:43:03-07:00
by jumpjack
I tried installing the Linux version in the Linux box, with no success (all I know about Linux is
ls -l and
chmod +x , so I'm using Windows version.
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T01:44:54-07:00
by jumpjack
fmw42 wrote: ↑2018-07-18T15:35:12-07:00
jumpjack wrote: ↑2018-07-18T11:52:40-07:00
Yes this solves the issue about unary operator.
The "^M" error remains, but I don't get why as I left the file in UNIX format as downloaded and just replaced the calls to IM executables as said.
How could you replace the calls to convert.exe in my script without saving the file again. If opened it and edited it and saved it again on Windows, then you have changed the line endings. Perhaps I misunderstand where you made changes to add .exe?
No, I use PSPad, which keeps the UNIX line endings while saving.
Notepad is useless for developers...
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T09:43:06-07:00
by fmw42
My script was designed to use Unix install of ImageMagick. I cannot say how it would react or what it would need or even if it would work using a Windows install of ImageMagick.
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T09:45:52-07:00
by fmw42
You could install Cygwin Unix on you Windows platform and then install the Cygwin binary for ImageMagick. See
http://www.imagemagick.org/discourse-se ... 26&t=25910
http://www.imagemagick.org/script/download.php
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T12:24:58-07:00
by jumpjack
I tried installing Cygwin but I gave up after seeing it's over 1 GB of stuff and dependencies to configure.
I tried installing IM from rpm in MobaXterm without success.
So I give up with Linux and I assume the algorithm is the same in Win and Lin, so if IM executables run in Windows, they work exactly as they do in Linux.
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T13:09:27-07:00
by fmw42
You are the first person that I know who is doing it that way. I am really surprised that it works. But perhaps with your change to add .exe, but still have all the Unix tools available, then if it seems to works for you, then great. Good to know.
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T14:03:10-07:00
by jumpjack
Yes, I did a horrible mess... but it is working.
Maybe .exe is not needed , but "convert" is a Windows system command and I want to be sure to execute IM convert, not Windows convert!
Summary:
- unpack IM for Windows into any folder, let's call it ImageMagick regardless of path
- download needed script
- use notepad++ or pspad to edit the file keeping the Unix format for carriage returns
- add to all calls to IM executables (convert and identify in scripts I am using) a trailing ./ and a leading .exe, e.g.convert will become ./convert.exe
- install MobaXterm (also portable version works fine)
- copy source images into ImageMagick folder (for easier paths)
- launch MobaXterm
- go to ImageMagick folder; please note that drives are mapped to /drives folder, hence F: drive maps to /drives/f
- to go into f:\graphics\ImageMagick folder type
- launch the script with required parameters; e.g:
Code: Select all
./fisheye2rect -i 235 -o 90 -m z -l 437,256 800x600 test01.jpg out01.jpg
Note: multiple command lines can be combined into one single text file beginning with
#!/bin/bash
Note: no need for chmod +x on the scripts
Re: Fisheye 235° to equirectangular
Posted: 2018-07-19T14:58:42-07:00
by fmw42
To use convert from ImageMagick rather than convert.exe from Windows, most people just rename the ImageMagick convert to IM_convert or something like that. But then you would still need to edit my script to use that name. However if you installed a Linux install of ImageMagick in your Linux system, then that rename is not likely to be needed.
But if what you have done works fine, then this is good information for others.