IZ3D algorithm

Post Reply
peter64
One Eyed Hopeful
Posts: 48
Joined: Wed May 02, 2007 12:17 am

IZ3D algorithm

Post by peter64 »

Hey Guys,

I don't have an IZ3D monitor but I've been doing some thinking about how the monitor works and I would be interested in providing some test images to someone who has a monitor. I won't have them done until next weekend but I think I have a good idea how to take a L/R image pair and generate the back intensity image and the polarization image :).

on a per/pixel/color basis I think one needs to apply the following algorithm.
Assuming the polarization layer accepts 0-90 degree in standard increments. based on 24 bit color depth. 8 bits per color. 2^8 = 256. 128 pushed to a pixel would cause the forward polarization layer to generate a 45 degree polarity.

Anyways this is the formula i came up with.

pixel_color_intensity_right is defined as pcir
pixel_color_intensity_left is defined as pcil
array subscripts are purely for illustration

polarization_layer[x][y][color] = arctan(pcir[x][y][color]/pcil[x][y][color]);

intensity_layer[x][y][red] = sqrt(pcir[x][y][color]^2+pcil[x][y][color]^2)/sqrt(2)/255;

basically i suspect the way it works when full intensity is delivered on the back layer and 45 degree polarization is used giving even color sent to each eye we would be achieving max intensity this would be cos(45) or sin(45) approx 70.7%.

Thus if we want to send more color to one eye say the right eye we need to set the polarization correctly and then normalize the intensity to match with this common maximum of 70.7% intensity.

Example 1 right eye red = 255 and left eye red = 127.

polarization_layer = arctan(255/127); = 63.524
intensity_layer = sqrt(255^2 + 127^2)/sqrt(2)/255 = 0.78999

so let us assume the back panel generates 100 lumens for a given sub pixel.
backpanel_output = 100 lumens;
intensity_layer_output = 100 * 0.78999= 78.999 lumens;
left_eye = cos(polarization_layer) * intensity_layer_output = 35.215;
right_eye = sin(polarization_layer) * intensity_layer_output = 70.7056;

Example 2 right eye red = 10 and left eye red = 127.

polarization_layer = arctan(10/127); = 4.502
intensity_layer = sqrt(10^2 + 127^2)/sqrt(2)/255 = 0.35326

so let us assume the back panel generates 100 lumens for a given sub pixel.
backpanel_output = 100 lumens;
intensity_layer_output = 100 * 0.35326= 35.326 lumens;
left_eye = cos(polarization_layer) * intensity_layer_output = 35.215;
right_eye = sin(polarization_layer) * intensity_layer_output = 2.7729;

From this approach I think the lumen output for a pixel with 255 value will be constant across the board regardless of the polarization for either eye. I would be really interested in generating some test images based on this to see if it is correct and also which values cause the polarization layer to twist in which direction.

I don't have a monitor myself so I don't even know if it's possible to drive both layers of the screen manually or not. If anyone knows and could tell me I would appreciate it!

Peter

*edit*
Did some more hunting around online and thanks to niels press release and a reference to Oleg Tishutin I managed to track down a patent for a similar display to the IZ3D 22" however this one uses circular polarization. The patent was applied for in February 2007. 20070035830 and is accesible from the following link

http://appft1.uspto.gov/netacgi/nph-Par ... in+Oleg%22

The lines which would be pertinent should the displays use a similar software component would be as follows.

said stereopair comprising a left input image and a right input image, said processing means being further adapted to calculate an angle of polarization for each pixel of said second liquid crystal panel; and panel control means for receiving signals from said processing means and controlling operation of said panels in accord with said signals; wherein said composite image represents an average color intensity for each pixel of the left and right input images, and said angle of polarization .phi. for each pixel of the second liquid crystal panel can be calculated from the relationshiptan .phi.=Square root of (L/R)where L is the intensity of a corresponding pixel for the left input image and R is the intensity of a corresponding pixel for the right input image

I do wonder why they sqrt the ratio before they arctan
"tan .phi.=Square root of (L/R)"
And I do wonder why they ambiguously refer to it as an average
"average color intensity for each pixel of the left and right input images"

It turns out I was slightly wrong cause it's cos^(alpha) that gives the light thruput of a polarizing filter :) I will repost with a correction
peter64
One Eyed Hopeful
Posts: 48
Joined: Wed May 02, 2007 12:17 am

Corrected Formulas

Post by peter64 »

polarization_layer[x][y][color] = arctan(sqrt(pcir[x][y][color]/pcil[x][y][color]));
intensity_layer[x][y][color] = (pcir[x][y][color]+pcil[x][y][color])/2;
(of pcil[x][y][color] is 0 then we get arctan(inf) which is 90 degrees

In accordance with the patent :)
Patents are great! haha

Thus the reciprocal formulas are as follows.

pcir[x][y][color] = 2*intensity_layer[x][y][color]*sin^2(polarization_layer[x][y][color])
pcil[x][y][color] = 2*intensity_layer[x][y][color]*cos^2(polarization_layer[x][y][color])

There is some extra formula that they use to adjust based on the effectivity of the polarization layer and the intensity layer on different colors for different LCD panels but I think this is a good start.
peter64
One Eyed Hopeful
Posts: 48
Joined: Wed May 02, 2007 12:17 am

samples and c code

Post by peter64 »

Hey Guys,

No one seems at all interested in this except for me hahaha. Go figure.
Anyways I made my software to generate the polarization layer and the intensity layer screens provided two 24 bit color depth bitmaps. I also made the inverse formula to make sure it was correctly reversible, under simulated viewing conditions. All works fine. If anyone actually wants to try loading these images up they will need to download my 14 mb archive.

I compressed using winrar as it made the smallest output file.

I couldn't just post jpegs because the compression on the polarization layer would completely mess up the sending of images to appropriate eyes. So I had to provide bitmaps. I also included the source code and a compiled binary in both release and debug. You never know when this might come in handy.

Available at:
http://www.box.net/shared/ho2qnv8cyb

For those interested the final generation algorithm was
f_out_i_l = (f_in_r+f_in_l)/2;
if (f_in_l == 0)
f_out_p_l = 255;
else
f_out_p_l = atan(sqrt((double)f_in_r/(double)f_in_l)) * 2 * 255 / 3.1415926 + 0.5;

The final reversing algorithm was
double sin_2_p_l = sin(f_in_p_l * 3.1415926 / 2 / 255) * sin(f_in_p_l * 3.1415926 / 2 / 255);
double cos_2_p_l = cos(f_in_p_l * 3.1415926 / 2 / 255) * cos(f_in_p_l * 3.1415926 / 2 / 255);
f_out_r = sin_2_p_l*2*f_in_i_l + 0.5;
f_out_l = cos_2_p_l*2*f_in_i_l + 0.5;
User avatar
Neil
3D Angel Eyes (Moderator)
Posts: 6882
Joined: Wed Dec 31, 1969 6:00 pm
Contact:

Post by Neil »

I don't know how to respond to your emails. With all the formulas you are posting, I can't help but wonder if you are looking to take over the world? :o

Regards,
Neil
peter64
One Eyed Hopeful
Posts: 48
Joined: Wed May 02, 2007 12:17 am

Post by peter64 »

Sorry hehehe I just thought other people might be interested in talking about how it worked.

I posted some pictures this time to test with :)

In the zip i posted theres an out_b.bmp and an out_f.bmp
if you put the out_b.bmp on the back LCD panel and hte out_f.bmp on the front I'de be interested to know if you see 3d :). If not try flipping the glasses. I used a farcry image you posted earlier to make this pair.

*edit*
direct link to the front and back images to make it easier to get them.
front: http://www.box.net/shared/tsd7a79zyd
back: http://www.box.net/shared/js8yg4q40t

the thought crossed my mind that the front image for polarization may need to be inverted depending on which way around IZ3D placed there second LCD panel used to polarize the screen output for glasses.
sharky
3D Angel Eyes (Moderator)
Posts: 1819
Joined: Fri May 25, 2007 4:08 am
Location: Italy
Contact:

Post by sharky »

personally i think that this is to complex to explain to "normal" people.. 98% don't even know what arctan is and lots of people here are to young. i personally think that something shown with a picture and explained "for children" would interest in much more people.. i studied in one of the best technical high schools here in italy (NOT UNEIVERSITY) but for me it sounds much to complex..

but this is just my thought...

bye bye hava nice day..

ps: i AM interested to understand the working.. but the working, not the mathematica complexity behind it.. :)
Adam Savage: "I reject your reality and substitute it for my own."
Jamie Hyneman: "It's really cool, but really unusual."

Image
xpeace
One Eyed Hopeful
Posts: 2
Joined: Fri Feb 15, 2008 7:28 pm

Post by xpeace »

Wow I`m trying to get a dual 3D Webcam Setup running in DirectShow and that was just what I needed to create a custom 3D Plugin for my iZ3D Monitor - Thank you so much !!!
User avatar
Likay
Petrif-Eyed
Posts: 2913
Joined: Sat Apr 07, 2007 4:34 pm
Location: Sweden

Post by Likay »

Peter 64. I can try it for you. Will take a pic with the camera to show you too.

edit: Picture here:

Image

To make a fair comparison i need the original stereopicture. But for now it looks like the iz3d team also had made some nice adjustments to the formula. There is dept especially the gun but the ghosting seems to be far much more than it use to be.

cheers
Mb: Asus P5W DH Deluxe
Cpu: C2D E6600
Gb: Nvidia 7900GT + 8800GTX
3D:100" passive projector polarized setup + 22" IZ3D
Image
peter64
One Eyed Hopeful
Posts: 48
Joined: Wed May 02, 2007 12:17 am

Post by peter64 »

hey Likay,

Sorry for the really late reply and sorry to bump a thread it isn't my intention. Anyways yeah just to follow up there was a thread on IZ3D that said the second polarization layer doesn't polarize different colors seperately.. ? (not really sure what it means) I think it means that all three R G and B cells on the lower panel are polarized by a single upper panel cell. Something like this.

____ ____
| | | | | |
| | | | | |
------ ------

IZ3D commented that it was (10 times cheaper? not sure about this) to handle the polarization of the colors together rather than polarizing them independently. I believe this leads to the ghosting that most people describe with IZ3D.

In terms of fixing my algoritm to match the IZ3D algorithm I guess one would need to figure out which of the RGB fields was used to control the polarity of the upper layer single cell covering the 3 lower cells. Perhaps it is the R G or B cells that control the polarizing layer, or perhaps it is a combination of them all (ex least significant bits). Secondly one would need to figure out the optimal way to merge the color desparities between the left and right eye in such a way to minimize ghosting when selecting the single polarity value for the upper layer polarizing cell :). Anyways I'll have to leave this up to someone else to figure out :) thanks for your interest guys.

Peter

*EDIT*
The link to the IZ3D Details:
http://forum.iz3d.com/viewtopic.php?t=1 ... c&start=17
10 times cheaper was refering to making a thiner LCD sandwhich not sub pixel pressence
Last edited by peter64 on Mon Apr 07, 2008 10:56 am, edited 1 time in total.
sharky
3D Angel Eyes (Moderator)
Posts: 1819
Joined: Fri May 25, 2007 4:08 am
Location: Italy
Contact:

Post by sharky »

on the back pannel you have the colored pixels.. each pixel is a mixture of the two colors that are there (for example a white could in teh sky, will make a bright blue pixel where the right and left iamge overlay)

the front pannel changes the brightness of that pixel. if a pixel is bright for one eye it is dark for the other one. so for example a polarization angle of -45 deg would give black on one eye and the mixed color for the other eye.

back to the example of the sky... with a polarization of 0 deg both eyes would see a bright blue.. by polarizing it at +20 degrees one eye has a even brighter blue which becomes white, and the other one has a darker blue which then matches the color of the sky..

i have no idea if i am right, but this is the explanation i got myself of the system...

regards

igor
Adam Savage: "I reject your reality and substitute it for my own."
Jamie Hyneman: "It's really cool, but really unusual."

Image
Mel
Binocular Vision CONFIRMED!
Posts: 287
Joined: Sat Nov 10, 2007 7:45 am

I tried the two images on my iZ3d...

Post by Mel »

...and I too could see depth, but I find the whole scene to be quite disorienting. Perhaps there's too much separation (which I find to be true for almost all user-posted images I get from this site or others).
User avatar
Neil
3D Angel Eyes (Moderator)
Posts: 6882
Joined: Wed Dec 31, 1969 6:00 pm
Contact:

Post by Neil »

Try reversing your L/R view to be sure.

Regards,
Neil
Mel
Binocular Vision CONFIRMED!
Posts: 287
Joined: Sat Nov 10, 2007 7:45 am

Post by Mel »

Neil wrote:Try reversing your L/R view to be sure.

Regards,
Neil
Not sure how to do that, since all I did to view the combined image was to edit each image in MS Paint (window maximized), putting the 'grayscale' image on one monitor, and the color image on the other.
User avatar
LukePC1
Golden Eyed Wiseman! (or woman!)
Posts: 1387
Joined: Wed May 16, 2007 11:30 am
Location: Europe
Contact:

Post by LukePC1 »

If you use 2 pairs of glasses, you could watch through the left glas of one with the right eye and through the right glass of the other glasses with the left eye....

O
O right Eye

O left Eye
O
^^ Glasses

Maybe mirroring both images helps, too? Maybe it's necessary to cut half of the picture and add it at the other side...

3) You could turn your head by 90° to the side. That way polarization is 'swapped', but the picture will look wrong, too...
Play Nations at WAR with this code to get 5.000$ as a Starterbonus:
ayqz1u0s
http://mtbs3d.com/naw/" onclick="window.open(this.href);return false;

AMD x2 4200+ 2gb Dualchannel
GF 7900gs for old CRT with Elsa Revelator SG's
currently 94.24 Forceware and 94.24 Stereo with XP sp2!
Mel
Binocular Vision CONFIRMED!
Posts: 287
Joined: Sat Nov 10, 2007 7:45 am

Post by Mel »

LukePC1 wrote:If you use 2 pairs of glasses, you could watch through the left glas of one with the right eye and through the right glass of the other glasses with the left eye....

O
O right Eye

O left Eye
O
^^ Glasses

Maybe mirroring both images helps, too? Maybe it's necessary to cut half of the picture and add it at the other side...

3) You could turn your head by 90° to the side. That way polarization is 'swapped', but the picture will look wrong, too...
Thanks, Luke. Sounds like I might injure myself if I pursue this any further... :)
Post Reply

Return to “General Stereoscopic 3D Discussion”