Re: [otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-11-08 Thread michel M
thanks you Julien it's great !!

On Tuesday, November 8, 2016 at 2:11:15 PM UTC+1, Julien Michel wrote:
>
> Le 08/11/2016 à 13:43, michel M a écrit : 
> > for i in $(seq 1 7); do var=date$i; otbcli_TrainVectorClassifier.bat 
> > -io.vd training_samples.sqlite -cfield code -classifier rf 
> > -classifier.rf.max 20 -io.out model.rf -feat ${!var} | grep Kappa; done 
> > 
> > otbcli_ImageClassifier.bat -in alldates2014_avignon_landsat.TIF -out 
> > classif.tif uint8 -model model.rf 
> > 
> > error: (-5) the input sample must be 1d floating-point vector with the 
> > same number of elements as the total number of variables used for train 
>
> Hi, 
>
> The problem is that in the for loop, you train the model.rf file for 
> each date. So the model is tailored for 7 bands. Next, you call 
> ImageClassifier with this very model (for 7 bands) on an image with all 
> the bands (49 then). If you want to classify an image with all dates, 
> you need to train model.rf with all the bands (i.e. using the $bands 
> variable). 
>
> Regards, 
>
> Julien 
>
> -- 
> Julien MICHEL 
> CNES - DCT/SI/AP 
>
>

-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-11-08 Thread Julien Michel

Le 08/11/2016 à 13:43, michel M a écrit :
for i in $(seq 1 7); do var=date$i; otbcli_TrainVectorClassifier.bat 
-io.vd training_samples.sqlite -cfield code -classifier rf 
-classifier.rf.max 20 -io.out model.rf -feat ${!var} | grep Kappa; done


otbcli_ImageClassifier.bat -in alldates2014_avignon_landsat.TIF -out 
classif.tif uint8 -model model.rf


error: (-5) the input sample must be 1d floating-point vector with the 
same number of elements as the total number of variables used for train 


Hi,

The problem is that in the for loop, you train the model.rf file for 
each date. So the model is tailored for 7 bands. Next, you call 
ImageClassifier with this very model (for 7 bands) on an image with all 
the bands (49 then). If you want to classify an image with all dates, 
you need to train model.rf with all the bands (i.e. using the $bands 
variable).


Regards,

Julien

--
Julien MICHEL
CNES - DCT/SI/AP

--
--
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-11-08 Thread michel M
this is my script  (i do again the TP of Montpellier, i don't use the ndvi, 
causeto resolve my error ) 

script OK for one date date1  and many thanks  guillaume  !!  ( for one 
image landsat  7 bandes i have the  var-count = 7 model.rf it's  ok )  , 
the classif is OK .

after i did an other test with 7 landsat images equals 49 bands for  the 
file alldates2014_avignon_landsat.TIF
but i have again my var_count de model.rf at 7  and an message error  why ?

see my script below  (maybe Manuel Grizonnet or Julien Michel or you  
Guillaume will help me)
good afternoon 
Michel 



otbcli_ConcatenateImages.bat -il LAND*.TIF -out 
alldates2014_avignon_landsat.TIF uint16


otbcli_PolygonClassStatistics.bat -in alldates2014_avignon_landsat.tif -vec 
training_range_rpg.shp -field "code" -out test.xml

otbcli_SampleSelection.bat -in alldates2014_avignon_landsat.tif -field code 
-vec training_range_rpg.shp  -out training_samples.sqlite -instats test.xml 
-strategy smallest

otbcli_SampleExtraction.bat -in alldates2014_avignon_landsat.tif  -vec 
training_samples.sqlite -outfield prefix -outfield.prefix.name band_ -field 
code

date1=`for i in $(seq 0 6);   do printf "band_$i "; done`

date2=`for i in $(seq 7 13);  do printf "band_$i "; done`

date3=`for i in $(seq 14 20); do printf "band_$i "; done`

date4=`for i in $(seq 21 27); do printf "band_$i "; done`

date5=`for i in $(seq 28 34); do printf "band_$i "; done`

date6=`for i in $(seq 35 41); do printf "band_$i "; done`

date7=`for i in $(seq 42 48); do printf "band_$i "; done`

bands=`for i in $(seq 0 48);  do printf "band_$i "; done`



for i in $(seq 1 7); do var=date$i; otbcli_TrainVectorClassifier.bat -io.vd 
training_samples.sqlite -cfield code -classifier rf -classifier.rf.max 20 
-io.out model.rf -feat ${!var} | grep Kappa; done





otbcli_ImageClassifier.bat -in alldates2014_avignon_landsat.TIF -out 
classif.tif uint8 -model model.rf


error: (-5) the input sample must be 1d floating-point vector with the same 
number of elements as the total number of variables used for train





Le lundi 31 octobre 2016 18:27:07 UTC+1, Guillaume Pasero a écrit :
>
> Hi,
>
> It seems that you trained you model 'model.rf' with a certain number of 
> bands, but try to use it with on an image that has a different number of 
> bands. 
>
> You can check the parameter 'var_count' in your file 'model.rf' and 
> compare it with the number of bands in 
> alldates2014_landsat_bandes_et_nvdi.TIF
>
> Regards,
>
> Guillaume
> On 10/26/2016 09:46 AM, michel M wrote:
>
> Hello , 
> I have an error on the command classifier 
>
>  otbcli_ImageClassifier.bat -in alldates2014_landsat_bandes_et_nvdi.TIF  
> -out classif.tif uint8 -model model.rf
>
> i replaced uint8 by float but the result is the same 
>
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Loading model
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Model loaded
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Input image 
> normalization deactivated.
> Writing classif.tif...: 0% 
> [  ]OpenCV Error: Bad 
> argument (the input sample must be 1d floating-point vector with
>  the same number of elements as the total number of variables used for 
> training ) in predict, file 
> /data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4  
> .10/modules/ml/src/tree.cpp, line 3620
> /data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4.10/modules/ml/src/tree.cpp:3620:
>  
> 

Re: [otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-11-03 Thread michel M
many many thanks Guillaume, I will look it  and i I would answer you
see you soon

Le lundi 31 octobre 2016 18:27:07 UTC+1, Guillaume Pasero a écrit :
>
> Hi,
>
> It seems that you trained you model 'model.rf' with a certain number of 
> bands, but try to use it with on an image that has a different number of 
> bands. 
>
> You can check the parameter 'var_count' in your file 'model.rf' and 
> compare it with the number of bands in 
> alldates2014_landsat_bandes_et_nvdi.TIF
>
> Regards,
>
> Guillaume
> On 10/26/2016 09:46 AM, michel M wrote:
>
> Hello , 
> I have an error on the command classifier 
>
>  otbcli_ImageClassifier.bat -in alldates2014_landsat_bandes_et_nvdi.TIF  
> -out classif.tif uint8 -model model.rf
>
> i replaced uint8 by float but the result is the same 
>
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Loading model
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Model loaded
> 2016 Oct 26 09:35:21  :  Application.logger  (INFO) Input image 
> normalization deactivated.
> Writing classif.tif...: 0% 
> [  ]OpenCV Error: Bad 
> argument (the input sample must be 1d floating-point vector with
>  the same number of elements as the total number of variables used for 
> training ) in predict, file 
> /data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4  
> .10/modules/ml/src/tree.cpp, line 3620
> /data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4.10/modules/ml/src/tree.cpp:3620:
>  
> error: (-5) the input sample must be 1d floating-point vector wit h the 
> same number of elements as the total number of variables used for training  
> in function predict
>
> many many thanks for your help 
>
> Michel 
>
>
>
> -- 
> -- 
> 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 otb-...@googlegroups.com 
> 
> To unsubscribe from this group, send email to
> otb-users+...@googlegroups.com 
> 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 otb-users+...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
>  *Guillaume PASERO*
> Responsable technique
> *Business Unit E-SPACE & Geo Information - Département Image & 
> 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 - guillaum...@c-s.fr  
>

-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-10-31 Thread Guillaume Pasero

  
  
Hi,
It seems that you trained you model 'model.rf' with a certain
  number of bands, but try to use it with on an image that has a
  different number of bands. 

You can check the parameter 'var_count' in your file 'model.rf'
  and compare it with the number of bands in
  alldates2014_landsat_bandes_et_nvdi.TIF
Regards,
Guillaume

On 10/26/2016 09:46 AM, michel M wrote:


  Hello , 
I have an error on the command classifier 

 otbcli_ImageClassifier.bat -in
alldates2014_landsat_bandes_et_nvdi.TIF  -out classif.tif uint8
-model model.rf

i replaced uint8 by float but the result is the same 

2016 Oct 26 09:35:21  :  Application.logger  (INFO) Loading
model
2016 Oct 26 09:35:21  :  Application.logger  (INFO) Model loaded
2016 Oct 26 09:35:21  :  Application.logger  (INFO) Input image
normalization de    activated.
Writing classif.tif...: 0%
[  ]OpenCV
Error: Bad argument (the input sample must be 1d floating-point
vector with
 the same number of elements as the total number of variables
used for training ) in predict, file
/data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4 
.10/modules/ml/src/tree.cpp, line 3620
/data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4.10/modules/ml/src/tree.cpp:3620:
error: (-5) the input sample must be 1d floating-point vector
wit h the same number of elements as the total number of
variables used for training  in function predict

many many thanks for your help 

Michel 



  
  -- 
  -- 
  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 otb-users@googlegroups.com
  To unsubscribe from this group, send email to
  otb-users+unsubscr...@googlegroups.com
  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 otb-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.


-- 
  

  
  
  Guillaume PASERO
Responsable technique
Business Unit E-SPACE & Geo Information -
  Département Image & 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 - guillaume.pas...@c-s.fr
  
  

  

  




-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[otb-users] Error otbcli_ImageClassifier (floating-point vector with ..)

2016-10-26 Thread michel M
Hello , 
I have an error on the command classifier 

 otbcli_ImageClassifier.bat -in alldates2014_landsat_bandes_et_nvdi.TIF  
-out classif.tif uint8 -model model.rf

i replaced uint8 by float but the result is the same 

2016 Oct 26 09:35:21  :  Application.logger  (INFO) Loading model
2016 Oct 26 09:35:21  :  Application.logger  (INFO) Model loaded
2016 Oct 26 09:35:21  :  Application.logger  (INFO) Input image 
normalization deactivated.
Writing classif.tif...: 0% 
[  ]OpenCV Error: Bad 
argument (the input sample must be 1d floating-point vector with
 the same number of elements as the total number of variables used for 
training ) in predict, file 
/data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4  
.10/modules/ml/src/tree.cpp, line 3620
/data/tools/mxe/tmp-opencv-i686-w64-mingw32.shared/opencv-2.4.10/modules/ml/src/tree.cpp:3620:
 
error: (-5) the input sample must be 1d floating-point vector wit h the 
same number of elements as the total number of variables used for training  
in function predict

many many thanks for your help 

Michel 



-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.