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: Simon Giraudot <>
  • To:
  • Subject: Re: [cgal-discuss] Fwd: CGAL classification
  • Date: Mon, 24 Feb 2020 09:58:29 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:ZounWBElEfZ+ioFDpx9fxJ1GYnF86YWxBRYc798ds5kLTJ76ps2+bnLW6fgltlLVR4KTs6sC17OK9fCxEjVavN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrogjdrMobjI9tJqos1BfEomZDdvhLy29vOV+ckBHw69uq8pV+6SpQofUh98BBUaX+Yas1SKFTASolPW4o+sDlrAHPQgST6HQSVGUWiQdIDBPe7B7mRJfxszD1ufR71SKHIMD5V7E0WTCl76d2VB/ljToMOjAl/G3LjMF7kaRWqw+jqRNi2Y7ZeJybOuRwfq3dft0US2ROUclTWCNdGY6zdZcDAvAbMOpEoYTwpV0Dpga+Cwm2A+PvzydFiGL33a0/1OQhFxzN0g0hH9IUqnvUscj6NKAOUeuoy6TI1jTDb/ZR2Tf78oTIfREhoeuWUrJtbMXRzlUvGhjKjlqOrozlOi2a1vgXs2mb4epvT/6gi3IgqwFrojmj3Nsjio7Mho8MzF3P6Ct3wIEwJdKiSU57Z8apH4dfty6AM4t6WMQiQ3tnuCoixb0Jp5m7fC0Ux5Q73R7ea/KHfJKU7RL/U+aROzd5iGh5d7K4gha/91WrxO7kVsSs01tHrDBJn93Pu3wXyhDe6dWLRuFj8kqu2juDzwTe5v1eLUwpiKbWKIQtzqM/m5cXq0jOECH7lF3qgKOMakko4PSk5/77brjgu5SRKYt0ihzlMqQyhMO/G/k2MgkPXmeF4emwyLvu9lDjTrpQlP05iKzZvYjaJcsFoq65BBdY34Y55xa6CDeqzs4UnXwdI1JEfBKLlo/pO0zSIPziCve/nVSsnC1tx//YIr3tGpTNLn7dn7f9Zbtw6ExRxBA3wN1c/Z5YF7IMLO/pVkPvu9HVDQc1MwmuzObmDNV92JkeWWWKAqKBK6PSsFqI5uUpI+WWa48VuSz9JOI45/Hzin85hUQQfaa30psQbXC3AOhmI1+ZYHrimNgODXsKvg0kTO3qklGNTTlTZ3OqU6Im+j47EJ6mDZvERo21nLOB0z20HplPam9bC1CMCmvnd5ifW/cXcy+SOc9gkjkcVbe7UYMh1BeutBX7y7V9NObU9DcYuYrm1Nhy+uLciwk/9SdxD8SBy2GBVmZ0nn4URzMu3KBwv0h9ylCb3Khgh/xXD9xS6O1TUgo4NJPRwfZ2C9DoVQ7bedeJVlamTs+gAT4vUtI9294OY0BjFNW+lh3PwzCmD6MPm7CXHpA47rrQ32LtKMZl13bGyK4hgkE6TctAL2Kmgrdz+BXSB47Sj0qZir2qdb8H0S7M8meD12uOs1tCXA5+S6WWFUwYM0DZpNC86kLZRKK1EpwmNBFAwIiMMPhkcNrs2G5HQfDlcPvfeWusl2CsTUKTx7aLaszlen8UwSnaFGALngcW8GqcJAY3DTumuXOYBztrQwG8K3jw+PVz/SvoBnQ/yBuHOhU4huiFvyUNjPnZcMs9m7cNuSMvsTJxRg/v0N/RDtecvRtvda5AZsksplxA0DCB7lEvDtmbN6lnw2UmXUF3skfpjUklV8NFlpJsqXoryE91NL7e101BMTWVwcKoY+GFGizJ5BmqLpXu9BTGyt/Mo/UA5fM9pkn5rQ+gHVYl6WQh2N5QgSOR

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



On Wed 19. Feb 2020 at 16:27, Simon Giraudot <> wrote:

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