Ask Your Question
0

How to detect coin and pills using opencv android ?

asked 2014-07-01 02:02:52 -0600

Nehalkumar gravatar image

updated 2014-07-01 04:49:09 -0600

I am not understanding how to detect coin and pills in android using opencv.

If anyone know hten help me or give link or give code so i understand and work on it. image description image description image description Thank You

edit retag flag offensive close merge delete

Comments

Please upload some example images.

GilLevi gravatar imageGilLevi ( 2014-07-01 03:59:36 -0600 )edit

Thank You for feedback and please check images give solution.

Nehalkumar gravatar imageNehalkumar ( 2014-07-01 04:50:27 -0600 )edit

You have to be more specific, What is your app goal? do you care if it is a coins or pills or you just want to recognize this objects in image that include more objects?

itay gravatar imageitay ( 2014-07-01 05:39:46 -0600 )edit

my app goal is if i press on count coin button then they count number coin and second time i press pills button they count number of pills.

Nehalkumar gravatar imageNehalkumar ( 2014-07-01 05:50:29 -0600 )edit

do you know the type of the coins and pills? or is it a unknown type?

itay gravatar imageitay ( 2014-07-01 06:05:38 -0600 )edit

its unknown type (coin means count circle) and (pills means capsules).

Nehalkumar gravatar imageNehalkumar ( 2014-07-01 06:15:38 -0600 )edit

To find and count coins you can start with a derivative filter to remove the background and find the edges after it you can fill the contour(use black and white image), then count the objects (look at Component labeling algorithms), if it is possible that the coins are find near to each other you have to use"Erosion" (shrinking) algorithm. This is my suggest, I didn't try it. but I believe that this is a direction. You can look at this guide : http://www.cs.rutgers.edu/~elgammal/classes/cs334/BinaryImageAnalysis.pdf

itay gravatar imageitay ( 2014-07-01 06:55:15 -0600 )edit

Thank you itay. i will check and post result..

Nehalkumar gravatar imageNehalkumar ( 2014-07-01 07:11:28 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-07-01 12:32:40 -0600

This is a classical detection problem. OpenCV has many different detector that you could use, see for example the Haar cascade classifier, latent SVM, Histogram of Oriented Gradients, or Bag of Words approaches.

All these solutions imply to train your own model, with a number of positive and negative samples. As your detections are independent, you could train your system independently. You could find many tutorials/research papers/samples on Google, and you probably need some (basic) knowledge on object detection/recognition.

edit flag offensive delete link more

Comments

any idea about counting the object using opencv android (like capsules and coin)

Nehalkumar gravatar imageNehalkumar ( 2014-07-02 03:58:11 -0600 )edit

If you are able to detect every object (bounding box for each of them) you already have your number of objects or I miss something?

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2014-07-02 04:49:26 -0600 )edit

Here is my code but i am not able to count coin please help me

http://answers.opencv.org/question/36111/how-to-count-number-of-coins-in-android-opencv/

Nehalkumar gravatar imageNehalkumar ( 2014-07-02 05:15:36 -0600 )edit

hello Mathieu thank you for answer but my problem is i am not get 100% result like(i count 10 coins and some time i get 10 and some time 9,8,11,..,7 so on ). in android is possible i get 100% correct result like i count 10 coin and i get 10.

Nehalkumar gravatar imageNehalkumar ( 2014-07-04 08:25:11 -0600 )edit

Question Tools

Stats

Asked: 2014-07-01 02:02:52 -0600

Seen: 3,104 times

Last updated: Jul 01 '14