Hi everyone,
I'm working on a path finding application in C# and I've run into a problem before I even start looking into coding the path finding aspect. The application will allow a user to place a marker on the map of the building then show the user the nearest exit from that position. I have the maps of the building I need but I'm not sure if I can use them straight away as jpeg images.
Would I be able to use the maps as they are or would it be better to remake them in a grid format so its all split up into squares? I'm thinking it may be easier to code the path finding aspect if the maps were made up of squares in a grid but it may take some time to remake the maps in this format.
Any advice is greatly appreciated, I do have experience in C# but path finding is a fairly new subject to me so I'm not sure of the best format for the maps to be in.
Thanks in advance!
Well, if you can afford some manual data processing, the best way would be to simply build a graph of the aisles and store it. You can then use simple graph search algorithms to find the nearest exit. Even spliting it into a grid is an overkill.
I've used this before to build graphs of aisles and stores in commerce buildings, and it's very useful and simple to implement.
Related
I have thousands of jpegs in a folder structure. These images are a snapshot of my driveway in 2560 x 1440 and are taken and stored every 60 seconds.
I'd like to create a program that can detect, from analyzing an image, whether I or my wife, was home at that particular time or not. I have a red car, she has a bright yellow car. So a simple color threshold should probably suffice. Another clear distinction is that we both have our own spot and never park in the others. Also, other people don't use the driveway (and if they do, I don't mind a false positive). One minor complication is that the camera's switch to black/white during the dark (but that may be when the parking spot rather than the color might come in handy).
So I was hoping I could use ML.Net and train a model with some hand-annotated images where I tag the image with data whether I see my or her car in the driveway. I was thinking of annotating maybe a 100 to a couple of hundred images for day and another set for night and feed all these images to ML.Net to train it and then have analyse a few 100 images where I can manually check the results and correct any mistakes and then create a sort of feedback-loop to train on a few hundred more images.
Once the training is complete I'd like to analyze all images currently stored and each new image as it comes in to generate some data on when I'm (or my wife is) home, away etc.
My problem is (and this is probably going to be the reason for the question being closed as "too broad" or something): I have no clue on how to do this. I have seen awesome tutorials that all make it seem like child's play but when I then try to do this in C# (my language of choice) and look for ML.Net Howto's I can't seem to find anything that helps me in the right direction.
For example: Train a machine learning model with data that's not in a text file. I'm a competent programmer so it's peanuts to create CSV file / database / whatever that has 1.jpg -> rob home, wife not home data. But the "How To" doesn't explain how to feed the image into ML.Net and I haven't been able to find anything that does. Most probable cause is that I'm new to ML(.Net) and probably that I'm too stubborn to give up trying to accomplish this in C# but the information available is, weird as it sounds, overwhelming but also scarce. The information available usually leads me going down some rabbit hole only to find out after way too long that it's not what I want or I can't find anything that hints of me going in the right direction.
So long story short; tl;dr:
How do I feed images into ML.Net, how do I tell ML.Net that my/her car is in the driveway for any given image (training) and how do I get ML.Net to tell me whether it thinks I'm / my wife is home or not for a given image? Or is this not possible (currently)? I'm NOT looking for complete code but for pointers, hints, links, tutorials, examples or whatever may help me in the right direction.
you might find something usefull here Image recognition/classification using Microsoft ML.net 0.2 (Machine learning)
However I would encourage you to consider python as weapon of choice for your task.
Here you would just store the data in different folders according to the label, you #home, your wife #home, both #home, no car in the drive way, other
and you are ready to go.
https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
It probably won't take you more than a weekend, and thats inlcuding to learn the bacics of python.
Edit:
I seems as it still does not support to train image classification tasks using ML.Net: "Again, note that this sample only uses/consumes a pre-trained TensorFlow model with ML.NET API. Therefore, it does not train any ML.NET model. Currently, TensorFlow is only supported in ML.NET for scoring/predicting with existing TensorFlow trained models."
There is a thread about it here https://github.com/dotnet/docs/issues/5379,
What you could try is uses: http://www.emgu.com/wiki/index.php/Main_Page in combination with OpenCV, this https://www.geeksforgeeks.org/opencv-python-program-vehicle-detection-video-frame/ is an example in python but it should translate well to c++ or c# using emgu. Once the car is detected check for the position and color. This approach would probably also avoid labeling any data.
Alternatively use a pre trained model h5 file and load into ML.Net then check for the position and mean color to check whos car it is.
I am working on a Xamarin iOS project trying to display a list of the most likely locations based on the user's GPS coordinates using either the Place Picker or GMSPlacePickerViewController from the google maps API, as shown in this Swift tutorial.
However I can't seem to find any decent tutorials using C#. I don't want to display the map to users I simply want to retrieve the list of most likely locations based on the coordinates.
Any guidance would be greatly appreciated as I'm at a bit of a loss about how to use the google maps API to achieve this.
Okay answering this for anyone coming after me and trying to do something similar.After lots of searching I have realised it is possible to use the nearbySearch method from the Google Places API Web Service to retrieve a list of addresses near particular coordinates within a specific radius (in metres). You can optionally specify the type of addresses you are searching for, e.g. Restaurants.
Not sure how I missed this but there is a Place Search demo at the bottom of this page;
https://developers.google.com/places/web-service/
I'm currently trying to create a small scale CMS for my personal website and thought I'd like to try to make some sort of a page layout from a basic aspx file with some placeholders and load content based on the URL, without the use of url query strings such as ?pageid=1.
I'm trying to wrap my head around how this can be achieved without getting errors of a physical file not existing when I e.g. type in http://mywebsite.com/projects/w8apps/clock.
I've read a lot about BLOB and storing files binarily in the database. But I haven't come across a blog which points in the direction of using a so called page layout and loading content based on the URL instead of a query string.
I'm not asking for a solution, just some hints - blogs mostly - which can point me in the right direction and help me achieve this goal.
To deal with loading a page with a URL that is more friendly, rather than ?page_id=1, you may want to have a look at this article about URL Rewriting and URL Mapping.
http://www.codeproject.com/Articles/18318/URL-Mapping-URL-Rewriting-Search-Engine-Friendly-U
Hope you can find a way of fitting this kind of code into your application!
You questions is too broad but here are couple hints that will point you in the right direction.
Create clear specs before you start working on this. Do you really need to have URLs like this http://mywebsite.com/projects/w8apps/clock ? If yes then check out MVC since it has best support for this
Storing binary files in database doesn’t have much to do with this. You first need to think of how your tables will look like and that is based on what are you trying to achieve…
I’d suggest you install some CRM that if open source and analyze this first. You’ll probably find a lot better ideas this way. Just go to CodePlex and search for CMS.
I have multiple graphs using Zedgraph in a project, and I have met with great success. The only issue I am running into is formatting a log type axis the way I want it. I managed to get rid of the scientific notation, but I want to include more than just the powers of 10 in my labels.
A little clarification: I would like to keep the data formatted in a log scale, but display labels more like a regular linear graph.
Has anyone had an success with this? I have no problem editing the source if need be, just having a hard time finding the best place to do this.
Ok, just in case anyone else is looking for this answer, I have found it. There may be a way without editing the source code, but it is a real easy fix. You just open up the source and navigate to the LogScale class. There is a method called PickScale, and it contains the code that defaults the step to 1. In a log axis, this step is the exponent, so by lowering it you can get more values than just 10s.
I have a project that has a list of gps coordinates. I would like to find a way to make a simple map of those coordinates (possibly just one at a time). The map should have basic street info.
This part of our project is pretty simple so I don't think it needs to be an exceptionally feature rich product. This also means it shouldn't be really expensive.
What is a good product to achieve this?
edit: This is a desktop app where internet connectivity will probably not be available.
Google Maps is great for this.
If this is a desktop app with internet access you could still host an IE control and show it there.
EDIT: If this is a desktop app without internet access you'll have to buy something like Microsoft Streets & Trips. I don't know if it has reusable controls. You probably have to buy something more expensive to get that. Applications of this nature often fall under the category "GIS". Try searching Google for that.
Sharpmap is open source project written in C# and released under LGPL. To quote first line from page:
SharpMap is an easy-to-use mapping library for use in web and desktop applications.
I'd go with this solution
Map Rendering: SharpMap
Geometry operations: NetTopologySuite
Map data store: shapefiles in your file system or PostGis over PostgreSQL
Map data itself: the easiest way may be extracting from OpenStreetMaps data. Here, for example you can download shapefiles for your desired location
Everyting is open source (more or less, check the licenses) and works fine on windows.
Hope it helps
ESRI has an API. They have javascript, silverlight,wpf, and flash. they may have more. ESRI is pretty much the standard in mapping.