Google Static Map API - image map with 25+ points - python

I am trying to create map of the track with 30 or so points with Google Static Map API. The problem is that it supports only origin-23waypoints-end even with premium key. So the idea I got is to split the route into two and then merge those two images. The problem is that since the parts of the track will have different points it means that the map canvas won't be same which renders the merge (almost?) impossible.
Anybody would have any idea how to solve this issue? I am helpless.
Thank you very much for any ideas. :)

There is no good way to do this, to best of my knowledge.
When solving the problem, we just went with multiple maps in the end. Everything is solvable yet this was not worth investing the time.
It's technically not an answer but an information for anybody attempting this. If you would be able to solve this, please post your solution here and I will mark it.

Related

Detecting rotated, scaled, re-colored images using OpenCV

I've recently come across a new type of captcha and am just curious about how someone would go about writing code in Python and OpenCV to solve it.
I'm a beginner in the field of image processing and am reading a lot about it online. I've written some basic code to solve some simple text-based captchas, but this one has me stumped. If you notice, the objects have a lot of properties modified i.e. they've been scaled, rotated, made transparent, re-colored (change of hue, saturation, brightness etc.) and possibly more.
This seemed similar to solving ReCaptcha, so I read up about that. It seems the most common way to solve something like this is to use a neural network and some form of learning algorithm. I'm interested where I could learn more about this.
However, what if I don't have enough training images to actually make a learning algorithm possible? If I have only 100 or 200 images, that wouldn't be enough. What can be done in this situation?
I am a beginner here, so please forgive my lack of knowledge here. Also request you to answer keeping this in mind.

Image Processing in Python- Is there a general solution to this problem?

I have been going over this for days now and have hit a road block as I am too scared to try out my hypothesis.
I would like to find out the number of grayed rectangular boxes in this image. However, I am not sure how I can do that. I was thinking of two ways:
i. Getting area of the connected components, calculating their median and getting the number of components between a certain percentile of the area (may sound pretty strange).
ii. Making a machine learning model and find out the similar boxes in the image and count them.
However, I would like them to be more generalized so that I will need to be able to make the solution fit other images that I would need to be processed.
Here is my source Image:
Any sort of help/suggestions and even solutions would be greatly appreciated.
Thanks in advance!
Maybe you are losing a lot of image information with filtering...Do you have an unfiltered source image too? I suppose ML approach would work pretty nice then.
I noticed you could achieve better resolution if your camera is 90 rotated (If you could affect this)

Will FFT help me in matching two images?

I wanted to create a photomosaic in python using the PIL library.
Will FFT help me in finding the best match for a picture from the given set of pictures?
I have tried with rgb colour space but the ouput seems to be ok.
I would need robust performance so thought of using fft.
Kindly provide some other valuable suggestions too.
An implementation to spark ideas might be useful. link
Otherwise google "image similarity measures". The top link is going to be this question which again might provide the needed direction your looking for.

Python graph like windirstat?

I'm interested in using python to make diagrams representing the size of values based on the size of squares (and optionally their colour). Basically I'm looking for a way to make overviews of a bunch of values like the good old program windirstat does with hard-drive usage (it basically makes a big square representing your harddrive and then smaller squares making up the area inside of it representing different programs, the bigger the square the larger the file, colour indicates the type of file). I'm fairly familiar with matplotlib, and I don't think it's possible to do something like this with it. Is there any other python package that would help? Any suggestions for something more low level if it's not? I guess I could do it manually if I could find a way to draw the boxes programatically (I don't really care about the format, but the option to export SVG as well as PNG would be nice).
Ultimately, it would be nice to have it be interactive like windirstat is, where if you were to hover over a particular square you get more information on it, and if you clicked on it maybe you'd go in and see the makeup of that particular square. I'm only familiar with wxpython for GUI stuff, not sure if it could be used for something like this. For now I'd be happy with just outputting them though.
Thanks a lot!
Alex
Edit:
Thanks guys, both your answers helped a lot.
You're looking for Treemapping algorithms. Once implemented, you can transform the output (which should be rectangles) into plotting commands to anything that can draw layered rectangles.
Edit:
More links and information:
If you don't mind reading papers, the browser-based d3 library provides for 'squarified' treemaps (js implementation). They reference this paper by Bruls, Huizing, and van Wijk. (This is also citation 3 on the wikipedia article)
I'd search on the algorithms listed on the linked Wikipedia article. For instance, they also link to this article, which describes an algorithm for "mixed treemaps". The paper also includes some interesting portions at the end describing transformations into other-than-rectangular shapes.
Squarified certainly appears to be the most common variety around. The above links should give you enough to work towards a solution or, even, directly port the d3 implementation. However, the cost of grokking d3's model (which is something like a declarative form of jQuery) may be somewhat high. At first glance, though, the implementation appears relatively straightforward.
Squaremap does this. I haven't used it (I only know it from RunSnakeRun) and its documentation is severely lacking, but it seems to work.

What's an easy to use API for plotting latitude/longitude pairs on a world map?

I have a list of 50000 latitude/longitude pairs and want to plot them on a map. I tried http://gsl-nagoya-u.net/appendix/software/worldmap/. It works but it seems to ignore the data after a certain point (less than 100). What else can I use to generate a static image? I'd rather not use Javascript.
Perl has GD::Map in CPAN which looks about right. I haven't used it myself to say for sure, but its the closest thing I could find based on your requirements.
You can use the google maps static image api, it has a 1000 images/day limit, but you could get it in 5 50 days. Script the creation of the links and save the resulting image.
Edit: Looks like I misread your total number of pairs. 50 days is quite a long time, perhaps there is some way to avoid this, otherwise maybe this won't be preferred.
You could look at MapServer. It's more of a complete GIS platform, so if you only need to do this one time, it is a bit of an overkill.
Someone else would have to tell you where to get baselayers, but you can render reasonable maps with QGIS.

Categories