Amal Merchaoui
Amal Merchaoui

Reputation: 9

use an api recognition vision for android

I want to create an application android that films on the road as long as it is open, and if it detects an accident it sends a request to a database, I directly thought to google vision, but unfortunately it paid and so, I found watson's vision, how i can use it for android studio

Upvotes: 1

Views: 190

Answers (2)

Alexandro Campos
Alexandro Campos

Reputation: 36

I think you can accomplish this by using an external REST API, you will need to send the image as a multiform input and it will return the labels with the level of confidence on it.

You can subscribe to this API and find its documentation here: https://market.mashape.com/zyanyatech1/image-recognition

The usage is very straight forward:

// These code snippets use an open-source library. http://unirest.io/java
HttpResponse<JsonNode> response = Unirest.post("https://zyanyatech1-image-recognition-v1.p.mashape.com/")
.header("X-Mashape-Key", "{api_key}")
.field("imgUploader", new File(""))
.asJson();

It will generate a response as follows:

{
  "Labels": [
    {
      "Name": "Food",
      "Confidence": 99.32677459716797
    },
    {
      "Name": "Hot Dog",
      "Confidence": 99.32677459716797
    }
  ],
  "OrientationCorrection": "ROTATE_0"
}

Hope this helps.

Upvotes: 1

Arun kumar
Arun kumar

Reputation: 1894

You can write vision API,Cany Edge detection, add some machine learning and Artificial Intelligence In your code, Python is the best tool for this in terms of computation,Compile this code in the android and give video/image as Input.

your camera should always on in video recoding mode so that your code will get the video and convert it into the images and can detect if it is a incident.

Upvotes: 1

Related Questions