am2 Posted April 23, 2017 Report Share Posted April 23, 2017 (edited) I have faced a problem, I have an aerial image, I have its elevation and x,y of its center, I know we need to have at least 3 point to georeference an image using afine calculations, Is there any way to do it by elevation and one point? I am thinking if I can find pixel size on land I can calculate two other points manually based on central pixels location, is it possible/? I want to do it using gdal and c#. I just need the methodology and to know if it is possible to do this using these data or not. Edited April 23, 2017 by am2 Quote Link to comment Share on other sites More sharing options...
rahmansunbeam Posted April 23, 2017 Report Share Posted April 23, 2017 You have to identify 4 more points from the xy location. Just set a fixed euclidean distance from that point and draw four other point who have same distance from their neighbors. The distance should not exceed the image size. Than let the program identify their xy locations. More ideas are here - Georeferencing aerial photos when only centroid is known using ArcGIS for Desktop or ERDAS Imagine? I think you cannot do it with elevation. 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 23, 2017 Author Report Share Posted April 23, 2017 1 hour ago, rahmansunbeam said: You have to identify 4 more points from the xy location. Just set a fixed euclidean distance from that point and draw four other point who have same distance from their neighbors. The distance should not exceed the image size. Than let the program identify their xy locations. More ideas are here - Georeferencing aerial photos when only centroid is known using ArcGIS for Desktop or ERDAS Imagine? I think you cannot do it with elevation. Dear rahmansunbeam, Thanks for your answer, you know the only data that I have are as this image. I think I can not find 4 points as I dont have any other benchmarks except what is in center of the image. I think If I can find pixel size on earth I can find other points but the rotation is the case here. https://ibb.co/ehscRQ The image that I have is uploaded in above link. Can you please take a look at it and give me some suggestions?thanks 1 Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 23, 2017 Report Share Posted April 23, 2017 (edited) Hi, Pixel size will solve the problem of scale, How about the rotation problem? Is that Azimuth angle? It seems like an imagery from a water body with an elevation near to zero. do you have the elevation of the camera (1114.1 meters?)? and size of the image? is it tilted? Edited April 23, 2017 by yousef2233 After looking at the Image 2 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 23, 2017 Author Report Share Posted April 23, 2017 2 hours ago, yousef2233 said: Hi, Pixel size will solve the problem of scale, How about the rotation problem? Is that Azimuth angle? It seems like an imagery from a water body with an elevation near to zero. do you have the elevation of the camera (1114.1 meters?)? and size of the image? is it tilted? Hi Yousef, Yes It is the elevation of camera is 1111.1 meters but I am not sure about azimuth. could it be the angle of horizontal image? Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 23, 2017 Report Share Posted April 23, 2017 (edited) I dont know about that. But there is another angle on the top right of the image. I dont remember these courses but my guess is information on top are about flight and on the bottom are about camera settings!! Edited April 23, 2017 by yousef2233 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 23, 2017 Author Report Share Posted April 23, 2017 1 hour ago, yousef2233 said: I dont know about that. But there is another angle on the top right of the image. I dont remember these courses but my guess is information on top are about flight and on the bottom are about camera settings!! Hi,If we consider those information as what you have suggested Can I georefrence it using those data?or it is not possible? Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 23, 2017 Report Share Posted April 23, 2017 As far as I know, yes you can you have image size, camera elevation, camera focus length, so you can solve Scale problem, you have flight azimuth, so you can solve Rotation problem if you have delta X, delta Y and delta Z, so you can solve Movement problem. 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 23, 2017 Author Report Share Posted April 23, 2017 Thanks, Can you please share some documents of using those parameters to georefrence?and also please explain a bit more about delta x, y and z...Why I need them? Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 24, 2017 Report Share Posted April 24, 2017 I don't have any documents, unfortunately. convert your image into an array. find the x y of the center of the image for example (10 cm, 12 cm) convert them to degrees dx = Long - Xdeg dy = Lat - Ydeg A = move all the cells with this dx and dy B = rotate A (flight azimuth) C = scale B based on flight height and .. (i'm not sure about dz) 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 24, 2017 Author Report Share Posted April 24, 2017 (edited) 1 hour ago, yousef2233 said: I don't have any documents, unfortunately. convert your image into an array. find the x y of the center of the image for example (10 cm, 12 cm) convert them to degrees dx = Long - Xdeg dy = Lat - Ydeg A = move all the cells with this dx and dy B = rotate A (flight azimuth) C = scale B based on flight height and .. (i'm not sure about dz) thanks very much. I have to search more to find calculations and equations but why the x,y of center of image is in cm?should not it be on pixels?On the other side I have the exact lat and lon of the center of image what about it? Edited April 24, 2017 by am2 Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 24, 2017 Report Share Posted April 24, 2017 you have to move center of your image which is not georeferenced to the exact location, this is the movement problem and your question about pixels and cm, think about a resolution (100,100) with 2 different pixel sizes 1 - 1*1 cm2 2 - 1000*1000 cm2 do you think calculation in pixels is correct now? 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 24, 2017 Author Report Share Posted April 24, 2017 10 hours ago, yousef2233 said: you have to move center of your image which is not georeferenced to the exact location, this is the movement problem and your question about pixels and cm, think about a resolution (100,100) with 2 different pixel sizes 1 - 1*1 cm2 2 - 1000*1000 cm2 do you think calculation in pixels is correct now? thanks for your help Quote Link to comment Share on other sites More sharing options...
am2 Posted April 25, 2017 Author Report Share Posted April 25, 2017 18 hours ago, yousef2233 said: you have to move center of your image which is not georeferenced to the exact location, this is the movement problem and your question about pixels and cm, think about a resolution (100,100) with 2 different pixel sizes 1 - 1*1 cm2 2 - 1000*1000 cm2 do you think calculation in pixels is correct now? Hi again, Can you please give some information about calculation of x,y in cm?How can I calculate them?Should I use the camera's focal lens? Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 25, 2017 Report Share Posted April 25, 2017 System.Drawing.Image img = System.Drawing.Image.FromFile (@"my image.jpg") now you have img.Width and img.Height 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 25, 2017 Author Report Share Posted April 25, 2017 10 hours ago, yousef2233 said: System.Drawing.Image img = System.Drawing.Image.FromFile (@"my image.jpg") now you have img.Width and img.Height Hi, Thanks very much but this gives the results in pixels not in cm?How can I convert it to cm? https://msdn.microsoft.com/en-us/library/system.drawing.image.height(v=vs.110).aspx Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 25, 2017 Report Share Posted April 25, 2017 Sorry my bad take a look http://stackoverflow.com/questions/6455979/how-to-get-the-image-dimension-from-the-file-name 1 Quote Link to comment Share on other sites More sharing options...
am2 Posted April 25, 2017 Author Report Share Posted April 25, 2017 53 minutes ago, yousef2233 said: Sorry my bad take a look http://stackoverflow.com/questions/6455979/how-to-get-the-image-dimension-from-the-file-name I read it but it again gives in pixel. It seems I must find a way to convert pixel size to pixel resolution value. humm? Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted April 25, 2017 Report Share Posted April 25, 2017 http://stackoverflow.com/questions/1613117/resizing-an-image-in-cm-c-sharp bmp.HorizontalResolution , bmp.VerticalResolution "HorizontalResolution and the VerticalResolution are pixel per inch 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.