Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

MakeHistogram1d.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Histogram_MakeHistogram1d_h
00002 #define Impala_Core_Histogram_MakeHistogram1d_h
00003 
00004 #include "Core/Histogram/Histogram1dTem.h"
00005 //#include "Data/Container/CxHistogram1d.h"
00006 //#include "Data/Geometry/CxPointZ.h"
00007 #include "Core/Array/MakeRoi.h"
00008 #include "Core/Histogram/TraitInOutHistogram1d.h"
00009 //#include "Core/Array/Pattern/CxPatSet.h"
00010 #include "Core/Array/Pattern/PatInOutOp.h"
00011 
00012 namespace Impala
00013 {
00014 namespace Core
00015 {
00016 namespace Histogram
00017 {
00018 
00019 template<class HistT, class ArrayT>
00020 void
00021 MakeHistogram1d(HistT* hist, ArrayT* im)
00022 {
00023     //Geometry::Rectangle rect(0, 0, im->CW(), im->CH());
00024     //MakeHistogram1d(hist,im,rect);
00025     hist->Clear();
00026     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00027     Array::Pattern::PatInOutOp(im, inoutHist);
00028 }
00029 
00030 template<class HistT, class ArrayT>
00031 void
00032 MakeHistogram1d(HistT* hist, ArrayT* im, ArrayT* weights)
00033 {
00034     hist->Clear();
00035     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00036     Array::Pattern::PatInOutOp(im, weights, inoutHist);
00037 }
00038 
00039 template<class HistT, class ArrayT>
00040 void
00041 MakeHistogram1d(HistT* hist, ArrayT* im, Geometry::Rectangle rect)
00042 {
00043     hist->Clear();
00044     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00045     ArrayT* roi = Array::MakeRoi(im, rect);
00046     Array::Pattern::PatInOutOp(roi, inoutHist);
00047     delete roi;
00048 }
00049 
00050 /*
00051 void
00052 CxMakeHistogram1d(CxHistogram1d* histogram, CxArray2dScalarReal64* image,
00053                 const CxPointZ& point, double sigma)
00054 {
00055     int w,h,x,y;
00056     w = h = ((int)(6.*sigma)) + 1;
00057     x = y = ((int)(3.*sigma)) + 1;
00058 
00059     CxInOutHistogram1dGaussian export(histogram);
00060     export.Initialise(w,h,sigma,x,y);
00061 
00062     CxArray2dScalarReal64* cutOut = new CxArray2dScalarReal64(w, h, 0, 0);
00063     CxPatSet(cutOut, image, point.mX - x, point.mY - y, w, h, 0, 0);
00064     CxPatInOutOp(cutOut, export);
00065     delete cutOut;
00066 }
00067 */
00068 
00069 } // namespace Histogram
00070 } // namespace Core
00071 } // namespace Impala
00072 
00073 #endif

Generated on Fri Mar 19 09:31:10 2010 for ImpalaSrc by  doxygen 1.5.1