3D Anaglyph stereo plugin
Plugin BPP_Anaglyph transforms in real time every grayscale or color picture to anaglyph stereo (greek anaglyphos – relief), that allows to achieve the scene depth while looking the plain TV and video programs. At that time this effect achieved not only for the whole scene but for every moving object in picture.
To view 3D picture, prepared by anaglyph method, you'll need special anaglyph glasses, one glass must be red, the other – cyan. Such glasses are often come with different magazines and booklets to view anaglyph advertising and commercials placed there. Also, you may encounter them in school manuals on stereometry or atlases. You may even make them yourselves. You may find the detailed instructions of making glasses with the help of transparent film and ink jet printer here.
There are many resources, devoted to 3D stereo, including anaglyph. Here are some links: Article on Wikipedia, Anaglyph screenshots on Flickr.com, Anaglyph galleries on colorstereo.com, 3D Eric, Mars in 3D.
For true 3D stereo picture you need to shoot from two different points, but to transform one plain picture into stereo it is required rather sophisticated method and masterly handling of graphical tools. Nevertheless, having a series of pictures of moving scenes, it is possible to almost automatically achieve good results.
In plugin BPP_Anaglyph to get stereo effect it is used two methods – parallax shifting, that allows to gain scene depth while preview, and shift in time, that allows to get depth for particular objects in picture. Second method provides an 3D illusion only for moving objects.
While viewing video processed by BPP_Anaglyph plugin, stereo effect may not be achieved for every scene. But this is enough for our brain to more or less successfully reconstrust the rest, based on the gained information and everyday experience.
BPP_Anaglyph is also useful in recording mode. Once you record anaglyph video, you may investigate it frame by frame in your most comfortable video editor and analyze the hidden volume.
Plugin settings description
Switching stereo on/off is performed by arbitrary assigned hot key combination. By default – Alt-A.
Turns on motion vectors computation and parallax correction based on the gained results, that allows to achieve more correct stereo effect for more scenes. Turning off motion vector analysis lowers CPU load, but highly decrease possible combinations of sequencies of frames that allow to restore scene depth.
This parameter allows to setup picture for your type of glasses.
Defines overall scene position relative to screen plane. Negative value moves scene behind the screen, that is most convenient for perception.
For comfortable perception anaglyph picture must not have saturaded pure colors. Pure colors in anaglyph make annoying feeling of luminescence and lustre. So if there is a red banner in frame, it will be seen only through red filter and for only one eye. Cyan filter will not pass red light through for another eye and red banner will look as black. This makes severe discomfort and prevents the correct perception of stereo images.
Pay an attention, how bright blue background shines on a screenshot with 100% saturation. Near is the same scene with saturation 50%.
Setting «Saturation» dilutes all, including pure colors, with white. As a result all elements of anaglyph picture, although partially, but become visible through each filter.
TV picture delivered, digitized and processed in YUV format. That means that each pixel is defined by three components – luminosity Y and two chrominance (color-difference) components U and V. And in the YUY2 format chrominance is defined only for a half of pixels. Chrominance for every second pixel is calculated by video renderer based upon color values of neighbour pixels immediately on picture output to screen. As a result of discrepancy between real brightness and calculated color, final color of even pixels will slightly differ from estimated. In anaglyph such difference results in appearance of false outline on color differed components of picture.
Below is the two times magnified part of anaglyph picture on video renderer and it's red channel, visible through red filter. In red channel it can be easily seen the junk appeared from errors of calculation of color of even pixels.
There exist at least two schemes, according to which videorenderers calculate intermediate color values. Both schemes taken into account in «YUY2-correction» setting of plugin. Scheme «1» used by hardware overlays of some videoadapters, scheme «2» – in hardware overlays and in EVR (Enhanced Video Renderer). Appropriate scheme for each videorenderer can be chosen by empirical method.
The same part of picture after YUY2-correction.
If an output through DirectDraw7 primary surface is switched on in Behold TV application settings, then video stream will be passed in RGB format, which will be shown on the screen by videorenderer without any chenges or intermediate calculations. In this case there is no need in pixel color correction and «YUY2-correction» setting will be inactive.
Ghosting (from ghost) – is the common term to represent doubling or tripling phantom images appearing on screen as a result of disturbances. In anaglyph ghosting appears because red filter of anaglyph glasses lets pass part of spectre of green channel of display. As a result one eye sees the image prepared for another eye. The same, but in less degree is applicable to cyan filter.
In general, ghosting suppression is performed only for red channel. In plugin ghost-compensation is set by two points – for light amd dark parts of red layer of image. Setup is performed through red filter of anaglyph glasses with template, that represents all possible combinations of green and red colors of display. Through red filter it can be easily seen how green cells appear on a dark background at the bottom of template, and at the top left corner of template yellow cells stand out by brightness against a saturated red background.
While setting of ghost compensation in dark colors it is necessary to achieve that red background in left bottom corner of template have same brightness as green cells placed there.
By tuning ghost-compensation in light tones you need toselect maximal red level so that it's brightness summed with green (group of yellow cells in top left corner of template) will be the same as brightness of pure saturated red background.
Intermediate values of red color for ghost-compensation are calculated automatically. Dependency of visible brightness from RGB values of pixel described by nonlinear function, with coefficients selected individually for each display («Gamma correction»).
After ghost-compensation the template should look about the sample below, i.e. green and yellow cells should not strongly stand out against red background.
Most probable that you'll not succeed in full compensation of green channel. Characteristics of each display are unique and not always predictable. Especially it concerns LCD displays. Besides, green light, penetrating through red filter, is seen as green color, so in spite of matched brightness, you'll still see difference in color. Overlay of video adapter may also influence by it's own gamma correction applied to the picture on output to the screen.
List of changesVersion 1.01
Link to the plugin: BPP_Anaglyph_v350.zip (47.9 kb)