IPB

Welcome Guest ( Log In | Register )

3 Pages V  < 1 2 3 >  
Reply to this topicStart new topic
shape from shade, so i do not take over Bjorn's
JohnVV
post May 13 2010, 11:46 PM
Post #21


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



4)
-- optional --
i like to normalize and convert this to a 16 bit unsigned image
fx
CODE
fx f1=d.hi.cub to=d1.cub equation=((f1-0.440323)/0.119344)*65536

for this image
then there are a few ways to take a highpass of this
in isis it makes a singed image
so i take a few steps

run lowpass on it (boxcar 101,101 )
[attachment=21635:Screenshot_9.png]

and subtract it from the other in Nip and openev
isis.cub to a 32bit tif from openev
then use nip to convert the 32 bit tif to a 16 bit tiff
you can use whatever programs you are comfortable with
but highpass the image or subtract a lowpass


in nip
invert the low pass and "use nip's "blend"
[attachment=21636:Screenshot_10.png]
[attachment=21637:Screenshot_11.png]

there is still some cosmetic editing yet
but it is in very predictable spots
the crater rims are a bit low on the top and bottom
and the crater is a bit deep on the inside left and right
and it has a slight emboss look to it
Go to the top of the page
 
+Quote Post
JohnVV
post May 28 2010, 12:07 AM
Post #22


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



an update
just a "testing " shot


with only a few of the images in it .
Go to the top of the page
 
+Quote Post
Bjorn Jonsson
post Jun 6 2010, 09:05 PM
Post #23


IMG to PNG GOD
****

Group: Moderator
Posts: 2146
Joined: 19-February 04
From: Near fire and ice
Member No.: 38



Looks very promising despite the 'terraced' appearance in much of the image (a consequence of an 8 bit DEM?)

And big thanks for the information above. Thanks to it I identified an error late in my processing chain. After fixing it I'm getting very promising results but it is obvious that the best results are going to come from combining several approaches: Stereo, Cyclops and my primitive SFS software. I still haven't tried ISIS' pc2d. I may have to install CentOS to do so although I'm hoping to get ISIS to work under the version of Linux I'm running (Ubuntu).

Some interesting finds:

(1) I get *much* better results from Cyclops by visually estimating the light source direction instead of using the true direction. As an example, for image N1507742440_2.IMG of Dione the correct direction is (0.303693, -0.205793, 0.930279) but I get much better results using (0.5,0.2,0.6).

(2) Cyclops apparently doesn't like images with high solar elevation angles. This is not unexpected. The results are useful though but the quality is significantly worse than at lower solar elevation angles.

(3) Big craters are often too shallow in the resulting DEMs, requiring postprocessing in Photoshop (or combining the Cyclops DEM with a stereo DEM).

Two test renders:

The first one is a Cyclops DEM, the big craters are too shallow so it requires additional postprocessing but the really nice thing is that there are no visible artifacts like striping for example:
Attached Image


The second one is from my primitive SFS software after extensive postprocessing (mainly destriping). Small scale details are probably better than in the Cyclops DEM but the bad thing is that some striping is still visible:

Attached Image
Go to the top of the page
 
+Quote Post
JohnVV
post Jun 7 2010, 03:02 AM
Post #24


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



QUOTE
Looks very promising despite the 'terraced' appearance in much of the image (a consequence of an 8 bit DEM?)

no, that is an artifact from a fast and not so good contrast bump on the low contrast map . At this stage i am not worried after all the screen shot is a 4096x2048 resize of the 16384x8192 map i am making .

QUOTE
As an example, for image N1507742440_2.IMG of Dione the correct direction is (0.303693, -0.205793, 0.930279) but I get much better results using (0.5,0.2,0.6).

for this image i am using this ( measurementsare on the image )
-- oops i miss typed --
[attachment=21852:N1507742440_2.png]
from the center 0.2 up and 1.0 over( right ) and 0.5 out from the screen is the height
-- correction --
on the photo should be ( 1.0 ,0.2,0.5)
QUOTE
Big craters are often too shallow in the resulting DEMs, requiring postprocessing in Photoshop (or combining the Cyclops DEM with a stereo DEM).

i have seen that too , that is why i posted above ( a few posts) that i have been editing , by hand, the craters
there are very predictable spots that need help
[attachment=21853:N1507742440_2.jpg]
also the second hi-pass is removing some of the depth in the hole but at the same time it is getting ride of the left to right slope
as seen in Nirgal's post
http://www.thethirdplanet.de/mars_gallery/...okrates_sfs.jpg
the one on the right is like the ply / normal map from cyclops , and that second hi-pass filter flattens the image .
-- i or we or all of us need to find a better solution --

but considering there is not much of a choice
the pc2d ( from 2004 )
-gimp-
shapefs-1.2.0.0-20051020.tar.gz ( this dos not work well and needs a very old version of gimp )
i have collected a few OLD things and they do build
linear.cpp
-- excerpt --
CODE
/****************************************************************************
NAME:   linear.cpp  --   Performs shape from shading using
                         linear FFT based algorithm

SYNOPSIS:  linear inImage inFmt sunElevAngle sunAzimAngle d -f fltFrq outFmt outDem

Example:  linear spot128.dat 2 19.3 287.2 2.5 -f 0 2 ts_dem.dat  

DESCRIPTION:   This program performs linear shape-from-shading

ALGORITHM REFERENCES:
   Liu, H. "Derivation of surface topography and terrain parameters
from single satellite image using shape-from-shading technique"
in Computers & Geosciences

BUGS:

Compiling on SGI:
CC -Ddebug=0 -g -o linear linear.cpp linear_sfs.cpp fft2d.cpp imageio.cpp stopwatch.cpp -LANG:std  -lm
Compiling on SUN:
CC -Ddebug=0 -g -o linear linear.cpp linear_sfs.cpp fft2d.cpp imageio.cpp stopwatch.cpp   -lm

or mini.cpp
CODE
/****************************************************************************
NAME:   mini.c  -   Performs shape from shading using minimization algorithm

SYNOPSIS:  mini inName inFmt sunElevAngle sunAzimAngle lamda iterNum -d initDemName outFmt outName

Example 1:mini spot128.dat 2 19.3 287.2 1.5 50  2 ts_dem.dat  

ALGORITHM REFERENCES:
  Liu, H. "Derivation of surface topography and terrain parameters
from single satellite image using shape-from-shading technique"
in Computers & Geosciences

Compiling on SGI:
CC -Ddebug=0 -g -o mini mini.cpp mini_sfs.cpp fft2d.cpp imageio.cpp stopwatch.cpp -LANG:std  -lm

Compiling on SUN:
CC -Ddebug=0 -g -o mini mini.cpp mini_sfs.cpp fft2d.cpp imageio.cpp stopwatch.cpp -lm

************************************************************/

the two above are from a zip called
v29-10-03.zip this was from a paper - google found the zip but not the paper
(h??p://207.176.140.93/documents/oldftp/VOL29/)

and then cyclops . So not to much of a choice here
in a few( or many,many) years there will be Nirgal's . If all the patent an IP issues can be solved
Go to the top of the page
 
+Quote Post
4th rock from th...
post Sep 2 2010, 01:16 PM
Post #25


Member
***

Group: Members
Posts: 378
Joined: 21-April 05
From: Portugal
Member No.: 347



I've programed a simple SFS implementation in Actionscript (Adobe Flash) and I'm surprised by the results.
The algorithm is as simple as evaluating brightness difference over two adjacent pixels and the making the terrain go up or down accordingly.
If I stick to non saturated original data and avoid completely shadowed areas, the resulting terrain is consistent.

Here's what I'm getting (left - original, right - elevation, both images contrast enhanced for posting):

Attached Image


--------------------
_______________________
www.astrosurf.com/nunes
Go to the top of the page
 
+Quote Post
AndyG
post Sep 2 2010, 01:52 PM
Post #26


Member
***

Group: Members
Posts: 591
Joined: 20-April 05
Member No.: 279



Very nice!

ActionScript, huh? Smarty-pants! rolleyes.gif

Is this adjacent pixels as in the nine around (or the four adjacent to) the target pixel, or are you processing the image in a raster-like manner?

Andy
Go to the top of the page
 
+Quote Post
4th rock from th...
post Sep 2 2010, 10:17 PM
Post #27


Member
***

Group: Members
Posts: 378
Joined: 21-April 05
From: Portugal
Member No.: 347



Thanks!

I'm reading the image as a raster and calculating pixel value differences along each row.
It's something like this:

difference= (pixelb-pixela)/60;
level=sin(difference)*2+level;

Of course, I'm assuming that the light comes from the left and the each row starts at the same level.

Given these limitations I'm surprised that it works at all!



--------------------
_______________________
www.astrosurf.com/nunes
Go to the top of the page
 
+Quote Post
JohnVV
post Sep 2 2010, 11:24 PM
Post #28


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



the main problem has been with non optimal images
the crater and it's rebound cone is one of the best examples of a very GOOD image for sfs

Go to the top of the page
 
+Quote Post
JohnVV
post Feb 1 2012, 05:04 AM
Post #29


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



just a bit of an update
stereo is by far better but

sometimes there are no useful stereo pairs
( and not much in single with shadows )

the Jupiter crowd will recognize this area of Io
[attachment=26345:IoBumpTest.jpg]

just a test for right now
Go to the top of the page
 
+Quote Post
volcanopele
post Feb 1 2012, 06:11 AM
Post #30


Senior Member
****

Group: Moderator
Posts: 3063
Joined: 11-February 04
From: Tucson, AZ
Member No.: 23



QUOTE (JohnVV @ Jan 31 2012, 10:04 PM) *
the Jupiter crowd will recognize this area of Io

What type of map is that? Bump, elevation? I am a little concerned about the material on the east side of Shamshu Mons appearing too high and some volcanic flows showing up southwest of Hi'iaka Patera.

Attached Image


--------------------
&@^^!% Jim! I'm a geologist, not a physicist!
The Gish Bar Times - A Blog all about Jupiter's Moon Io
Go to the top of the page
 
+Quote Post
JohnVV
post Feb 1 2012, 06:53 AM
Post #31


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



a height map but that spot IS an artifact from Shamshu Patera
[attachment=26347:map.jpg]
that test image is a merg of a full map and and a close up
there are still some problems it getting something that is in-between scientifically close to accurate ( io is not a good candidate ) and something that also looks nice

otherwise a height map for the full moon would be gray with a few spots of lighter gray
[attachment=26349:close.jpg]
Go to the top of the page
 
+Quote Post
JohnVV
post Apr 17 2012, 09:03 AM
Post #32


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



for now i have dropped the hyperionCV sfs in favor of the old "mini.cpp" from a few pages back
examples using the LRO-WAC stereo DEM
-- 16 bit gray data was normalized and converted to jpg
the topo crop

the ISIS3 "shade" tool set at 270Deg and 45 deg height

and the sfs from it with some pre processing in G'mic
Go to the top of the page
 
+Quote Post
JohnVV
post Jan 15 2018, 06:13 AM
Post #33


Member
***

Group: Members
Posts: 862
Joined: 18-November 08
Member No.: 4489



just a update on a rather old thread
i was asked about using SFS
starting image of Ceres PIA21750
Attached Image


a 8 bit copy of the 32 bit float image
Attached Image


and a hillshade using GDAL
Attached Image


yes i am using the same old mini.cpp
-- link
https://drive.google.com/file/d/1v_y_rmCC6p...iew?usp=sharing

contains the original readme and the paper in pdf format along with the PIA21750 image
REQUIRES g++3.3 to build !!!

i also use a bash script to automate the multi resolution i use
a 1024x1024 , a 512x512,a 256x256 and a 128x128 images
this script uses
GDAL and G'Mic ( the TERMINAL VERSION of gmic)
CODE
#!/bin/bash

gmic PIA21750.pgm -resize 128,128 -split_freq 10% -n[1] 0,1 -o[1] 128.tif
gmic PIA21750.pgm -resize 256,256 -split_freq 10% -n[1] 0,1 -o[1] 256.tif
gmic PIA21750.pgm -resize 512,512 -split_freq 10% -n[1] 0,1 -o[1] 512.tif
gmic PIA21750.pgm  -split_freq 10% -n[1] 0,1 -o[1] 1k.tif

gdal_translate -of EHdr -ot Float32 128.tif 128.raw
gdal_translate -of EHdr -ot Float32 256.tif 256.raw
gdal_translate -of EHdr -ot Float32 512.tif 512.raw
gdal_translate -of EHdr -ot Float32 1k.tif 1k.raw

mini_sfs 1k.raw 2 35 95 2 66 2 c_dem
gmic c_dem1.raw,1024,1024 -split_freq 3% -n[1] 0.1,0.9 -o[1] 1kc.tiff

mini_sfs 512.raw 2 35 95 10 125 2 512_dem
gmic 512_dem1.raw,512,512 -resize 1024,1024 -blur 3 -split_freq 4% -n[1] 0.05,0.95 -o[1] 1k_512.tiff

mini_sfs 256.raw 2 35 95 10 200 2 256_dem
gmic 256_dem1.raw,256,256 -resize 1024,1024 -blur 4 -split_freq 5% -n[1] 0.05,0.95 -o[1] 1k_256.tiff

mini_sfs 128.raw 2 35 95 25 600 2 128_dem
gmic 128_dem1.raw,128,128 -resize 1024,1024 -blur 5 -split_freq 6% -n[1] 0,1 -o[1] 1k_128.tiff

gmic 1kc.tiff 1kc.tiff 1k_512.tiff 1k_256.tiff 1k_128.tiff -blend add -div 5 -n 0.1,0.9 -o HeightMap.tiff

gdaldem hillshade -z 40 -az 95 -alt 35 -compute_edges HeightMap.tiff hillshade.tiff

# this line below can be undocumented after a good test
# rm 128.tif 128.hdr 256.tif 256.hdr 512.tif 512.hdr 1k.tif 1k.hdr 128.raw 128_dem.hdr 128_dem1.raw 256.raw 256_dem.hdr 256_dem.hdr 256_dem1.raw 512.raw 512_dem.hdr 512_dem1.raw 1k.raw  1kc.tiff 1k_512.tiff 1k_256.tiff 1k_128.tiff c_dem.hdr c_dem1.raw 128.raw.aux.xml 256.raw.aux.xml 512.raw.aux.xml 1k.raw.aux.xml


now this is important !!!
the way i make the height map looses ALL real height information
only the RELATIVE data is there . If it looks twice as high and something in the image it is likely about twice as high but there is NO height in meters information
Go to the top of the page
 
+Quote Post
TrappistPlanets
post May 10 2021, 12:52 PM
Post #34


Junior Member
**

Group: Members
Posts: 69
Joined: 15-April 21
Member No.: 9009



QUOTE (JohnVV @ Apr 17 2012, 10:03 AM) *
for now i have dropped the hyperionCV sfs in favor of the old "mini.cpp" from a few pages back
examples using the LRO-WAC stereo DEM
-- 16 bit gray data was normalized and converted to jpg
the topo crop

the ISIS3 "shade" tool set at 270Deg and 45 deg height

and the sfs from it with some pre processing in G'mic

why does the 2 sides of the crater rim SFS dem look higher then everything else but in the real offishal dem everything on the rim is about the same height?
Go to the top of the page
 
+Quote Post
TrappistPlanets
post May 10 2021, 01:05 PM
Post #35


Junior Member
**

Group: Members
Posts: 69
Joined: 15-April 21
Member No.: 9009



i have a SFS dem of umbriel

Attached thumbnail(s)
Attached Image
Attached Image
Attached Image
 
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3 >
Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 20th September 2021 - 10:15 PM
RULES AND GUIDELINES
Please read the Forum Rules and Guidelines before posting.

IMAGE COPYRIGHT
Images posted on UnmannedSpaceflight.com may be copyrighted. Do not reproduce without permission. Read here for further information on space images and copyright.

OPINIONS AND MODERATION
Opinions expressed on UnmannedSpaceflight.com are those of the individual posters and do not necessarily reflect the opinions of UnmannedSpaceflight.com or The Planetary Society. The all-volunteer UnmannedSpaceflight.com moderation team is wholly independent of The Planetary Society. The Planetary Society has no influence over decisions made by the UnmannedSpaceflight.com moderators.
SUPPORT THE FORUM
Unmannedspaceflight.com is funded by the Planetary Society. Please consider supporting our work and many other projects by donating to the Society or becoming a member.