Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th March 2015, 15:45   #1  |  Link
Kisa_AG
Registered User
 
Join Date: Sep 2005
Location: Moscow, Russia
Posts: 58
"Defish" with different map projections

I made few functions which make defish with different map projections, like Lambert Cylindrical Equal Area, Mercator and Miller

projections.

These function are based on xyremap, thanks davidhorman for such a powerful filter!

Right now there are two different functions ready.

Both these functions available in ZIP archive attached.

Current version: 1.1

Here is the direct link: https://www.dropbox.com/s/il7g2lh39s...v.1.1.zip?dl=0
#######################
CHANGE LIST:

16/03/2015 v1.0
- First release

17/03/2015 v1.1
- Core plugin (xyremap v0.2) changed to v0.3 due to great speed improvements (up to 40x).
#######################

It's Cylindrical_Equal_Area.avsi and Mercator_Projection.avsi.

The first one makes the following projections depending on the Standard Latitude settings:
0 degrees - Lambert cylindrical equal-area projection (this is my choise, the reason why I decided to make this function)
30 degrees - Behrmann cylindrical equal-area projection
37.383 degrees - Tristan Edwards projection
44.138 degrees - Peters projection
45 degrees - Gall orthographic projection
50 degrees - Balthasart projection

The second one makes Mercator and Miller projections depending on "Miller" settings.

There are special features which helps to find right zoom and crop values to get output picture without black areas around it.

Quote:
#### Cylindrical_Equal_Area #######
Typical usage:
ConvertToRGB32(matrix="Rec709")
Cylindrical_Equal_Area(FocalLenght=3.5, zoom=0.97, VCropping=54)
ConvertToYV12(matrix="Rec709")

Usage instruction:
1. Input color format must be RGB32
2. Set the desired StandardLatitude_Fi_s (in degrees). For the first time it's better to leave it by default.
Default value is 0 degree, it's Lambert cylindrical equal-area projection.
3. Set FocalLenght and MatrixWidth (in mm). Then you can fine tune it visually, if you want.
Default FocalLenght is 2.77mm and MatrixWidth=6.28mm, these values are for GoPro 3BE.
4. Set zoom=0, open script in VirtualDub and move forward to find the number of frame,
which have no left and right black areas.
5. Set zoom=frame_number_founded/100.
6. Set VCropping=-1, open script in VirtualDub and move forward to find the frame,
which have no top and bottom black areas between cropping lines.
Read the correct cropping value in upper left corner of picture.
7. Set VCropping=cropping value founded.

###################################

#### Mercator_Projection #######
Typical usage:
ConvertToRGB32(matrix="Rec709")
Mercator_Projection(FocalLenght=3.5, zoom=0.97, VCropping=54, Miller=True)
ConvertToYV12(matrix="Rec709")

Usage instruction:
1. Input color format must be RGB32
2. Set the desired projection - Mercator or Miller.
3. Set FocalLenght and MatrixWidth (in mm). Then you can fine tune it visually, if you want.
Default FocalLenght is 2.77mm and MatrixWidth=6.28mm, these values are for GoPro 3BE.
4. Set zoom=0, open script in VirtualDub and move forward to find the number of frame,
which have no left and right black areas.
5. Set zoom=frame_number_founded/100.
6. Set VCropping=-1, open script in VirtualDub and move forward to find the frame,
which have no top and bottom black areas between cropping lines.
Read the correct cropping value in upper left corner of picture.
7. Set VCropping=cropping value founded.

###################################
More info on functions are in ReadMe files inside ZIP archive.

And here are six pictures which shows (I hope so) the advantage of Lambert cylindrical equal-area, Mercator and Miller

projections over the standard defishing.

PS: These Lambert cylindrical equal-area, Miller and Mercator projections are very suitable for defishing of 4:3 frames because

the output frame is very close to 16:9 apect rate and it's not necessary to crop big parts of picture.

PPS: Special thanks to Edgar from MathMap Google group!
His letter about different projections (https://groups.google.com/forum/#!to...ap/9aL2CqC8eDA) saved me a huge

amount of time for formulation and debugging.
Attached Images
 
Attached Files
File Type: zip Defish_Different_Projections_v.1.1.zip (7.2 KB, 89 views)

Last edited by Kisa_AG; 17th March 2015 at 09:22. Reason: version update from 1.0 to 1.1
Kisa_AG is offline   Reply With Quote
Old 16th March 2015, 23:00   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,034
You should try your functions with the new version of xyremap (new URL, the old version is still at the old URL), and add "static=true" to the parameter list when you call it. You should find it a lot quicker.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is online now   Reply With Quote
Old 17th March 2015, 09:26   #3  |  Link
Kisa_AG
Registered User
 
Join Date: Sep 2005
Location: Moscow, Russia
Posts: 58
Quote:
Originally Posted by davidhorman View Post
You should try your functions with the new version of xyremap (new URL, the old version is still at the old URL), and add "static=true" to the parameter list when you call it. You should find it a lot quicker.
Yes, it's much, MUCH faster!
Up to 40 times on my GoPro 3BE 2.7K @25p files! Incredebly!
Thnaks, davidhorman!

I've updated functions and changed links in the first post.
Kisa_AG is offline   Reply With Quote
Old 24th April 2015, 14:31   #4  |  Link
bigboss97
Registered User
 
Join Date: Jul 2008
Posts: 31
I'm attaching an image from my Ricoh Theta camera. Would you be able to give me some advice how I can apply the defish function?

There are 2 "eyes" :-) So I assume the image cannot be flatten as one. My aim is to simulate camera pan 360, i.e. there is always only one part of the image visible.

Thanks
Attached Images
 
bigboss97 is offline   Reply With Quote
Old 24th April 2015, 15:45   #5  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,034
Attachment approval can take some time. You could try an external image host instead.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is online now   Reply With Quote
Old 24th April 2015, 15:48   #6  |  Link
Kisa_AG
Registered User
 
Join Date: Sep 2005
Location: Moscow, Russia
Posts: 58
Quote:
Originally Posted by bigboss97 View Post
I'm attaching an image from my Ricoh Theta camera. Would you be able to give me some advice how I can apply the defish function?

There are 2 "eyes" :-) So I assume the image cannot be flatten as one. My aim is to simulate camera pan 360, i.e. there is always only one part of the image visible.

Thanks
Hello!

Sorry, I can take a look on it only on monday because I'm skiing in mountains right now.
Kisa_AG is offline   Reply With Quote
Old 26th April 2015, 01:46   #7  |  Link
bigboss97
Registered User
 
Join Date: Jul 2008
Posts: 31
Quote:
Originally Posted by Kisa_AG View Post
Sorry, I can take a look on it only on monday because I'm skiing in mountains right now.
Thanks in advance. Have a good time!

Here are some camera information from that image:
F-Number: F2.1
Focal length [mm]: 0.75
35mm focal length [mm]: 6
bigboss97 is offline   Reply With Quote
Old 6th May 2015, 05:12   #8  |  Link
bigboss97
Registered User
 
Join Date: Jul 2008
Posts: 31
Quote:
Originally Posted by Kisa_AG View Post
Sorry, I can take a look on it only on monday because I'm skiing in mountains right now.
Any update?
bigboss97 is offline   Reply With Quote
Old 6th May 2015, 08:31   #9  |  Link
Kisa_AG
Registered User
 
Join Date: Sep 2005
Location: Moscow, Russia
Posts: 58
Quote:
Originally Posted by bigboss97 View Post
Any update?
Sorry, I have no idea what can be done with it.
It seems to me that photos has been defished during panorama creation.
I would suggest you to take a look on Hugin - panorama creation tool, there are many different projections there for all kind of panorams.
Kisa_AG is offline   Reply With Quote
Old 7th May 2015, 02:10   #10  |  Link
bigboss97
Registered User
 
Join Date: Jul 2008
Posts: 31
Quote:
Originally Posted by Kisa_AG View Post
Sorry, I have no idea what can be done with it.
It seems to me that photos has been defished during panorama creation.
I would suggest you to take a look on Hugin - panorama creation tool, there are many different projections there for all kind of panorams.
Thanks.
I'll play around with the defish plug-in first. I love avisynth :-) I've used it for so many different purposes. It's really powerful.
bigboss97 is offline   Reply With Quote
Old 29th July 2020, 11:19   #11  |  Link
an3k
Registered User
 
an3k's Avatar
 
Join Date: Oct 2006
Location: Munich, Germany
Posts: 171
Please excuse my probably stupid question but can I use your script to "defish" into "Equirectangular" for eg. VR180 videos? What projection (degree) would I have to use? Thanks A LOT!
an3k is offline   Reply With Quote
Reply

Tags
defish, fisheye, lambert, mercator, projection

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.