Hi,

You should use *otb::StreamingCompareImageFilter* instead of *otb::PersistentCompareImageFilter*. The persistent filter is used internally but it is not meant to be instanciated by the user.

A few comments also:

 * calling Update() on each reader is not necessary, nor suited for
   streaming processing. You can remove these updates, only keep the
   update on the compareFilter.
 * You don't need an intermediate ImageType::Pointer to get the readers
   output. You can directly give them to the compare filter :
   *compareFilter->SetInput1(movingReader->GetOutput())*

Regards,
Guillaume

Le 25/06/2014 07:05, wijuk pruksuriya a écrit :
Hello , I use otbStreamingCompareImageFilter to compare two images.

But I have problem when I use GetPSNR() and GetMSE() both of output is 1.79769e+308 (I think PSNR result is ... DB %).

My code.

|
typedefotb::PersistentCompareImageFilter<ImageType>CompareImageType;

ReaderType::PointermovingReader =ReaderType::New();
movingReader->SetFileName("images.jpg");
movingReader->Update();
ImageType::Pointero_image =movingReader->GetOutput();

ReaderType::PointermovingReader2 =ReaderType::New();
movingReader2->SetFileName("images2.jpg");
movingReader2->Update();
ImageType::Pointeru_image =movingReader2->GetOutput();

CompareImageType::PointercompareFilter =CompareImageType::New();
compareFilter->SetInput1(o_image);
compareFilter->SetInput2(u_image);
compareFilter->Update();

cout <<"MSE of two images"<<compareFilter->GetMSE()<<endl;
cout <<"PSNR of two images"<<compareFilter->GetPSNR()<<endl;
|

--
--
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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.


--
<www.c-s.fr>      *Guillaume PASERO*
Ingénieur d'études et développement
*Business Unit E-SPACE & Geo Information* <https://thor.si.c-s.fr/blogs/cs-blogs-business/>*- Département 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