Image pixel conversion to Latitude and longitude of that position

Hi all
I am working on a project with matlab. I am trying to convert a image pixels into its corresponding latitude and longitude of that position to find that location on the google map. I have a 618x998 image that I ma using. details of its upper left corner or pixel(1,1) are as lat = 50.421442 and long = -104.592987. and its far corner (618,998) lat = 50.412676 and long = -104.584345. its pixel resolution is 1pixel = 1.0465 meters.
Is there any way i can covert a certain pixel let say 125,285 into its corresponding lat and long position with this available info. Please help me with this problem.

답변 (1개)

Alex
Alex 2015년 7월 8일

0 개 추천

You need to change the XTick, YTick properties of the image.

댓글 수: 5

Thanks for replying. Can you please little elaborate I'm not sure how to get that.
if true
load clown
im = image(X);
hAxes = get(im, 'Parent');
set(hAxes, 'XTick', [Tick1 Tick2 Tick3]);
set(hAxes, 'YTick', [Tick1 Tick2 Tick3]);
set(hAxes, 'XLim', [minLong maxLong]);
set(hAxes, 'YLim', [minLat maxLat]);
end
If you have MATLAB 2014b or 2015b, you can do: im.Parent.XTitck = [values]; etc.
Hope that helps.
Hi U have MatLab 2014b And I am using this command: A.XTitck = [-104.592987,-104.584345] A.YTitck = [50.421442 , 50.412676] this is running without a error but when I'm opening A instead of showing a matrix it gives me A = XTitck : [-104.592987,-104.584345] YTitck : [50.421442 , 50.412676]
Sorry about that. I corrected it now. A.Parent.XTick.
This just puts up axes tick marks - it doesn't "convert" anything. If you have a certain row and column, you'd need to use a typical scaling equation to turn the (row, column) coordinate into a (latitude, longitude) coordinate.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Geographic Plots에 대해 자세히 알아보기

질문:

2015년 7월 8일

댓글:

2015년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by