Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5fbd3e9

Browse files
committed
commit
1 parent 88af14b commit 5fbd3e9

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

‎ch04-Image/4.1_imread_imshow.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
print(cv2.__version__)
99

1010

11-
# img = cv2.imread('messi5.jpg',cv2.IMREAD_COLOR)#读入一副彩色图像。图像的透明度会被忽略 默认参数。
12-
#img = cv2.imread('messi5.jpg', cv2.IMREAD_GRAYSCALE)# Load an color image in grayscale 灰度
13-
img = cv2.imread('messi5.jpg',cv2.IMREAD_UNCHANGED)#包括图像的 alpha 通道
11+
img = cv2.imread('data/messi5.jpg',cv2.IMREAD_COLOR)#Read in a color image. The transparency of the image will be ignored. Default parameters.
12+
#img = cv2.imread('data/messi5.jpg', cv2.IMREAD_GRAYSCALE)# Load an color image in grayscale 灰度
13+
#img = cv2.imread('data/messi5.jpg',cv2.IMREAD_UNCHANGED) # Load an color image in grayscale 灰度
1414

1515
img = cv2.resize(img, (640, 480))
1616

@@ -19,8 +19,8 @@
1919

2020
#
2121
rows,cols,ch=img.shape
22-
print('行/高:',rows,'列/宽:',cols,'通道:',ch)
23-
#图像的宽对应的是列数, 高对应的是行数。
22+
print('Row/High:',rows,'Column/wide:',cols,'channel:',ch)
23+
#The width of the image corresponds to the number of columns, and the height corresponds to the number of rows.
2424

2525
cv2.namedWindow('image', cv2.WINDOW_NORMAL)#可以调整窗口大小
2626
# cv2.namedWindow('image', cv2.WINDOW_AUTOSIZE)#自动调整

‎ch10-图像上的算术运算/10.addWeighted.py‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
import cv2
33
import numpy as np
44

5-
# 学习图像上的算术运算 加法 减法 位运算等
6-
7-
# 你可以使用函数 cv2.add() 将两幅图像进行加法运算 当然也可以直接使 用 numpy ,
8-
# res=img1+img
9-
# 两幅图像的大小 类型必须一致 ,或者第二个 图像可以使一个简单的标量值。
5+
# Learn arithmetic operations on images, addition, subtraction, bit operations, etc.
106

117
# You can use the function cv2.add() to add two images. Of course, you can also use numpy directly.
128
# res=img1+img
@@ -20,11 +16,11 @@
2016
# [4]
2117

2218

23-
# 图像混合
24-
img1 = cv2.imread('data/ml.png')
25-
img2 = cv2.imread('data/opencv_logo.jpg')
19+
# Image mixing
20+
img1 = cv2.imread('../data/ml.png')
21+
img2 = cv2.imread('../data/opencv_logo.jpg')
2622

27-
dst = cv2.addWeighted(img1, 0.7, img2, 0.3, 0) # 第一幅图的权重是 0.7 第二幅图的权重是 0.3
23+
dst = cv2.addWeighted(img1, 0.7, img2, 0.3, 0) # The weight of the first image is 0.7 and the weight of the second image is 0.3
2824

2925
cv2.imshow('dst', dst)
3026
cv2.waitKey(0)

‎ch18-图像梯度/18.Sobel.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import numpy as np
2424
from matplotlib import pyplot as plt
2525

26-
img = cv2.imread('../data/sudoku.jpg', 0)
26+
img = cv2.imread('data/sudoku.jpg', 0)
2727
# cv2.CV_64F 出图像的深度 数据类型 可以使用 -1, 与原图像保持一致 np.uint8
2828
laplacian = cv2.Laplacian(img, cv2.CV_64F)
2929
# 参数 1,0 为只在 x 方向求一 导数 最大可以求 2 导数。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /