Locus Map - forum

Support => Wishlist => Implemented => Topic started by: InfX on March 20, 2011, 00:37:39

Title: Using a jpg image/camera pic as a map + onboard calibration
Post by: InfX on March 20, 2011, 00:37:39
Well, obviously, this is may not be easy, but this forum dir is called a "wishlist", isn't it  ;)

How about using a jpg image from a camera (or any jpg image at all) as a map + letting the user calibrate it by marking a few known points while hiking ? This would allow one to take a picture of a map "in the field", for example, at the hiking trail entry, and use it straight away as a map.

PS: This is not a request, just a wish, a feature that would be really nice to have  ;)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: marlar on March 21, 2011, 20:07:56
On my Nokia 6600 phone I had a few years ago, I had a program that was able to do this. So it is absolutely possible.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on March 21, 2011, 20:28:03
hi,
  interesting idea but to be true - this feature use 1 user from 1000, maybe once per year :). So sorry, it's too much work for very little benefit ...
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on March 21, 2011, 21:16:15
Its not just possible, a program called "GPSTuner" on WM did that. I've only seen it long ago, though. But yea, as i already mentioned, it's just a wish. Kinda sounds like a bit too much work to implement, really. Still, isn't this directory called a "wishlist" ?  :D
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on March 23, 2011, 22:40:40
yes it is :) But not all wishes may come true, and this is one that will not.
Title: Create map from a picture
Post by: golgot on April 13, 2011, 14:43:12
Long time ago, I used a similar product on Windows Mobile (don't remember the name) with a really nice function which enable to transform an image stored on the phone into a maps. It was only necessary to give 2 or 3 coordinates on the image and then I was able to use the map directly on the phone.
It it very useful for example when you're visiting a natural park with a map at the office, or when you want to use an old paper map without installing software on a computer.
Title: Re: Create map from a picture
Post by: marlar on April 13, 2011, 15:59:43
I think it has been discussed before.

Anyway, +1 from me :-)
Title: Re: Create map from a picture
Post by: Menion on April 13, 2011, 16:53:49
hey guys are you kidding :) this request was here once, as marlar say. I cannot find it now .. ah here viewtopic.php?f=13&t=377&hilit=map+camera (http://forum.asamm.cz/viewtopic.php?f=13&t=377&hilit=map+camera)

so merged
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: davr on July 26, 2011, 07:20:54
There's a couple apps on the android market that claim to do the map calibration on-phone from a picture. Some free ones even:

https://market.android.com/details?id=c ... Calibrator (https://market.android.com/details?id=com.Martin.MapCalibrator)
https://market.android.com/details?id=c ... ika&rdot=1 (https://market.android.com/details?id=com.maprika&feature=search_result&rdid=com.maprika&rdot=1)
https://market.android.com/details?id=c ... rch_result (https://market.android.com/details?id=com.confitek.gpsmates&feature=search_result)

Probably don't have all the features of locus, but if you want this one particular thing it might be good.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Ferretty on July 27, 2011, 23:42:34
Did you check if any of those is capable of exporting the calibrated map for use with Locus? From the descriptions, it does not look like  :(
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gemeenaapje on September 20, 2011, 23:15:38
+1 from me.  Really need to scan an aviation chart and set my coorinates on it then export to Locus readable format
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Khaytsus on October 02, 2011, 21:53:01
Quote from: "davr"
There's a couple apps on the android market that claim to do the map calibration on-phone from a picture. Some free ones even:

https://market.android.com/details?id=c ... Calibrator (https://market.android.com/details?id=com.Martin.MapCalibrator)
https://market.android.com/details?id=c ... ika&rdot=1 (https://market.android.com/details?id=com.maprika&feature=search_result&rdid=com.maprika&rdot=1)
https://market.android.com/details?id=c ... rch_result (https://market.android.com/details?id=com.confitek.gpsmates&feature=search_result)

Probably don't have all the features of locus, but if you want this one particular thing it might be good.
Maprika  works really well for this.  You can calibrate directly in the app against Google Maps.  I was at a large park here a few months ago, wife and kid were in line for something so I got on the tablet, googled a map, loaded up Maprika, spent about 10 minutes putting matching points and then I had a nice geo-calibrated map to use for the park.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Rob on October 03, 2011, 22:29:15
Maprika really worky well - thx for this info.
Question: how to import calibrated map into Locus?
Title: Re: Re: Using a jpg image/camera pic as a map + onboard cali
Post by: femto on October 04, 2011, 09:39:12
Quote from: "Rob"
Question: how to import calibrated map into Locus?

Good question!

I've also a lot of self-calibrated maps.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: krzysiekz on October 04, 2011, 14:01:49
I tried scanned maps with locus, but most of then use custom datum and defined tm projection. When used with locus as tared map i've got wrong position. When used custom wpts map work terribly - when scrolled wpts moves on their own, changing position on map. So until locus could use oziexplorer datums and projections i'm using androzic (tb is nice, but need prepared maps).
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on November 23, 2011, 19:27:33
hi guys,
  seems like this topic, that was at start focused on on-board calibration of maps in the wild, now moved to even more serious topic - globally about map calibration. So let's go for a while back to on-board photo calibration. Work on improve of using calibrated maps in locus will start soon. I've successfully integrated one library that allow me more coordinate conversions then before, so I'm sure, map calibration will be fixed and improved, but not yet

  now I need some testing and help with new photo calibration system ;) ... version here viewtopic.php?f=25&t=1250 (http://forum.asamm.cz/viewtopic.php?f=25&t=1250)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 24, 2011, 00:27:08
nice!
this weekend i will test it..
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on November 24, 2011, 21:19:23
Great  :mrgreen: I wanted this feature a lot. I have Maprika on my phone only because it can do this.

I have only spent 2 minutes looking at it, but I have one immediate suggestion. The options are to pick a photo or take one. If I choose to pick a photo it allows me to choose which photo viewer to use. That's fine, except that because I didn't want to see my Maprika maps in my photo viewer, I added a .nomedia file to the folder that they are in. It would be nice if there was also an option to browse the folder structure to choose a file.

I will test this feature some more  :)

Edit: I put the attached jpg file in the root of my SD card, and tried to pick it. When I do that (using either Gallery or Quickpic), Locus Free forces closes :(

Edit again. It's something about that file, because I tried another one of the Summer Palace in Beijing, and it loads fine. So then I added a calibration point. I chose the pixel from the photo, and this works quite nicely. It seems I have to type in the coordinates for latitude and Longitude though. Maprika lets me choose a location on either a Google map or a Google satellite image, and takes the coordinates from that. Of course, you can't use Google maps this way because they are not supported, but would it be possible to let the user choose a location on any existing map they have available (on-line, personal, or vector)?

Thanks for this great addition to Locus. Soon I will be able to uninstall Maprika  :)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 26, 2011, 21:45:13
Menion - thanks a lot for the feature :-) I keep getting pleasant surprises from Locus :-)

Not being on the forum very often at all, i've just noticed the feature mentioned in the market change log, totally surprised by it, especially after being the original poster of this thread and after being told, politely, that "not all wishes may come true", in this very thread :-)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 26, 2011, 23:42:42
its much better than "Map Calibrator". so i can delete this stuff now. :)
to calibrate from a reference-map is a great idea and works!

how can i save (and load) now various calibrated pictures/maps?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Khaytsus on November 27, 2011, 02:01:02
Okay, I found how to calibrate a map, it shows...  Works pretty good, but not sure how to use it from there.  I would have expected it to show up as an overlay I can turn on/off somewhere and it persists.  Perhaps in the Maps menu, a new tab?   It'd also be able to tweak some things..  Turning it completely off, back on, perhaps opacity, deleting it, exporting it, etc..

Right now it seems like it's only temporary, goes away when I exit..  I can start the tool again and it has the last set of data in there and I can bring it back up, but personally I have a few sets of maps it'd be handy to have in Locus.

One suggestion..  Maprika makes it really fast to calibrate maps because it estimates where the next point will be at every input, can Locus also do this?  :)  ie:  If I give it enough points for it to start making a decent estimate, when I put the mark on the image to calibrate it'll estimate where it'll be on the map screen, so less moving around etc.

BTW, bug report....  if you do Map Item Manager after calibrating a map, Locus crashes.  I'm sending a report.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on November 27, 2011, 08:04:06
Quote from: "rijackson741"
Great  :mrgreen: I wanted this feature a lot. I have Maprika on my ...

glad you like it ;). Anyway there is button "Map" next to coordinates, where you can display map (with small overlay from photo). There is not need to define exact coordinates

Quote from: "gynta"
its much better than "Map Calibrator". so i can delete this stuff now. :)
to calibrate from a reference-map is a great idea and works!

how can i save (and load) now various calibrated pictures/maps?

all calibrated maps are exported to "export" directory for now

Quote from: "Khaytsus"
Okay, I found how to calibrate a map, it shows...
Thank you for feedback, I'll surely improve it. Currently worst part is size of images ... that's maybe reason why app crashed to rijackson.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 27, 2011, 10:40:36
Quote
Thank you for feedback, I'll surely improve it. Currently worst part is size of images ... that's maybe reason why app crashed to rijackson.
I seem to get an out of memory crash on every calibration attempt, after clicking compute and confirming. I have yet to do a single successfull use of the feature :( The out of memory exception is thrown by bitmap factory, but this is only visible via a system log or the report preview details, to the simple user its just an evil detailless fc.

Note - i use the normal 5mp internal camera pics at its full resolution, not some oversized 100megapixel paper map scans.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 27, 2011, 11:02:33
hmm.. crashed with a 2494kb camerapicture
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: stebu on November 27, 2011, 12:02:59
I have a 1Mb jpg file, Locus crashed after the first calibration attemp when I moved the map. After 2nd attempt "process successful" I closed Locus. Then I checked in the Export-folder, both maps were there. I can now download either one of them. (Crashreport: OutOfMem, bitmap size exceeds VM budget)

But during the calibration computation Locus informed that there will be a deviation of about 200m on the three points. And this seems to be true. Would it help, if I rotate the picture on my PC so that true north is up?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 27, 2011, 12:49:29
Quote
Quote
how can i save (and load) now various calibrated pictures/maps?
all calibrated maps are exported to "export" directory for now
thx - dataimport the *.kmz works.
can I hide the map only with a restart?
-----> viewtopic.php?f=10&p=7956#p7955 (http://forum.asamm.cz/viewtopic.php?f=10&p=7956#p7955)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: packham on November 27, 2011, 20:36:12
Are there any online sources to find jpg maps (from brochures for example)?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 27, 2011, 20:38:36
I again. (i told you "i will it testing")  :)

is it possible to display the zoomed picture not so blurred?
It would be better to find the points
e.g.

(http://http://www.scf.at/brigitte/downloads/handout/locus/zoomview00.png)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on November 27, 2011, 21:21:05
Quote from: "menion"
Anyway there is button "Map" next to coordinates, where you can display map (with small overlay from photo). There is not need to define exact coordinates
This works, mostly. Thanks. I just calibrated two maps and there is a minor problem though. For the first map, when I switched to the personal map it started at the location I last viewed that map. After that, it always started at the first calibration point, which is fine (although I agree with the comment that the Maprika feature of trying to get you as close as possible to the correct point is nice). However, on the second map it started at the first calibration point of the first map, which was a very long way from where it needed to be! I had to fire up Google maps on the computer to figure out how to get back to the correct location  :roll: Prior to calibrating the second map I had loaded an appropriate personal map, and zoomed in on the correct location. It would be better if it had started there.

Quote from: "menion"
Thank you for feedback, I'll surely improve it. Currently worst part is size of images ... that's maybe reason why app crashed to rijackson.
Yes, I just tested this. I created two smaller versions of the same map: 580kB and 270kB. All three maps were saved from the same software, so there are no differences in the jpeg format. The 580kB map also crashed Locus, but the 270kB worked OK.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on November 27, 2011, 21:24:00
Quote from: "stebu"
But during the calibration computation Locus informed that there will be a deviation of about 200m on the three points. And this seems to be true. Would it help, if I rotate the picture on my PC so that true north is up?

I had the same problem on one map, but much worse. All but one of my points had a deviation of about half a mile  :D The map has a really weird orientation though, with north pointing to the bottom right (I have no idea why they drew it that way!). Does the map have to have north pointing exactly up?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion 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]
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX 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 ?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: stebu 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.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: hendo 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX 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 ?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion 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 ...
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 28, 2011, 21:36:01
Seems like there ARE some ways (http://http://blog.javia.org/how-to-work-around-androids-24-mb-memory-limit/) around this limit. Not a very coder-friendly ones, though.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 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.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: hendo 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
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta 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".
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gemeenaapje on November 29, 2011, 09:56:27
Menion... you are my hero!  If I ever find you first beer is on me!
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gemeenaapje on November 29, 2011, 20:15:01
Menion,

it works perfectly (crashed once when selecting a photo but doesn't matter, works ok now).

All I want to do now is delete all my offline maps and have this "overlay" load everytime I start Locus.

Basically I've scanned in my aviation chart and that's all I use Locus for.  I want it to load everytime.

Double thumbs up though Menion, I promise you I know a lot of pilots who will be buying this now!!

Matt
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 29, 2011, 23:52:58
Cyanogen ROMs have an interesting setting... it allows the user to set the VM heap size, the max is 48mbytes. I admit, i've seen this setting before, but didn't touch it, thinking "the apps are coded with the limited heap size in mind anyway, what's the point of touching it", i guess now i know better, lol.

EDIT: well, Locus still crashes miserably on this (http://http://dl.dropbox.com/u/32489520/Temp/Holon.jpg) huge (5184x4623) file, but i guess i just demand too much from it, lol.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: stebu on November 30, 2011, 00:48:17
Quote from: "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
I guess you are on the right track. You have to repeat the operation so that you'll have at least three matching points (picture vs map).
Then you will be able to click the calibrate button. Locus will then create a map overlay of your picture (if it doesn't crash).
On the fuctions menu, there is the map items manager button. With it you can recall the map overlay and also disable it.
Currently this works only with the test version, but I guess Menion will get it to the market any day now.

I tried to calibrate my picture using Google Earth, that's a PITA  :cry:
So I tested a small Python script to calibrate the map. Works OK. But I had to manually use 7z (zip file software) to update an existing .KMZ file with a new DOC.KML file. Is there a (windows/dos) program that can create a .KMZ out of a .JPG and the DOC.KML?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 30, 2011, 01:10:33
Info-zip's "zip", the old good command line pkzip, rar (that can do zip files too and got command line version) and whats not.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on November 30, 2011, 10:55:56
Quote from: "InfX"
Cyanogen ROMs have an interesting setting... it allows the user to set the VM heap size, the max is 48mbytes. I admit, i've seen this setting before, but didn't touch it, thinking "the apps are coded with the limited heap size in mind anyway, what's the point of touching it", i guess now i know better, lol.

EDIT: well, Locus still crashes miserably on this (http://http://dl.dropbox.com/u/32489520/Temp/Holon.jpg) huge (5184x4623) file, but i guess i just demand too much from it, lol.

ehm, this image is really .. too much :)

anyway guys, new version if you want to test is here ... viewtopic.php?f=25&t=1250&p=7349#p7349 (http://forum.asamm.cz/viewtopic.php?f=25&t=1250&p=7349#p7349)

should contain some more memory modifications and some checking for prevent of OutOfMemory errors ...
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 30, 2011, 21:18:15
Quote from: "menion"
anyway guys, new version if you want to test is here ... viewtopic.php?f=25&t=1250&p=7349#p7349 (http://forum.asamm.cz/viewtopic.php?f=25&t=1250&p=7349#p7349)
should contain some more memory modifications and some checking for prevent of OutOfMemory errors ...
thx :)
works now without any out of memory crash. What factors prevent the load? max image size (length width) or the data volume (kb)?

u read my other suggestions on post viewtopic.php?f=13&t=377&p=8028#p7995 (http://forum.asamm.cz/viewtopic.php?f=13&t=377&p=8028#p7995) too?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on November 30, 2011, 21:22:24
I managed to crash the new test version despite the checks :(

What i did is calibrated a map pic, already having another one stored and calibrated before and then started choosing them multiple times inside the item manager. Eventually - i've got a crash.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on November 30, 2011, 23:02:09
Quote from: "InfX"
...multiple times inside the item manager...
 hmm - loading multiple times ?
yes :roll:  this freeze locus.  it give me a statusbar 'xyz' already loaded and then locus loop with "importing..."
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on December 01, 2011, 07:09:01
I'm checking size only for calibration. Not for every loading. But as I can see on you ... user will just try to load into locus everything that is possible :))

- check is done, based on image area (pixels) not on size of file (depend on format) and expected heap limit (based on android version and screen size

- I was looking on suggestions, but forget to implement them ... I'll do it

anyway, main is to be able to calibrate map in locus and to be able to display ONE map at time and use it! I'll anyway do some more checks to warn user about memory limits. Thanks guys for testing, I appreciate it very much
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on December 01, 2011, 17:31:11
Quote
But as I can see on you ... user will just try to load into locus everything that is possible
Especially when trying to crash the app on purpose, knowing it tends to crash on heap allocs here and there, lol
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on December 04, 2011, 20:07:52
I've found a minor bug. If you use seven points for calibration (or presumably more), the screen that shows the deviations does not display them all, because there is no scroll bar.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on December 05, 2011, 13:49:43
ah thanks, forget to add some scrollable background. Anyway how this works for you (not just Richard)? I was playing with it quite a lot and seems that except memory limits, this feature is quite intuitive and easy to handle and mainly working. For some field quick calibration, seems enough ...
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on December 05, 2011, 14:21:55
Well, i didn't do any extensive testing, nor i had any practical use of it yes (such as actually using a picture of a map on a hike or something), but in general, it looks working really well, well, except for the out of mem crashes. BTW, the GUI, with an ability to use an existing map for the calibration of the new one, is a really nice idea, especially considering the existing map can be a fully offline vector map :-)

Something i have to add - having it in KMZ format, readable by google earth, is another bonus point here.

PS: Speaking about calibration using another map as a reference, are there any PC based tools that can calibrate using the same approach and output in the SQL db format ? (It's not a feature request, just a question if anyone knows any).
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on December 05, 2011, 14:43:08
Quote from: "InfX"
PS: Speaking about calibration using another map as a reference, are there any PC based tools that can calibrate using the same approach and output in the SQL db format ? (It's not a feature request, just a question if anyone knows any).

search for MAPC2MAPC
or look at
 forum.asamm.cz/viewtopic.php?f=15&t=899
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on December 05, 2011, 17:49:28
Quote from: "menion"
Anyway how this works for you (not just Richard)? I was playing with it quite a lot and seems that except memory limits, this feature is quite intuitive and easy to handle and mainly working. For some field quick calibration, seems enough ...

It works well for me. As I mentioned in an earlier post, the only thing that I can think of that would make it a little easier to use would be to make the map item manager available directly from the data manager screen (so 6 items on that screen, rather than 5). It would make it easier to find for those less familiar with Locus.

I think it's a great addition to Locus. It doesn't quite do everything Maprika does (Maprika handles bigger images, because the app does very little else, and I think it can even calibrate maps such as ski resort maps that are perspective views of the mountain), but it does most of it. And it does it in Locus, where everything else is available  :)  I think it's time to delete Maprika from the phone  :)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on December 05, 2011, 19:03:29
Quote from: "menion"
except memory limits

I tried an experiment with this. I created 3 maps, all with the same number of pixels, but with 24 bit, 8 bit palleted, and 8 bit grayscale color depths. The 8 bit versions should require less memory, at least in principle, but I could not load any of them. Is the way you store the images inside Locus always the same, regardless of the color depth of the image?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on December 05, 2011, 21:20:41
you should not load them because locus do not allow it (by message that image is too large)? If so, then this check is done only based on image size (pixels). I don't know if loaded bitmap take same amount of memory no matter of color palette, but I'm worried it does. I took 3 bytes for every pixel no matter of color palette you use. Anyway I'll test it a little. But no matter of result, memory limit will be still to tight till some improvement will be done
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: rijackson741 on December 05, 2011, 21:51:43
Quote from: "menion"
I took 3 bytes for every pixel no matter of color palette you use.

Thanks for looking at it. It was worth a try, even if it didn't work.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: InfX on December 05, 2011, 22:48:05
Quote from: "gynta"
search for MAPC2MAPC
or look at
 forum.asamm.cz/viewtopic.php?f=15&t=899
10x, i took a look at it. TBH, it's not nearly as convenient as the new Locus calibration or as Maprika. To calibrate using an external reference, you have to display the map inside that external reference, saving the points file in there, and only calibrate using the saved points inside this program after. Nowhere near the way Locus is now offering, really.

Also, the GUI of this app looks like something a person seeing winforms for the first time in his/her life would do. Ah, and the site looks like a first time encounter with html either. In fact, i wouldn't care if it was am open source or at least a free app, but the guy is asking quite some money for it, putting nasty red crosses over the map if you don't register (making the app useless). And yes, i know i can probably simply replace the whatever resource/file this cross is stored in with blank, that's not the point.

PS: Thanks anyway :)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on December 05, 2011, 23:01:30
i dont say "its perfect"   :)

MAPC2MAPC and Oziexplorer also look like...
u right!

but it works!
I would also be happy about other stuff.
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: fencepost on December 20, 2011, 21:22:48
Don't know if it was mentioned in this thread or elsewhere on the forum (I looked and didn't see it), so forgive me if it has been, but I like to create a set of points in locus to help calibrating the maps.  Make sure the points are turned on when you start the calibration process and after you set a calibration point and open the map to set the corresponding map point, click on the appropriate POI and the exact coordinates will pop right in place.  Eliminates having to zoom in/out to get it as close as possible and reduces some of the error.

Thanks for this option, menion!

P.S. Once the map is calibrated, I assume it should be moved to the maps folder within Locus so that it can be turned on/off as needed?
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on December 20, 2011, 21:32:35
good point, yes it's perfect method for precise calibration. About your "PS", calibrated map placed into 'maps' folder will not be able to load. You have to place map into mapsItems directory and use "Map Item manager" for fast loading and unloading. Currently, there is need to load map everytime after start. I'm trying to prevent some unexpected outOfMemory errors that may happen ...
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: gynta on December 20, 2011, 21:49:35
Quote from: "fencepost"
P.S. Once the map is calibrated, I assume it should be moved to the maps folder within Locus so that it can be turned on/off as needed?
Is this a "map"? or is this a calibrated "picture"? or only a little "overlay"? in this topic it was a picture. but maybe in the future we can calibrate and transform huge pics - and then we sould store in the maps-folder...

edit:
damn - my reply came too late :)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: Menion on December 20, 2011, 21:53:56
I'll rather call overlays in KML file, just a calibrated picture. My idea is allow calibrate huge files in few steps - select file > cut file to pieces and create not-yet-calibrated-tar-map > calibrate this map ... voala ... but this in future ;)
Title: Re: Using a jpg image/camera pic as a map + onboard calibrat
Post by: fencepost on December 20, 2011, 21:58:03
Thanks for the response, menion.  I'll make sure I place them in that folder.  

Sorry, gynta, as menion indicated, it's a calibrated image, not map.  My bad. :)