}
}
{ } count--; o_dis[count]=-1; k1--;
o_dis[l]=o_dis[l+1];
//将该字块计算得到的颜色对表填入该图像的特征颜色对表
for(int scan=0; scan<8; scan++) { } }
if(o_dis[scan]>0) { }
pair[num].x1=x; pair[num].y1=y;
pair[num].o_dis1=o_dis[scan]; num++;
//对四个子块的颜色对表排序
void CImageRetrievalDlg::SortColorPair() {
//32个数据项中有count个实际数值 for(int count=0; count<32; count++)
{ }
if(pair[count].x1 == -1) break;
//对颜色对表从大到小排列序
struct pairs temp; for(int i=count; i>0; i--) { }
//计算域值 double ave=0;
for(int e=0; e ave=ave/count; ave=ave*0.02; //消除差值小于域值的颜色对 ave += pair[e].o_dis1; for(int j=0; j if(pair[j].o_dis1 temp = pair[j]; pair[j] = pair[j+1]; pair[j+1] = temp; for(int k=0; k if(fabs(pair[k].o_dis1-pair[k+1].o_dis1) for(int l=k+1; l pair[count-1].x1 = -1; count--; k--; pair[l] = pair[l+1]; //臵特征颜色对数目变量 pair_count=count; } //显示关键图(1,1)块颜色对信息 void CImageRetrievalDlg::OnShowInfo() { CWnd* pWnd = GetDlgItem(IDC_STATIC_SHOWINFO); CDC* pDC = pWnd->GetDC(); pDC->Rectangle(0, 0, 120,160); int t1=0; CString imagefilepath = strfile; CalculateColor(imagefilepath); } CalculateColorPair(1, 1); for(int ka1=0; ka1<8; ka1++) { } CString sd1; sd1.Format(\ pDC->TextOut(0,t1,sd1); t1+=20; //开始检索 void CImageRetrievalDlg::OnStartRetrieval() { UpdateData(TRUE); for (int objset=0; objset<4; objset++) { } int m1=0; if (m_00 == TRUE) {obj_set[m1].x=0; obj_set[m1].y=0; m1++;} if (m_01 == TRUE) {obj_set[m1].x=0; obj_set[m1].y=1; m1++;} if (m_02 == TRUE) {obj_set[m1].x=0; obj_set[m1].y=2; m1++;} obj_set[objset].x=0; obj_set[objset].y=0; if (m_03 == TRUE) {obj_set[m1].x=0; obj_set[m1].y=3; m1++;} if (m_10 == TRUE) {obj_set[m1].x=1; obj_set[m1].y=0; m1++;} if (m_11 == TRUE) {obj_set[m1].x=1; obj_set[m1].y=1; m1++;} if (m_12 == TRUE) {obj_set[m1].x=1; obj_set[m1].y=2; m1++;} if (m_13 == TRUE) {obj_set[m1].x=1; obj_set[m1].y=3; m1++;} if (m_20 == TRUE) {obj_set[m1].x=2; obj_set[m1].y=0; m1++;} if (m_21 == TRUE) {obj_set[m1].x=2; obj_set[m1].y=1; m1++;} if (m_22 == TRUE) {obj_set[m1].x=2; obj_set[m1].y=2; m1++;} if (m_23 == TRUE) {obj_set[m1].x=2; obj_set[m1].y=3; m1++;} if (m_30 == TRUE) {obj_set[m1].x=3; obj_set[m1].y=0; m1++;} if (m_31 == TRUE) {obj_set[m1].x=3; obj_set[m1].y=1; m1++;} if (m_32 == TRUE) {obj_set[m1].x=3; obj_set[m1].y=2; m1++;} if (m_33 == TRUE)