Hi,

Thanks Rashad for the replay,

This is a overview of my code, the exception is generated after the update 
call 


    //Sample list generator
     myListSampleGeneratorType::Pointer sampleGenerator 
=myListSampleGeneratorType
::New();
     
     sampleGenerator->SetInput(image);


    sampleGenerator->SetInputVectorData(vdreproj->GetOutput());
    sampleGenerator->SetThemeKey(GetParameterString("sample.theme"));
    sampleGenerator->SetMaxTrainingSize(GetParameterInt("sample.mt"));
    sampleGenerator->SetMaxValidationSize(GetParameterInt("sample.mv"));
    sampleGenerator->SetValidationTrainingProportion(GetParameterFloat(
"sample.vtr"));




    for(MapThemesType::const_iterator itTheme = mapThemes.begin(); itTheme 
!=mapThemes.end(); itTheme++)
    {
 
 ClassLabelType currentTheme = itTheme->second;
        sampleGenerator->SetCurrentTheme(currentTheme);


        double maxRecall = 0;


        //training OUT
        otbAppLogINFO(" random training out");
        ListSamplePointerType outTrainingSample = ListSampleType::New();
        LabelListSamplePointerType outTrainingLabel = LabelListSampleType::
New();


        sampleGenerator->SetOutOnly();
        sampleGenerator->SetTakeAll(false);
        sampleGenerator->Update();


        for (ListSampleType::Iterator itSample = sampleGenerator->
GetValidationListSample()->Begin();
                itSample != sampleGenerator->GetValidationListSample()->End
();
                ++itSample)
            outTrainingSample->PushBack(itSample.GetMeasurementVector());


        for ( LabelListSampleType::Iterator itLabel = sampleGenerator->
GetValidationListLabel()->Begin();
                itLabel != sampleGenerator->GetValidationListLabel()->End();
                ++itLabel)
            outTrainingLabel->PushBack(itLabel.GetMeasurementVector());


        //training IN randomly initialized
        otbAppLogINFO(" random training in");
        ListSamplePointerType inTrainingSample = ListSampleType::New();
        LabelListSamplePointerType inTrainingLabel = LabelListSampleType::
New();


        sampleGenerator->SetInOnly();
        sampleGenerator->Update();


        for (ListSampleType::Iterator itSample = sampleGenerator->
GetValidationListSample()->Begin();
                itSample != sampleGenerator->GetValidationListSample()->End
();
                ++itSample)
            inTrainingSample->PushBack(itSample.GetMeasurementVector());


        for ( LabelListSampleType::Iterator itLabel = sampleGenerator->
GetValidationListLabel()->Begin();
                itLabel != sampleGenerator->GetValidationListLabel()->End();
                ++itLabel)
            inTrainingLabel->PushBack(itLabel.GetMeasurementVector());


 .......
 ......
 }//For all themes of the DB




Best,
Walid

-- 
-- 
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