プログラム初心者です。
以下のコードで表示される画像のWindow名「test1」と「test2」の違いを教えてください。
実行すると表示される画像の質感がわずかに違う感じがします。
python
1import cv2 2import numpy as np 3from time import sleep 4 5def test1(path): 6 src1=cv2.imread(path,1) 7 gray=cv2.cvtColor(src1,cv2.COLOR_BGR2GRAY) 8 cv2.imshow('gray',gray) 9 10def test2(path): 11 src=cv2.imread(path,0) 12 cv2.imshow('src',src) 13 cv2.waitKey(0) 14 cv2.destroyAllWindows() 15 16test1('test.png') 17print('test1終了') 18sleep(1) 19print('test2開始') 20sleep(1) 21test2('test.png') 22
カラー画像とグレー画像を比較しているんですかね。結果画像を質問に追記してみてください。
追記:0,1のフラグを見落としてました。このコメントは無視してください
回答1件
あなたの回答
tips
プレビュー