Model Training using a Data Set with CSV files and Images - dataset

I'm trying out to retrieve data from vertical bar charts as x, y, x_axis_title, y_axis_title. An example image is as follows.
I am currently creating a dataset with vertical bar charts as above. with a CSV file for each image as follows.
Would it be possible to create a model that can output the titles, and values for both x, and y without using OCR(Optical character recognition) with a certain number of images?
Is there a specific method to build the model? or a better method?
**I was trying to do this using tesseract OCR but it was a bit inaccurate
Any help would be appreciated!

In my personal experience, Paddle OCR works a lot better than Tesseract and can help you identify all the fields. Here is a good article explaining the usage of Paddle. Using this OCR, you will not really face any problem with the text since most of it is clearly visible
I don't think if it will be possible to get the data without that. As for the values of x and y, you can use Open CV and get intersection points of blue and white to get the points and link them with the y axis to get the exact values

Related

Can map points be entered in Postgis by clicking on the map in QGIS?

I have a Postgis table of about 200 entries for which I have to enter lat/lon coordinates. I use QGIS to process and display them. Is there a way of clicking at the QGIS map and thereby entering the coordinates into the Postgis table?
I can find the coordinates on the map, copy the coordinates and enter them in the table. But that is a lot of work and it is error prone. I browsed thru all plugins, found the digitizing tools promising but this does not do what I want. I googled this specific question but didn't find a clue.
Is what I want possible at all?
I am rather a noob at gis and qgis so it took me some time before I had the right keywords to search with. And the right keyword for what I want to do apparently is "digitize". What I want is partially possible. Links that helped me are:
https://www.igismap.com/digitization-in-qgis-exploring-tools-for-digitizing/
https://www.qgistutorials.com/en/docs/digitizing_basics.html
https://gis.stackexchange.com/questions/41799/adding-shapefiles-to-postgis-database
The gist of it is:
enable the advance digitizing toolbar: view > toolbars > advanced digitizing toolbar
create a new shapefile layer: layer > create new shapefile layer. Don't forget the correct fields, in my case the name of the location. Also try to remember where you store the file (it will be a shapefile), you later need that to import the shapefile into postgis
enable the edit state of the current layer, enable the type of shape you want to import. In my case they were points
click on each location, a dialog pops up with the attributes you should add
later on you should import the shapefile, you need the third link for that together with your memory of where you stored that #$#%$& file

Scanning through camera against a bank of 10 images

I building an app that can use an iPad camera to scan for particular images. There will be a bank of 10 images that will be matched against, and when there is a match on one I need to navigate the app to a specific screen.
I guess you can compare this to a QR scanner, but without QR codes.
Example of one of the images to scan is:
https://imgur.com/a/lhWv8ny
Trouble is, I'm struggling to come up with a solution to scan the images. The other parts, no issue.
I've tried pattern markers with a-frame, I've done a load of research but can't find anything concrete at the moment.
Any direction will greatly be appreciated.
Maybe try to import some machine-learning library and if it's text only extract the text and match it to a dictionary:
https://github.com/zsajjad/react-native-text-detector
Or you could match for similar images with opencv:
Checking images for similarity with OpenCV
https://github.com/brainhubeu/react-native-opencv-tutorial

Online Maps (google, nokia)

Is it possible to highlight a list of countries with a different colors?
I need to display some countries' statistics on the world map.
Now I use an image and fill a region with color (calculated for each country) by country's coordinates. It's a simple solution and it works well. But now I need to specify the countries' name too (and I think it's not the last customization).
There is a polygon solution, but it uses an array of coordinates. I don't think it's a suitable solution to highlight countries's territory.
I haven't found a solution yet. Any suggestions?
Thanks in advance.
Highlighting countries or regions to support statistics is known as Choropleth Mapping
, but unfortunately there usually isn't direct library support for Choropleth maps bundled into an online map API. This means you'll have to create your own framework, but fortunately it is possible to create one - I wrote an example using jQuery + HERE Maps to
answer the question here
Updated WKT solution now available
Access to KML shapes is no longer required, since the Geocoder API now offers an IncludeShapes attribute which returns the shape of a country in WKT format. A WKT parser can be found here.
A simple WKT choropleth example can be found here.
KML Base solution
For any framework you will need to have a file holding the boundaries of the countries or regions you need. The example uses a KML file, but you could also start with polygons if you had them. Country borders are a political minefield, which is the reason I guess most online mapping APIs steer clear of them. As a hint: try starting with something like http://geocommons.com/overlays/119819 and simplify it as much as possible to speed up the rendering- many small wiggles in the coast lines and small outlying islands are unnecessary.
Of course you could also try searching for "create choropleth map" from a search engine of your choice and use an tool to create a static image for your data (potentially at several zoom levels) and then use this as the basis of an map tile overlay. This requires a lot more work up front, but would push all the calculations server side and hence be faster to display.
Working example can be found on GitHub here
You could put the country's name into the image. It's not that difficult to place text into an image. The only tricky bit is if you are using tiles, you need to deal with names that cross tile boundaries by drawing the name once for each tile.

KML file polygon data to db/php?

I'm using gmaps v3 and I am using a kml file to display polygon shapes.
What I want to do, is that if I have a LNG/LAT coordinate, how to find whether it falls on the boundary or inside the shape?
I understand you can do this with V2 maps but not V3. So then my questions are:
Can I import the coordinates into my db in a useful way that I can then do a select statement if the LNG/LAT falls in between?
Can I do something useful on the serverside end since I have all the data to hand anyway?
Any advice appreciated.
Thanks
Solved, I found a way of converting the kml file to lat/lng coordinates which I could then apply to a php function here: derivante.com/files/phpgis.txt

dynamic map managment in google earth

My goal is to display various shapes(polygons, points, linestring) on google maps by using data entered into a Postgis database dynamically(i mean by that we can see modifications in the map in real time).
I was looking for a way to do this that used the spatial structure already provided in postgis(already designating if shape is a linestring or polygon, etc) instead of parsing out the coordinates and then re-entering spatial structure in google maps. I saw that google maps api is now compatible with kml data formats. And then I read that i have to convert postgis data to kml format.
I've done some reading in the forums about the actual process of converting postgis data to kml via FWTools, but didn't see anything that would help me. I'm new to kml but am familiar with postgis and perl and PHP. Is there a tutorial for the process of converting postgis data to kml? Where can I get started? Thanks for any help
You can use PostGIS to convert to KML directly:
SELECT ST_AsKML(geometry) from MyTable;
ST_AsKML is one of several output formats, including WKT, GML, GeoJSON, etc.
To show dynamic data in Google Earth, a common pattern is to use KML with a NetworkLink element. Have the link's viewRefreshMode equal to onStop and Google Earth will make requests (to a URL served by PHP, presumably) with bounding box parameters attached. Use the bounding box to query features in the PostGIS database, and return results as kml. This is great if you have lots and lots of features, but only want to retrieve those in the region the user is looking at.
Depending on the complexity of your application, you may also want to look at GeoDjango. (Familiarity with PostGIS is a big head start!)
You can get a textual representation of the spatial data from a Postgres DB using a text conversion function, like
SELECT AsText(MyGemoetry) from MyTable
then you parse the string, create your objects using various API functions - depending on the PostGIS geometry type - and append these object to the main GE plugin object in a DOM like way.
If you are familiar with JavaScript and have a fundamental knowledge of XML, a good start is http://code.google.com/apis/earth/documentation/reference/
Don't forget to specify unique ID's to your objects so you can find them later to drop/modify.
Maybe you can get some inspirations here, display the linked "locator.js" file and look at function PaintSubField(Coord) ... this is another way, bit crude but effective, avoiding to mess around with too many individual parent/child objects and structures
You also may want to consult sample applications and use the code playground for "rapid prototyping"
re "realtime" you need at least an event that you can link your generation/redraw routines to.
Good luck
MikeD

Resources