PacktPublishing / PacktPublishing/Python-Image-Processing-Cookbook
Some warning and error fix for chapter 01 02 03
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 176
- Fork
- 122
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
With python 3.9 and up-to-date libraries
Chapter 01
Perspective Projection and Homography
matplotlib 3.4 savefig bbox_in, pad_in is deprecated, updated to bbox_inches and pad_inches
plt.savefig('images/homography_out.png', bbox_inches='tight', pad_inches=0)
Pencil Sketches from images
plt.savefig(img_file.split('.')[0] + '_sketches_all.png', bbox_inches='tight')
Image need using tuple() instead array warning
#output = img - anisotropic_diffusion(img, niter=niter, kappa=kappa, gamma=gamma, voxelspacing=None, option=1) # change to
output = img - anisotropic_diffusion((img), niter=niter, kappa=kappa, gamma=gamma, voxelspacing=None, option=1)
Chapter 02
Edge Detection with Canny, LOG / Zero-Crossing and Wavelets
from skimage.io import imread # use io package as misc imread deprecrated
#img = rgb2gray(misc.imread('images/tiger.png')) # change to
img = rgb2gray(imread('images/tiger.png'))
Edge Detection with Anisotropic Diffusion
#diff_out = anisotropic_diffusion(img, niter=50, kappa=20, option=1)
diff_out = anisotropic_diffusion((img), niter=50, kappa=20, option=1)
Image Denoising with Denoising Autoencoder
import torchvision, matplotlib, sklearn, numpy as np, torch# added torch
Improving Image Contrast
#hist, bins = np.histogram(img[...,i].flatten(),256,[0,256], normed=True) # Changed to
hist, bins = np.histogram(img[...,i].flatten(),256,[0,256], density=True)
#plt.savefig('images/hist_out.png', bbox_in='tight', pad_in=0) # Changed to
plt.savefig('images/hist_out.png', bbox_inches='tight', pad_inches=0)
Image Denoising with Anisotropic Diffusion
#diff_out = anisotropic_diffusion(noisy, niter=20, kappa=20, option=1)
diff_out = anisotropic_diffusion((noisy), niter=20, kappa=20, option=1)
#diff_out = anisotropic_diffusion(noisy, niter=50, kappa=100, option=2)
diff_out = anisotropic_diffusion((noisy), niter=50, kappa=100, option=2)
Chapter 03
Wiener Filter
this import only support until < 0.16.2
from skimage.measure import compare_psnr
need update to
from skimage.metrics import peak_signal_noise_ratio as compare_psnr
#ax = fig.gca(projection='3d')
ax = fig.add_subplot(projection='3d')
Some warning updated on CLA section
from skimage.color import rgb2gray,rgba2rgb
im = rgb2gray(rgba2rgb(imread('images/book.png'))) # street
Noisy Image Restoration with Markov Random Field
#% matplotlib inline
%matplotlib inline
Image Completion with Inpainting (using Deep learning - pre-trained torch CompletionNet model)
Only with python 3.7 torch==0.4.1 torchvision==0.2.0
#from torch.legacy import nn
#from torch.legacy.nn.Sequential import Sequential
from torch import nn
from torch.nn import Sequential
Image Restoration with Dictionary Learning
Online Dictionary Learning
#lena = rgb2gray(imread('images/lena.png'))
lena = rgb2gray(rgba2rgb(imread('images/lena.png')))
Image Compression with Wavelets
#imw = soft_threshold(imw, 12)
imw = soft_threshold((imw), 12)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Kiểm tra các notebook hoặc ví dụ trong Chapter 01, Chapter 02 và Chapter 03, sau đó chạy chúng với Python 3.9 và các thư viện được cập nhật để tái hiện các cảnh báo và lỗi được liệt kê. Áp dụng các bản cập nhật tương thích đã được ghi lại và xác minh rằng các ví dụ xử lý hình ảnh bị ảnh hưởng chạy mà không có cảnh báo ngừng hỗ trợ hoặc lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- jupyter-notebook, matplotlib, numpy, python, pytorch
- Lĩnh vực
- computer-vision
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100