Ask Your Question
1

how to detect and count pills (capsules)

asked 2014-07-23 02:15:28 -0600

Nehalkumar gravatar image

updated 2014-07-29 01:24:09 -0600

Which algorithm is use full to detect pills and capsules. And after detection count the number of capsules on the table using opencv android.

image description

image description

edit retag flag offensive close merge delete

Comments

1

First of all, before people start suggesting approaches, are these images examples of the cases this is going to be used on? These seem as google grabbed examples, whereas computer vision problems depend A LOT on the actual situation, so providing examples that will need the algorithm to work on, will be much better.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-23 03:36:37 -0600 )edit

How to detect capsules from image using opencv android ? Just now i am using generalize Hough transform algorithm to detect capsules

Nehalkumar gravatar imageNehalkumar ( 2014-07-23 04:11:55 -0600 )edit
1

... answer my question !

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-23 04:35:12 -0600 )edit

These images are from google. But in my criteria 5 to 10 capsule on table and user start app camera and count the capsules. like i have 10 live capsules on table and count it

Nehalkumar gravatar imageNehalkumar ( 2014-07-23 04:54:10 -0600 )edit

background is white(normal no another item at background) and light is appropriate for detect. it's depend on shape(cylinder shape)

Nehalkumar gravatar imageNehalkumar ( 2014-07-23 05:14:41 -0600 )edit

Then please add pictures that represent your problem. If I describe a solution for these images, which are quite difficult, then it will never work for you ...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-23 05:53:19 -0600 )edit

Hello StevenPuttemans i upload images please check and give solution how to detect all pills using opencv android

Nehalkumar gravatar imageNehalkumar ( 2014-07-29 01:25:54 -0600 )edit

I do not provide copy paste solutions. I will think about some guidelines and get back to you.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-30 03:42:26 -0600 )edit

ok i am also think on it and you get then update me . Thank you....

Nehalkumar gravatar imageNehalkumar ( 2014-07-30 23:44:21 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-07-31 01:53:24 -0600

Since I am not a favorite of providing of the shelf solutions but rather insights on how to tackle this problem, I will try to explain how I would go ahead with this problem.

  1. Perform a grayscaling and histogram equilization of the input image.
  2. Perform a thresholding on the image, based on the background color range to retrieve a binary blob image.
  3. Since the binary image will also contain the lines on the paper (no way of avoiding lines but keeping black pills) I would perform a erosion operator on the image then a dilation to grow the pill regions back.
  4. You will now have blobs that perfectly describe regions of pills.
  5. You are now able to perform a contours finding function, resulting in the amount of pills inside the image.
  6. If preferred you could set a region of interest to the seperate pills and use a classifier to decide which kind of pill you are dealing with.
edit flag offensive delete link more

Comments

as per our discussion , i am use findContours then after find area and drawContours but camera distance give different number pills from different distance. how to solve distance problem ? you have any idea regarding this.

Nehalkumar gravatar imageNehalkumar ( 2014-08-02 02:06:27 -0600 )edit

Hello @Nehalkumar I am working on the pill count project in my college . Can you let me know how you did it so that I can have an idea.

rishita gravatar imagerishita ( 2020-11-18 10:09:19 -0600 )edit

Question Tools

Stats

Asked: 2014-07-23 02:15:28 -0600

Seen: 2,643 times

Last updated: Jul 31 '14