Hi,
windows7, vs 2005,
I have been trying API function GetFitCylinder but it return strange results. I have example with scann of 3 inch pipe 18646points (theoretical radius 44.45mm)
Using API GetFitCylinder I get result Radius= 54.5mm. ( BLUE cylinder in the picture below)
Using another software( RED cylinder in the picture below)) I get this results:
Normal estimation is done with 10 neighboars
----------------------
********** Normal Estimation started.... :
-input kSearch : 10
-output plane coefficients0.00457876-0.186737-0.982399-346.195********** Normal Estimation finished.... :
-input model Sylinderthreshold = 10
-output coeficients : 1087.051636-output coeficients : -7542.705078-output coeficients : 1089.206909-output coeficients : -0.999795-output coeficients : 0.018364-output coeficients : -0.008512-output coeficients : 43.992542 ->RADIUS-output nr. points within threshold : 18646
It is obvious tha getFitCylinder result is wrong.
API code:
Bentley::Ustn::PointCloud::PointCloudDataQueryPtr sel_query = Bentley::Ustn::PointCloud::IPointCloudDataQuery::CreateSelectedPointsQuery (eeh); sel_query->SetDensity(Bentley::Ustn::PointCloud::IPointCloudDataQuery::QUERY_DENSITY_FULL,(float)1);
double UM = 0; // UORs in Master mdlCnv_masterToUOR (&UM, 1, MASTERFILE); double rad;
double rms_=sel_query->GetFitCylinder (axis, basePoint,rad,height, constrainToAxis,constrainToRadius); rms=rms_; UM=0; mdlCnv_UORToMaster (&UM, 1, MASTERFILE); //axis.x =UM* axis.x; //axis.y =UM* axis.y; //axis.z =UM* axis.z; basePoint=apiDefault::convertPoint_UOR_ToMaster(basePoint); radius =UM* rad; height =UM* height; mdlElmdscr_freeAll (&pElm);
Am I doing something wrong or GetFitCylinder computes bad result?
POD file is attached.
Thanks
Manko
Your code looks good, fit cylinder gives average results on points that make up are less than half a pipe.
hth
Simon
Answer Verified By: Manko
Hi Simon,
Does this mean that getFitCylinder is not accurate unless points cover more than 50% of pipe?
This is a little bit disappointing considering that, in reality, large number of pipes are scanned only from one place. That means, point cloud is covering less than 50% of the pipe.
Any chance of improving this function in the future?
Cheers
Hi Monko,
This function is not very robust and particularly sensitive to noise in the point cloud.
It was used by our first implementation of Descartes fit cylinder tool.
We have implemented a more sophisticated approach far more robust to noise. At this point the function is not available as an API service .
We could make it available as a Descartes API as well as other functions used by some of the tools we developed.
I am thinking at tools to create pipes but also to create and manipulate sections.
Have you ever looked at Descartes SELECTSeries 4 or SELECTSeries 5 ?
I would be interested in having your input on such more focused API that would be part of Descartes.
Feel free to contact me directly if you want to discuss this.
Regards
Ben