205 #define ICL_INSTANTIATE_DEPTH(T) \ 206 template<> inline depth getDepth<icl ## T>() { return depth ## T; } 208 #undef ICL_INSTANTIATE_DEPTH 216 inline void copy(
const T *src,
const T *srcEnd, T *dst){
218 memcpy(dst,src,(srcEnd-src)*
sizeof(T));
225 inline void copy<icl8u>(
const icl8u *poSrcStart,
const icl8u *poSrcEnd,
icl8u *poDst){
226 ippsCopy_8u(poSrcStart,poDst,(poSrcEnd-poSrcStart));
229 inline void copy<icl16s>(
const icl16s *poSrcStart,
const icl16s *poSrcEnd,
icl16s *poDst){
230 ippsCopy_16s(poSrcStart,poDst,(poSrcEnd-poSrcStart));
233 inline void copy<icl32s>(
const icl32s *poSrcStart,
const icl32s *poSrcEnd,
icl32s *poDst){
234 ippsCopy_32s(poSrcStart,poDst,(poSrcEnd-poSrcStart));
237 inline void copy<icl32f>(
const icl32f *poSrcStart,
const icl32f *poSrcEnd,
icl32f *poDst){
238 ippsCopy_32f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
241 inline void copy<icl64f>(
const icl64f *poSrcStart,
const icl64f *poSrcEnd,
icl64f *poDst){
242 ippsCopy_64f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
251 template <
class srcT,
class dstT>
252 inline void convert(
const srcT *poSrcStart,
const srcT *poSrcEnd, dstT *poDst){
253 std::transform(poSrcStart,poSrcEnd,poDst,utils::clipped_cast<srcT,dstT>);
258 template<>
inline void convert<icl8u,icl32f>(
const icl8u *poSrcStart,
const icl8u *poSrcEnd,
icl32f *poDst){
260 ippsConvert_8u32f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
263 template<>
inline void convert<icl16s,icl32s>(
const icl16s *poSrcStart,
const icl16s *poSrcEnd,
icl32s *poDst){
264 ippsConvert_16s32s(poSrcStart,poDst,(poSrcEnd-poSrcStart));
266 template<>
inline void convert<icl16s,icl32f>(
const icl16s *poSrcStart,
const icl16s *poSrcEnd,
icl32f *poDst){
267 ippsConvert_16s32f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
269 template<>
inline void convert<icl16s,icl64f>(
const icl16s *poSrcStart,
const icl16s *poSrcEnd,
icl64f *poDst){
270 ippsConvert_16s64f_Sfs(poSrcStart,poDst,(poSrcEnd-poSrcStart),0);
274 template<>
inline void convert<icl32s,icl16s>(
const icl32s *poSrcStart,
const icl32s *poSrcEnd,
icl16s *poDst){
275 ippsConvert_32s16s(poSrcStart,poDst,(poSrcEnd-poSrcStart));
277 template<>
inline void convert<icl32s,icl32f>(
const icl32s *poSrcStart,
const icl32s *poSrcEnd,
icl32f *poDst){
278 ippsConvert_32s32f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
280 template<>
inline void convert<icl32s,icl64f>(
const icl32s *poSrcStart,
const icl32s *poSrcEnd,
icl64f *poDst){
281 ippsConvert_32s64f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
285 template <>
inline void convert<icl32f,icl8u>(
const icl32f *poSrcStart,
const icl32f *poSrcEnd,
icl8u *poDst){
286 ippsConvert_32f8u_Sfs(poSrcStart,poDst,(poSrcEnd-poSrcStart),ippRndNear,0);
288 template <>
inline void convert<icl32f,icl16s>(
const icl32f *poSrcStart,
const icl32f *poSrcEnd,
icl16s *poDst){
289 ippsConvert_32f16s_Sfs(poSrcStart,poDst,(poSrcEnd-poSrcStart),ippRndNear,0);
291 template <>
inline void convert<icl32f,icl32s>(
const icl32f *poSrcStart,
const icl32f *poSrcEnd,
icl32s *poDst){
292 ippsConvert_32f32s_Sfs(poSrcStart,poDst,(poSrcEnd-poSrcStart),ippRndNear,0);
294 template <>
inline void convert<icl32f,icl64f>(
const icl32f *poSrcStart,
const icl32f *poSrcEnd,
icl64f *poDst){
295 ippsConvert_32f64f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
299 template<>
inline void convert<icl64f,icl32f>(
const icl64f *poSrcStart,
const icl64f *poSrcEnd,
icl32f *poDst){
300 ippsConvert_64f32f(poSrcStart,poDst,(poSrcEnd-poSrcStart));
302 template <>
inline void convert<icl64f,icl32s>(
const icl64f *poSrcStart,
const icl64f *poSrcEnd,
icl32s *poDst){
303 ippsConvert_64f32s_Sfs(poSrcStart,poDst,(poSrcEnd-poSrcStart),ippRndNear,0);
306 #elif defined ICL_HAVE_SSE2 356 maxVal = c>maxVal ? c : maxVal;
369 ICLCore_API std::vector<double>
mean(
const ImgBase *poImg,
int iChannel = -1,
bool roiOnly =
false);
379 ICLCore_API std::vector<double>
variance(
const ImgBase *poImg,
const std::vector<double> &
mean,
bool empiricMean =
true,
int iChannel = -1,
bool roiOnly =
false);
387 ICLCore_API std::vector<double>
variance(
const ImgBase *poImg,
int iChannel = -1,
bool roiOnly =
false);
403 ICLCore_API std::vector<double>
stdDeviation(
const ImgBase *poImage,
const std::vector<double>
mean,
bool empiricMean =
true,
int iChannel = -1,
bool roiOnly =
false);
411 ICLCore_API std::vector< std::pair<double, double> >
meanAndStdDev(
const ImgBase *image,
int iChannel = -1,
bool roiOnly =
false);
418 ICLCore_API std::vector<std::vector<int> >
hist(
const ImgBase *image,
int levels = 256,
bool roiOnly =
false);
undocument this line if you encounter any issues!
Definition: Any.h:37
ICLCore_API std::vector< std::vector< int > > hist(const ImgBase *image, int levels=256, bool roiOnly=false)
computes the color histogramm of given image
#define ICL_INSTANTIATE_ALL_DEPTHS
Definition: Macros.h:175
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
ICLCore_API std::vector< std::pair< double, double > > meanAndStdDev(const ImgBase *image, int iChannel=-1, bool roiOnly=false)
Calculates mean and standard deviation of given image simultanously.
ICLCore_API std::istream & operator>>(std::istream &s, format &f)
puts a string representation of format into the given stream
ICLCore_API std::ostream & operator<<(std::ostream &s, const format &f)
puts a string representation of format into the given stream
ICLQt_API ImgQ levels(const ImgQ &image, icl8u levels)
reduces an images quantisation levels
ICLCore_API void getMinAndMax(T a, T b, T c, T &minVal, T &maxVal)
function, that calculates the mininum and the maximum value of three value
Definition: CoreFunctions.h:344
ICLQt_API ImgROI roi(ImgQ &r)
creates a ROI-struct from an image
ICLCore_API ImgBase * ensureDepth(ImgBase **ppoImage, depth eDepth)
ensures that an image has the specified depth
static const Rect null
null Rect is w=0, h=0, x=0, y=0
Definition: Rect.h:99
The ImgParams class stores all image parameters .
Definition: ImgParams.h:58
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
ICLCore_API ImgBase * imgNew(depth d=depth8u, const ImgParams ¶ms=ImgParams::null)
create a new image instance of the given depth type and with given parameters
Ipp32s icl32s
32bit signed integer type for the ICL
Definition: BasicTypes.h:58
Ipp32f icl32f
32Bit floating point type for the ICL
Definition: BasicTypes.h:55
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
Size class of the ICL.
Definition: Size.h:61
ICLCore_API std::vector< double > variance(const ImgBase *poImg, const std::vector< double > &mean, bool empiricMean=true, int iChannel=-1, bool roiOnly=false)
Compute the variance value of an image a with given mean.
depth getDepth()
getDepth<T> returns to depth enum associated to type T
static const ImgParams null
as default size=(0,0), channels=0, format=matrix, roi=(0,0,0,0)
Definition: ImgParams.h:61
ICLCore_API std::vector< int > channelHisto(const ImgBase *image, int channel, int levels=256, bool roiOnly=false)
computes the color histogramm of given image channel
ICLCore_API std::vector< double > mean(const ImgBase *poImg, int iChannel=-1, bool roiOnly=false)
Computes the mean value of a ImgBase* ingroup MATH.
ICLCore_API ImgBase * ensureCompatible(ImgBase **dst, depth d, const ImgParams ¶ms)
ensures that an image has given depth and parameters
ICLCore_API std::vector< double > stdDeviation(const ImgBase *poImage, int iChannel=-1, bool roiOnly=false)
Compute the std::deviation of an image.
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
ICLCore_API unsigned int getSizeOf(depth eDepth)
return sizeof value for the given depth type
void convert(const srcT *poSrcStart, const srcT *poSrcEnd, dstT *poDst)
moves value from source to destination array (with casting on demand)
Definition: CoreFunctions.h:252
void copy(const T *src, const T *srcEnd, T *dst)
moves data from source to destination array (no casting possible)
Definition: CoreFunctions.h:216
ICLCore_API int getChannelsOfFormat(format fmt)
determines the count of channels, for each color format
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
ICLQt_API ImgQ channel(const ImgQ &image, int channel)
picks a specific image channel
Ipp16s icl16s
16bit signed integer type for the ICL (range [-32767, 32768 ])
Definition: BasicTypes.h:61
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
#define ICLCore_API
Definition: CompatMacros.h:174