imref2d axis direction
16 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I'm trying to use imref2d to map an image onto world coordinates.
Be default, imref2d seems to consider the top-left corner of a matrix the origin such that, compared to the standard Cartesian coordinate system, the Y-axis is flipped (larger values of Y are further down). See the example on the support page for imref2d.
I'd like to use imref2d without a flipped Y axis. The bottom-left element in the matrix of pixel values should have the lowest x and y values of all pixels, and the top-right element should have the highest x and y values. I tried flipping the world coordinates passed to imref2d, but it throws and error if the values are non-increasing. I could use flipud() on the image matrix, but that seems to defeat the purpose of using a spatial referencing object. Is there a better way?
Thanks, Matt
0 件のコメント
回答 (1 件)
Image Analyst
2016 年 1 月 19 日
You could use XData and yData and flip the image just for display only:
grayImage = imread('cameraman.tif');
imshow(flipud(grayImage), 'XData', [0, 3], 'YData', [0, 3]);
set(gca, 'YDir', 'normal');
axis on;
axis image
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!