欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python圖像處理模塊ndimage用法實(shí)例分析

 更新時(shí)間:2019年09月05日 11:57:24   作者:cakincqm  
這篇文章主要介紹了Python圖像處理模塊ndimage用法,結(jié)合實(shí)例形式分析了Python圖像處理模塊ndimage基本功能及常見(jiàn)的圖形運(yùn)算操作實(shí)現(xiàn)技巧,需要的朋友可以參考下

本文實(shí)例講述了Python圖像處理模塊ndimage用法。分享給大家供大家參考,具體如下:

一 原始圖像

1 代碼

from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是測(cè)試圖像之一
plt.figure()#創(chuàng)建圖形
plt.imshow(face)#繪制測(cè)試圖像
plt.show()#原始圖像

2 運(yùn)行結(jié)果

二 高斯濾波

1 代碼

from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是測(cè)試圖像之一
plt.figure()#創(chuàng)建圖形
blurred_face = ndimage.gaussian_filter(face, sigma=7)#高斯濾波
plt.imshow(blurred_face)
plt.show()

2 運(yùn)行結(jié)果

三 邊緣銳化處理

1 代碼

from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是測(cè)試圖像之一
plt.figure()#創(chuàng)建圖形
blurred_face1 = ndimage.gaussian_filter(face, sigma=1)#邊緣銳化
blurred_face3 = ndimage.gaussian_filter(face, sigma=3)
sharp_face = blurred_face3 +6*(blurred_face3-blurred_face1)
plt.imshow(sharp_face)
plt.show()

2 運(yùn)行結(jié)果

四 中值濾波

1 代碼

from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是測(cè)試圖像之一
plt.figure()#創(chuàng)建圖形
median_face = ndimage.median_filter(face,7)#中值濾波
plt.imshow(median_face)
plt.show()

2 運(yùn)行結(jié)果

更多關(guān)于Python相關(guān)內(nèi)容可查看本站專(zhuān)題:《Python圖片操作技巧總結(jié)》、《Python數(shù)據(jù)結(jié)構(gòu)與算法教程》、《Python函數(shù)使用技巧總結(jié)》、《Python字符串操作技巧匯總》及《Python入門(mén)與進(jìn)階經(jīng)典教程

希望本文所述對(duì)大家Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論