耳部分のタグ(耳標)だけを取り出し、その後文字認識を行いたい
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
現在以下のようなプログラムを作成しています。
うまく耳部分のタグ(耳標)だけを取り出したいです。
その後は文字認識として光学式文字認識などを用いる予定です。
アドバイス宜しくお願いします。
I = imread('\耳標写真\牛舎.png');
HSV = rgb2hsv(I);
Hue = HSV(:,:,1);
figure,
%subplot(2,2,1);imshow(Hue,"InitialMagnification","fit");
%impixelinfo
Th1 =0.13; Th2 =0.15;
BW = (Th1<=Hue&Hue<=Th2);
subplot(2,2,2),imshow(BW,"InitialMagnification","fit");
2 Kommentare
Antworten (1)
Kojiro Saito
am 11 Jan. 2023
>その後、文字認識に移りたいのですが耳標部分の画像を拡大したいです。
耳標部分の画像を拡大するには、画像から耳標の周りを切り抜きをしてリサイズする必要があります。
bwareafiltとregionprops (どちらもImage Processing Toolboxの関数)を使って対象領域を切り抜きし、imresizeでリサイズできます。文字認識はocr関数 (Computer Vision Toolbox)でできます。
for文の中に以下を追加してみてください。
bwMask = bwareafilt(I_5(:, :, 1), 1);
props = regionprops(bwMask, 'BoundingBox');
imgNew = imcrop(I_7, props.BoundingBox);
imgNewRes = imresize(imgNew, 5); % 画像サイズを5倍にする
ocrResults = ocr(imgNewRes, 'TextLayout', 'block'); % 自動レイアウト解析を無効にしてテキストブロックを検出
disp(ocrResults)
10 Kommentare
Kojiro Saito
am 19 Jan. 2023
CNNを使うということは分かりましたが、上記のコードで何が困っているところでしょうか?提出まで時間がないとは思いますが、聞きたいところを的確にしないと他の方も回答しづらいと思います。
「宿題・研究課題などの丸投げはご勘弁くださいませ。
また、問題点・状況をできるだけ明確することで的確な回答に繋がるかと思います。」
Siehe auch
Kategorien
Mehr zu イメージを使用した深層学習 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!