Counting guides

Are pill counting apps accurate? What they can and cannot do

Camera pill counters can be quick and close, but their accuracy depends far more on how the pills are laid out than on the app. Here is how they work, where they go wrong and how to test one yourself before you rely on it.

A smartphone next to a dark green counting tray with a single layer of white and yellow tablets
Illustrative image created for this guide.

The short answer

A pill counting app can be very close when the conditions are right and badly wrong when they are not. With tablets in a single layer, small gaps between them, a plain contrasting background and even light, a camera counter often lands on or near the right total. Put the same tablets in a heap, under a lamp that makes hot spots, or on a busy patterned cloth, and the same app may miss several or count shadows as extra pills.

So the honest answer to "are pill counter apps accurate?" is: accurate enough to speed up a count, not accurate enough to skip the check. That is true of general counting apps like ours and of the dedicated pharmacy tools. The app is one step in the process; the person counting is still the last line of defence, especially when the count is for a prescription.

How camera pill counters work

Almost every camera counter follows the same three steps. First it finds candidate objects in the image, usually with a trained detection model that has learned what a round or oval tablet looks like from many example photos. Then it decides which candidates are real, using a confidence threshold. Finally it draws a marker on each accepted object and adds them up.

This means an app does not "know" how many pills are in the bottle. It only sees what the camera sees, from one angle, at one moment. Anything hidden under another pill, lost in glare or blended into the background simply does not exist for the model. Anything that looks pill-like, such as a crumb, a reflection or a printed dot on the tray, can be counted by mistake.

Some pharmacy apps add a dedicated tray, a fixed camera height or cloud processing to make the scene more predictable. Those help, but they work by controlling the same factors you can control at home: layout, light, background and angle.

What goes wrong, and why

Researchers who assessed an AI pill-counting app used in Japanese pharmacies found that the transparency of the items, overlap between them and their direction (orientation) were important factors in whether the app recognised them. Those three causes match what most people see in daily use:

  • Overlap and touching pills: two tablets pressed together can be read as one larger object, and a tablet resting on another may be hidden completely.
  • Clear or translucent capsules: soft gels and transparent shells let the background show through, so their outline is faint and easy to miss.
  • Pills on their edge or tilted: an oval tablet seen from the side looks like a thin bar and may fall below the confidence threshold.
  • Low contrast: white tablets on a white tray, or pale yellow ones on a beige counter, give the model very little edge to work with.
  • Glare and shadows: a shiny coating can turn into a white blob, while a hard shadow can be counted as a second dark pill.
  • Split or broken tablets: halves and fragments are smaller and irregular, so they may be skipped or counted as whole pills.
  • Pills at the edge of the frame: a tablet cut off by the photo border is easy to drop or to count twice across two photos.

What helps a pill counter app get it right

You can remove most of those failure cases before you press the shutter. Spread the pills in one layer and nudge them apart with a spatula or a card so none are touching. Use a matte tray or sheet in a colour that contrasts with the tablets, such as dark blue or green for white pills. Turn on soft, even light from above or from a window, and switch off a single bright lamp that throws hard shadows.

Hold the phone straight above the tray, parallel to it, at a height where the whole layer fits with a little margin on every side. Tap to focus on the pills and keep the phone still. If you are counting a large quantity, split it into batches of a size you can easily recount, for example one tray at a time, rather than one crowded photo.

Finally, count one product at a time. Mixing capsules and tablets in one photo makes recognition harder and, more importantly, risks mixing medicines that must be kept apart.

How to test a pill counter app yourself

You do not have to take any accuracy claim on trust. A short home test tells you how a particular app behaves with your own pills, tray and lighting. Use a quantity you have already counted carefully by hand, and repeat each step a few times:

  • Count a known number of tablets by hand, for example 30, and write it down.
  • Lay them out well (single layer, gaps, contrasting background) and take a photo. Compare the app total with your known number.
  • Push half the tablets together so they touch, take another photo and compare again.
  • Move the lamp to create glare or shadows, or swap to a pale background, and photograph again.
  • Repeat with any capsules or split tablets you regularly count.
  • Note which setups match your known number and which drift. That is your personal "safe setup" for that app.

A worked example

A worked example makes the difference clear. Suppose you count 60 round white tablets by hand, then photograph them twice: once spread out on a dark blue tray by a window, and once in a loose pile on a white plate under a ceiling lamp. If the first photo agrees with your 60 and the second comes out several short, you have learned something useful: the app is fine for that tablet when the layout is right, and the pile is the problem. Repeat the good setup a few times to make sure it agrees every time, not just once.

Write the result down next to the setup, for example "dark tray, window light, one layer, up to about one tray of tablets: matches hand count". The next time you count the same product, you can reproduce that setup quickly and still do a short check, such as recounting one row by hand, instead of starting from scratch.

When an app count is not enough

Even with a good setup, treat a camera count as a first pass. For prescriptions, controlled medicines, a child’s or an elderly relative’s doses, or any situation where one missing tablet matters, recount by hand or with a pharmacy counting tray and spatula, and follow the instructions of your pharmacist or doctor. A camera counter is not a medical device, does not identify medicines and cannot tell you whether a dose is correct.

It also helps to keep the photo with the markers. If a total looks wrong later, the photo shows exactly what was counted, which makes it much easier to find a missed or doubled tablet.

Where Count Objects Camera fits in

Count Objects Camera is a general counting app: it detects items in a photo, shows a marker on each one and gives you a total, so you can photograph tablets on a tray and get a quick estimate. Like every camera counter, its result depends on layout, light, angle and image quality, and it is meant to be checked, not trusted blindly. It is not a pharmacy system and it does not identify pills.

Our free Photo Count Readiness Checklist walks through the same factors covered above before you take the picture, and the app is available on the App Store and Google Play.

Frequently asked questions

Can a pill counter app replace counting by hand? Not for anything important. Use it to speed up the first count and to keep a photo record, then check the total.

Why does the app give a different number each time? Small changes in angle, light or pill positions change what the model sees. If totals vary, improve the layout until repeated photos agree, then recount by hand.

Do paid or pharmacy apps avoid these problems? Dedicated trays and fixed camera positions reduce them, but the same causes, overlap, transparency and orientation, still apply. Test any app with a known count before relying on it.

Is it safe to use for medication? It is a counting aid, not medical advice. Always follow your pharmacist’s or doctor’s instructions and recount prescriptions.

Sources and further reading