mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-18 18:44:39 +00:00
MILESTONE!
The evolution seems to proceed well! I tried first a dummy evolution which shrinks the field by .05 at each iteration (check balloon evolve and the if(false) therein. Then, I corrected the refresh of the data structures for the field update The simple test contraction works well, I also tried the tests on the sphere dataset using only view direction, as the laplacian complains about marching cube having svn commit -m
This commit is contained in:
parent
86aa730101
commit
991becfbba
@ -205,43 +205,37 @@ void Balloon::computeCurvature(){
|
||||
(*vi).C().lerp(Color4<CT>::Yellow, Color4<CT>::Red, (*vi).Kg()/absmax);
|
||||
}
|
||||
}
|
||||
|
||||
// HP: a correspondence has already been executed once!
|
||||
void Balloon::evolveBalloon(){
|
||||
// Update iteration counter
|
||||
numiterscompleted++;
|
||||
|
||||
|
||||
// Compute normalized Mean-Curvature and assign it to quality
|
||||
// computeCurvature();
|
||||
|
||||
//--- DEBUG;
|
||||
#if 0
|
||||
// qDebug() << vol.band.size();
|
||||
// vol.band.clear();
|
||||
// vol.band.reserve(5*surf.fn);
|
||||
// vol.updateSurfaceCorrespondence( surf, gridAccell, 2*vol.getDelta() );
|
||||
// qDebug() << vol.band.size();
|
||||
// Update the band
|
||||
// for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
// Point3i& voxi = vol.band[i];
|
||||
// MyVoxel& v = vol.Voxel(voxi);
|
||||
// v.field -= .05;
|
||||
// }
|
||||
vol.isosurface( surf, 0 );
|
||||
for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
Point3i& voxi = vol.band[i];
|
||||
MyVoxel& v = vol.Voxel(voxi);
|
||||
v.status = 0;
|
||||
v.face = 0;
|
||||
v.index = 0;
|
||||
v.field = NAN;
|
||||
//--- THIS IS A DEBUG TEST, ATTEMPTS TO DEBUG
|
||||
if( false ){
|
||||
//--- Test uniform band update
|
||||
for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
Point3i& voxi = vol.band[i];
|
||||
MyVoxel& v = vol.Voxel(voxi);
|
||||
v.sfield += .05;
|
||||
}
|
||||
//--- Estrai isosurface
|
||||
vol.isosurface( surf, 0 );
|
||||
//--- Clear band for next isosurface, clearing the corresponding computation field
|
||||
for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
Point3i& voxi = vol.band[i];
|
||||
MyVoxel& v = vol.Voxel(voxi);
|
||||
v.status = 0;
|
||||
v.face = 0;
|
||||
v.index = 0;
|
||||
v.field = NAN;
|
||||
}
|
||||
vol.band.clear();
|
||||
//--- Update correspondences & band
|
||||
vol.band.reserve(5*surf.fn);
|
||||
vol.updateSurfaceCorrespondence( surf, gridAccell, 2*vol.getDelta() );
|
||||
return;
|
||||
}
|
||||
vol.band.clear();
|
||||
vol.band.reserve(5*surf.fn);
|
||||
vol.updateSurfaceCorrespondence( surf, gridAccell, 2*vol.getDelta() );
|
||||
qDebug() << vol.band.size();
|
||||
// qDebug() << "FN: " << surf.fn;
|
||||
return;
|
||||
#endif
|
||||
|
||||
//--- Compute updates from amount stored in vertex quality
|
||||
float a,b,c;
|
||||
@ -267,11 +261,14 @@ void Balloon::evolveBalloon(){
|
||||
view_maxdst = (updates_view[i]>view_maxdst) ? updates_view[i] : view_maxdst;
|
||||
|
||||
// Interpolate curvature amount & keep track of the range
|
||||
if( surf.vert.IsCurvatureEnabled() )
|
||||
if( surf.vert.IsCurvatureEnabled() ){
|
||||
updates_curv[i] = a*f.V(0)->Kg() + b*f.V(1)->Kg() + c*f.V(2)->Kg();
|
||||
curv_maxval = (fabs(updates_curv[i])>curv_maxval) ? fabs(updates_curv[i]) : curv_maxval;
|
||||
}
|
||||
}
|
||||
qDebug("max curvature: %f", curv_maxval);
|
||||
// Only meaningful if it has been computed..
|
||||
if( surf.vert.IsCurvatureEnabled() )
|
||||
qDebug("max curvature: %f", curv_maxval);
|
||||
|
||||
//--- Apply exponential functions to modulate and regularize the updates
|
||||
float sigma2 = vol.getDelta(); sigma2*=sigma2;
|
||||
@ -280,7 +277,7 @@ void Balloon::evolveBalloon(){
|
||||
Point3i& voxi = vol.band[i];
|
||||
MyVoxel& v = vol.Voxel(voxi);
|
||||
//--- Faster if further
|
||||
k1 = exp( -powf(updates_view[i]-view_maxdst,2) / (3*sigma2) );
|
||||
k1 = exp( -powf(updates_view[i]-view_maxdst,2) / (sigma2) );
|
||||
//--- Slowdown weight (according to distance from surface)
|
||||
k2 = 1 - exp( -powf(updates_view[i],2) / sigma2 );
|
||||
//--- Curvature weight
|
||||
@ -288,15 +285,14 @@ void Balloon::evolveBalloon(){
|
||||
k3 = updates_curv[i] / curv_maxval; // sign(1.0f,updates_curv[i])*exp(-powf(fabs(updates_curv[i])-curv_maxval,2)/curv_maxval);
|
||||
|
||||
//--- Update
|
||||
// v.field += .25*k1*k2;
|
||||
//v.field += 0; // .001*k3;
|
||||
v.sfield += .1*k3;
|
||||
v.sfield += .25*k1*k2*vol.getDelta();
|
||||
//v.sfield += 0; // .001*k3;
|
||||
// v.sfield += .1*k3;
|
||||
}
|
||||
|
||||
//--- Extract initial zero level set surface
|
||||
//--- Estrai isosurface
|
||||
vol.isosurface( surf, 0 );
|
||||
|
||||
//--- Zero the band information so that next extraction will be successfull
|
||||
//--- Clear band for next isosurface, clearing the corresponding computation field
|
||||
for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
Point3i& voxi = vol.band[i];
|
||||
MyVoxel& v = vol.Voxel(voxi);
|
||||
@ -305,6 +301,10 @@ void Balloon::evolveBalloon(){
|
||||
v.index = 0;
|
||||
v.field = NAN;
|
||||
}
|
||||
vol.band.clear();
|
||||
//--- Update correspondences & band
|
||||
vol.band.reserve(5*surf.fn);
|
||||
vol.updateSurfaceCorrespondence( surf, gridAccell, 2*vol.getDelta() );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------//
|
||||
|
||||
@ -63,15 +63,15 @@
|
||||
<valuemap type="QVariantMap">
|
||||
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||
<value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-EifpT4/Render</value>
|
||||
<value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-R6Jz7J/Render</value>
|
||||
<value type="QString">COMMAND_MODE=unix2003</value>
|
||||
<value type="QString">DISPLAY=/tmp/launch-8q7GQp/:0</value>
|
||||
<value type="QString">DISPLAY=/tmp/launch-XCvhtA/:0</value>
|
||||
<value type="QString">HOME=/Users/ata2</value>
|
||||
<value type="QString">LOGNAME=ata2</value>
|
||||
<value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
|
||||
<value type="QString">QTDIR=/usr/local/Qt4.6</value>
|
||||
<value type="QString">SHELL=/bin/bash</value>
|
||||
<value type="QString">SSH_AUTH_SOCK=/tmp/launch-62SK6e/Listeners</value>
|
||||
<value type="QString">SSH_AUTH_SOCK=/tmp/launch-rukhkf/Listeners</value>
|
||||
<value type="QString">TMPDIR=/var/folders/nT/nTstT998GAStacv9t5mUAk+++TQ/-Tmp-/</value>
|
||||
<value type="QString">USER=ata2</value>
|
||||
<value type="QString">__CF_USER_TEXT_ENCODING=0x1F7:0:0</value>
|
||||
@ -92,15 +92,15 @@
|
||||
<valuemap type="QVariantMap">
|
||||
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||
<value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-EifpT4/Render</value>
|
||||
<value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-R6Jz7J/Render</value>
|
||||
<value type="QString">COMMAND_MODE=unix2003</value>
|
||||
<value type="QString">DISPLAY=/tmp/launch-8q7GQp/:0</value>
|
||||
<value type="QString">DISPLAY=/tmp/launch-XCvhtA/:0</value>
|
||||
<value type="QString">HOME=/Users/ata2</value>
|
||||
<value type="QString">LOGNAME=ata2</value>
|
||||
<value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
|
||||
<value type="QString">QTDIR=/usr/local/Qt4.6</value>
|
||||
<value type="QString">SHELL=/bin/bash</value>
|
||||
<value type="QString">SSH_AUTH_SOCK=/tmp/launch-62SK6e/Listeners</value>
|
||||
<value type="QString">SSH_AUTH_SOCK=/tmp/launch-rukhkf/Listeners</value>
|
||||
<value type="QString">TMPDIR=/var/folders/nT/nTstT998GAStacv9t5mUAk+++TQ/-Tmp-/</value>
|
||||
<value type="QString">USER=ata2</value>
|
||||
<value type="QString">__CF_USER_TEXT_ENCODING=0x1F7:0:0</value>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user