Skip to content

Commit 8491b94

Browse files
authored
Update splitmergechannels.py
1 parent a1902f8 commit 8491b94

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

splitmergechannels.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import argparse
88
import cv2
99
import numpy as np
10+
from numpy import dtype
1011

1112
#E:/naresh/learning/books/pyimage/Books/ppocv/code/images/trex.png
1213
#ap = argparse.ArgumentParser()
@@ -16,7 +17,9 @@
1617
image = cv2.imread("E:/naresh/learning/books/pyimage/Books/ppocv/code/images/trex.png")
1718

1819
b,g,r=cv2.split(image)
19-
cv2.imshow("blue",b)
20+
zero=np.zeros(image.shape[:2],dtype="uint8")
21+
blue=cv2.merge([b,zero,zero])
22+
cv2.imshow("original",image)
2023
orimage=cv2.merge([b,g,r])
21-
cv2.imshow("ori",orimage)
22-
cv2.waitKey(0)
24+
cv2.imshow("blue",blue)
25+
cv2.waitKey(0)

0 commit comments

Comments
 (0)