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 9 2010, 04:02 AM
Post #16


Member
***

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



first the gimp Gmic filter( was called Graystration ) and is also in the CImg.h
this filter is a bit on the "odd "side .It dose things a bit differently than other filters .
It uses a PDE for heat flow ( diffy-Q's are fun)

http://cimg.sourceforge.net/

http://gmic.sourceforge.net/gimp.shtml

and it is a frequency splitting plugin
the top layer in the image becomes the LOW ferq. and the bottom layer is the HI freq.
[attachment=21575:enw_orig_crop.jpg]
[attachment=21573:Screenshot_1.png]
[attachment=21574:Screenshot_2.png]
i use a setting of 20 for the split
but this filter is also causing the chevron strips , so... at the end i need to remove them .

then i import that "hipass" into cyclops

as to the direction of the light i was doing this ( a bit wrong)
[attachment=21576:Screen2.png]
now this is working better
[attachment=21577:Screen1.png]

i really should go and send off a mail to ' Tom SF Haines '
Go to the top of the page
 
+Quote Post
JohnVV
post May 13 2010, 06:42 PM
Post #17


Member
***

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



a bit of a change - the below will create a "good looking" bump image BUT NOT one that is scientifically accurate

someone i look up to - who dose very good work is having a bit of a problem
{ this reminds me - i still need to mail the creator of the program - for some advice}
cyclops is a bit of some "odd" software and i am doing something with it that it was not 100% meant to do
and to solve one problem i am adding another problem .
-- a bit of my background --
10+ years in the photo darkroom doing pro and fine art photofinishing ( i see things a bit differently than others )
then add to it about 10 years on the computer learning "image restoration " and "inpainting" software
- do not get me started on "csi and ncis" shows

--------------------
a tutorial over the next few posts
-------------------
i will start with a dem i posted last night
i am using a crop of N1514126616_1.img ( pds - dione )
[attachment=21621:test.png]
something familiar

1)
there is a bug in using and building cyclops using very new OS
i think it is in glib or libIl( now DevIl ) . But i have not tract it down
it DOSE build on RHEL 5 just fine ( well i use CentOS 5.4 )
for some reason it tosses a "can not open image " on very new os's ( arch and fedora,and i am told Ubuntu also)

i have ran into problems like this before so that is why i have Cent installed along with Arch ( stereo pipline ( isis3) also dose not run in Arch ,but dose work fine in CentOS 5.4
-- so i will go and boot into cent and finish this part

as you can see in the crop above there is some lighting caused by the moons spherical shape ( low res image / wide angle )
the sun is to the left about centered
[attachment=21622:Screenshot.png]

i am using h&w2 ( seams to work the best for this )
the settings i am using are in the screenshot
-- run it --
[attachment=21623:Screenshot_1.png]

this is a normal map ( most will see that )
now there is a LOT of curvature in this image
-- for show in blender --
top
[attachment=21624:Screenshot_2.png]
side
[attachment=21625:Screenshot_3.png]

Go to the top of the page
 
+Quote Post
JohnVV
post May 13 2010, 08:01 PM
Post #18


Member
***

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



2)
removing the curvature
yes one or two meshes can be done in blender
but not for 80+ images
i have tried a few different "hipass " filters
removing the low frequency part of the normal map will "flatten" a mesh

and the one i found that works the best ( so far ) is G'Mic on Gimp
(see the above posts )
[attachment=21628:d.png]
setting of 10 ( out of 1 to 20 )
[attachment=21627:dhi.png]

UNFORTUNATELY the gimp filter CAUSES a bit of repeating noise
The chevron strips

and this will need to be fixed later
( i am still looking for a better solution than this ,it is not a solution but a "work around " )
Go to the top of the page
 
+Quote Post
Sajid
post May 13 2010, 08:20 PM
Post #19


Newbie
*

Group: Members
Posts: 9
Joined: 30-April 10
Member No.: 5339



Interesting work you are doing.

Where did you find this cyclops software? The only place I saw was an old and empty website with basically a download link and some cryptic documentation listing function calls.
Go to the top of the page
 
+Quote Post
JohnVV
post May 13 2010, 08:39 PM
Post #20


Member
***

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



3)

convert the hipassed normal to a mesh then to a dem
[attachment=21629:cyc_inter.png]
this is how cyclops sees the hi-normalmap image from above
and it saves to a *.ply
import into blender
[attachment=21631:Screenshot_2.png]
side view
[attachment=21630:Screenshot_1.png]

export to a obj format mesh
the obj format is a ascii text format
.ply is a binary hex format
i use gedit to open it
( i need to wright a script that will do this and automate it , for a few it is not a problem but for 80+ so far it is becoming one )
[attachment=21632:Screenshot.png]
and remove all the data i do not need
then in OO calc ( excel ) i extract the z access
-- be back i have a cat that wants on my lap--
back

the output of OO is a ascii text "raw" FILE
isis,openev, or your fav can import it

i use ascii2isis
[attachment=21634:Screenshot_8.png]
the next step
cleaning this
Go to the top of the page
 
+Quote Post
JohnVV
post May 13 2010, 11:46 PM
Post #21


Member
***

Group: Members
Posts: 832
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: 832
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: 1954
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: 832
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: 581
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: 832
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: 832
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: 2967
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

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

 



RSS Lo-Fi Version Time is now: 23rd June 2018 - 08:09 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 a project of the Planetary Society and is funded by donations from visitors and members. Help keep this forum up and running by contributing here.