第5章 Python 數字圖像處理(DIP) - 圖像復原與重建9 - 空間濾波 - 均值濾波器 - 算術平均、幾何平均、諧波平均、反諧波平均濾波器

標題

    • 只存在噪聲的復原 - 空間濾波
      • 均值濾波器
        • 算術平均濾波器
        • 幾何均值濾波器
        • 諧波平均濾波器
        • 反(逆)諧波平均濾波器

只存在噪聲的復原 - 空間濾波

僅被加性噪聲退化
g(x,y)=f(x,y)+η(x,y)(5.21)g(x, y) = f(x, y) + \eta(x, y) \tag{5.21}g(x,y)=f(x,y)+η(x,y)(5.21)

G(u,v)=F(u,v)+N(u,v)(5.22)G(u, v) = F(u, v) + N(u, v) \tag{5.22}G(u,v)=F(u,v)+N(u,v)(5.22)

噪聲項通常是未知的,因此不能直接從退化圖像中減去噪聲項來得到復原的圖像。

對于周期噪聲,只是個例外而不是規律,我們可以用譜G(u,v)G(u, v)G(u,v)來估計N(u,v)N(u, v)N(u,v),從G(u,v)G(u, v)G(u,v)中減去N(u,v)N(u, v)N(u,v)能夠得到原圖像的一個估計。

均值濾波器

算術平均濾波器

算術平均濾波器是最簡單的均值濾波器。
f^(x,y)=1mn∑(r,c)∈Sxyg(r,c)(5.23)\hat{f}(x, y) = \frac{1}{mn} \sum_{(r,c)\in S_{xy}} g(r,c) \tag{5.23}f^?(x,y)=mn1?(r,c)Sxy??g(r,c)(5.23)

SxyS_{xy}Sxy?表示中心為(x,y)(x, y)(x,y)、大小為m×nm\times{n}m×n的矩形子圖像窗口(鄰域)的一組坐標。算術平均濾波器在由SxyS_{xy}Sxy?定義的區域中,計算被污染圖像g(x,y)g(x, y)g(x,y)的平均值。復原的圖像f^\hat{f}f^?(x,y)(x, y)(x,y)處的值,是使用SxyS_{xy}Sxy?定義的鄰域中的像素算出的算術平均值。

均值濾波平滑圖像中的局部變化,它會降低圖像中的噪聲,但會模糊圖像

def arithmentic_mean(image, kernel):"""define arithmentic mean filter, math: $$\hat{f}(x, y) = \frac{1}{mn} \sum_{(r,c)\in S_{xy}} g(r,c)$$param image: input imageparam kerne: input kernel, actually use kernel shapereturn: image after arithmentic mean filter, """img_h = image.shape[0]img_w = image.shape[1]m, n = kernel.shape[:2]padding_h = int((m -1)/2)padding_w = int((n -1)/2)# 這樣的填充方式,可以奇數核或者偶數核都能正確填充image_pad = np.pad(image, ((padding_h, m - 1 - padding_h), \(padding_w, n - 1 - padding_w)), mode="edge")image_mean = image.copy()for i in range(padding_h, img_h + padding_h):for j in range(padding_w, img_w + padding_w):temp = np.sum(image_pad[i-padding_h:i+padding_h+1, j-padding_w:j+padding_w+1])image_mean[i - padding_h][j - padding_w] = 1/(m * n) * tempreturn image_mean
# 算術平均濾波器
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0507(b)(ckt-board-gauss-var-400).tif', 0) #直接讀為灰度圖像mean_kernal = np.ones([3, 3])
mean_kernal = mean_kernal / mean_kernal.sizeimg_arithmentic = arithmentic_mean(img_ori, kernel=mean_kernal)img_cv2_mean = cv2.filter2D(img_ori, ddepth= -1, kernel=mean_kernal)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_arithmentic, 'gray'), plt.title('Self Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_cv2_mean, 'gray'), plt.title('CV2 mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

幾何均值濾波器

f^(x,y)=[∏(r,c)∈Sxyg(r,c)]1mn(5.24)\hat{f}(x, y) = \Bigg[\prod_{(r,c)\in S_{xy}} g(r,c) \Bigg]^{\frac{1}{mn}} \tag{5.24}f^?(x,y)=[(r,c)Sxy??g(r,c)]mn1?(5.24)

幾何均值濾波器實現的平滑可與算術平均濾波器的相比,但損失的圖像細節更少

def geometric_mean(image, kernel):"""define geometric mean filter, math: $$\hat{f}(x, y) = \Bigg[\prod_{(r,c)\in S_{xy}} g(r,c) \Bigg]^{\frac{1}{mn}}$$param image:  input imageparam kerne:  input kernel, actually use kernel shapereturn: image after geometric mean filter, """img_h = image.shape[0]img_w = image.shape[1]m, n = kernel.shape[:2]order = 1 / (kernel.size)padding_h = int((m -1)/2)padding_w = int((n -1)/2)# 這樣的填充方式,可以奇數核或者偶數核都能正確填充image_pad = np.pad(image.copy(), ((padding_h, m - 1 - padding_h), \(padding_w, n - 1 - padding_w)), mode="edge")image_mean = image.copy()# 這里要指定數據類型,但指定是uint64或者float64,但結果不正確,反而乘以1.0,也是float64,但卻讓結果正確for i in range(padding_h, img_h + padding_h):for j in range(padding_w, img_w + padding_w):prod = np.prod(image_pad[i-padding_h:i+padding_h+1, j-padding_w:j+padding_w+1]*1.0)image_mean[i - padding_h][j - padding_w] = np.power(prod, order)return image_mean
def geometric_mean(image, kernel):""":param image: input image:param kernel: input kernel:return: image after convolution"""img_h = image.shape[0]img_w = image.shape[1]kernel_h = kernel.shape[0]kernel_w = kernel.shape[1]# paddingpadding_h = int((kernel_h -1)/2)padding_w = int((kernel_w -1)/2)image_pad = np.pad(image.copy(), (padding_h, padding_w), mode="constant", constant_values=1)image_convol = image.copy()for i in range(padding_h, img_h + padding_h):for j in range(padding_w, img_w + padding_w):temp = np.prod(image_pad[i-padding_h:i+padding_h+1, j-padding_w:j+padding_w+1] * kernel)image_convol[i - padding_h][j - padding_w] = np.power(temp, 1/kernel.size)return image_convol
# 幾何均值濾波器
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0507(b)(ckt-board-gauss-var-400).tif', 0) #直接讀為灰度圖像mean_kernal = np.ones([3, 3])
arithmetic_kernel = mean_kernal / mean_kernal.sizeimg_geometric = geometric_mean(img_ori, kernel=mean_kernal)img_arithmentic = arithmentic_mean(img_ori, kernel=arithmetic_kernel)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_geometric, 'gray'), plt.title('Geomentric Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_arithmentic, 'gray'), plt.title('Arithmetic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
# plt.show()

在這里插入圖片描述

諧波平均濾波器

f^(x,y)=mn∑(r,c)∈Sxy1g(r,c)(5.25)\hat{f}(x, y) = \cfrac{mn}{\sum_{(r,c)\in S_{xy}} \cfrac{1}{g(r,c)}} \tag{5.25}f^?(x,y)=(r,c)Sxy??g(r,c)1?mn?(5.25)

可以處理鹽粒噪聲,又能處理類似于高斯噪聲的其他噪聲,但不能處理胡椒噪聲

def harmonic_mean(image, kernel):"""define harmonic mean filter, math: $$\hat{f}(x, y) = \Bigg[\prod_{(r,c)\in S_{xy}} g(r,c) \Bigg]^{\frac{1}{mn}}$$param image:  input imageparam kerne:  input kernel, actually use kernel shapereturn: image after harmonic mean filter, """epsilon = 1e-8img_h = image.shape[0]img_w = image.shape[1]m, n = kernel.shape[:2]order = kernel.sizepadding_h = int((m -1)/2)padding_w = int((n -1)/2)# 這樣的填充方式,可以奇數核或者偶數核都能正確填充image_pad = np.pad(image.copy(), ((padding_h, m - 1 - padding_h), \(padding_w, n - 1 - padding_w)), mode="edge")image_mean = image.copy()# 這里要指定數據類型,但指定是uint64或者float64,但結果不正確,反而乘以1.0,也是float64,但卻讓結果正確# 要加上epsilon,防止除0for i in range(padding_h, img_h + padding_h):for j in range(padding_w, img_w + padding_w):temp = np.sum(1 / (image_pad[i-padding_h:i+padding_h+1, j-padding_w:j+padding_w+1]*1.0 + epsilon))image_mean[i - padding_h][j - padding_w] = order / tempreturn image_mean
# 諧波濾波處理高斯噪聲
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0507(b)(ckt-board-gauss-var-400).tif', 0) #直接讀為灰度圖像mean_kernal = np.ones([3, 3])
arithmetic_kernel = mean_kernal / mean_kernal.sizeimg_geometric = geometric_mean(img_ori, kernel=mean_kernal)img_harmonic_mean = harmonic_mean(img_ori, kernel=mean_kernal)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_geometric, 'gray'), plt.title('Geomentric Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_harmonic_mean, 'gray'), plt.title('Harmonic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

# 諧波濾波處理鹽粒噪聲
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(b)(circuit-board-salt-prob-pt1).tif', 0) #直接讀為灰度圖像mean_kernal = np.ones([3, 3])
arithmetic_kernel = mean_kernal / mean_kernal.sizeimg_geometric = geometric_mean(img_ori, kernel=mean_kernal)img_harmonic_mean = harmonic_mean(img_ori, kernel=mean_kernal)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_geometric, 'gray'), plt.title('Geomentric Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_harmonic_mean, 'gray'), plt.title('Harmonic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

# 諧波濾波處理胡椒噪聲
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(a)(circuit-board-pepper-prob-pt1).tif', 0) #直接讀為灰度圖像mean_kernal = np.ones([3, 3])
arithmetic_kernel = mean_kernal / mean_kernal.sizeimg_geometric = geometric_mean(img_ori, kernel=mean_kernal)img_harmonic_mean = harmonic_mean(img_ori, kernel=mean_kernal)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_geometric, 'gray'), plt.title('Geomentric Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_harmonic_mean, 'gray'), plt.title('Harmonic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

反(逆)諧波平均濾波器

f^(x,y)=∑(r,c)∈Sxyg(r,c)Q+1∑(r,c)∈Sxyg(r,c)Q(5.26)\hat{f}(x, y) = \frac{\sum_{(r,c)\in S_{xy}} g(r,c)^{Q+1}}{\sum_{(r,c)\in S_{xy}} g(r,c)^Q} \tag{5.26}f^?(x,y)=(r,c)Sxy??g(r,c)Q(r,c)Sxy??g(r,c)Q+1?(5.26)

Q稱為濾波器的階數。這種濾波器適用于降低或消除椒鹽噪聲。Q值為正時,該濾波器消除胡椒噪聲;Q值為負時,該濾波器消除鹽粒噪聲。然而,該濾波器不能同時消除這兩種噪聲。注意當Q=0Q=0Q=0時,簡化為算術平均濾波器;當Q=?1Q=-1Q=?1時,簡化為諧波平均濾波器。

def inverse_harmonic_mean(image, kernel, Q=0):"""define inverse harmonic mean filter, math: $$\hat{f}(x, y) = \frac{\sum_{(r,c)\in S_{xy}} g(r,c)^{Q+1}}{\sum_{(r,c)\in S_{xy}} g(r,c)^Q}$$param image : input imageparam kernel: input kernel, actually use kernel shapeparam Q     : input order of the filter, default is 0, which equal to arithmentic mean filter, while is -1 is harmonic mean filterreturn: image after inverse harmonic mean filter, """epsilon = 1e-8img_h = image.shape[0]img_w = image.shape[1]m, n = kernel.shape[:2]padding_h = int((m -1)/2)padding_w = int((n -1)/2)# 這樣的填充方式,可以奇數核或者偶數核都能正確填充image_pad = np.pad(image.copy(), ((padding_h, m - 1 - padding_h), \(padding_w, n - 1 - padding_w)), mode="edge")image_mean = image.copy()# 這里要指定數據類型,但指定是uint64或者float64,但結果不正確,反而乘以1.0,也是float64,但卻讓結果正確# 要加上epsilon,防止除0for i in range(padding_h, img_h + padding_h):for j in range(padding_w, img_w + padding_w):temp = image_pad[i-padding_h:i+padding_h+1, j-padding_w:j+padding_w+1] * 1.0 + epsilon# image_mean[i - padding_h][j - padding_w] = np.sum(temp**(Q+1)) / np.sum(temp**Q + epsilon)image_mean[i - padding_h][j - padding_w] = np.sum(np.power(temp, (Q+1))) / np.sum(np.power(temp, Q) + epsilon)return image_mean
# 反諧波濾波處理胡椒噪聲
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(a)(circuit-board-pepper-prob-pt1).tif', 0) #直接讀為灰度圖像mean_kernel = np.ones([3, 3])
arithmetic_kernel = mean_kernel / mean_kernel.sizeimg_inverse_harmonic = inverse_harmonic_mean(img_ori, kernel=mean_kernel, Q=1.5)img_harmonic_mean = harmonic_mean(img_ori, kernel=mean_kernel)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_inverse_harmonic, 'gray'), plt.title('Inverse Harmonic Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_harmonic_mean, 'gray'), plt.title('Harmonic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

# 反諧波濾波處理椒鹽噪聲
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0510(a)(ckt-board-saltpep-prob.pt05).tif', 0) #直接讀為灰度圖像mean_kernel = np.ones([3, 3])
arithmetic_kernel = mean_kernel / mean_kernel.sizeimg_inverse_harmonic = inverse_harmonic_mean(img_ori, kernel=mean_kernel, Q=1.5)
img_arithmentic_mean = inverse_harmonic_mean(img_ori, kernel=mean_kernel, Q=0)
# img_arithmentic_mean = arithmentic_mean(img_ori, kernel=mean_kernel)plt.figure(figsize=(18, 6))
plt.subplot(131), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(132), plt.imshow(img_inverse_harmonic, 'gray'), plt.title('Inverse Harmonic Mean'), plt.xticks([]), plt.yticks([])
plt.subplot(133), plt.imshow(img_arithmentic_mean, 'gray'), plt.title('Arithmentic mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

下面是各種濾波器的對比與總結

# 算術平均濾波器和幾何均值濾波器對比
img_ori = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0507(a)(ckt-board-orig).tif', 0) #直接讀為灰度圖像
img_noise = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0507(b)(ckt-board-gauss-var-400).tif', 0) #直接讀為灰度圖像mean_kernel = np.ones([3, 3])
arithmetic_kernel = mean_kernel / mean_kernel.sizeimg_arithmentic = arithmentic_mean(img_noise, kernel=mean_kernel)
img_geometric   = geometric_mean(img_noise, kernel=mean_kernel)plt.figure(figsize=(12, 12))
plt.subplot(221), plt.imshow(img_ori, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(222), plt.imshow(img_noise, 'gray'), plt.title('Noisy'), plt.xticks([]), plt.yticks([])
plt.subplot(223), plt.imshow(img_arithmentic, 'gray'), plt.title('Arithmentic mean'), plt.xticks([]), plt.yticks([])
plt.subplot(224), plt.imshow(img_geometric, 'gray'), plt.title('Geomentric mean'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

反諧波濾波器可以處理胡椒與鹽粒噪聲。在處理胡椒噪聲的時候,Q值一般為正值;在處理鹽粒噪聲時,Q值一般為負值。錯誤的選擇Q值,不僅不能得到好的濾波效果,反而帶來災難性的結果。

# 反諧波濾波器分別使用不同的Q值對胡椒與鹽粒噪聲的濾波器
img_pepper = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(a)(circuit-board-pepper-prob-pt1).tif', 0) 
img_salt = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(b)(circuit-board-salt-prob-pt1).tif', 0)mean_kernel = np.ones([3, 3])
arithmetic_kernel = mean_kernel / mean_kernel.sizeinverse_harmonic_15 = inverse_harmonic_mean(img_pepper, kernel=mean_kernel, Q=1.5)
inverse_harmonic_15_ = inverse_harmonic_mean(img_salt, kernel=mean_kernel, Q=-1.5)plt.figure(figsize=(12, 12))
plt.subplot(221), plt.imshow(img_pepper, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(222), plt.imshow(img_salt, 'gray'), plt.title('Noisy'), plt.xticks([]), plt.yticks([])
plt.subplot(223), plt.imshow(inverse_harmonic_15, 'gray'), plt.title('Pepper Noise Q = 1.5'), plt.xticks([]), plt.yticks([])
plt.subplot(224), plt.imshow(inverse_harmonic_15_, 'gray'), plt.title('Salt Noise Q = -1.5'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

# 錯誤的使用Q值,反諧波濾波器得到的是嚴重的后果
img_pepper = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(a)(circuit-board-pepper-prob-pt1).tif', 0) 
img_salt = cv2.imread('DIP_Figures/DIP3E_Original_Images_CH05/Fig0508(b)(circuit-board-salt-prob-pt1).tif', 0)mean_kernel = np.ones([3, 3])
arithmetic_kernel = mean_kernel / mean_kernel.sizeinverse_harmonic_15 = inverse_harmonic_mean(img_pepper, kernel=mean_kernel, Q=-1.5)
inverse_harmonic_15_ = inverse_harmonic_mean(img_salt, kernel=mean_kernel, Q=1.5)plt.figure(figsize=(12, 12))
plt.subplot(221), plt.imshow(img_pepper, 'gray'), plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(222), plt.imshow(img_salt, 'gray'), plt.title('Noisy'), plt.xticks([]), plt.yticks([])
plt.subplot(223), plt.imshow(inverse_harmonic_15, 'gray'), plt.title('Pepper Noise Q = -1.5'), plt.xticks([]), plt.yticks([])
plt.subplot(224), plt.imshow(inverse_harmonic_15_, 'gray'), plt.title('Salt Noise Q = 1.5'), plt.xticks([]), plt.yticks([])
plt.tight_layout()
plt.show()

在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/260604.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/260604.shtml
英文地址,請注明出處:http://en.pswp.cn/news/260604.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

librosa能量_librosa與python_speech_features

在語音識別領域,比較常用的兩個模塊就是librosa和python_speech_features了。最近也是在做音樂方向的項目,借此做一下筆記,并記錄一些兩者的差別。下面是兩模塊的官方文檔LibROSA - librosa 0.6.3 documentation?librosa.github.ioWelcome t…

java Unicode轉碼

1 //中文轉UNICODE2 public static String chinaToUnicode(String str) {3 String result "";4 for (int i 0; i < str.length(); i) {5 int chr1 (char) str.charAt(i);6 if (chr1 > 19968 && ch…

oracle-備份工具exp-imp

雖然是按照用戶的方式導出的&#xff0c;但導入之前&#xff0c;還是必須要有相同的用戶存在&#xff0c;刪除用戶以后&#xff0c;是無法進行導入的 --重新創建回zlm用戶 SQL> create user zlm identified by zlm; 盡管zlm用戶的默認表空間是USERS&#xff0c;但是用imp導入…

繼承String?

不能繼承&#xff0c;因為 public final class String extends Objectimplements Serializable, Comparable<String>, CharSequence final修飾的類是不能被繼承的轉載于:https://www.cnblogs.com/crane-practice/p/3666006.html

python中字典數據的特點_Python數據類型(字典)

Python 字典(Dictionary) 字典是另一種可變容器模型&#xff0c;且可存儲任意類型對象。 字典的每個鍵值(key>value)對用冒號(:)分割&#xff0c;每個對之間用逗號(,)分割&#xff0c;整個字典包括在花括號({})中 ,格式如下所示&#xff1a; d {key1: value1, key2: value2}…

第5章 Python 數字圖像處理(DIP) - 圖像復原與重建10 - 空間濾波 - 統計排序濾波器 - 中值、最大值、最小值、中點、修正阿爾法均值濾波器

標題統計排序濾波器中值、最大值、最小值、中點 濾波器修正阿爾法均值濾波器統計排序濾波器 中值、最大值、最小值、中點 濾波器 f^(x,y)median{g(r,c)}(5.27)\hat{f}(x, y) \text{median} \{g(r,c)\} \tag{5.27}f^?(x,y)median{g(r,c)}(5.27) f^(x,y))max{g(r,c)}(5.28)\ha…

如何設置坐標原點值_氨氣檢測儀電化學原理及報警值如何設置

氨氣體檢測儀檢定規程&#xff1a;一般氨氣體檢測儀檢定規程主要是針對技術參數設定的一些標準&#xff0c;具體包含有規程的名稱和范圍、儀器示值誤差、充分性標準差、響應時間、穩定性、報警功能、流量控制器、檢定項目表、檢定操作有數值誤差、重復性、響應時間、穩定性等。…

統計信息及相關說明

統計信息&#xff1a;0 recursive calls20434 db block gets 317970511 consistent gets 0 physical reads 3759764 redo size 382 bytes sent via SQL*Net to client 1061 bytes received via SQL*Net from client 3 SQL*Ne…

Android橫豎屏切換的生命周期

關于Android手機橫豎屏切換時Activity的生命周期問題&#xff0c;網上有很多相似的文章&#xff0c;大多數都是說明在豎屏切換橫屏時Activity會重啟一次&#xff0c;而在橫屏切換豎屏時Activity會重啟兩次。 我本身不太理解這樣設計的意義&#xff0c;并且覺得新版本會解決這個…

python 隨機字符串_python生成隨機數、隨機字符串

python生成隨機數、隨機字符串 import random import string # 隨機整數&#xff1a; print random.randint(1,50) # 隨機選取0到100間的偶數&#xff1a; print random.randrange(0, 101, 2) # 隨機浮點數&#xff1a; print random.random() print random.uniform(1, 10) # 隨…

ACM 會場安排問題

會場安排問題 時間限制&#xff1a;3000 ms | 內存限制&#xff1a;65535 KB難度&#xff1a;4描述學校的小禮堂每天都會有許多活動&#xff0c;有時間這些活動的計劃時間會發生沖突&#xff0c;需要選擇出一些活動進行舉辦。小劉的工作就是安排學校小禮堂的活動&#xff0c;…

第5章 Python 數字圖像處理(DIP) - 圖像復原與重建11 - 空間濾波 - 自適應濾波器 - 自適應局部降噪、自適應中值濾波器

標題自適應濾波器自適應局部降噪濾波器自適應中值濾波器自適應濾波器 自適應局部降噪濾波器 均值是計算平均值的區域上的平均灰度&#xff0c;方差是該區域上的圖像對比度 g(x,y)g(x, y)g(x,y)噪聲圖像在(x,y)(x, y)(x,y)處的值 ση2\sigma_{\eta}^2ση2? 為噪聲的方差&am…

關閉防火墻_從零開始學Linux運維|09.關閉防火墻和SElinux

firewalld是centos7默認的防火墻安全增強型 Linux(Security-Enhanced Linux)簡稱 SELinux初學者建議先關閉,等熟悉了之后再來使用前期聯系中的好多錯誤都有可能是由于沒有關閉或者正確配置上面兩項造成的1.臨時關閉centos7下的防火墻firewalld一行命令就能夠關閉firewalld--&qu…

Discuz!NT - 在線顯示列表 游客 bug 修復

引發bug的條件&#xff1a;當你修改了系統組里面的[游客]組 的名字后&#xff01;&#xff01; 你會發現首頁上底部的在線顯示列表里始終都是顯示"游客"字樣而非你改過得字樣&#xff01;如圖 至此你需要運行一個t-sql腳本去修復這個bug&#xff01;&#xff08;但是…

Linux查看物理CPU個數、核數、邏輯CPU個數

# 總核數 物理CPU個數 X 每顆物理CPU的核數 # 總邏輯CPU數 物理CPU個數 X 每顆物理CPU的核數 X 超線程數# 查看物理CPU個數 cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l# 查看每個物理CPU中core的個數(即核數) cat /proc/cpuinfo| grep "cpu …

基于空間方法的圖神經網絡模型_用于時空圖建模的圖神經網絡模型 Graph WaveNet | 課程上新...

課程概要本課程來自集智學園圖網絡論文解讀系列活動。是對論文《Graph WaveNet for Deep Spatial-Temporal Graph Modeling》的解讀。時空圖建模 (Spatial-temporal graph modeling)是分析系統中組成部分的空間維相關性和時間維趨勢的重要手段。已有算法大多基于已知的固定的圖…

dataframe類型數據的遍歷_Python零基礎入門到爬蟲再到數據分析,這些你都是要學會的...

1.必須知道的兩組Python基礎術語A.變量和賦值Python可以直接定義變量名字并進行賦值的&#xff0c;例如我們寫出a 4時&#xff0c;Python解釋器干了兩件事情&#xff1a;在內存中創建了一個值為4的整型數據在內存中創建了一個名為a的變量&#xff0c;并把它指向4用一張示意圖表…

第5章 Python 數字圖像處理(DIP) - 圖像復原與重建12 - 空間濾波 - 使用頻率域濾波降低周期噪聲 - 陷波濾波、最優陷波濾波

標題使用頻率域濾波降低周期噪聲陷波濾波深入介紹最優陷波濾波本章陷波濾波器有部分得出的結果不佳&#xff0c;如果有更好的解決方案&#xff0c;請賜教&#xff0c;不勝感激。 使用頻率域濾波降低周期噪聲 陷波濾波深入介紹 零相移濾波器必須關于原點(頻率矩形中心)對稱&a…

Android之Menu動態改變文字

Menu創建&#xff1a; Override//這里遇到一個問題add的是MenuItem的idpublic boolean onCreateOptionsMenu(Menu menu) {// TODO Auto-generated method stubmenu.add(0,1023, 0, "一");menu.add(0,1022, 1, "開啟線程");Log.e("onCreateOptionsMenu…

iOS 開發周報:Apple 發布 iPhone 7 / 7 Plus 、Apple Watch 2 等新品

新聞\\Apple 發布 iPhone 7 / 7 Plus 、Apple Watch 2 等新品&#xff1a;Apple 正式發布了 iPhone 7 / 7 Plus、Apple Watch 2 新品&#xff0c;帶來 AirPods 無線耳機&#xff0c;并把馬里奧帶進了 iOS。iPhone 7 新增亮黑色&#xff0c;移除3.5mm 耳機孔&#xff0c;支持 IP…