图像分割评价标准VO&DC的计算方法

来源:互联网 发布:剑雨江湖进阶数据2017 编辑:程序博客网 时间:2024/06/05 22:34
1.DC  Dice Coefficient
2.VO  Volume Overlap
     The number of voxels in the intersection of segmentation and reference,divided by the number of voxels in the union of segmentation and reference

// int main(int argc, char** argv)   
//{
//    char filename[100];
//    float sum,sum1;
//    
//    for(int i=0;i<=23;i++)
//
//    {
//    sprintf(filename,"F:/fighting/project/data/add_result/4-%d.png",i);// 将图片以数字命名:例如1.jpg 2.jpg等,放入D:/test/文件夹下
//    sum=sum1=0.00;
//    IplImage * img=cvLoadImage(filename);
//    CvScalar s;
//    for(int i=0;i<img->height;i++)
//       {
//          for(int j=0;j<img->width;j++)
//          {
//             s=cvGet2D(img,i,j); // get the (i,j) pixel value
//
//             if(s.val[0]==255)
//             {
//             sum++;
//             }
//             else if(s.val[0]>100 && s.val[0]<255)
//             {
//                 sum1++;
//             }
//         }
//       }
//    float DC=2*sum/(sum1+2*sum);
//    float VO=sum/(sum1+sum);
//    //printf("iou=%d",ratio);
//    //cout<<sum<<"  "<<sum1<<endl;
//    cout<<"DC is "<<DC<<";  "<<"VO is "<<VO<<endl;
//    }
//    cvWaitKey();
// }
原创粉丝点击