Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Fwd: CGAL classification

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Fwd: CGAL classification


Chronological Thread 
  • From: Zhang Jinwei <>
  • To:
  • Subject: Re: [cgal-discuss] Fwd: CGAL classification
  • Date: Fri, 28 Feb 2020 15:00:53 +0800
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:K1K5kB2bOmT5gEaOsmDT+DRfVm0co7zxezQtwd8ZseIUK/ad9pjvdHbS+e9qxAeQG9mCt7QV1KGP6/qocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfLx/IA+yoAjTucUanJduJrgswRbVv3VEfPhbymxvKV+PhRj3+92+/IRk8yReuvIh89BPXKDndKkmTrJWESorPXkt6MLkqRfMQw2P5mABUmoNiRpHHxLF7BDhUZjvtCbxq/dw1zObPc3ySrA0RCii4qJ2QxLmlCsLKzg0+3zRh8dtjqxUvQihqgRwzI7aYo6bNPRwcKDAc90EWWVMRdxeWzBbD46mc4cDE+gMMOBFpIf9vVsOqh6+CBGvC+Pv0DBIgHD21rA+3eQgFwHH0hIvH9MTu3nTrtX6LrwSUeezzKXSzzXCYfJX2Tfn54jOfRAsuv6MXbdqfsrQzUkjDR/KjlKVqYH8OT6ey+oDs2+e7+V6VOKvjXYqpB1+oje1wscgkI7Jhpgaylzc+iV23oE1JdimR05ne96lEJVQuDuGOItqRcMiWWFptDwmxb0BvJ62ejUBxpc/xxPHdfCLb4yF7gjgWeuROzt0mXNodbOlixqv8kWs1uvxXdSu3llQtCpKiNzMu2gN1xPN7siHTeNw/kK71jaO0wDf8+BEIUQpmabCJZ4t3709moYJvUTMGS/2n0r2jKuIeUk+5ueo7OHnbq3npp+aKYB0lhnzProylsG7G+g1MQgDU3KG9em91bDv51D1TbZWgvEul6nWqpHaJcAVpq6jBA9V154u6xSlADe919QYm2MLLFBLeROGj4jmIVfOIP/jAPewhlSjijZrx/TcMrL9BZXNK2DPkK39crZl905c1A0zwMhD6JJbEL4BJOv/VVLwtNzDEhA5Lhe0w/38BdVm1oIeXHqPDbWDPKPTt1+I/OMvLPOWaI8bojauY8QisvXhhHt8lV4GdrSyxrMWbmq5F7JoORa3e33p1+UBGGEF9ig/SvPniRXWUzdIYHD0Xb0u5jg9B6qpCI7CQsamh7nXj3TzJYFfem0TUgPEKnzvbYjRA65dOhLXGddol3k/bZbkToYg0R+0swqjkuhoK+PV/msTspexjYEptd2Wrgk78HlPN+rYy3uEFjgmkWYBRjtw16d68xQklwWzlJNgivkdLuR9ovNEVgBga8zZxu1+TtH2A0fPJ4fRDlmhRdqiDHc6Sddjm9I=

Dear Simon,

Following your solutions, the error is still not fixed. The error locates in the boost serialization head file throw_exception.hpp, showing an exception error at throw_exception() when processing the load_configuration function.

I guess it has something to do with the format of the config file of trained classifier.

1. Could you please specify the format and content of your generated config file after classifier training? 

2. Could you explain in detail how you generate such files, e.g. b9_cluster_config and b9_mesh_config?

3. As described in your example codes named example_generation_training, the output of the trained classifier is written in a .xml format, isn’t it?

4. If so, how could I utilize the .xml as input for classification? Because the load_configuration function requires stream files.

At this moment, I am stopped at this training and classifying step because of these confusions, even though I have my own training datasets. I really need your help and would appreciate for your explanation.

Thank you very much! Looking forward to your reply!

Best regards,
Jinwei

Dear Mr. Jinwei,

Le 21/02/2020 à 05:56, Zhang Jinwei a écrit :

For output configuration file I use:
std::ofstream fconfig(“classifier_config.gz”);
classifier.save_configuration(fconfig);
fconfig.close();
Note that on some OS (Windows for example), you need to specify the tag std::ios_base::binary so that the binary output is correctly written. That might be the source of your error here?

However, when I tried to produce and load my own configuration file by using save_ and load_configuration function, then I encountered  an exception errors which jumps to the boost serialization library file. I compared the file I produced with the file in your example, and I found your configuration file is ascii format while mine is binary format. So how did you generate the configuration file of the trained classifier?
You must be mistaken, the configuration files provided with CGAL are also binary (to be precise: they are compressed archives containing an ASCII file).

Another question: as shown in the examples, the cluster and mesh can also be classified by the package. But there is no example to show how to export them? In which format?
If you are talking about the configuration file, then it's no different from the point set case, the save_configuration + load_configuration should work all the same.
And how to export the results of cluster and mesh with the colors and labels?

If your clusters are defined on a CGAL::Point_set_3 (as is done in the example of the user manual), then you can just propagate the labels back to the inliers of each cluster and color them similarly to what is done in the point sets example.

For the mesh, if your are using a CGAL::Surface_mesh (as is done in the example of the user manual), then you can also generate a color for each face. The API is slightly different from Point_set: in Point_set, you need to define 3 properties of type unsigned char "r", "g" and "b", whereas for Surface_mesh, you need to define 1 face property of type CGAL::Color "v:color". Then, use CGAL::write_ply to save your mesh to the PLY format: https://doc.cgal.org/latest/Surface_mesh/group__PkgSurface__mesh.html#ga77bbb79d449c981895eedb6c3c23bd14

I hope this helps.

Best regards,

-- 
Simon Giraudot, PhD
R&D Engineer
GeometryFactory - http://geometryfactory.com/

If you could give me help and suggestions, I would really appreciate it!

Thank you very much! Looking forward to your reply!

Best regards,
Jinwei



Hello,

Sorry you encountered trouble with CGAL Classification.

What version of CGAL are you using? Also, can you share a source code + the full error messages?

Best regards,


-- 
Simon Giraudot, PhD
R&D Engineer
GeometryFactory - http://geometryfactory.com/
Le 18/02/2020 à 19:12, Zhang Jinwei a écrit :
Dear Ms./Mr.,

Thank you for providing us this CGAL open source library. I am a research engineer working in the field of urban reconstruction.

I faced a problem, when I used the package Classification for point cloud and mesh classification. I want to train the classifier, and then classify the point cloud data by the trained classifier. 

So, firstly I used the example training dataset training_b9.ply, for training step by using ETHZ random forest, and save the configuration by function save_configuration as .gz file. And secondly, I load the produced configuration from last step using load_configuration, and classify the data by this trained classifier. 

However,  when I saved and loaded the configuration of classifier, it came out an unhandeled exception: boost::archive::archive_exception. I just used the example data file training_b9.ply for the whole procedure. 

So could you explain me what the reason is? And could you please help me and give me suggestions on how to solve it? What do I need to notice when I doing training and classification using configuration file? It would be better if you could provide me more examples in detail. 

Thank you very much for your support! Looking forward to your kindly reply!

Best regards,
Jinwei Zhang







Archive powered by MHonArc 2.6.18.

Top of Page