cvMinMaxLoc
獲取圖片顏色最大最小值及其位置
cvMinMaxLoc(影像 , &MinValue,&MaxValue,&MinLocation,&MaxLocation);
cvSetImageCOI(image,1);
cvMinMaxLoc(image,&MinValue,&MaxValue,&MinLocation,&MaxLocation);
printf("The Min number is : %.f\n",MinValue);
printf("The position is : ( %d , %d )\n",MinLocation.x,MinLocation.y);
printf("The Max number is : %.f\n",MaxValue);
printf("The position is : (%d , %d )\n",MaxLocation.x,MaxLocation.y);
cvNamedWindow("grotto",1);
cvShowImage("grotto",image);
cvWaitKey(0);
}
cvMinMaxLoc(影像 , &MinValue,&MaxValue,&MinLocation,&MaxLocation);
cvSetImageCOI(image,1);
cvMinMaxLoc(image,&MinValue,&MaxValue,&MinLocation,&MaxLocation);
printf("The Min number is : %.f\n",MinValue);
printf("The position is : ( %d , %d )\n",MinLocation.x,MinLocation.y);
printf("The Max number is : %.f\n",MaxValue);
printf("The position is : (%d , %d )\n",MaxLocation.x,MaxLocation.y);
cvNamedWindow("grotto",1);
cvShowImage("grotto",image);
cvWaitKey(0);
}
留言
張貼留言