Fisheye 235° to equirectangular

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fisheye 235° to equirectangular

Post 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?
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: Fisheye 235° to equirectangular

Post 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.
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: Fisheye 235° to equirectangular

Post 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...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fisheye 235° to equirectangular

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fisheye 235° to equirectangular

Post 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
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: Fisheye 235° to equirectangular

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fisheye 235° to equirectangular

Post 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.
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: Fisheye 235° to equirectangular

Post 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

    Code: Select all

    cd /drives/f/graphics/ImageMagick
  • 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fisheye 235° to equirectangular

Post 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.
Post Reply