Author Topic: Using a jpg image/camera pic as a map + onboard calibration  (Read 28630 times)

Offline rijackson741

  • Expert
  • Apprentice of Locus
  • **
  • Posts: 180
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #30 on: November 27, 2011, 21:28:38 »
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://http://www.pdfill.com/freewriter.html
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12508
  • Thanked: 788 times
    • View Profile
    • http://www.asamm.com
  • Device: Pixel 5, A12
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #31 on: November 28, 2011, 13:50:49 »
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]
« Last Edit: January 01, 1970, 01:00:00 by Guest »
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline InfX

  • More than Newbie
  • *
  • Posts: 54
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #32 on: November 28, 2011, 16:01:47 »
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 ?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline stebu

  • Expert
  • Padavan of Locus
  • ***
  • Posts: 252
  • Thanked: 1 times
    • View Profile
  • Device: Xcover 2
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #33 on: November 28, 2011, 17:29:14 »
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.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline hendo

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #34 on: November 28, 2011, 18:15:42 »
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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline InfX

  • More than Newbie
  • *
  • Posts: 54
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #35 on: November 28, 2011, 18:38:49 »
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 ?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12508
  • Thanked: 788 times
    • View Profile
    • http://www.asamm.com
  • Device: Pixel 5, A12
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #36 on: November 28, 2011, 20:01:24 »
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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline InfX

  • More than Newbie
  • *
  • Posts: 54
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #37 on: November 28, 2011, 20:30:38 »
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...

Code: [Select]
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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12508
  • Thanked: 788 times
    • View Profile
    • http://www.asamm.com
  • Device: Pixel 5, A12
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #38 on: November 28, 2011, 20:53:27 »
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 ...
« Last Edit: January 01, 1970, 01:00:00 by Guest »
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline InfX

  • More than Newbie
  • *
  • Posts: 54
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #39 on: November 28, 2011, 21:36:01 »
Seems like there ARE some ways around this limit. Not a very coder-friendly ones, though.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline rijackson741

  • Expert
  • Apprentice of Locus
  • **
  • Posts: 180
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #40 on: November 28, 2011, 21:54:41 »
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.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12508
  • Thanked: 788 times
    • View Profile
    • http://www.asamm.com
  • Device: Pixel 5, A12
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #41 on: November 28, 2011, 22:01:52 »
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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline hendo

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #42 on: November 28, 2011, 22:53:10 »
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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline gynta

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 3550
  • Thanked: 44 times
    • View Profile
    • Locus live tracking service
  • Device: SM-A530F(A8) Android 8.0.0
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #43 on: November 28, 2011, 23:25:53 »
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".
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline gemeenaapje

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Using a jpg image/camera pic as a map + onboard calibrat
« Reply #44 on: November 29, 2011, 09:56:27 »
Menion... you are my hero!  If I ever find you first beer is on me!
« Last Edit: January 01, 1970, 01:00:00 by Guest »