Comments (33)
If it is okay, you can provide some images of your point cloud and your 3D object so I can understand the situation better.
It is very hard for me to guess what is wrong with your data, since the method does not work on ALL type of objects and the parameters (such as leaf size) is very dependent on which type of camera you use, lighting circumstances, is the object mostly planar or edges, etc.
The method in this Fast-PPF repo is suitable for objects constructed by planar and cylinder shape, where as my other repo PPF-MEAM is more suitable for objects with a lot of edges. If your object does not falls into these 2 category, I would suggest choosing another method.
from fast-ppf.
Dear author
Thank you very much for your reply.
Attachment 1 is the original data, and Attachment 2 is the adjusted data. Here's what I tested with this data set.
Thanks again for your help and looking forward to your reply!
附件2_adjusted data.zip
from fast-ppf.
With first glance, it seems that the background has not been discarded successfully, can you recheck the result of the background filter?
from fast-ppf.
I have just had a look of your posted dataset and I must say the part has some small interior details. Because of it, when the camera captured the scene with it, the details are not going to be on the scene pointcloud and the normal vector are gonna be computed wrongly, hence the wrong detection. You should check the resolution of the captured scene and verify if my assumption is correct.
from fast-ppf.
Dear author,
After receiving your reply, I checked the data set again and tested it again, but there was a new problem. What happened? Which parameter should I adjust?
from fast-ppf.
It is related to ICP problems. Try tuning these:
https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.h#L26-L27
from fast-ppf.
When I tested using your data set, the model and scenario were attached to each other, as shown below.
But when I tested with my own data set, the model and the scene didn't stick together, they were far apart.as shown below.
What is the reason for this?
For your convenience, I will upload some files to you. Attachment 1 is the original data set, Attachment 2 is the adjusted data set (to be consistent with the size of your data set), and Attachment 3 is how I ran the program.
附件1 original_data.zip
附件2 adjusted data.zip
附件3 Program processing.zip
from fast-ppf.
There is something wrong with the Normal Calculation step, let me check.
from fast-ppf.
Yes, when I tested with the data you provided, when I ran to step 7, the predicted model was attached to the scenario. But when I tested it with my own data set, it didn't stick together.
from fast-ppf.
Did you change any lines of code?
from fast-ppf.
As I had the error "Not enough correspondences found. Relax your threshold parameters."
I modified the "icp_max_iter" and "icp_corr_distance" parameters in the ppf. h header file in Fast PPF. The diagram below. That's what you gave me. The above error will not occur after modification.
Other than that, I didn't change any lines of code.
from fast-ppf.
But after changing those lines, I guess that the Normals is still misplaced, am I correct?
from fast-ppf.
But I don't have the idea to solve it now. Could you give me some hints?
from fast-ppf.
I am guessing that there is some transformation done to the scene by mistake, and it effect the normal calculations. https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.cpp#L246-L247
from fast-ppf.
I also noticed the cloud captured from your camera is orthogonal with Oy(green), while mine is Oz(blue). Maybe you should transformed the inputCloud so that it is similar to mine?
(P/s: somehow your normals in step 6 is also orthogonal to Oz, I guess that this approach should work)
from fast-ppf.
Try adding
pcl::transformPointCloud(*latestCloud , *latestCloud , Eigen::Vector3f(0, 0, 0), Eigen::Quaternionf(0.7071, 0.7071, 0, 0));
after
https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.cpp#L159
(this Eigen::Quaternionf(0.7071, 0.7071, 0, 0)
means rotates around Ox axis 90 degree, you can tune these values to suit your needs)
from fast-ppf.
Try adding
pcl::transformPointCloud(*latestCloud , *latestCloud , Eigen::Vector3f(0, 0, 0), Eigen::Quaternionf(0.7071, 0.7071, 0, 0));
after https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.cpp#L159 (thisEigen::Quaternionf(0.7071, 0.7071, 0, 0)
means rotates around Ox axis 90 degree, you can tune these values to suit your needs)
Why is the normal calculation error?
from fast-ppf.
I am just guessing at this point, we have to wait for him to clarify.
from fast-ppf.
After adding code after line 159 in "ppf.cpp", the scene is perpendicular to OZ(blue). Unfortunately, the model and scenario did not match.
After the normals are calculated, the position of the scene changes.
from fast-ppf.
Let's do a little debug. We will check if scene and scene_keypoints is transformed wrongly or not.
Try adding these lines after https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.cpp#L258
cout << "DEBUG: scene " << std::endl;
customViewer.viewer->removeAllShapes();
customViewer.viewer->removeAllPointClouds();
customViewer.viewer->addPointCloud(scene);
std::getchar();
cout << "DEBUG: scene_keypoints" << std::endl;
customViewer.viewer->removeAllShapes();
customViewer.viewer->removeAllPointClouds();
customViewer.viewer->addPointCloud(scene_keypoints);
std::getchar();
Then can you captured those 2 debug positions and post them here?
from fast-ppf.
I've added the code the way you did, the 2 debug positions are shown below.
from fast-ppf.
Is that with or without the pcl::transformPointCloud(*latestCloud , *latestCloud , Eigen::Vector3f(0, 0, 0), Eigen::Quaternionf(0.7071, 0.7071, 0, 0));
?
from fast-ppf.
yes, i added this code to it.
from fast-ppf.
Everything is fine haha, I really have no idea. Do you mind sharing your https://github.com/ktgiahieu/Fast-PPF/blob/master/include/PPF/PPF.cpp file?
from fast-ppf.
this is "PPF.cpp"file.
PPF.txt
from fast-ppf.
I tried printing out the values of the pointclouds and there is nothing wrong, only the visualizer displayed them wrongly. I guess that this is caused by converting .ply to .pcd file using some other software than PCL (the way you converted it). But the result is actually correct.
My advice is that you should try avoid converting .ply to .pcd
from fast-ppf.
Dear author,
After receiving your reply yesterday, I checked the code and data set again.
- In order to avoid the trouble caused by the conversion of ".ply "to".pcd "by the third party software, I wrote a piece of code to obtain the field cloud in".pcd "format and reduce its size to be similar to your data set (of course, the model will also be reduced in the same scale). Unfortunately, after the test, did not get good results.
- Considering the error caused by normal vector calculation, I added normal vector visualization code in the project. When testing with my own data set, the normal orientation of the model was all inward, as shown in Fig 1. I thought it was this problem that caused the mismatch, I added the following code with all its normal directions facing outward, as shown in Fig 2. However, this change does not change the result of the mismatch.
for (int i = 0; i < normals->points.size(); ++i) { (*normals)[i].normal_x = (*normals)[i].normal_x * (-1); (*normals)[i].normal_y = (*normals)[i].normal_y * (-1); (*normals)[i].normal_z = (*normals)[i].normal_z * (-1); }
Fig 1
Fig 2
Because I see that in your data set, the normal orientation that you get when you compute the normal vector is not always inward or outward. So I think it is not necessarily the problem of normal calculation, of course you can give me some advice on normal calculation. - Yesterday, you reminded me that there might be a problem with the location of scene cloud in the coordinate system, and added code.
pcl::transformPointCloud(*latestCloud , *latestCloud , Eigen::Vector3f(0, 0, 0), Eigen::Quaternionf(0.7071, 0.7071, 0, 0));
When I used your data set for testing today, I found that although the axis of green (OY) was perpendicular to the field cloud, as shown in Fig. 3, good matching results could also be obtained, as shown in Fig. 4.
Fig 3
Fig 4
Now I don't know what went wrong. Could you give me some hints? In addition, do you have other data sets? If convenient, could you please give me a copy so that I can test it again?
Looking forward to your reply!
from fast-ppf.
All of the scenes I captured is already uploaded in this repo, and I am sorry to tell you that I cannot obtain more scene data because my setup is already gone after I finished this project, unfortunately.
I also doesn't know the source of the issue, a hotfix could be adding pcl::transformPointCloud(*latestCloud , *latestCloud , Eigen::Vector3f(0, 0, 0), Eigen::Quaternionf(0.7071, 0.7071, 0, 0));
only to the scene
and scene_keypoints
before displaying them, not when doing calculations.
from fast-ppf.
Where exactly should I add this code?
from fast-ppf.
PPF.txt
I tried added it and it should be working for you (hotfix). However the matching part is not correct yet, feel free to tune the parameters.
from fast-ppf.
It still needs some tuning for better result. Also feel free to remove some uncessary std::cout for debug purpose.
Maybe your "normals inwards, outwards" idea is crucial here.
from fast-ppf.
Dear author
After testing with the "ppf.cpp" file you gave me, my data set also matched the result you uploaded, but the match was incomplete (inaccurate), as shown in Fig 1.
Fig 1
In addition, I also used other PPF projects to test my data sets, and this project did not include ICP algorithms. The PPF algorithm in the project can achieve better matching. As shown in Fig 2.
Fig 2
In your project, there is no initial matching between the model and the scene cloud before the implementation of ICP algorithm, as shown in Fig 3. Only after the implementation of ICP algorithm, that is after Step 9, can the model and the scene cloud match.
Fig 3
Can I understand that there is a problem in normal calculation, which leads to the failure of PPF algorithm to match?
Or before the implementation of ICP algorithm, PPF algorithm did not play its due role?
from fast-ppf.
I think you should try detecting 1, then 2, then more parts in the scene. By testing with less objects, we can understand better those questions you asked earlier. It is hard for me to guess the problem as well.
from fast-ppf.
Related Issues (16)
- result misalignment HOT 12
- Code questions HOT 3
- Why are relatively complete objects not identified? HOT 1
- This code seems to rely on VTK? HOT 1
- This project keeps crashing and instances are not aligned when running HOT 9
- How to adjust the parameters of the background filter HOT 3
- The bad results of the test data you gave
- something wrong about the program
- Add the acos in computePPFPairFeature ,is it really right? HOT 3
- About the issue of a too small 'leaf_size' in large-scale point cloud filtering. HOT 1
- Migration Application for this Project. HOT 7
- Step6 Visualization results in automatic exit HOT 8
- 招聘 HOT 1
- Compile PCL error
- Compile the PCL problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-ppf.