Image flip around arbitrary axis
10 ビュー (過去 30 日間)
古いコメントを表示
I have a 128x128 binary mask. I would like to flip the image with respective to an arbitrary axis, similar to what 'flipup' and 'fliplr' do but with a user defined axis. Is there a quick and easy way to get this done? Thanks for reading.
0 件のコメント
採用された回答
Matt J
2017 年 8 月 29 日
編集済み: Matt J
2017 年 8 月 29 日
Using AxelRot ( Download ) you could do the flip as follows given the direction vector u and a point x0 on the line in (i,j) pixel coordinates
[i,j]=find(yourMask);
ij0=[i,j].';
ij0(3,end)=0; %Embed in 3D
u(3)=0;
x0(3)=0;
ij=round(AxelRot( ij0, 180,u,x0 )).';
newMask=accumarray(ij(:,1:2),true,size(yourMask));
The above does nearest neighbor interpolation whenever the flipping places pixels at non-integer locations.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Computer Vision with Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!