一文總結(jié)Python數(shù)字圖像處理基礎(chǔ)知識(shí)與前沿應(yīng)用
點(diǎn)擊上方“小白學(xué)視覺”,選擇加"星標(biāo)"或“置頂” 重磅干貨,第一時(shí)間送達(dá) ![]()
了解圖像實(shí)際上是什么
圖像處理幫助
-
改進(jìn)我們存儲(chǔ)的數(shù)字信息。 -
使圖像處理自動(dòng)化。 -
更好的圖像優(yōu)化,實(shí)現(xiàn)高效的存儲(chǔ)和傳輸。
圖像處理用途
1. 圖像校正、銳化和分辨率校正
2. 編輯應(yīng)用程序和社交媒體的過濾器
3. 醫(yī)療技術(shù)
4. 計(jì)算機(jī)/機(jī)器視覺
5. 模式識(shí)別
6. 視頻處理
Python 圖像處理入門
安裝
pip install pillow
import matplotlib.image as img
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# reading jpg image
img = img.imread('image1.jpg')
plt.imshow(img)
# modifying the shape of the image
lum1 = img[:, :, 0]
plt.imshow(lum1)
plt.imshow(lum1, cmap ='hot')
plt.colorbar()
imgplot = plt.imshow(lum1)
imgplot.set_cmap('nipy_spectral')
#data type of lum1
print(type(lum1))
print(lum1)
len(lum1)
len(lum1[300])
from PIL import Image
img2 = Image.open('people.jpg')
plt.imshow(img2)
img2.thumbnail((50, 50), Image.ANTIALIAS) # resizes image in-place
imgplot = plt.imshow(img2)
imgplot1 = plt.imshow(img2, interpolation="nearest")
imgplot2 = plt.imshow(img2, interpolation="bicubic")
#some more interesting stuff
file='image1.jpg'
with Image.open(file) as image:
width, height = image.size
#Image width, height is be obtained
#Relative Path
img3 = Image.open("image1.jpg")
#Angle given
img_rot= img3.rotate(180)
#Saved in the same relative location
img_rot.save("rotated_picture.jpg")
#transposing image
transposed_img = img3.transpose(Image.FLIP_LEFT_RIGHT)
#Saved in the same relative location
transposed_img.save("transposed_img.jpg")
尾注
下載1:OpenCV-Contrib擴(kuò)展模塊中文版教程
在「小白學(xué)視覺」公眾號(hào)后臺(tái)回復(fù):擴(kuò)展模塊中文教程,即可下載全網(wǎng)第一份OpenCV擴(kuò)展模塊教程中文版,涵蓋擴(kuò)展模塊安裝、SFM算法、立體視覺、目標(biāo)跟蹤、生物視覺、超分辨率處理等二十多章內(nèi)容。
下載2:Python視覺實(shí)戰(zhàn)項(xiàng)目52講
在「小白學(xué)視覺」公眾號(hào)后臺(tái)回復(fù):Python視覺實(shí)戰(zhàn)項(xiàng)目,即可下載包括圖像分割、口罩檢測、車道線檢測、車輛計(jì)數(shù)、添加眼線、車牌識(shí)別、字符識(shí)別、情緒檢測、文本內(nèi)容提取、面部識(shí)別等31個(gè)視覺實(shí)戰(zhàn)項(xiàng)目,助力快速學(xué)校計(jì)算機(jī)視覺。
下載3:OpenCV實(shí)戰(zhàn)項(xiàng)目20講
在「小白學(xué)視覺」公眾號(hào)后臺(tái)回復(fù):OpenCV實(shí)戰(zhàn)項(xiàng)目20講,即可下載含有20個(gè)基于OpenCV實(shí)現(xiàn)20個(gè)實(shí)戰(zhàn)項(xiàng)目,實(shí)現(xiàn)OpenCV學(xué)習(xí)進(jìn)階。
交流群
歡迎加入公眾號(hào)讀者群一起和同行交流,目前有SLAM、三維視覺、傳感器、自動(dòng)駕駛、計(jì)算攝影、檢測、分割、識(shí)別、醫(yī)學(xué)影像、GAN、算法競賽等微信群(以后會(huì)逐漸細(xì)分),請(qǐng)掃描下面微信號(hào)加群,備注:”昵稱+學(xué)校/公司+研究方向“,例如:”張三 + 上海交大 + 視覺SLAM“。請(qǐng)按照格式備注,否則不予通過。添加成功后會(huì)根據(jù)研究方向邀請(qǐng)進(jìn)入相關(guān)微信群。請(qǐng)勿在群內(nèi)發(fā)送廣告,否則會(huì)請(qǐng)出群,謝謝理解~
評(píng)論
圖片
表情

