Using a jpg image/camera pic as a map + onboard calibration

Started by InfX, March 20, 2011, 00:37:39

0 Members and 1 Guest are viewing this topic.

rijackson741

Quote from: "packham"Are there any online sources to find jpg maps (from brochures for example)?

A lot of parks, resorts, etc have maps online. They are often in pdf format, but you can use PDFill Image Writer to print them to jpg files:
//http://www.pdfill.com/freewriter.html
  •  

Menion

hi guys,

so

1. I hope that map should NOT have to be orientated to north. Thanks to required three points, map should be orientated in any directory. But I haven't tried yet. Have you any sample that do not work? I'll check it ... (after few hours ...), uff mistake found. You was right, there was a problem ... should be fixed now

2. I found one issue after pressing "Compute" that might cause out of memory error, so it should be now also fixed (use testing version here)

3. anyway I currently need to load whole image to memory to work with it, so huge images may cause troubles. I still have no simple solution for this. Tested on Xoom, and loading of 4000x3000 huge image, took around 25MB of memory ... on normal phone, this is more then max memory that system allow locus to handle.

4. also I cannot find problem with displaying "Map item manager" dialog. May anyone create this testing version? Some changes was done there so it may help, otherwise log is needed. Also one important change. Created maps are now placed into locus/mapItems directory. After locus start you may start "Map item manager" (if will work) and here you can enable/disable maps you want without need to import (only as display) as it is currently.

5. glynta - I disabled anti-aliasing so now image should be sharper then before, try please

Also I was thinking about storing state of loaded maps between session. But due to problems with memory, I'll for now leave it as is, so you need after every start, load your own maps ...

[attachment=0:3nfsrpmi]1.14.5.2.apk[/attachment:3nfsrpmi]
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

InfX

Thanks, i will check if it still crashes on the cam images later today or tomorrow morning (i am at GMT+2). About 4000x3000 image, it's 12megapixels, that's not exactly unusual on todays high-end phones. And, btw, how comes loading the whole image in memory only takes 25mb or RAM ? I would assume it need either 3 or 4 bytes per pixels, requiring at least 36mbytes (not counting the 1000/1024 crap).

Now, about the max memory the system lets the process to have - for those of us on rooted phones, where can we modify this ?
  •  

stebu

I recalibrated the same 1Mb map, now there were 0m deviations at the three points (even when I entered a coordinate with 1 minute error)
Still a couple of crashes, but after calibration is done, it seems to work OK. And the map is almost as accurate as the calibration points.

Same crash report: BMP size exceeds VN budget.
  •  

hendo

Does this mean I can take a photograph from a mountain summit and after calibrating the photo, use it as a map overlay ?
If this is the case, can some kind soul outline the steps on how to achieve this, i'e a small tutorial on calibrating the photo and using it with Locus ?

Andrew
  •  

InfX

Menion, i just did a quick test at work, took a random full resolution pic (5mp) with the phone camera, and tried to "calibrate" it as if it was a map. I no longer get an out of memory crash :-)

Note that i only tested it once, though.

PS: A bit of a noobish question - where do i put the resulting files in order to be able to select them from GUI later ?
  •  

Menion

ah good news ...

so stebu .. the errors are only out of memory? I'm sorry but it's problem with your phone. I expect that zte blade allow only 16MB of memory for application. For unknown reason, Locus takes 5MB in moment it start (cannot figure out why .. maybe too much languages? have to try someday) and next 4MB till fully initialized (without any extra points or tracks loaded). So it leave only 7MB to whole calibration and it's really tooo looow. "Small" disadvantage of program complexity compare to specialized programs

InFX ... as I wrote. calibrated maps are then saved into locus/mapItems directory. Did "Map item manager" works for you? If so, you should there see all available and loaded maps ...

hendo ... you understand correctly. Did you tried this function? I think that whole system is pretty easy so I'm sure you'll understand how this works. Function is accessible from menu > functions > on board calibration
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

InfX

Quote from: "menion"InFX ... as I wrote. calibrated maps are then saved into locus/mapItems directory. Did "Map item manager" works for you? If so, you should there see all available and loaded maps ...
Sorry, it's just me being dumb, i've read it as "map manager" instead of "map item manager" and have been wondering where the heck am i supposed to see it :) The new map item manager works for me. BTW, i did try a few more pics, no more out of mem crashes happened, but... Memory problems are not over yet :-(

I've been playing with the calibration, added the shortcut button to the right bar, moving around the map, playing with it all a little more until finally i've tapped that shortcut button and got a nasty crash. Guess what i found in the logcat...

I/LocationState(10846): addLocationChangeListener(menion.android.maps.a@40582e80), listeners:1
I/LocationState(10846): addLocationChangeListener(menion.android.locus.core.MainActivity@4057db68), listeners:2
W/MainApplication(10846): onAppRestored()
I/Orientation(10846): addListener(menion.android.locus.core.maps.MapScreenView@4058a158), listeners.size():1
I/MainActivity(10846): ----------------------------------------------------
I/MainActivity(10846): Memory info: onResume() - finished, correct:true (47787ms)
I/MainActivity(10846):            PrivDirty      Pss     SharedDirty
I/MainActivity(10846):   dalvik: 684 (0), 731 (0), 1600 (0)
I/MainActivity(10846):   native: 3188 (-88), 3207 (-88), 672 (0)
I/MainActivity(10846):
I/MainActivity(10846):           nativeHeapSize: 29.55 MB
I/MainActivity(10846):  nativeHeapAllocatedSize: 20.35 MB
I/MainActivity(10846):       nativeHeapFreeSize: 291.52 kB
I/MainActivity(10846): ----------------------------------------------------
I/SmartKeyboardPro(  795): Trying to load dictionary: EN
E/CustomActivity(10846): dialog:null
E/dalvikvm-heap(10846): 9830400-byte external allocation too large for this process.
E/GraphicsJNI(10846): VM won't let us allocate 9830400 bytes
W/dalvikvm(10846): threadid=1: thread exiting with uncaught exception (group=0x40015560)
I/Logger  (10846): handleException(java.lang.OutOfMemoryError: bitmap size exceeds VM budget, SILENT)
I/Logger  (10846): Writing crash report file.
W/MainApplication(10846): onAppMinimized()
I/DbWaypoint(10846): saveVisibles() - data:0, saved:true, size:0
W/Service (10259): setForeground: ignoring old API call on com.carl.tcpro.counter.UpdateService
I/SmartKeyboardPro(  795): Trying to load dictionary: EN
I/Process (10846): Sending signal. PID: 10846 SIG: 9
  •  

Menion

you can see exact memory stats ;) ... I leave enabled personal log messages just for this case. Hmm there is probably problem that you calibrated map before, then you display it on map and then you go back to on-board calibration screen that loaded previous calibration session ...

this will be very dangerous function and I'm sure, I'll receive many info that it do not work and only crashing :). Hmm one solution should be separate map into pieces and pack it to tar archive but it will lost kmz file format which I don't want ..., damn phone memory limits ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

InfX

Seems like there ARE some ways around this limit. Not a very coder-friendly ones, though.
  •  

rijackson741

OK. I tried my strangely oriented map, and it calibrated fine in this new version. I got 1.7m deviations at each of 4 points. I also went to the location and walked one of the trails, and it seems to be as good as could be expected, given the limited accuracy of the phone GPS (in fact, it was better than I expected). I also recorded a track, and this worked fine when it was recording. When I saved the track it disappeared from view though, because it was then behind the map overlay, not in front of it.

The map item manager worked fine too, but it would be nice if we could access it directly from the Data Manager screen where we can already access tracks and POIs.
  •  

Menion

ah good point rijackson. I'll look on both issues.

about deviations. I'm using special least square method. Three points are minimum so deviation on them will be very low. Best is to use four or more points to get best results
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

hendo

I gave it a try, but I'm not sure what what to do, I assume that you add a point by clicking an area on the photo that corresponds to an area on the map, sorry for being to stupid  :oops: any chance of a quick guide please  :P
  •  

gynta

So, here my results for today

jpg  470kb 750x522 =>works
jpg 2,55MB 2129x1566 =>works
jpg 16,5MB 8750x7964 =>crash

# the funktions-screen should be closed after the map item manager was closed.
   also the the mainmenu. currently they pops up.

# u can check the max.size of an picture and stop the import, before locus crash.

# It would be fine, after press "add calibration point" immediately pops up the "edit window".

gemeenaapje

Menion... you are my hero!  If I ever find you first beer is on me!
  •