Log in

View Full Version : Deanaglyph green-magenta with full colored 2D Version


Pages : 1 [2]

Jack-Bauer
1st April 2010, 12:31
Unfortunately I wont be able to experiment the encoded movie as I have no 3D setup yet. Crossed eye vision has reached its limits.
In the next few months, I intend to build a dual setup with 2 sony's VPL-HW15 and polarized filters ;). My current VPL-VW50 will go to a friend.
As soon as I am ready, I will go on working on the subject (it is unlikely that a 3D version of the movie be ready by this time...:confused:)
Jack

AnnaFan777
5th April 2010, 04:06
I don't have the equipment (lcd glasses) to play them right now.

But, suppose I want to make full color stereo videos and put on
the net for people (who have those nvidia goggle).

What's the most common format for this kind of video?

Stack them left&right ? up&down ? or interlace ?

Any rules (dimension, framerate, etc ) that I should follow ?

..

Jack-Bauer
5th April 2010, 09:52
Thank you for the idea of sharing.;)

No standard has been defined yet.

IMO, stacked right-left is better because its the only one that allows to test the movie with no equipment (crossed eye vison) in full color 3D stereo. Any hardware/software should be able to use this format in input as it is widely used for video clips. Even 3D TV intend to use it (though it will use half horizontal definition).

In our case:
size = 2560 x 720
framerate = 23.976

In any case, using the free "3dtv.at.Stereo Transformation" filter from Peter Wimmer's stereoscopic player (the filter is free, the player is not) allows to convert from one format to the other when playing through correct graph.:)

Jack

Jack-Bauer
6th April 2010, 16:02
@MvB
I have found a new method for deghosting (and changed parameters a little bit). I have compared ga2 in both cases (side by side) and I think there is a significant improvement. You tell me.

As I understand, the anaglyph file had been created with "optimized anaglyphs" in mind, in order to decrease eye rivalry in case of saturated colors.
So both channels are taken now from the anaglyph to take this into account. I think theory is better complied with.

Too bad, this has little impact on color vectors accuracy.:(

####################################################### OLD ####################
comp = 0.22 # pre-compensation weight %
cut = 10 # pre-compensation cutoff
#------------------------------------
gn = vidl.greyscale()
ga = vidr.showgreen()
#------------------------------------
# create cutoff mask to prevent overcompensation in dark areas
cutoff = ga.levels(0,1,cut,127,255)

# create deghost mask (applying cutoff)
mask = overlay(gn,cutoff,mode="multiply",pc_range=true)

ga2 = levels(ga,0,0.7,255,0,255) # deghosting is non linear
ga2 = merge(ga2,mask,comp) # deghost !
ga2 = levels(ga2,0,1.3,255,0,255) # restoring gamma

####################################################### NEW ####################
comp = 0.23 # pre-compensation weight %
cut = 30 # pre-compensation cutoff
#------------------------------------
gn = vidr.RGBadjust(1,0,1).greyscale().levels(0,1,127,0,255) # NEW ! take magenta from ana
ga = vidr.showgreen()
#------------------------------------
# create cutoff mask to prevent overcompensation in dark areas
cutoff = ga.levels(0,1,cut,127,255)

# create deghost mask (applying cutoff)
mask = overlay(gn,cutoff,mode="multiply",pc_range=true)

ga2 = levels(ga,0,0.6,255,0,255) # deghosting is non linear
ga2 = merge(ga2,mask,comp) # deghost !
ga2 = levels(ga2,0,1.4,240,0,255) # restoring gamma
#################################################################################

MvB
8th April 2010, 15:25
Hi jack,

i'll try as soon as i can. Even better than your previous version? Great! Your previous version was already really good.
Got myself a new encoding monster, corei7-920@4GHz. I'm quite busy installing all the software again i was using, now in Win 7 64 Bit. Let's see.
Should try this thing and i think i have to play a little bit with multithreaded avisynth....

the next thing, when we've converted this movie to our satisfaction should be to try with red/cyan conversion. There are two promising candidates: final destination 4 and Porlar Express 3d. I already tried and final destination was quite good (without deghosting, it doesn't seem to work on the red channel?), but because of the overlay (no eye rivalry) the red color changed to pink :(, which looks a little bit strange but i didn't find a way to get rid of eye rivalry otherwise. Polar express is very complicated because of the VERY strong ghosting the motion vectors tend to find the "ghost" nearly as often as the real picture. But this is another story and will be told another time.

MvB

@AnnaFan777

Nvidia has a special version of peter wimmers player bundled with their 3dvision glasses. It's freely downloadable from nvidia but only works with 3dvision, of course.
I shouldn't matter what format you use because the players should be able to play theses formats anyway. I personally think the r/l format (crosseye) is the best because, as jack already stated, you can watch it directly without equipment and it's possible to watch bigger sizes of the two pictures with crosseye than with parallel technique. The default of 3dvision is r/l and the 3dvision 3d-picture-viewer takes r/l as default, too.
I always had the problem that avisynth delivers no picture @fullHD resolution (x2), don't know why.
BTW, did you ever watch the nurburgring-Demo-video from Peter wimmers site? I think it's downloadable from nivdia, too. there you can get a feeling for the quality of the upcoming 3d blu rays :)

Jack-Bauer
9th April 2010, 11:08
I have long considered the nurburgring demo as a mistake in the post, as I was unable to see two images on my 2D system, even mixed up. Still, with the good comments made about the clip, I think I was completely wrong.

Please find below a method for converting the clip into side by side format. Take it for what it is worth..

Graphedit with the 3dtv filters from Peter Wimmer:
- 3dtv.at Stereo Windows Media Source
- 3dtv.at Stereo Transformation

Set the parameters for the Stereo Transformation filter prior to connecting it:
- Input = Dual Input
- Output = Side By Side, Right Image Left
... then connect it:

http://img243.imageshack.us/img243/3972/3dnurburgring1.jpg

You can directly watch the clip as is by importing it in a player (Zoom Player for instance).

OR you can reencode the clip with:
http://img534.imageshack.us/img534/5091/3dnurburgring2.jpg
...and an AVS file such as:

DirectShowSource("U:\3D\nurburgring\stereo.grf",audio=false)
lanczosresize(2560,720)

Jack

MvB
10th April 2010, 11:06
@jack

encoding now "journey" and "my bloody valentine" with your new deghost-parameters. Let's see if there's any difference.

Jack-Bauer
10th April 2010, 11:54
Well done, MvB. Tell us the speed improvement with your new monster....:p

By the way, I tried to speed up the encoding process by reducing colormap sizes (I only have a dualAMD 4800+ CPU...):

###############################################################################
# then interleave the normal green channel with the deghosted green channel
gnga = interleave(gn,ga2).converttoyv12().reduceby2().reduceby2() # 320x180 COLORMAP

# and the maganta channel(s) with themselves
rbi = interleave(rb,rb).converttoyv12().reduceby2().reduceby2() # 320x180 COLORMAP

# doing motionanalysing of both green channels and applying the resulting motion vectors to vidl
mv_gnga = gnga.mvanalyse(blksize=blk, overlap=blk/2, chroma=false,truemotion=tm, dct=dct)
mc_g = gnga.mvcompensate(mv_gnga, thSCD2=255,thSCD1=10000, thSAD =thSAD)
mc_rb = rbi.mvcompensate(mv_gnga, thSCD2=255,thSCD1=10000,thSAD=thSAD)

# assigning the motion compensated magenta channel(s) to rbvidr
rbvidr = mc_rb.selectodd().converttorgb().bicubicresize(1280,720) # RESIZING COLORMAP prior to mergechroma

# and the motion compensated green channel to gvidr
gvidr = mc_g.selectodd().converttorgb().bicubicresize(1280,720) # RESIZING COLORMAP prior to mergechroma
###############################################################################

As far as I can see, the difference with the original colormap is not dramatic, and the encoding is 8 times faster...(must be 16 for the colormap part). Remember that Oliver Amato used a 64x64 colormap with no displacement vectors.

Jack

MvB
11th April 2010, 20:42
@jack

I would like the conversion as perfect as possible, so i'll work with the original colormap. Even if i don't see it at once, just knowing that it could be better would drive me crazy :)

Multithreaded avisynth isn't a good idea for mvtools, as i have seen now. a lot of artifacts:
setmtmode(2,8) -> horrible, but fast (4 fps)
setmtmode(2,4) -> less horrible
setmtmode(2,2) -> a little less horrible than the mode before
no mtmode -> quite good, but as usual: slow


so i stick to one thread.
But here the advantage: i could convert up to 4 movies at the same time (at the moment i do 2). Speed is between .72 and .93 fps

Jack-Bauer
11th April 2010, 23:25
MvB, You could also split the movie into 2 or 4 parts and encode them simultaneously, then append the results together. I did that on my first encode and it worked well. By the way, I did a two pass encoding, the first pass using the original 2D image for both channels to speed up the process.

I am not sure my new algorythm is better than the old one. Some scenes are much better but most are unchanged. I also took a special care for the light flare scene as it was really a challenge for ghosting and a pop-out that I would'nt miss (I set different parameters specially for this scene. Some others may need this also).

After the encoding was completed, I reencoded the title and the credits with different .AVS and inserted them in place of the wrong scenes. I also simply discarded the title that appears again in the credits.

For all these trials, I used XVID encoding as it is faster and easier to work with (cut, paste, reencode parts, etc...). Are you using mkv/x264?

Jack

MvB
12th April 2010, 09:34
Jack, I'm using mkv/x264.
That's a good idea splitting the movie. Thanks.

For this Hidef resolution vo 2560x720 i think it's the best choice qualitywise. The final movie with 2 audio tracks with crf=18 is abour 6-7GB and fits fine on a dvd9 in very good quality.

Jack-Bauer
13th April 2010, 14:15
Rolling back to anaglyphs..

For those (including me) who are not equiped with 3D hardware yet, please find below a method to play side-by-side movies in anaglyphs. It uses pre-compensation deghosting parameters adapted to your screen and glasses (similar to the so-called ghostbusting from realD).

The method can be used with any rendering technology, from anaglyphs to passive or shutter glasses, as long as you want to improve deghosting.

First, create an AVS file such as:
#################################################
DirectShowSource("D:\movies\Nurburgring-sidebyside.avi")

Rcomp=0.05
Lcomp=0.07
#------------------------------------------------------
R = crop(0,0,1280,0)
L = crop(1280,0,0,0)

Rc = merge(R,L.invert(),Rcomp)
Lc = merge(L,R.invert(),Lcomp)

stackhorizontal(Rc,Lc)
#################################################

Then create this GRF file:
http://img688.imageshack.us/img688/8084/compensate.jpg
...and set the stereo filter output to "Optimised green-purple anaglyphs". Then import the GRF into your favorite player.
(for the audio graph, you can as well use the Reclock filter if you wish). The GRF file and the Rcomp/Lcomp parameters are always the same, only the first line of the AVS file must be patched for another title.

In my case, I set Rcomp=0.05 and Lcomp=0.07. I also had to lower the black level using ffdshow's picture properties: Luminance offset=-17 (ffdshow video processor is called by the AVS file)

With these values, I get absolutely no ghosting (except in black areas of course, as it is cut off - the drawback of realD's ghostbusting...).

The parameters values depend on your screen type and glasses (I personally used my "Journey to the center of the earth" genuine cardboard green-magenta glasses).


EDIT: You can use my test clip: http://membres.multimania.fr/chrono2424/divers/3Ddeghostadjust-sidebyside.avi (use right click - saveas...)
Close one eye: If you see ghosting, try to adjust the matching parameter. Same for the other eye.

Jack

MvB
19th August 2010, 22:44
Did you get your dual projector setup yet?

Jeremy Duncan
24th August 2010, 10:54
Check out my thread for green magenta: link (http://forum.doom9.org/showthread.php?t=155943)

2005sylvain
23rd August 2011, 19:34
@jack-bauer except for the last script u can use it with any video program even virtualdub.

And thanks a lot to MvB,doom9 community and Oliver Amato for these nice script !!! I'm having a lot of fun with it and it works very well.

MvB
20th November 2011, 18:49
@jack-bauer except for the last script u can use it with any video program even virtualdub.

And thanks a lot to MvB,doom9 community and Oliver Amato for these nice script !!! I'm having a lot of fun with it and it works very well.

Nice to hear. Thanks.