如何使用 Matlab 创建偏振 3D 图像?

发布于 2024-10-16 11:40:28 字数 82 浏览 8 评论 0原文

我想使用 Matlab 或 C# 创建偏振 3D 图像?。
有什么方法可以使用 Matlab 或 C# 从任何 2D 图像创建 3D 图像吗?

I want to create polarized 3D image using Matlab or C#?.
Is any way to create 3D image from any 2D image using Matlab or C#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

献世佛 2024-10-23 11:40:28

偏振 3D 是在物理世界中通过物理投影仪照射到物理屏幕的同一点上创建的效果。它不是可以在计算机屏幕上的图像中创建的数字效果。您无法编写代码将图像渲染到普通计算机屏幕上,然后使用偏光眼镜观看 3D。

Polarized 3D is an effect created in the physical world with physical projectors shining onto the same spot of a physical screen. It's not a digital effect that you can create in an image on a computer screen. You cannot write code to render an image onto a normal computer screen then see 3D with the polarized glasses.

旧城空念 2024-10-23 11:40:28

与偏光眼镜一起使用的立体图像是通过投影左眼和右眼图像来创建的,以便它们通过装有偏光滤光片的单独投影仪重叠。

红色和绿色有色眼镜也是如此(与旧款式浮雕图像)。

如果您只有一张 2D 图像,则在不参与手动图像处理的情况下无法从中创建 3D 图像。

Stereoscopic images for use with polarised glasses are created by projecting the left and right eye images so that they overlap through separate projectors which have a polarising filter fitted.

The same is true for the red and green tinted glasses (which are not the same as the old style anaglyph images).

If you only have one 2D image you cannot create a 3D image from it without getting involved in manual image processing.

许仙没带伞 2024-10-23 11:40:28

构建您自己的偏振立体投影系统

偏振光学原理

偏振光

自 19 世纪末以来,我们知道,光可以用以下术语来描述:
的电磁波。其背后的理论是众所周知的
麦克斯韦方程组。因为这不仅仅是一篇关于电动力学的文章
要点:

  • 光是波长在 800 纳米(红色)至 400 纳米(紫色)之间的电磁辐射。
  • 电磁辐射具有电场和磁场分量。
  • 电场和磁场是横向的,这意味着垂直于波的传播。
  • 电场和磁场彼此垂直。

电场矢量(也可以 使用磁场,但约定
是使用电场)确定极化。有两种
极化:

  • 线性极化:电分量保持在一个平面(极化平面)中
  • 圆极化:每个周期电分量“摆动”到不同的方向
    如果沿着传播方向观察,场矢量可能会循环经过:

    • ↑→↓← -- 这称为右转极化
    • ↑←↓→ -- 这称为左转极化
      圆偏振效应是通过延迟一个分量而产生的
      四分之一波长的线偏振光。

另请参阅这篇维基百科文章
http://en.wikipedia.org/wiki/Polarization_(waves)

创建偏振光

维基百科有一篇关于细节的优秀文章
http://en.wikipedia.org/wiki/Polarizer

这是要点。

Linear Polarization

线偏振光可以通过多种方式获得:

  • 通过滤除所有不需要的偏振分量
    来自具有宽偏振分布的光。
    所有以统计方式发射的光(热辐射,
    高压气体放电(照明电弧)具有这种特性。
    可以使用滤光器过滤所需的偏振面。
    以下过滤器是已知的:

    • 布儒斯特分束器使用布儒斯特反射进行分裂
      一束光分成两个偏振分量,偏振
      相互垂直。
    • 双折射利用了某些晶体的现象
      对于不同的偏振有不同的折射率
      飞机。光路再次分开。
    • 拉伸聚合物的吸收。拉伸聚合物给出
      它是各向异性结构。一些各向异性聚合物会吸收
      只有平行偏振(或垂直偏振)的入射光
      取决于材料)到拉伸方向。
  • 激光器发出的光是线偏振的。
    根据激光器的构建方式,偏振平面将
    随着时间的推移逐渐改变。

在光学

Circular Polarization

中,圆偏振是由通过线性偏振
光穿过一些各向异性材料,这会延迟其中之一
分量(电或磁)的四分之一波长。这
称为λ/4延迟器

线性偏振与各向异性材料主偏振之间的角度
轴确定左转和右转偏振光之间的比率,结果:

  • 倾斜 +45° 的入射线偏振光将完全左转。
  • 倾斜-45° 的入射线偏振光将完全右转。
  • 倾斜 0° 的入射线偏振光将包含 50% 左转和 50% 右转。

应该指出的是,由于光路的可逆性
圆偏振光通过 λ/4 延迟片将
将其转变成相应一定偏振的线偏振光
飞机。该线偏振光可以再次被线性过滤
偏光镜。这就是圆偏振 3D 眼镜的工作原理。

偏振光和与屏幕

Scattering and Diffraction

交互典型的投影屏幕使用非常小的颗粒,通常是二氧化钛,
将光散射和衍射到各个方向。在散射过程中
光在粒子之间反射多次。当每次弹跳离开时
在大统计方案中偏振的光波孤子任何值得注意的
偏振消失。

因此普通的白色投影屏幕不适合偏振立体投影。

Metallic Reflection

构建偏振立体投影系统的关键是使用
保留入射光偏振的屏幕材料。
这是通过在比
光的波长。

DIY 立体投影系统

制作 DIY 银幕

您需要:

  • 铝粉颜料
  • 透明丙烯酸基底
  • 深黑色纺织染料
  • 画布

操作方法如下:

  1. 将画布染成深黑色。这将吸收任何未反射的光,
    而不是分散它。让它彻底干燥。您可以重复步骤1
    多次。
  2. 在现在深黑色染色的画布上涂一层透明丙烯酸基底。
    做一侧就足够了。所有进一步的步骤现在都在这个透明的丙烯酸底座上完成。
  3. 制作非常厚的铝丙烯酸漆。以下是一些提示:
    • 将铝粉与丙烯酸基料分批混合。
      不要通过与水混合来制作铝粉浆!
    • 将每一小批铝粉放入丙烯酸树脂中后
      充分搅拌,使其成为均匀的物质。
    • 您最终应该得到 1 份铝粉和 1 份丙烯酸底漆
    • 获得浓稠的油漆后,用 1 份水稀释。
  4. 在准备好的画布上涂上一层铝丙烯酸漆。让每一层干燥。
    重复步骤 4,直到获得均匀铝金属漆面,且没有任何痕迹。
    黑色部分闪闪发光。

视频投影

Single Projector Setup

大多数电影院都使用一台投影仪和 RealD Z 滤波器系统
以 144Hz 的交换速率交替显示左右图像,其中
Z 滤波器动态调制偏振。

从技术上讲,Z 滤波器只是一些大型液晶面板。 LC 具有
属性,根据电压旋转通过的光的偏振平面
应用于LC。因此,Z 滤波器可将光线旋转 +/-45°,并受控制
通过与左右图像交换同步的交流电压。 Z 滤波器之前
是一个线性偏振器,其后面是一个 λ/4 延迟器,与线性偏振器平行
偏光镜。 Z 滤波器将偏振平面旋转到仅
左转或右转偏振光离开系统,如果有立体
显示材料。

如果 Z 滤镜关闭,光线将变成 50% 左、50% 右
转向极化。

完全可以 DIY 重新创建该系统。然而,这将被描述
仍有待撰写的另一篇文章中。

Dual Projector Setup

使用两台投影仪是投影不同偏振图像的最简单方法。
这个想法很简单:每台投影机都配备了与
滤光器位于观看者眼镜的眼部滤光器中,使光线从“左侧”投射
投影仪将仅到达左眼,“右”投影仪的光到达
只有观看者的右眼。

Selecting the Projectors

归结为以下几点:您需要两台相同的投影仪,它们可以发出
非偏振光 - 即使用经典弧光灯的 DLP 投影仪 -
或所有基色的均匀线偏振光。
后一种情况更具吸引力,因为您不会“丢弃”光。但越安全
即,选择某种 DLP 类型。请注意,那些新型漂亮的 LED 投影仪通常会展示
一些不均匀的极化,这使得它们很难用于下一个不可能的用途
偏振立体视觉。

Making the Filter Slides

投影仪的滤光片可以由同一种 3D 眼镜制成
观众佩戴的。 RealD 的 3D 眼镜仅供一次性使用。
虽然电影院设置了回收箱,但如果你
把你在电影院拿到的眼镜归你自己用。事实上大多数电影院都会
可以将一些眼镜退回到回收箱中,这没有问题。

您可能会想将这些滤镜放在投影仪镜头后面。
然而,这是粗鲁的,并且会很快破坏这些过滤器。请记住,50%
灯的功率可能最终进入过滤器,从而使过滤器升温。

因此,您希望将光的功率分布到相当大的区域。

您需要:

  • 一些用过的 RealD 眼镜
  • 4 块相同尺寸的相框玻璃(大约 50 毫米 × 50 毫米)
  • 锋利且精确的剪刀或剪纸机
  • 一支细尖水溶剂记号笔(或类似笔) - 白板笔就可以!
  • 一些胶带。管道胶带效果非常好(什么,您还期待其他东西吗?)

事情是这样的:

  1. 在所有 3D 眼镜中标记背面(即朝向眼睛的一侧)
    中间有一个小写字母“L”或“R”(左眼或右眼)。
  2. 通过在眼镜框上施加一些扭转/扭矩,您可以分离 RealD 眼镜
    释放过滤器。
  3. 将过滤器分为左过滤器和右过滤器。
  4. 将过滤器切成大小相等的矩形块,并将它们分类为左右。
    不要让它们成为二次方。重要的是你仍然知道内部的方向
    眼镜框。
  5. 清除标记,确保您仍然知道正面和背面是什么。
  6. 将滤光片排列在玻璃板上,使其几乎填满玻璃板。当然
    全部面向相同(即全部正面或全部背面)。
    保持间隙尽可能小。
  7. 安装第二块玻璃板,沿边框粘贴鸭胶带。

现在您已经有了左右偏光滤镜幻灯片。戴上同品牌的 3D 眼镜
并通过观察确定每个窗格最有效地阻挡光线的方向
通过过滤幻灯片。 重要提示:阻挡眼睛光线的滤光片平面
直接通过它观看将是稍后投影该特定眼睛的幻灯片。
原因是反射改变了手性,即左转和右转是
通过反射交换。

Setting up the Projection

  1. 对齐投影仪,使其图像匹配。垂直对齐必须完美。
    水平对齐可能会略有偏移,但应尽可能做到最好。
  2. 将滤光片放置在光线经过的地方。应使用整个过滤面积。

显示立体素材,让每个投影仪都显示出自己眼睛的画面。

Build your own Polarized Stereoscopic Projection System

Principles of Polarization Optics

Polarized Light

Since the late 19th century we know, that light can be described in terms
of electromagnetic waves. The theory behind it are the well understood
Maxwell Equations. Since this is not an article about electrodynamics just
the essentials:

  • Light is electromagnetic radiation with wavelenghts between 800nm (red) to 400nm (violet).
  • Electromagnetic radiation has an electric and a magnetic field component.
  • The electric and magnetic field are transversal, which means perpendicular to the propagation of the wave.
  • The electric and magnetic field are perpendicular to each other.

http://en.wikipedia.org/wiki/Electromagnetic_radiation

The electric field vector (one could also use the magnetic field, but convention
is to use the electric filed) determines the polaization. There are two kinds of
polarization:

  • Linear polarization: The electric component remains in one single plane, the polarization plane
  • Circular polarization: With each cycle the electric component "swings" into different direction
    If you look along the propagation the field vector may cycle through:

    • ↑→↓← -- this is called right turning polarization
    • ↑←↓→ -- this is called left turning polarization
      The effect of circular polarization is created by retarding one component
      of linear polarized light by a quarter of a wavelength.

See also this Wikipedia article
http://en.wikipedia.org/wiki/Polarization_(waves)

Creating Polarized Light

Wikipedia has an excellent article on the details
http://en.wikipedia.org/wiki/Polarizer

Here's the essentials.

Linear Polarization

Linear polarized light can be obtained in various ways:

  • By filtering out all unwanted polarization components
    from light with a broad polarization distribution.
    All light emitted in a statistical manner (thermic radiation,
    high pressure gas discharge, lighting arcs) has this property.
    One can filter the desired polarization plane using a filter.
    The following filters are known:

    • Brewster Beam Spliters use brewster reflection to split
      a beam of light into two polarization components, polarized
      perpendicular to each other.
    • Birefringence employs the phenomenon that some crystals
      have different indices of refraction for different polarization
      planes. Again the light ways are split.
    • Absorption in strechted polymers. Stretching a polymer gives
      it an anisotropic structure. Some anisotropic polymers will absorb
      only incoming light polarized parallel (or perpendicular, it
      depends on the material) to the strechting direction.
  • The light emited from a laser is linear polarzied.
    Depending on how the laser is built, the polarization plane will
    gradually change over time.

http://en.wikipedia.org/wiki/Linear_polarization

Circular Polarization

In optics, circular polarization is created by passing linear polarized
light through some anisotropic material, that will retard one of the
components (electric or magnetic) by a quarter of the wavelength. This
is called a λ/4 retarder.

The angle between linear polarization and the anisotropic material's major
axis determines ratio between left and right turning polarized light resulting:

  • Incoming linear polarized light tilted by +45° will be fully left turning.
  • Incoming linear polarized light tilted by -45° will be fully right turning.
  • Incoming linear polarized light tilted by 0° will consist of 50% left and 50% right turning.

It should be noted, that due to the reversibility of the light's way the
passing of circular polarized light through a λ/4 retarder will
turn it into linear polarized light of the corresponding certain polarization
plane. This linear polarized light can the be filtered again by linear
polarizers. This is, how circular polarization 3D glasses work.

http://en.wikipedia.org/wiki/Circular_polarization

Polarized Light and Interaction with the Screen

Scattering and Diffraction

The typical projection screen uses very small particles, usually they're TiO2,
to scatter and diffract the light into all directions. In the scattering process
the light bounces multiple times between the particles. While each bounce leaves
a light wave solition polarized in the grand statistical scheme any notable
polarization is lost.

Thus a normal white projection screen is unsuitable for polarized stereoscopic projection.

Metallic Reflection

The key for building a polarizing stereoscopic projection system is the use
of a screen material that retains the polaization of the incoming light.
This is achieved by employing metallic reflection on particles much larger than
the light's wavelengths.

A DIY Stereoscopic Projection System

Making a DIY Silver Screen

You'll need:

  • aluminum powder pigment
  • clear acrylic base
  • deep black textile dye
  • canvas

This is how you do it:

  1. Dye the canvas deep black. This will absorb any light not reflected,
    instead of scattering it. Let it dry thorougly. You may repeat step 1
    multiple times.
  2. Paint one layer of clear acrylic base on the now deep black dyed canvas.
    Doing it one side suffices. All futher steps are now done on this clear acrylic base.
  3. Make a very thick aluminum acrylic paint. Here are a few hints:
    • Mix the aluminum powder with the acrylic base in very small batches.
      Don't make a aluminum power paste by mixing it with water!
    • After putting each small batch of aluminum powder into the acrylic
      stir thoroughly so that it is a homogenous mass.
    • You should end up with a 1 part aluminum powder to 1 part acrylic base paint
    • Once you've got that thick paint, thin it with 1 part of water.
  4. Apply layers of aluminum acrylic paint on the prepared canvas. Let each layer dry.
    Repeat step 4 until you've got an even aluminum metallic painted surface with no
    black parts shining through.

Video Projection

Single Projector Setup

Most cinemas are using a single projector and the RealD Z-filter system to
alternating show left and right images at a swap rate of 144Hz, where the
Z-filter is dynamically modulating the polarization.

Technically the Z-filter is just some large Liquid Crystal Panel. LCs have the
property, to rotate the passing light's polarization plane, depending on a voltage
applied on the LC. The Z-filter thus rotates the light by +/-45°, controlled
by an AC voltage in sync with the left-right-image swap. Before the Z-filter
is a linear polarizer, behind it a λ/4 retarder, in parallel to the linear
polarizer. The Z-filter will rotate the polarization plane to that either only
left or right turning polarized light is leaving the system, if there's stereoscopic
material shown.

If the Z-filter is turned off, the light will be turned into 50% left and 50% right
turning polarization.

It is perfectly possible to recreate this system DIY. This however shall be described
in a separate article still to be written.

Dual Projector Setup

Using two projectors is the most easy way to project the distinct polarized images.
The idea is simple: Each projector is equiped with a polarizing filter matching the
filter in the viewer's glasses eye filters, so that light projected from the "left"
projector will reach only the left eyes, and the "right" projector's light reaches
only the viewer's right eyes.

Selecting the Projectors

It boils down to the following: You need two identical projectors which emit either
unpolarized light - that are DLP projectors using classical arc lamps -
or evenly linear polarized light for all base colours.
The later case is more appealing since you'll not "throw away" light. But the safer
is, choosing some DLP type. Note that those new nifty LED projectors usually exhibit
some uneven polarization, which makes them tricky to next impossible to use for
polarized stereoscopy.

Making the Filter Slides

The projector's filter slides can be made from the very same kind of 3D glasses
which are worn by the viewers. The 3D glasses of RealD are meant for single use.
Although cinemas setup boxes for recycling, there's no harm to the venues if you
put those glasses you got in the cinema to your own use. In fact most cinemas will
have no problem with giving you some of the glasses returned to the recycling boxes.

You may be tempted to just put those filters right behind the projectors lens.
This is however crude and will quickly destroy those filters. Remember that 50% of
the lights power may end up in the filters, heating them up.

So you want to distribute the light's power over a significant large area.

You'll need:

  • a number of used RealD glasses
  • 4 panes of identically sized picture frame glass (something like 50mm × 50mm)
  • sharp and exact scissors or a paper guillotine
  • a fine tip water solvent marker pen (or similar) - whiteboard markers do fine!
  • some adhesive tape. Duct tape works very well (what, did you expect something else?)

This is how it goes:

  1. In all the 3D glasses mark the back side (i.e. the side towards the eyes)
    with a small letter 'L' or 'R' (left eye or right eye), right in the middle.
  2. By applying some twist/torque on the glasses frames you can separate RealD glasses
    releasing the filters.
  3. Sort the filters into left and right filters.
  4. Cut the filters into equally sized rectangular pieces sort them into left and right.
    Don't make them quadratic. It's important that you still know the orientation within
    the glasses' frame.
  5. Clear the marking, making sure you still know what's front and what's back.
  6. Arrange the filter pieces on the glass panes so that they nearly fill it. Of course
    all facing the same (i.e. all front or all back).
    Keep the gaps as small as possible.
  7. Apply the second glass pane, apply the duck tape along the borders.

You've now left and right polarizing filter slides. Put on 3D glasses of the same making
and determine the orientation in which each pane blocks the light most efficiently by looking
through the filter slide. Important: The filter plane that blocks the light on a eye
looking through it directly will be the slide for projection that particular eye later.
The reason for that is, that reflection changes chirality, i.e. left and right turning are
swapped by reflection.

Setting up the Projection

  1. Align the projectors so that their images match. Vertical alignment must be perfect.
    Horizontal alignment may be slightly shifted, but it should be done as good as possible, to.
  2. Place the filters in the light's way. The whole filter area should be used.

Show the stereoscopic material, so that each projector display's its eyes picture.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文