OpenCV2 x自學筆記 自適應閾值

2022-01-15 02:30:54 字數 1054 閱讀 5659

adaptivethreshold(src,dst, double maxvalue, int adaptivemethod, int thresholdtype, int blocksize, double c);

src——8位單通道浮點型影象

dst——輸出影象

maxvalue——最大值,一般為255

adaptivemethod——演算法

adaptive_thresh_mean_c、adaptive_thresh_gaussian_c

thresholdtype——閾值型別

thresh_binary(大於閾值為白)、thresh_binary_inv(大於閾值為黑)

blocksize——領域尺寸,一般取值357等奇數,小則邊緣檢測效果,大則二值化

c——常數

當演算法為adaptive_thresh_mean_c時,閾值= blocksize*(鄰域塊內所有畫素-c的平均值)

當演算法為adaptive_thresh_ gaussian _c時,閾值= blocksize*(鄰域塊內所有畫素-c之後與高斯窗交叉相關的加權總和)

【例】adaptivethreshold(image, binary, 255, cv_adaptive_thresh_mean_c, cv_thresh_binary, 25, 10);

opencv2 x檔案結構解析

1 opencv簡介 2 opencv模組結構 modular structure opencv擁有乙個模組結構,也就是說,opencv包 package 裡包含數個共享的或靜態的庫 libraries 分別如下 opencv doc opencv2refman.pdf p1 core.該模組定義了...

OpenCV學習筆記 自適應閾值化

自適應閾值化的函式為 自適應閾值方法 void cvadaptivethreshold const cvarr src,cvarr dst,double max value,int adaptive method cv adaptive thresh mean c,int threshold typ...

OpenCV學習筆記 自適應閾值化

自適應閾值化的函式為 自適應閾值方法 void cvadaptivethreshold const cvarr src,cvarr dst,double max value,int adaptive method cv adaptive thresh mean c,int threshold typ...