[vtkusers] 3d reconstruction
Wes Turner
wes.turner at kitware.com
Fri Jul 23 20:33:53 EDT 2010
Celeste,
If everything is applied correctly, then there should be very little
difference between any of these transforms and the initial 2 to 1 transform.
I would recommend saving out the images before transformation, after the
initial transformation and after the final ICP transformation. You can view
these in Paraview (www.paraview.org) and figure out what is going on.
- Wes
On Fri, Jul 23, 2010 at 8:09 PM, celeste gonzalez <celgon23 at gmail.com>wrote:
> Hi Wes,
>
> Thanks for your help. I am using the transform determined at the previous
> stage as an initial transform on the currente stage. For example, I am
> registering the data set in 0 grades and 10 grades, then apply
> the transformation to the images at 10 grades and with a new point cloud (20
> grades) I use the ICP algorithm again, that is, my sequence of registrations
> is 2 to 1, 3 to 2, 4 to 3, etc..
>
> I got a perfect alignment until 90 grades. I've tried with many objects
> but I always have the same result, the alignment at 100 grades is
> erroneous...
>
>
> On Fri, Jul 23, 2010 at 7:43 PM, Wes Turner <wes.turner at kitware.com>wrote:
>
>> I'm not sure I understand exactly the sequence of registrations, but I can
>> make a quick guess. Most likely you are sequentially registering each data
>> set to the same reference i.e. 2 to 1, 3 to 1, 4 to 1, etc. instead of 2 to
>> 1, 3 to 2, 4 to 3, etc. Unfortunately, ICP can easily fall into a local
>> minimum and fail to converge if the initial positions of the point clouds
>> are too dissimilar. An easy fix would be to use the transform determined at
>> the previous stage as an initial transform of the current stage. That would
>> keep the registration errors within about 10 degrees and should allow
>> everything to works as expected.
>>
>> - Wes
>>
>> On Fri, Jul 23, 2010 at 7:21 PM, celeste gonzalez <celgon23 at gmail.com>wrote:
>>
>>> Hi everybody,
>>>
>>> I want to reconstruct a 3D object via registration of stereo range data.
>>> I am using vtkIterativeClosestPointTransform to align individual point sets
>>> with respect to each other.
>>>
>>>
>>> The sequence consists of 36 images pairs constituting a full rotation of
>>> the object. I am using two consecutive points cloud with this code and then
>>> I transform the source points by the matrix solution.
>>>
>>> Initially, I took the first pair of point cloud then I use the point
>>> set that was aligned and a new point cloud that I wish to align
>>>
>>> The problem is when the rotation angle it’s over 90 grades, that is, from
>>> the tenth picture the alignment fails.
>>>
>>>
>>>
>>> This is part of the code I am using now.
>>>
>>>
>>>
>>> //setup ICP transform
>>>
>>> icp = vtkSmartPointer<vtkIterativeClosestPointTransform>::New();
>>>
>>> icp->SetSource(newPolydata); // newPolydata
>>>
>>> icp->SetTarget(referencePolydata); // referencePolydata
>>>
>>> icp->GetLandmarkTransform()->SetModeToRigidBody();
>>>
>>> icp->SetMaximumNumberOfLandmarks((int)ceil(newPolydata->
>>> GetNumberOfPoints()*0.9));
>>>
>>>
>>>
>>> icp->SetMaximumNumberOfIterations(100);
>>>
>>> icp->SetCheckMeanDistance(1);
>>>
>>> icp->SetMaximumMeanDistance(0.001);
>>>
>>> icp->StartByMatchingCentroidsOn();
>>>
>>>
>>>
>>> icp->Modified();
>>>
>>> icp->Update();
>>>
>>>
>>>
>>> vtkSmartPointer<vtkMatrix4x4> M = icp->GetMatrix();
>>>
>>> cout << "The resulting matrix is: " << *M << cout;
>>>
>>>
>>>
>>> vtkSmartPointer<vtkTransformPolyDataFilter> Transf =
>>>
>>> vtkSmartPointer<vtkTransformPolyDataFilter>::New();
>>>
>>> Transf->SetInput(newPolydata);
>>>
>>> Transf->SetTransform(icp);
>>>
>>> Transf->Update();
>>>
>>>
>>>
>>> Thanks in advance
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>> --
>> Wesley D. Turner, Ph.D.
>> Kitware, Inc.
>> Technical Leader
>> 28 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4920
>>
>
>
--
Wesley D. Turner, Ph.D.
Kitware, Inc.
Technical Leader
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4920
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100723/81fcd94a/attachment.htm>
More information about the vtkusers
mailing list