Effacer les filtres
Effacer les filtres

トリム画像へ外枠を追​加した場合に枠がずれ​ることを回避する

3 vues (au cours des 30 derniers jours)
雅巳
雅巳 le 30 Juin 2023
Commenté : 雅巳 le 3 Juil 2023
トリムした画像にinsertShapeで外枠を追加すると、画像の外周と追加した枠がずれるのですが、解決方法はないでしょうか? insertShape以外の描画方法でもよいです。

Réponse acceptée

交感神経優位なあかべぇ
InsertShapeのヘルプにある例の画像で、ピーマンのヘタ部分の画像をトリムして、画像の外周を追加してみました。
imshow("peppers.png"); % 元画像の表示
I = imread("peppers.png");
trimI = I(245:315,115:185,:); % ピーマンのへた部分の画像部分をトリム
RGB = insertShape(trimI,"rectangle",[1 1 71 71],LineWidth=2,Color='green');% InsertShapeで外周を追加
imshow(RGB);
  1 commentaire
雅巳
雅巳 le 3 Juil 2023
ご回答ありがとうございます。返信が土日をはさんでしまいすいませんでした。
MATLAB上では枠がずれないことがわかりました。
参考に検証してみます。

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!