Hi,

The file "otb_opencv_api.h" is generated from "otb_opencv_api.h.in" when compiling the OTB : if you use opencv 3 then OTB_OPENCV_3 is defined, otherwise, the file is empty.

Could you give some details on how you compile OTB?

Your working model file seems to be generated by OpenCV 2.

Guillaume

On 08/18/2017 12:17 PM, Julien Radoux wrote:
Hello,

I have an unexpected segmentation fault with random forest classifier in OTB6.1.


I had an error compiling RF forest classifier due to the compiler not finding otb_opencv_api.h. It could be solved by adding the path of the include dir with ccmake, but I wonder what is the purpose of this file: it seems to set a variable OPENCV_3, but it is not actually checking if open_cv v3 is there (in my case, I use an external open_cv3). 

Now it gives me a systematic segmentation fault (on previous version, I had sometimes a segmentation fault, but not always, and I was hoping that the next version would solve the problem).  The problem seems to come from my training step: I can run the models of my previous version with otbcli_ImageClassifier, but it doesn't work with the new models (which has a different structure, see below)

NOT working

%YAML:1.0
opencv_ml_rtrees:
   is_classifier: 1
   var_all: 5
   var_count: 4
   ord_var_count: 4
   cat_var_count: 1
   training_params:
      use_surrogates: 0
      max_categories: 10
      regression_accuracy: 9.9999997764825821e-03
      max_depth: 15
      min_sample_count: 25
      cross_validation_folds: 0
      nactive_vars: 0
   global_var_idx: 1
   var_idx: [ 0, 1, 2, 3 ]
   var_type: [ 0, 0, 0, 0, 1 ]
   cat_ofs: [ 0, 0, 0, 0, 0, 0, 0, 0 ]
   class_labels: [ 1, 6, 7, 12, 13, 17, 19, 22, 24 ]
   missing_subst: [ 0., 0., 0., 0., 0. ]
   oob_error: 2.4000992032737081e-01
   ntrees: 75

WORKING
%YAML:1.0
my_random_trees: !!opencv-ml-random-trees
   nclasses: 9
   nsamples: 88071
   nactive_vars: 2
   oob_error: 2.4195188071840054e-01
   ntrees: 75
   is_classifier: 1
   var_all: 4
   var_count: 4
   ord_var_count: 4
   cat_var_count: 0
   training_params:
      use_surrogates: 0
      max_categories: 10
      max_depth: 15
      min_sample_count: 25
      cross_validation_folds: 0
      priors: !!opencv-matrix
         rows: 1
         cols: 9
         dt: d
         data: [ 1., 1., 1., 1., 1., 1., 1., 1., 1. ]
   var_type: [ 0, 0, 0, 0 ]
   cat_count: !!opencv-matrix
      rows: 1
      cols: 1
      dt: i
      data: [ 9 ]
   cat_map: !!opencv-matrix
      rows: 1
      cols: 9
      dt: i
      data: [ 1, 6, 7, 12, 13, 17, 19, 22, 24 ]
   trees:


--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
 
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

--
Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation - Département Payload Data & Applications

CS Systèmes d'Information
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
 
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to