Effacer les filtres
Effacer les filtres

検出枠の分割

1 vue (au cours des 30 derniers jours)
tsuyoshi tsunoda
tsuyoshi tsunoda le 24 Déc 2021
Commenté : tsuyoshi tsunoda le 25 Déc 2021
以下のように以前、検出した枠を6分割して2コマ目と5コマ目を新しく枠として設定するといったコードを書いていたのですが、
これを「3分割して1コマ目と3コマ目を新しい枠として設定」に変更したいのですが、分からなくなってしまいました。
どなたかご教授願います。
EyeBox = [ObjBox(:,1)+ObjBox(:,3)*(1+wd*3)/6, ObjBox(:,2), ObjBox(:,3)/6, ObjBox(:,4)];

Réponse acceptée

Shunichi Kusano
Shunichi Kusano le 24 Déc 2021
一気にやろうとすると頭がこんがらがってくるので、おススメのやり方は、配列の要素を1つずつ取り出してわかりやすい変数名で置き換えて、一ステップずつ考えるといいと思います。
x0 = ObjBox(:,1); % 左上のX座標
y0 = ObjBox(:,2); % 左上のY座標
w = ObjBox(:,3); % widthの頭文字
h = ObjBox(:,4); % heightの頭文字
% 3分割した枠の定義
w3 = round(w/3); % X方向に3分割した場合の1個当たりの枠のwidth
EyeBox1 = [x0,y0,w3,h];
CenterBox = [x0+w3,y0,w3,h];
EyeBox2 = [x0+w3*2,y0,w3,h];
  1 commentaire
tsuyoshi tsunoda
tsuyoshi tsunoda le 25 Déc 2021
回答ありがとうございます。教えていただいた事を理解でき、一文でも書くことが出来ました。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 文字と文字列 dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!