【问题标题】:Place an image on the XY plane in a 3D Plot in Mathematica在 Mathematica 的 3D 图中将图像放置在 XY 平面上
【发布时间】:2011-10-07 21:57:58
【问题描述】:

请从以下内容中考虑以下内容

Can we generate "foveated Image" in Mathematica

Clear[acuity];

acuity[distance_, x_, y_, blindspotradius_] :=

 With[{\[Theta] = ArcTan[distance, Sqrt[x^2 + y^2]]},
      Clip[(Chop@Exp[-Abs[\[Theta]]/(15. Degree)] - .05)/.95, 
                     {0,1}] (1.-Boole[(x + 100.)^2 + y^2 <= blindspotradius^2])]

Plot3D[acuity[250., x, y, 9], {x, -256, 256}, {y, -256, 256}, 
PlotRange -> All, Axes -> False, PlotPoints -> 40, 
ExclusionsStyle -> Automatic, Boxed -> False, Mesh -> None]

我怎样才能在 X & Y 平面上添加下面的照片。然后将表面绘制成透明的。 是否可以 ? (通过上述问题的解决方案获得的图像)。

【问题讨论】:

  • 我以前看过那张照片……是一位著名摄影师拍的……他叫什么名字?
  • 亨利·卡地亚·布列松,“塞维利亚”1933 :-)
  • @belisarius:google.com/…。对我来说,只有亚历克斯·韦伯(Alex Webb)与他在构图上添加色彩的天赋相匹配! :google.com/…

标签: image 3d wolfram-mathematica plot mathematica-8


【解决方案1】:
i = Import["http://i.stack.imgur.com/0EizO.png"];
p = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
Show@{
  Plot3D[
   acuity[250., x, y, 9], {x, -256, 256}, {y, -256, 256},
   PlotRange -> All, PlotPoints -> 40,ExclusionsStyle -> Automatic,Axes -> False,
   Boxed -> False,   Mesh -> None,    PlotStyle -> Directive[Opacity[0.5]]],
  Graphics3D[{Texture[i],
    Polygon[Join[#, {0}] & /@ (2 p - 1) 256,   VertexTextureCoordinates -> p]}
  ]}

编辑

按照 cmets 的要求处理 AspectRatio[]:

p = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
r = First@#/Last@# &@Dimensions@ImageData@i;
a = 1.4;
Show@{Plot3D[
         acuity[250., a x, a y, 9], {x, -256  , 256 }, {y, -256 r , 256 r }, 
          PlotRange -> All, PlotPoints -> 40, ExclusionsStyle -> Automatic, 
          Axes -> False, Boxed -> False, Mesh -> None, 
          PlotStyle -> Directive[Opacity[0.5]], AspectRatio -> r], 
  Graphics3D[{Texture[i], 
             Polygon[{{-256 , -256 r, 0}, { 256 , -256 r , 0}, 
                      { 256 ,  256 r, 0}, {-256 ,  256 r, 0}}, 
             VertexTextureCoordinates -> p]}]}

【讨论】:

  • 再次感谢您。在你的第一个版本中,有没有绘制图片比例?我无法弄清楚 3D Plot 中的 PlotRange :-(
  • @500 我不知道你所说的“情节超过图片比例”是什么意思。请改写。 :)
  • 谢谢。我实际上可以改写:我想要的是 XY 平面具有图像的比例,例如 3/2。
  • @Perfect 谢谢。让我们稍等一下,但这绝对解决了我的问题,并且会让我的文章变得非常甜蜜:-)
  • @500 你可以“避免”改变情节的视力函数比例的颠簸。像 Plot3D[acuity[250.,xa, ya, ..] 之类的东西 a>1.
猜你喜欢
  • 2022-12-04
  • 1970-01-01
  • 1970-01-01
  • 2023-02-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-06-13
  • 2010-12-06
相关资源
最近更新 更多