How to translate an image?
7 ビュー (過去 30 日間)
古いコメントを表示
I want to know how it would be possible to use a loop to translate an image. I am not looking for full written out code, just something that allows my brain to wrap around so I can at least be given a starting point. Thanks.
1 件のコメント
回答 (2 件)
Walter Roberson
2012 年 12 月 4 日
Presuming you are not talking about optical character recognition and natural language processing:
set the XData and YData properties of the image() handle to move the image on the screen.
Or if you are working with matrices, then construct an output matrix of appropriate size and assign the input matrix (or a suitable portion of it) to the position within the output matrix.
OutMatrix = zeros(512, 512, 3);
OutMatrix(183:214, 7:51, :) = InMatrix;
tranlates InMatrix by 182 in one dimension and by 6 in the other dimension.
6 件のコメント
Image Analyst
2012 年 12 月 4 日
編集済み: Image Analyst
2012 年 12 月 4 日
Of course if you need your " brain to wrap around" then maybe you also need the image to wrap around and you could use circshift. Search Answers for circshift because I recently posted code to do translation with circshift().
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!