|
![]() |
|
| Author |
|
|||||||
|
Strik3r
Posts: 1301
Location: Gold Coast, Queensland
|
hello all.. its been 6 or 7 years since ive done any trig (ahh, highschool, how i miss thee). any of you guys that have done it more recently might be able to help.
I have an image that has a set of co-ordinates (x,y)that is a picture of a map (lets say) that has North and East co-ordinates. Lets say at 25,30 on the image, the real world might be N: 123154 and E: 151241 now i have point 30,35 on the map. I don't know what the N: and E: values are, BUT i do know how big each pixel on the image is. so i know the distance between the 2 (in meters). How do i work out the N: E: values for this new point ? i feel this should be very simple, yet its eluding me. you can all laugh at my stupidity AFTER you provide me with the answer :P (p.s., the numbers ive used here are completel fictitional, i need the formula) |
|||||||
| #0 02:12pm 22/05/07 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
Bah
Posts: 2488
Location: Brisbane, Queensland
|
(y2-y1)^2 + (x2-x1)^2 = d^2
|
|||||||
| #1 02:24pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1302
Location: Gold Coast, Queensland
|
no not quite what im after
|
|||||||
| #2 02:28pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1303
Location: Gold Coast, Queensland
|
thats pythagoras basically.. im already using that to calculate the ratio of pixel:distance between 2 points, now i need to work out a new location.. i think i need to use the line equation.. im just not sure how :P
|
|||||||
| #3 02:29pm 22/05/07 |
|
|||||||
|
Tollaz0r!
Posts: 7800
Location: Brisbane, Queensland
|
From what you say it sounds like you need to set up a triangle ABC, point A is 123154,151241 and point B is n,e. Point C is a right angle to A and B.
The length c would be the real world distance in meters that you know. http://upload.wikimedia.org/wikipedia/en/thumb/1/17/Triangle_www_footflyer_com.png/180px-Triangle_www_footflyer_com.png Only I dont know if you can solve it with only that information. It would be good if you knew the starting point of N=0,E=0. Then it would be easier, not sure if you could make a right angle triangle from it tho. edit: That is the length of N=0,E=0 to N=123154,E=151241 in meters. You know the length and I'm guessing you know the direction. There is a formula for that, I just cant remember it or what it was called :( last edited by Tollaz0r! at 14:37:01 22/May/07 |
|||||||
| #4 02:37pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1304
Location: Gold Coast, Queensland
|
sorry, to clarify, x,y on the image do not directly map to NE ont he map.. ie North might be pointing to the top right of the image.
|
|||||||
| #5 02:33pm 22/05/07 |
|
|||||||
|
Bah
Posts: 2489
Location: Brisbane, Queensland
|
soh cah toa
work out the angle from your first numbers, plug in the distance, et voila. |
|||||||
| #6 02:36pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1305
Location: Gold Coast, Queensland
|
i do have a 3rd point.. maybe this will help:
Point A: Real World(N1,E1). Image(X1,Y1) Point B: Real World(N2,E2). Image(X2,Y2) Point C: Real World (N3, E3. Image (X3, Y3) the only unkowns are N3 and E3, I used point A and point B to calculate a pixel:distance ratio cause i thought that would help work out point C.. now im not so sure =\ |
|||||||
| #7 02:38pm 22/05/07 |
|
|||||||
|
Tollaz0r!
Posts: 7801
Location: Brisbane, Queensland
|
Do you know X3 and Y3?
if (X1,Y1)*x=(N1,E1) and (X2,Y2)*x=(N2,Y2) why dosnt (X3,Y3)*x=(N3,Y3)? Sounds like it could be a matrices problem? Gota go, be back later. |
|||||||
| #8 02:43pm 22/05/07 |
|
|||||||
|
demon
Posts: 2794
Location: Brisbane, Queensland
|
you'd have to graph the points on the map on a cartesian plane (with north referencing directly up/down & east left-right) then measure the angle, then use the angle to calculate the opposite & adjacent sides of the triangle. then add the results to the original starting point.
if i understood the question properly :P |
|||||||
| #9 02:45pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1306
Location: Gold Coast, Queensland
|
toll: nah not quite. (x1,y1)*x != N1 E1... x doesnt exist actually :P
i think demon is on the right track.. anyone kow how this might be doable ? |
|||||||
| #10 02:51pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1307
Location: Gold Coast, Queensland
|
ill give some more problem info if it helps: N and E are points of longtitude and latitude. I have an image of (for arguments sake) part of a map. there are 3 points on the map (a b and c) and i have the NE co-ordinates for a and b. The image is 480*320 big, and i know the pixel locations of the 3 points. is there any way i can work out the NE value for point c ?
|
|||||||
| #11 02:54pm 22/05/07 |
|
|||||||
|
Bah
Posts: 2490
Location: Brisbane, Queensland
|
The distance will be a simple ratio, then use sin/cos/tan rules to work out the n/e coords.
Seems pretty simple. |
|||||||
| #12 02:56pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1308
Location: Gold Coast, Queensland
|
could you express it in terms of xy1,2 and 3, and NE 1 2 and 3 ?
|
|||||||
| #13 02:58pm 22/05/07 |
|
|||||||
|
Bah
Posts: 2491
Location: Brisbane, Queensland
|
No.
|
|||||||
| #14 03:01pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1309
Location: Gold Coast, Queensland
|
let me give you the image and see if it helps:
http://users.bigpond.net.au/Strik3r/shore1.jpg black dots = known N/E points, Yellow dot = unknown NE. i obviously know the xy of all the points on the image. i think that because of the angle of the image, rotating it wont be easy |
|||||||
| #15 03:12pm 22/05/07 |
|
|||||||
|
demon
Posts: 2795
Location: Brisbane, Queensland
|
with such a low res picture & such big dots you are never going to achieve great accuracy as far as i can see. just say the yellow dot is a bit more south than the top black dot... but more east than teh 2nd top black dot ;p
sure if it's an exercise there is a way to do it... you'd have to graph & measure the offsets between north & y / east & x ... but it would be kinda pointless due to the lack of accuracy imo. |
|||||||
| #16 03:21pm 22/05/07 |
|
|||||||
|
Raven
Posts: 1912
Location: Melbourne, Victoria
|
X1 = 25
Y1 = 30 X2 = 30 Y2 = 35 dy.dx = Z So, Z = sqrt((Y2-Y1)^2+(X2-X1)^2) In this case, Z = sqrt((35 - 30)^2 + (30 - 25)^2) Z = (5^2 + 5^2) ^ 0.5 Z = (25 + 25) ^ 0.5 Z = 50 ^ 0.5 Z = 7.07 We know the distance between X1,Y1 and X2,Y2 (well, you do - you haven't told us). Now, you need that as a ratio of your original values. X1 = 123154 Y2 = 151241 We kinda need to know the distance between the original values now. Also, there's two ways to attack the remaining portion. Do we know what the N/E value at 0,0 is? If so, you can use pythag to go from X0,Y0 to X1,Y1 and take that as a ratio of that distance to against 7.07 / sqrt(25^2+30^2). If this helps you get the answer, great. If not, give us some more details and I'll point you in the right direction. I didn't want to do all the work for you - besides, I'm supposed to be working here myself :P |
|||||||
| #17 03:22pm 22/05/07 |
|
|||||||
|
Tollaz0r!
Posts: 7802
Location: Brisbane, Queensland
|
From what you say, your image points are from the same image. The N,E points are all in the same referance.
So you do something to convert x1,y1 to N1,E1. Surly you would need to do the same to convert x2,y2 to N,E co-ords, then the same to x3,y3. You need to find what the common something is, matrices would lead to that? I havn't done them for ages now :( |
|||||||
| #18 04:10pm 22/05/07 |
|
|||||||
|
Tollaz0r!
Posts: 7803
Location: Brisbane, Queensland
|
Oooer, Are you doing an image analysis and GPS tracking thing for robotics or some such?
|
|||||||
| #19 04:11pm 22/05/07 |
|
|||||||
|
TicMan
Posts: 2079
Location: Brisbane, Queensland
|
Yes, I concur.
|
|||||||
| #20 04:34pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1310
Location: Gold Coast, Queensland
|
toll, not for robotics.. but other stuff :)
we referenced each point (black dot) using a mobile differential GPS system (accurate to < 1 metre). i have one idea but its a bit of a hack.. is there a legitimate algebraic solution anyone can think of |
|||||||
| #21 04:38pm 22/05/07 |
|
|||||||
|
Strik3r
Posts: 1311
Location: Gold Coast, Queensland
|
so to elaborate further, we manually geo-referenced all the black points, and now need to determine another point.
the solution i have in mind involves exploiting the problem space which i don't like doing, but looks like i might have to. due tomorrow, this is turning into panic stations :P |
|||||||
| #22 04:40pm 22/05/07 |
|
|||||||
|
TicMan
Posts: 2080
Location: Brisbane, Queensland
|
The company I work for develops spatial mapping software as a business (and one of the biggest mobs at it) - the chats I've had with our developers has blown my mind about how all this type of software is put together and how they overcome problems.
|
|||||||
| #23 04:46pm 22/05/07 |
|
|||||||
|
Bah
Posts: 2492
Location: Brisbane, Queensland
|
Using pythagoras work out ab and bc using x co-ords and ab using ne coords
now you will have ab(x) = 50 (or whatever) ab(ne) = 100. now you can make a ratio ab(x)/ab(ne) =50/100 Now work out the angle of bc tan((y3-y2)/(x3-x2)) now you have the length of bc in terms of x use the ratio from earlier to turn it into your ne length now use sin(angle) = o/h and cos(angle) = a/h |
|||||||
| #24 04:48pm 22/05/07 |
|
|||||||
|
Scooter
Posts: 820
Location: Brisbane, Queensland
|
How did you get N1, Y1, N2 and Y2 ?
GPS co-ordinated points? If so any calculations for N3 and Y3 will put it in MGA Coordinates (Map Grid Australia) So if you were to go out there and measure with a Tape everything will be different. In Logan the Scale Factor for MGA is 0.9996. (So 1 meter on the Ground is only 0.9996 in an MGA system) Whats it for anyway? If you have 2 known points, just align those 2 points from the photo into Coordinated points in a program (AutoCAD does it well) then pick the third point off with a pointer/node. Edit: Also if you have 2 known points, you can work out the Bearing (In both Image and Ground) Then you can work (image)bearing to Point #3 rotate that bearing to get it onto (world)bearing. Then a simple bearing and DIstance Calc. last edited by Scooter at 17:57:00 22/May/07 |
|||||||
| #25 05:57pm 22/05/07 |
|
|||||||
|
Tollaz0r!
Posts: 7804
Location: Brisbane, Queensland
|
From the picky it looks like you want to get real world x,y co-ords from the digital image where the digital image has an imaginary z plane. So going up 2 units on the x axis of the image you are actually moving away from the screen along the z axis. You want to know the real world co-ords of where you are along the z axis? Something like that?
|
|||||||
| #26 08:51pm 22/05/07 |
|
|||||||
|
system
|
--
|
|||||||
| #26 |
|
|||||||
|
| ||||||||