void darkRate() { //gROOT->SetBatch(true); gROOT->SetStyle("Plain"); gStyle->SetOptStat(0000); gStyle->SetOptTitle(0); TFile * f1300 = new TFile("Spectra/08_12_16_1700V_LightsOff_Short.root", "READ"); TFile * f1500 = new TFile("Spectra/08_12_16_1800V_LightsOff_Short.root", "READ"); TFile * f1700 = new TFile("Spectra/08_12_16_1900V_LightsOff_Short.root", "READ"); TTree * t1300 = (TTree*)f1300->Get("Channel_1"); TTree * t1500 = (TTree*)f1500->Get("Channel_1"); TTree * t1700 = (TTree*)f1700->Get("Channel_1"); TGraphErrors * h1300 = integralHistogram(t1300); TGraphErrors * h1500 = integralHistogram(t1500); TGraphErrors * h1700 = integralHistogram(t1700); h1300->GetYaxis()->SetTitle("Rate [Hz]"); h1300->GetYaxis()->SetRangeUser(0.5, 10e6); h1300->GetXaxis()->SetTitle("Threshold [mV]"); h1300->GetXaxis()->SetRangeUser(0.5, 1000); h1300->SetLineColor(kBlack); h1500->SetLineColor(kRed); h1700->SetLineColor(kBlue); TLegend * leg = new TLegend(0.60, 0.70, 0.88, 0.88); leg->SetHeader("PMT Voltage"); leg->AddEntry(h1300, "1700V", "l"); leg->AddEntry(h1500, "1800V", "l"); leg->AddEntry(h1700, "1900V", "l"); h1300->Draw("ALP"); h1500->Draw("LP"); h1700->Draw("LP"); leg->Draw(); }
void CvHOGEvaluator::setImage( const Mat &img, uchar clsLabel, int idx ) { CV_DbgAssert( !hist.empty()); CvFeatureEvaluator::setImage( img, clsLabel, idx ); std::vector<Mat> integralHist; for ( int bin = 0; bin < N_BINS; bin++ ) { integralHist.push_back( Mat( winSize.height + 1, winSize.width + 1, hist[bin].type(), hist[bin].ptr<float>( (int) idx ) ) ); } Mat integralNorm( winSize.height + 1, winSize.width + 1, normSum.type(), normSum.ptr<float>( (int) idx ) ); integralHistogram( img, integralHist, integralNorm, (int) N_BINS ); }
bool HOGEvaluator::setImage( const Mat& image, Size winSize ) { int rows = image.rows + 1; int cols = image.cols + 1; origWinSize = winSize; if( image.cols < origWinSize.width || image.rows < origWinSize.height ) return false; hist.clear(); for( int bin = 0; bin < Feature::BIN_NUM; bin++ ) { hist.push_back( Mat(rows, cols, CV_32FC1) ); } normSum.create( rows, cols, CV_32FC1 ); integralHistogram( image, hist, normSum, Feature::BIN_NUM ); size_t featIdx, featCount = features->size(); for( featIdx = 0; featIdx < featCount; featIdx++ ) { featuresPtr[featIdx].updatePtrs( hist, normSum ); } return true; }