Fisheye 235° to equirectangular
Fisheye 235° to equirectangular
How can I convert a fisheye picture with FOV=235° into an equirectangular projection?
Re: Fisheye 235° to equirectangular
You could try one of fmw42's scripts; for instance this one: http://www.fmwconcepts.com/imagemagick/ ... /index.php
Re: Fisheye 235° to equirectangular
It looks interesting, but how can I run it in Windows?
Re: Fisheye 235° to equirectangular
Windows 10 has a developer mode where you can run bash but I tried one of fmw42's scripts before and it came up with errors. I think it is for basic bash commands only.
Install Cygwin which might work and there are some instructions in snibgo's site: http://im.snibgo.com/cygwin.htm
Find some other software to do the job.
Install Cygwin which might work and there are some instructions in snibgo's site: http://im.snibgo.com/cygwin.htm
Find some other software to do the job.
Re: Fisheye 235° to equirectangular
I'm studying "Generic Mapping Tools" (GMT), Flexify Plugin, NASA G.projector, Marzipano tool,... but still can't figure out how to get what I need.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Fisheye 235° to equirectangular
Please identify your IM version and platform when asking questions on this forum.
Please post an example input and output image (to some free hosting service and put the URLs here). Also post any links to the camera/lens system being used.
I suspect you might want my script at http://www.fmwconcepts.com/imagemagick/ ... /index.php, which allows large FOV. The last example shows the equivalent Imagemagick commands to achieve most of what my script does and they can be run individually in Windows. See http://www.imagemagick.org/Usage/windows/ for any potential Windows vs Unix syntax issues with Imagemagick.
My scripts only run in Unix-like environments. So on Windows you would need to install Cygwin or try Windows 10.
Please post an example input and output image (to some free hosting service and put the URLs here). Also post any links to the camera/lens system being used.
I suspect you might want my script at http://www.fmwconcepts.com/imagemagick/ ... /index.php, which allows large FOV. The last example shows the equivalent Imagemagick commands to achieve most of what my script does and they can be run individually in Windows. See http://www.imagemagick.org/Usage/windows/ for any potential Windows vs Unix syntax issues with Imagemagick.
My scripts only run in Unix-like environments. So on Windows you would need to install Cygwin or try Windows 10.
Re: Fisheye 235° to equirectangular
SED converter is not working on my system (Win7), it complains about some "garbage" being present in cim.txt.
I'll try with manual conversion described in last example.
I'll try with manual conversion described in last example.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Fisheye 235° to equirectangular
On my Windows 8.1 computer, with Cygwin, Fred's fisheye2pano script, example 1...
... runs with no problem, and makes the expected output.
Code: Select all
bash fisheye2pano -v -90,52.5 -h 211.5 -f angle testimage2.jpg out.png
snibgo's IM pages: im.snibgo.com
Re: Fisheye 235° to equirectangular
I installed Linux inside Windows 10, so now I can run BASH; I copied the script directly inside Imagemagick folder, together with test image, but if I run this commmand:
I get these errors:
Line 197 is:
Code: Select all
bash fisheye2pano -v -90,52.5 -h 211.5 -f angle test.jpg out.png
Code: Select all
fisheye2pano: line 197: -h}: command not found
fisheye2pano: line 294: [: too many arguments
fisheye2pano: line 302: [: too many arguments
fisheye2pano: line 303: [: too many arguments
fisheye2pano: line 304: [: too many arguments
fisheye2pano: line 229: [: too many arguments
fisheye2pano: line 278: [: too many arguments
fisheye2pano: line 286: [: too many arguments
fisheye2pano: line 229: [: too many arguments
fisheye2pano: line 411: convert: command not found
--- FILE test.jpg DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---
basename $PROGNAME:
sed: can't read dirname $PROGNAME/basename $PROGNAME: No such file or directory
Code: Select all
PROGNAME=`type $0 | awk `{print $3}`` # search for executable on path
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Fisheye 235° to equirectangular
There is no "-h}" at that line in my script! Not sure what is going on. But I would suggest you test with a simple ImageMagick command line first. If that works, then try one of my simpler scripts such as 2colorthresh. But be sure you have followed my Pointers For Use on my home page at my like below. Also be sure you have all the Unix commands, such as bc, expr, type, sed, tr, etc.
I do not think you needed to install a separate Linux. Windows 10 comes with its own Unix. See the notes on my home page and especially, http://www.howtogeek.com/249966/how-to- ... indows-10/
Are you calling the script and the images from a Linux terminal or from a Windows CMD window?
I do not think you needed to install a separate Linux. Windows 10 comes with its own Unix. See the notes on my home page and especially, http://www.howtogeek.com/249966/how-to- ... indows-10/
Are you calling the script and the images from a Linux terminal or from a Windows CMD window?
Re: Fisheye 235° to equirectangular
I know, i pasted the line in my post... but it's what the command prompt says.
It also says another weird thing:
Code: Select all
--- FILE test.jpg DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---
But this could mean my environment is not properly configured.
I'll try.Not sure what is going on. But I would suggest you test with a simple ImageMagick command line first. If that works, then try one of my simpler scripts such as 2colorthresh. But be sure you have followed my Pointers For Use on my home page at my like below. Also be sure you have all the Unix commands, such as bc, expr, type, sed, tr, etc.
Yes I read so, but just typing "bash" in ALT+R window or in CMD window resulted in an error message redirecting to Windows Store to download Linux, so I did that.I do not think you needed to install a separate Linux. Windows 10 comes with its own Unix.
Yes, this is what I did.See the notes on my home page and especially, http://www.howtogeek.com/249966/how-to- ... indows-10/
From Windows CMD window.Are you calling the script and the images from a Linux terminal or from a Windows CMD window?
But I don't know what happens when calling bash from inside CMD window: does bash use current DOS folder as its current folder or as its home folder? How do I make a Windows folder directly accessible to bash?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Fisheye 235° to equirectangular
You must call the script from a Linux window, not a Windows DOS CMD window. If the script errors earlier in the argument parsing, then it may fail later with other messages about not being able to read the input image. So I would not worry about the second message. You need to run the script from a proper Linux terminal and then see if you get the -h error, which is not at the line you mention, but in the argument parsing.
Sorry I am not Windows (Unix) user, so cannot advise. But you should read more about the Windows built in Linux and how to get to its terminal window.
Sorry I am not Windows (Unix) user, so cannot advise. But you should read more about the Windows built in Linux and how to get to its terminal window.
Re: Fisheye 235° to equirectangular
It looks like your scripts cannot directly be used in Windows bash, they need a little tuning: when calling ImageMagick executables, script must use syntax ./FILENAME.exe rather than just the filename, and script itself must end by ".sh".
Apart from this, one version of your script which I have had characters ' and ` messed up; I downloaded it again and now they are ok.
But that's not enough:
running this command from command prompt:
results in these errors:
A little less errors appear if I run bash and then I run:
But it looks like they are jut warnings, because then the scripts starts processing:
At the end of the processing I eventually get the equirectangular image. I have yet to test if I can properly view it in some SW, but in the meantime I have a question: is it possible for the script to add to the final image the exif data needed by Facebook (and I guess other platforms and tools) to recognize it as a panoramic photo? (called "spherical photo)
https://developers.google.com/streetvie ... l-metadata
https://developers.facebook.com/docs/gr ... nce/photo/
Second question:
which are the correct parameters to use to convert a 235° fisheyes photo into equirectangular? I don't see any "235" in the commandline I used (copied from this thread).
Apart from this, one version of your script which I have had characters ' and ` messed up; I downloaded it again and now they are ok.
But that's not enough:
running this command from command prompt:
Code: Select all
bash fisheye2pano_win.sh -v -90,52.5 -h 211.5 -f angle test.jpg out.png
Code: Select all
line 197: type: fisheye2pano_win.sh: not found
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
fisheye2pano_win.sh: line 301: bc: command not found
fisheye2pano_win.sh: line 302: bc: command not found
fisheye2pano_win.sh: line 303: bc: command not found
fisheye2pano_win.sh: line 304: [: -eq: unary operator expected
fisheye2pano_win.sh: line 305: [: -eq: unary operator expected
fisheye2pano_win.sh: line 306: [: -eq: unary operator expected
fisheye2pano_win.sh: line 287: bc: command not found
fisheye2pano_win.sh: line 288: [: -eq: unary operator expected
fisheye2pano_win.sh: line 452: bc: command not found
fisheye2pano_win.sh: line 452: [: -eq: unary operator expected
fisheye2pano_win.sh: line 479: bc: command not found
fisheye2pano_win.sh: line 479: [: -eq: unary operator expected
Mogrify/Image/.[fisheye2pano_430.mpc]: 1 of 2, 100% complete
Code: Select all
fisheye2pano_win.sh -v -90,52.5 -h 211.5 -f angle test.jpg out.png
Code: Select all
line 197: type: fisheye2pano_win.sh: not found
fisheye2pano_win.sh: line 301: bc: command not found
fisheye2pano_win.sh: line 302: bc: command not found
fisheye2pano_win.sh: line 303: bc: command not found
fisheye2pano_win.sh: line 304: [: -eq: unary operator expected
fisheye2pano_win.sh: line 305: [: -eq: unary operator expected
fisheye2pano_win.sh: line 306: [: -eq: unary operator expected
fisheye2pano_win.sh: line 287: bc: command not found
fisheye2pano_win.sh: line 288: [: -eq: unary operator expected
fisheye2pano_win.sh: line 452: bc: command not found
fisheye2pano_win.sh: line 452: [: -eq: unary operator expected
fisheye2pano_win.sh: line 479: bc: command not found
fisheye2pano_win.sh: line 479: [: -eq: unary operator expected
Code: Select all
Mogrify/Image/.[fisheye2pano_430.mpc]: 1 of 2, 100% complete
image[]: 1 of 1621, 00% complete
https://developers.google.com/streetvie ... l-metadata
https://developers.facebook.com/docs/gr ... nce/photo/
Second question:
which are the correct parameters to use to convert a 235° fisheyes photo into equirectangular? I don't see any "235" in the commandline I used (copied from this thread).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Fisheye 235° to equirectangular
Adding .exe is not correct for Linux.
To get rid of those issue, you need to follow the directions on my home page to put the path to the scripts into your PATH environment variable. Without doing that, the script cannot use the unix type command to find the script. As you found out, those are warnings. That also allows you to run the script without using bash and from any directory. The other issue is that you need to be sure that your Windows 10 unix has all the unix tools it needs. It seems that you do not have the unix calculator, bc, installed. This was also noted on my home page about using Windows 10 unix.
Please read my home page carefully about the Pointers for Use and the Windows 10 installation notes.
ImageMagick does not have tools to add XMP or EXIF meta data. Any EXIF data would need to be added perhaps by EXIFTOOL. I am not sure it can write XMP data.
See the -h argument for the angular coverage in degrees of your fisheye. See my examples for other types of fisheye views and angular coverage.
To get rid of those issue, you need to follow the directions on my home page to put the path to the scripts into your PATH environment variable. Without doing that, the script cannot use the unix type command to find the script. As you found out, those are warnings. That also allows you to run the script without using bash and from any directory. The other issue is that you need to be sure that your Windows 10 unix has all the unix tools it needs. It seems that you do not have the unix calculator, bc, installed. This was also noted on my home page about using Windows 10 unix.
Please read my home page carefully about the Pointers for Use and the Windows 10 installation notes.
ImageMagick does not have tools to add XMP or EXIF meta data. Any EXIF data would need to be added perhaps by EXIFTOOL. I am not sure it can write XMP data.
See the -h argument for the angular coverage in degrees of your fisheye. See my examples for other types of fisheye views and angular coverage.
Re: Fisheye 235° to equirectangular
I have the windows versione of ImageMagick, it uses .exe files.
So bc command is not necessary for a proper output?
What about this error?
[: -eq: unary operator expected
So bc command is not necessary for a proper output?
What about this error?
[: -eq: unary operator expected