1.视频图像类别
一级分类 |
二级分类 |
备注 |
黑屏 |
中心无文字 |
二级分类单选 |
中心有文字 |
||
中心无文字-灰色背景 |
||
中心有文字-灰色背景 |
||
花屏 |
黑底条线或点阵 |
二级分类单选 |
中心区域复杂纹理 |
||
全屏复杂纹理(雪花) |
||
中心区域固定图信息 |
||
彩色背景-无文字 |
||
彩色背景-有文字 |
||
全屏规则条纹 |
||
扭曲 |
||
严重扭曲 |
||
非规则线条 |
||
滚屏 |
||
强噪音条带 |
||
横向亮度突变 |
||
图像亮度错位 |
||
遮挡 |
左侧遮挡 |
二级分类单选 |
右侧遮挡 |
||
上侧遮挡 |
||
下侧遮挡 |
||
左右两侧遮挡 |
||
三面遮挡 |
||
正常(画质欠佳) |
色偏 |
二级分类复选 |
过暗 |
||
过明 |
||
过曝光 |
||
线干扰 |
||
色块干扰 |
||
马赛克 |
||
模糊 |
||
正常(画质清晰) |
疑似提示(如轻微模糊) |
同时多种提示 |
2. 参数设置
2.1 阈值及检测项设置
对正常显示,但画质欠佳的各检查项设置阈值。
阈值归一化为[0 1]区间,其中0表示敏感度最低, 也即只选出相似度较高的干扰项,1表示敏感度最高,即把可能存在的干扰项全部选出。
检测项设置用于强制检测非常规的干扰,包括字迹和横向移位两项。当用户需要或特定应用场景下会出现该类故障时,可选中这两项。
2.2 位置参数设置
不同的监控系统中,往往在图像上方或下方添加时间、位置、状态等文字属性信息,这类信息可能会对图像质量分析产生干扰。位置参数设置用于设置这类文字属性信息的位置,以相对于原始图像百分比的形式给出,使识别结果更稳定。
3. 库函数接口
3.1 接口简介
定义类CDigitVerify及接口函数voidCDigitVerify::ProcessMain(int* anResult,unsigned char* abyImageColor, int nHeight,int nWidth, float* afParas, float* afBounds),其中anResult为输出结果,abyImageColor为输入RGB图像数据, nHeight为输入图像高度, nWidth为输入图像长度, afParas为输入阈值, afBounds为输入上下边界。
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=new unsigned char[nLength];
}
if(nBitCount==8){ // 灰度图,(后续需考虑调色板)
unsigned char* pbyRealData=(unsigned char*)m_Image.GetBits(); // 首字节指针
k=0; //标志存入数组的索引
for (y=0; y
for (x=0; x
i=nRowByte*y+x;
pabyImage[k++]=*(pbyRealData+i); // R
pabyImage[k++]=*(pbyRealData+i); // G
pabyImage[k++]=*(pbyRealData+i); // B
}
}
else if(nBitCount==24){
unsigned char* pbyRealData=(unsigned char*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y
i=nRowByte*y;
memcpy(&(pabyImage[k]),pbyRealData+i,3*nWidth);
k=k+3*nWidth;
}
}
else if(nBitCount==32){
unsigned char* pbyRealData=(unsigned char*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y
for (x=0; x
i=nRowByte*y+x*4;
pabyImage[k++]=*(pbyRealData+i); // R
pabyImage[k++]=*(pbyRealData+i+1); // G
pabyImage[k++]=*(pbyRealData+i+2); // B
}
}
else if(nBitCount==16){
WORD* pbyRealData=(WORD*)m_Image.GetBits();
k=0; //标志存入数组的索引
for (y=0; y
for (x=0; 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)
}
}
else{ // 不支持的图象格式
nResult[0]=0;
m_ListView.SetItemText(nItem, 3, “无法处理色阶”);
continue;
}
// 检测算法
m_clImageVerify.ProcessMain(nResult, pabyImage,nHeight,nWidth, fParas, fBounds));
// 保存结果
free [] pabyImage;
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!