什麼圖像歸一化
通俗地講就是將矩陣的值經過某種方式變到某一個區間內數組
###圖像歸一化的做用spa
- 目前能理解的就是歸一化到某個區間便於處理,但願高人能夠指點
opencv文檔中的介紹
C++: void normalize(InputArray src, InputOutputArray dst, double alpha=1, double beta=0, int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray() ) C++: void normalize(const SparseMat& src, SparseMat& dst, double alpha, int normType) Python: cv2.normalize(src[, dst[, alpha[, beta[, norm_type[, dtype[, mask]]]]]]) → dst Parameters: src – input array. dst – output array of the same size as src . alpha – norm value to normalize to or the lower range boundary in case of the range normalization. beta – upper range boundary in case of the range normalization; it is not used for the norm normalization. normType – normalization type (see the details below). dtype – when negative, the output array has the same type as src; otherwise, it has the same number of channels as src and the depth =CV_MAT_DEPTH(dtype). mask – optional operation mask.
norm_type有NORM_INF, NORM_MINMAX,NORM_L1和NORM_L2四種。 一、在 NORM_MINMAX 模式下,alpha表示歸一化後的最小值,beta表示歸一化後的最大值。 二、在NORM_L一、NORM_L二、NORM_INF 模式下,alpha表示執行相應歸一化後矩陣的範數值,beta不使用。 三、稀疏矩陣歸一化僅支持非零像素code
NORM_MINMAX
數組的數值被平移或縮放到一個指定的範圍,線性歸一化。orm
$dst(i, j) = \frac{(src(i, j) - min(src(x, y))) * (beta - alpha)}{max(src(x, y)) - min(src(x, y))} + alpha$ $${x}\over{y}$$blog
NORM_INF
分母爲L∞範數 ,即矩陣各元素絕對值的最大值(切比雪夫距離)文檔
NORM_L1
分母爲L1-範數,即矩陣元素的絕對值之和(曼哈頓距離)input
NORM_L2
分母爲L2-範數,即矩陣各元素的歐幾里德距離之和it