POV-Ray : Newsgroups : povray.general : Creating heightfields from photographs Server Time
28 Nov 2024 22:40:57 EST (-0500)
  Creating heightfields from photographs (Message 1 to 4 of 4)  
From: Jeremy M  Praay
Subject: Creating heightfields from photographs
Date: 21 Jul 2006 15:32:41
Message: <44c12bd9$1@news.povray.org>
It would be great to be able to take relief photographs of  real-world 
objects and then have them easily converted into heightfields.

The easiest way, for things like brick walls, is to convert the image to 
gray scale, perhaps invert the tones, maybe adjust the contrast, and then go 
with it.  But this can lead to strange things happening in some cases, and 
it generally only tends to work (using the term loosely) for things like 
brick walls, pavement, etc.

I know that there are "shape from shading" filters which can be applied to 
The Gimp, but they don't exactly look like a no-brainer.  Has anyone tried 
this approach?

Basically, any advice on this subject would be appreciated.

Thanks.


Post a reply to this message

From: Tim Attwood
Subject: Re: Creating heightfields from photographs
Date: 21 Jul 2006 22:26:24
Message: <44c18cd0$1@news.povray.org>
There's a method that uses 4 photos with controled lighting to produce
a normal map after a fair amount of editing. This normal map can then
be processed by a utility to produce a heightfield.

Details about this method can be found at Ryan Clark's site.
http://66.70.170.53/Ryan/heightmap/heightmap.html
This method produces normal maps that have no blue channel data.

"In the most common implementation of normal maps, used by Valve's
Source engine and implemented in hardware in nVidia cards,
the red channel should be the relief of the material when lit from the 
right,
the green channel  should be the relief of the material when lit from below,
and the blue channel should be the relief of the material when lit from
the front" -- Wikipedia. This is not to be confused with a POVray
normal_map, or bump_map.

Instructions for editing the images are provided for Corel PSP 10+.

Inputing the resulting normal map into Ryan Clark's Displacement Map
Creator software can make a greyscale height field image, at 512 x 512
only. It promps for ATI style, I think inverting the output.

The image can be fed into POVray, or used to correct the blue channel
of the normal map (for game engines). It seems to handle sharp
horizontal edges near the top and bottom poorly. Don't forget to make
sure your photos line up, use the perspective tool and resizing.


Post a reply to this message

From: Meothuru
Subject: Re: Creating heightfields from photographs
Date: 25 Jul 2006 01:25:00
Message: <web.44c5aa1541860cc259588aed0@news.povray.org>
"Jeremy M. Praay" <jer### [at] questsoftwarecmo> wrote:
> It would be great to be able to take relief photographs of  real-world
> objects and then have them easily converted into heightfields.
>
> The easiest way, for things like brick walls, is to convert the image to
> gray scale, perhaps invert the tones, maybe adjust the contrast, and then go
> with it.  But this can lead to strange things happening in some cases, and
> it generally only tends to work (using the term loosely) for things like
> brick walls, pavement, etc.
>
> I know that there are "shape from shading" filters which can be applied to
> The Gimp, but they don't exactly look like a no-brainer.  Has anyone tried
> this approach?
>
> Basically, any advice on this subject would be appreciated.
>
> Thanks.

On my "photos-->heightfields"-experiments, in many cases I got
better results without a conversion to grayscale, but with
the reduction of the Y-scale-factor to a value <1

i.e.

 scale <2, 0.3, 2>


Post a reply to this message

From: Jeremy M  Praay
Subject: Re: Creating heightfields from photographs
Date: 25 Jul 2006 16:08:10
Message: <44c67a2a$1@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote in message 
news:44c18cd0$1@news.povray.org...
> There's a method that uses 4 photos with controled lighting to produce
> a normal map after a fair amount of editing. This normal map can then
> be processed by a utility to produce a heightfield.
>
> Details about this method can be found at Ryan Clark's site.
> http://66.70.170.53/Ryan/heightmap/heightmap.html
> This method produces normal maps that have no blue channel data.
>

Thanks for the info.  That looks like a pretty good method, when you can 
control the lighting.  I've wished I had a way to do this on quite a few 
occasions, but I've often ended up finding some other shortcut, or I simply 
decided to do something entirely different.  I hope to try this method some 
day.

In cases where you can't control the lighting, I don't think there is a 
decent method.  I tried The Gimp plugin for "Shape from shading", but while 
it works fairly well for Mars satellite photos (and probably other satellite 
photos), it doesn't seem to work very well for other purposes.  If anyone 
wants to try it (it may work well, depending on what you're doing), here is 
a link: http://www.geocities.com/alreaud/gimp_plug-in/shapefs.html 
especially if you're studying the "Mars Face".  But if you want to use the 
data in POV-Ray as a heightfield, I guess you'll have to make your own 
heightfield image by using the dumped data (or email the author).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.