Guides ·
How to count objects in a photo automatically
Counting a few hundred small things by hand is slow and easy to get wrong. A photo can be counted automatically, but only as well as it was taken, and only if you check the result. Here is how automatic counting works, how to take a photo that counts well, and a real test: 42 hazelnuts, counted by hand and by the free unmake counter.

How automatic counting works
Most counters, from lab software to phone apps, follow the same recipe. First they separate objects from the background by brightness or colour, a step called thresholding. Then they outline each separate patch and count it. Touching objects form one patch, so a second step splits patches where they narrow into a waist; ImageJ's Watershed command is a well-known version of this.
Last, patches far smaller or larger than the rest are dropped or flagged. A counter like this does not know what a hazelnut is. It counts what stands out, so the photo decides most of the result.
Take a photo that counts well
Shoot from straight above, with the objects and a little background all round. Use a plain background that contrasts with them: dark seeds on white paper, pale beans on black card. Spread the objects out so they don't touch; a heap is the hardest case for any counter.
Light evenly, from a window or two lamps, and avoid shine: glossy things reflect the light in bright patches that look like separate objects. If you also want sizes in millimetres, put a sheet of A4 or US Letter paper, or a bank card, in the photo.
Check the marks, always
A count with a mark on every object is a count you can check in seconds. Look for four things: objects with no mark, two touching objects with one mark, one object with two marks, and marks on things that aren't objects, such as a shadow or a crumb.
Marks are also the fastest way to count by hand: put a dot on each object in a photo editor or on a printout, so you never count one twice or lose your place.
Fixing the count on the unmake page
The unmake counter counts in the browser; the photo stays on your device unless you press Send under the optional What are these? button. Drop a photo and every object it finds gets an orange outline and a number. Tap a mark to remove it, tap empty space to add one; the panel then says how many were found automatically and how many you added or removed.
Clumps it cannot split are estimated from their size and marked ≈. Under Adjust, Count one kind only counts things like one object you tap, and Sensitivity runs from fewer to more. Details shows the size spread, Objects (CSV) saves one line per object, and Download picture saves the count with its marks.
When to trust the number
Objects lying apart on a plain background are the easy case. On the counter's own sample, 17 buttons on white, it finds all 17, the pale one included.
Heaps, shine and low contrast are where any automatic count needs help, as the hazelnut test shows. The page itself says it is not for dispensing medicines or any count where a mistake can hurt someone.

A worked example: 42 hazelnuts, partly in a heap
- The photo: 3,840 × 2,560 px, hazelnuts on a pale blue surface, about ten lying apart and the rest in a heap.
- We counted by hand first, with a numbered dot on each nut: 42.
- Dropped on the counter: 27 objects, with a note that 3 clumps could not be split and were estimated from their size.
- The marks show why. Most loose nuts got one mark each, but the middle of the heap got none, two loose nuts got two marks each where a highlight cut them in half, and one single nut was estimated as ≈2.
- Count one kind only depends on which nut you tap: our tap on one loose nut gave 48, and taps on other loose nuts gave counts from 24 to 56.
- Single taps do work: one tap on a doubled nut removed its extra mark, and the panel read 26 found automatically, 1 removed by you. For a heap like this, though, the real fix is a new photo with the nuts spread out.
Common mistakes
- Counting a heap. Touching and stacked objects merge into shapes no counter splits reliably; spread them out first.
- Shooting shiny things in hard light. Highlights cut one object into two marks; use soft light from the side.
- Turning sensitivity up to catch misses. On any counter, a lower threshold also picks up highlights and shadows; add misses with a tap instead.
- Filling the frame edge to edge. With white beans covering most of a wooden board, the counter outlined the dark gaps between the beans instead of the beans. Leave background all round.
- Trusting the number without looking. A glance over the marks takes seconds and catches every case above.
Questions
How accurate is counting objects in a photo?
It depends on the photo. Objects apart on a plain background come out close to exact (all 17 buttons on the page's sample); a shiny heap does not (27 of 42 hazelnuts). Check the marks either way.
Can I count objects in a photo on my phone?
Yes. The unmake counter runs in a phone browser: take the photo from straight above, then tap to fix any marks.
How do I count one kind of object among others?
Open Adjust, tap Count one kind only, then tap one typical object; the page counts only things like it.
Can it measure the objects too?
Yes. With a sheet of paper or a bank card in the photo, sizes come out in millimetres, otherwise in pixels. The CSV lists every object's size.
Sample file: Hazelnuts (Corylus avellana).jpg (3,840 px copy) · CC BY-SA 4.0 (Ivar Leidus)
Sources
- ImageJ documentation: Analyze menu (Analyze Particles counts objects in thresholded images)
- ImageJ documentation: Process menu (Binary > Watershed separates touching particles)
- Wikimedia Commons: Botones.jpg (the counter's button sample), public domain