当前位置:文档之家› 视频质量分析软件简介

视频质量分析软件简介

视频质量分析软件简介1. 视频图像类别
2. 参数设置
2.1阈值及检测项设置
对正常显示,但画质欠佳的各检查项设置阈值。

阈值归一化为[0 1]区间,其中0表示敏感度最低,也即只选出相似度较高的干扰项,1表示敏感度最高,即把可能存在的干扰项全部选出。

检测项设置用于强制检测非常规的干扰,包括字迹和横向移位两项。

当用户需要或特定应用场景下会出现该类故障时,可选中这两项。

2.2位置参数设置
不同的监控系统中,往往在图像上方或下方添加时间、位置、状态等文字属性信息,这类信息可能会对图像质量分析产生干扰。

位置参数设置用于设置这类文字属性信息的位置,以相对于原始图像百分比的形式给出,使识别结果更稳定。

3. 库函数接口
3.1 接口简介
定义类CDigitVerify及接口函数void CDigitVerify::ProcessMain(int* anResult,unsignedchar* abyImageColor, int nHeight,int nWidth, float* afParas, float* afBounds),其中a nResult为输出结果,abyImageColor为输入RGB图像数据, nHeight为输入图像高度, nWidth为输入图像长度, afParas 为输入阈值, a fBounds为输入上下边界。

3.2 例程
//读取图象
m_Image.Destroy();
HRESULT hResult = m_Image.Load(m_StrFileName);
if (hResult!=S_OK){ // 未成功读取
nResult[0]=0;
m_ListView.SetItemText(nItem, 3, "无法读取");
continue;
}
int nWidth= m_Image.GetWidth(); /// 长度
int nHeight= m_Image.GetHeight(); /// 高度
int nBitCount=m_Image.GetBPP(); /// 获取每象素的数据位数
int nRowByte =m_Image.GetPitch(); /// 相邻两行象素首地址间的间隔,可正可负
int nSize=nWidth*nHeight; // 单色宽度,为加速运算
if (nWidth*nHeight*3>nLength){ // 确保动态内存分配足够
nLength= nWidth*nHeight*3;
delete [] pabyImage;
pabyImage=newunsignedchar[nLength];
}
if(nBitCount==8){ // 灰度图,(后续需考虑调色板)
unsignedchar* pbyRealData=(unsignedchar*)m_Image.GetBits(); // 首字节指针 k=0; //标志存入数组的索引
for (y=0; y<nHeight; y++)
for (x=0; x<nWidth; x++){
i=nRowByte*y+x;
pabyImage[k++]=*(pbyRealData+i); // R
pabyImage[k++]=*(pbyRealData+i); // G
pabyImage[k++]=*(pbyRealData+i); // B
}
}
elseif(nBitCount==24){
unsignedchar* pbyRealData=(unsignedchar*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y<nHeight; y++){
i=nRowByte*y;
memcpy(&(pabyImage[k]),pbyRealData+i,3*nWidth);
k=k+3*nWidth;
}
}
elseif(nBitCount==32){
unsignedchar* pbyRealData=(unsignedchar*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y<nHeight; y++)
for (x=0; x<nWidth; x++){
i=nRowByte*y+x*4;
pabyImage[k++]=*(pbyRealData+i); // R
pabyImage[k++]=*(pbyRealData+i+1); // G
pabyImage[k++]=*(pbyRealData+i+2); // B
}
}
elseif(nBitCount==16){
WORD* pbyRealData=(WORD*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y<nHeight; y++)
for (x=0; x<nWidth; x++){
i=(nRowByte*y+x*2)/2; //字节数,需换算为字数
pabyImage[k++]=((*(pbyRealData+i) & 0xF800)>>8) ; // R
pabyImage[k++]=((*(pbyRealData+i) & 0x07E0)>>3) ; // G
pabyImage[k++]=((*(pbyRealData+i) & 0x001F)<<3) ; // B
}
}
else{ // 不支持的图象格式
nResult[0]=0;
m_ListView.SetItemText(nItem, 3, "无法处理色阶");
continue;
}
// 检测算法
m_clImageVerify.ProcessMain(nResult,pabyImage,nHeight,nWidth, fParas, fBounds)); // 保存结果
free [] pabyImage;
4. 开发者联系信息
blog: /signalthu
Email: imagethu@
qq: 1913440946。

相关主题