[vtkusers] Actor Disappeared
    Wenlong Wang 
    scc.wwl at gmail.com
       
    Tue Dec  6 17:58:38 EST 2011
    
    
  
Dear all,
I'm trying to do a gradient descent in my application. It was working well.
But as I tried to lower the threshold(which means more iterations are
happening), the application just stop rendering and give me a blank screen.
Most misterious is, there is no error happens. No memory leak, no access
vialation, no nothing. The program just jump out of the loop. I am really
confused by this.
Here is my code
while(abs(CurErr - PreErr) > threshold)
    {
        PreErr = CurErr;
        tPoints->Delete();
        for (int i = 0; i<sizeof(para)/sizeof(double); i++)
        {
            temp_para[i] = para[i];
        }
        for(int index = 0; index < sizeof(para)/sizeof(double); index++)
        {
            temp_para[index] = temp_para[index] + temp_para[index]*step;
            tCamera->DeepCopy(markCamera);
            tPoints = GenerateNewPoints(temp_para, count);
            double err = Dist_2DLandmarks(tPoints, tCamera);
            temp_para[index] = para[index];
            par_der[index] = (err - CurErr) / temp_para[index]*step;
        }
        for(int i = 0; i < sizeof(para)/sizeof(double); i++)
        {
            para[i] = para[i] - par_der[i] * step;
        }
        tPoints = GenerateNewPoints(para, count);
        tCamera->DeepCopy(markCamera);
        CurErr = Dist_2DLandmarks(tPoints, tCamera);
        count ++;
    }
Thank you very much for any suggestions.
Best regards
Long
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111206/da550ec6/attachment.htm>
    
    
More information about the vtkusers
mailing list