本文整理汇总了C++中Video::getCoefs方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::getCoefs方法的具体用法?C++ Video::getCoefs怎么用?C++ Video::getCoefs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::getCoefs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeSI
void SI::ComputeSI(Video refvideo,Sobel refsobel ,int row ,int col){
int i,j,k;
int NoFrames;
NoFrames = refvideo.returnFrames();
double *si_tmp = new double[row*col];
double avg=0,std=0;
Image ref;
float coefs[3];
refvideo.getCoefs(coefs);
refsobel.allocate_Pixelmaps(row,col,coefs);
for(i=0;i<NoFrames;i++){
refvideo.readVideo(i,row,col);
ref = refvideo.getFrame(i);
refsobel.Sobel_Operation(ref);
for(j=0;j<row;j++){
for(k=0;k<col;k++){
avg += refsobel.get_Sobel_Ptrstream(j,k);
}
}
avg /= (row*col);
for(j=0;j<row;j++){
for(k=0;k<col;k++){
std += pow( refsobel.get_Sobel_Ptrstream(j,k) - avg,2 );
}
}
std = sqrt(std/(row*col-1));
si_tmp[i] = std;
avg = 0;
std = 0;
}
SI_avg = si_tmp[0];
for(i=1;i<NoFrames;i++){
if(SI_avg<si_tmp[i])
SI_avg = si_tmp[i];
}
refsobel.deallocate_Pixelmaps();
}
示例2: computeTI
void TI::computeTI(Video tmpVideo, Video tmpVideo1, TemporalMap tmpTempMap,int row, int col)
{
int i,j,k;
int noframes = tmpVideo.returnFrames();
double *ti_tmp = new double[noframes];
double avg = 0, std = 0;
Image tmp,tmp1;
float coefs[3];
tmpVideo.getCoefs(coefs);
tmp.setCoefs(coefs);
tmp1.setCoefs(coefs);
tmpTempMap.allocate_Pixelmaps(row,col,coefs);
for(i = 0; i < noframes - 1; i++)
{
tmpVideo.readVideo(i,row,col);
tmpVideo1.readVideo(i+1,row,col);
tmp = tmpVideo.getFrame(i);
tmp1 = tmpVideo1.getFrame(i+1);
tmpTempMap.generateTemporalMap(tmp,tmp1);
tmpTempMap.writeFrames(i,row,col);
for(j = 0; j < col; j++){
for (k=0;k<row;k++){
avg += tmpTempMap.get_TemporalMap_Ptrstream(j,k);
}
}
avg /= (row*col);
for(j = 0; j < col; j++){
for (k = 0;k < row; k++){
std += pow((tmpTempMap.get_TemporalMap_Ptrstream(j,k)- avg),2);
}
}
std = sqrt(std/(row*col-1));
ti_tmp[i] = std;
avg = 0;
std = 0;
}
TI_Avg = ti_tmp[0];
for(i = 1; i < noframes - 1; i++)
{
if(TI_Avg < ti_tmp[i]){
TI_Avg = ti_tmp[i];
}
}
tmpTempMap.deallocate_Pixelmaps();
cout << "TI = " << TI_Avg << endl;
}