python zbar についての質問です。
OpenCVのadaptiveThreshold()を利用して複数のQRマーカーを認識させたいのですが、認識が不安定です。
何か対処方法がありますでしょうか。
A question about python zbar.
I want to recognize multiple QR markers using OpenCV adaptiveThreshold (), but the recognition is unstable.
Is there any way to deal with it?
python
1import cv2 2import zbar 3import PIL.Image 4from PIL import Image 5 6path = 'sample.jpg' 7#initialize scanner 8scanner = zbar.ImageScanner() 9scanner.parse_config('enable') 10 11#load image 12img_src = cv2.imread(path) 13img_gray = cv2.cvtColor(img_src, cv2.COLOR_BGR2GRAY) 14img_dst = cv2.adaptiveThreshold(img_gray,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY,13,5) 15im = Image.fromarray(img_dst,'L') 16 17#zbar 18width, height = im.size 19raw = im.tobytes() 20image = zbar.Image(width, height, 'Y800', raw) 21scanner.scan(image) 22 23for symbol in image: 24 print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data 25 26del(image)
https://qiita.com/y-nakamurashcom/items/c5d1ee08d362dd10fb47
1. マルチポストは非推奨です。https://teratail.com/help#posted-otherservice
2. Qiitaは質問サイトではありません。
⇒ Qiitaの投稿を削除するのが吉です。
「認識が不安定」とは具体的にはどういうことでしょうか?
あなたの回答
tips
プレビュー