Hi, 337300 and 7674920 are just the coordinates of the image origin I got with otbcli_ReadImageInfo command or by adding the line std::cout << cloudDetection->GetInput()->GetOrigin() << std::endl; in the code.
Le lundi 28 avril 2014 17:09:08 UTC+1, Rashad a écrit : > > Hi, > > On Mon, Apr 28, 2014 at 10:49 AM, OTB Florian <[email protected]<javascript:> > > wrote: > >> Hi Rashad, >> >> Thanks for your reply. >> I've tested all the examples you recommanded to me. >> >> I'm still working on the cloud detection example and always experimenting >> the same problem. >> I've just added theses code lines after cloudDetection->SetInput(reader-> >> GetOutput()); (l.157 : >> https://github.com/echristophe/OTB/blob/master/Examples/FeatureExtraction/CloudDetectionExample.cxx) >> >> : >> >> OutputImageType::IndexType pixelIndex; >> pixelIndex[0] = 337300; >> pixelIndex[1] = 7674920; >> unsigned short int pixelValue; >> for (int i = 0; i < 4; i++) { // cause it's a 4-band image >> pixelValue = cloudDetection->GetInput()->GetPixel(pixelIndex)[i]; >> std::cout << "GetPixel[" << i << "] = " << pixelValue << std::endl; >> } >> >> >> Then I get senseless values which are different at each execution. >> >> > > How do you find the pixelIndex in the code? > > pixelIndex[0] = 337300; > pixelIndex[1] = 7674920; > > Could you please elaborate the calculation of "337300" and "7674920" ? > > >> Any idea? >> >> Thanks in advance. >> >> >> Le vendredi 25 avril 2014 11:11:08 UTC+1, Rashad a écrit : >>> >>> Hi OTB, >>> >>> >>> On Fri, Apr 25, 2014 at 11:50 AM, OTB Florian <[email protected]> wrote: >>> >>>> >>>> Hi all! >>>> >>>> I'm new at OTB and studying some examples to become familiar with the >>>> library. >>>> >>>> >>> You might start with the first example - http://www.orfeo-toolbox.org/ >>> SoftwareGuide/SoftwareGuidech4.html >>> >>> >>>> I've tried the cloud detection example (https://github.com/ >>>> echristophe/OTB/blob/master/Examples/FeatureExtraction/ >>>> CloudDetectionExample.cxx) with the CloudsOnReunion.tif file and it >>>> works very well. >>>> However, I'm facing some difficulties while trying to get the values of >>>> the different (4) bands of a pixel via the GetPixel() method. >>>> >>> >>> Could you post some of your code which you tried?. >>> >>> >>>> I'm wondering the type returned by this method. In that case, I get an >>>> array with four values which don't mean anything (NaN or values around >>>> 1e-154). >>>> Behind this trouble is the way of encoding the band intensities. Is >>>> there any function to know the type of encoding, the min and max of each >>>> band? >>>> >>> >>> I think you must try the examples first. Sources are available here - >>> http://hg.orfeo-toolbox.org/OTB/file/fc0c18977f12/Examples/Tutorials >>> >>> [1] http://www.orfeo-toolbox.org/SoftwareGuide/SoftwareGuidech4.html >>> >>>> >>>> >>> >>>> If you could help me... >>>> >>>> Thanks. >>>> >>>> -- >>>> -- >>>> 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. >>>> >>> >>> >>> >>> -- >>> Regards, >>> Rashad >>> >> -- >> -- >> 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]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> 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] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Regards, > Rashad > -- -- 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.
