[GIL] any_image difference
Hi all, What is the best way to compute the difference between 2 any_image? Of course, the input any_image may not be of the same type... So, if pixels are unsigned int for the 1st one and double for the 2nd one, the result must be stored as double. I (accidently) found pixel_minus_t in pixel_numeric_operations.hpp but cannot figure how to use it. Hope you could help. Regards, Olivier
Hi,
2010/11/5 Olivier Tournaire
Hi all,
What is the best way to compute the difference between 2 any_image? Of course, the input any_image may not be of the same type... So, if pixels are unsigned int for the 1st one and double for the 2nd one, the result must be stored as double. I (accidently) found pixel_minus_t in pixel_numeric_operations.hpp but cannot figure how to use it.
I am still having problem with this. I found a way to write such an image
difference, but not for any_image. Here is what I have now:
namespace boost { namespace gil {
typedef double bits64F;
GIL_DEFINE_BASE_TYPEDEFS(64F,gray)
typedef float bits32F;
GIL_DEFINE_BASE_TYPEDEFS(32F,gray)
} }
struct image_difference
{
typedef void result_type;
template
Hi Olivier, sorry for the late reply. Interesting problem you have and I started looking into it.
What is the best way to compute the difference between 2 any_image? Of course, the input any_image may not be of the same type... So, if pixels are unsigned int for the 1st one and double for the 2nd one, the result must be stored as double. I (accidently) found pixel_minus_t in pixel_numeric_operations.hpp but cannot figure how to use it.
Where did you find pixel_numeric_operations.hpp? Regards, Christian
Hi Christian,
2010/11/6 Christian Henning
Hi Olivier, sorry for the late reply. Interesting problem you have and I started looking into it.
Great, thank you! What about my first solution?
What is the best way to compute the difference between 2 any_image? Of course, the input any_image may not be of the same type... So, if pixels are unsigned int for the 1st one and double for the 2nd one, the result must be stored as double. I (accidently) found pixel_minus_t in pixel_numeric_operations.hpp but cannot figure how to use it.
Where did you find pixel_numeric_operations.hpp?
in extension/numeric Regards, Olivier
Regards, Christian _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Olivier,
Great, thank you! What about my first solution?
Yes. I think it's the right way. Here is what I have which uses
transform_pixels.
#include
Hi Olivier, there is no transform_pixels for any_image. That's a bit odd since there are other STL algorithms. I'll try my best to create one but it might take a bit. I'll let you know. Christian
Hi Olivier, here is a slightly better version:
#include
participants (2)
-
Christian Henning
-
Olivier Tournaire