add folder img
This commit is contained in:
1 parent
c59622aec4
commit
b02cd70ac3
147 files changed
+31
-36
No files matched your search
@@ -1,10 +1,9 @@
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
|
||||
if __name__ == "__main__":
|
||||
lenna = cv2.imread(r"src.jpg")
|
||||
print(type(lenna))
|
||||
cv2.namedWindow("Lena", cv2.WINDOW_AUTOSIZE)
|
||||
cv2.imshow("Lena", lenna)
|
||||
cv2.waitKey(0)
|
||||
cv2.destroyWindow("Lena")
|
||||
cv2.imwrite(r"1\imwrite.png", lenna, (cv2.IMWRITE_PNG_COMPRESSION, 5))
|
||||
lenna = cv.imread(r"img\iris.jpg")
|
||||
print(type(lenna))
|
||||
cv.namedWindow("Lena", cv.WINDOW_AUTOSIZE)
|
||||
cv.imshow("Lena", lenna)
|
||||
cv.waitKey(0)
|
||||
cv.destroyWindow("Lena")
|
||||
cv.imwrite(r"1\imwrite.png", lenna, (cv.IMWRITE_PNG_COMPRESSION, 5))
|
||||
@@ -1,10 +1,9 @@
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
if __name__ == "__main__":
|
||||
plt.rcParams["font.family"] = ["SimHei"]
|
||||
plt.rcParams["axes.unicode_minus"] = False
|
||||
img_BGR = cv2.imread(r"src.jpg")
|
||||
img_RGB = cv2.cvtColor(img_BGR, cv2.COLOR_BGR2RGB)
|
||||
plt.imshow(img_RGB)
|
||||
plt.show()
|
||||
plt.rcParams["font.family"] = ["SimHei"]
|
||||
plt.rcParams["axes.unicode_minus"] = False
|
||||
img_BGR = cv.imread(r"img\iris.jpg")
|
||||
img_RGB = cv.cvtColor(img_BGR, cv.COLOR_BGR2RGB)
|
||||
plt.imshow(img_RGB)
|
||||
plt.show()
|
||||
@@ -1,6 +1,5 @@
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
import matplotlib.pyplot as plt
|
||||
import math
|
||||
import numpy as np
|
||||
|
||||
|
||||
@@ -8,7 +7,7 @@ def createBox():
|
||||
box = np.zeros((100, 100), np.uint8) + 255
|
||||
print(type(box))
|
||||
shape = box.shape
|
||||
box = cv2.circle(box, (30, 50), 25, 0, -1)
|
||||
box = cv.circle(box, (30, 50), 25, 0, -1) # type: ignore
|
||||
for i in range(shape[0]):
|
||||
for j in range(shape[1]):
|
||||
if j in range(45, 95) and i in range(25, 75):
|
||||
@@ -29,7 +28,7 @@ if __name__ == "__main__":
|
||||
image0 = createBox()
|
||||
plt.figure()
|
||||
plt.subplot(1, 2, 1)
|
||||
plt.imshow(image0, vmin=0, vmax=255, cmap=plt.cm.gray)
|
||||
plt.imshow(image0, vmin=0, vmax=255, cmap=plt.cm.gray) # type: ignore
|
||||
plt.title("idel image")
|
||||
image_hist0 = histogram(image0)
|
||||
plt.subplot(1, 2, 2)
|
||||
|
||||
Reference in new issue
Block a user