Petiole Pro Blog

Counting Round Objects with a Smartphone: Blueberries, Seeds, Nuts and Computer Vision

How a smartphone counts round objects — blueberries, soybean and chickpea seeds, peanuts, beans, grapes — using computer vision and light deep-learning models. Get count, average size, and standard deviation from one photo, why 87% accuracy is often enough, and why a calibration plate is the rule for real measurements.

Published on 14 May 2026 by Petiole Pro

Around fifty strawberries spread on black fabric next to a Petiole Pro area calibration plate, ready to be counted and measured by computer vision.

Counting & quality control

When people picture agricultural AI, they imagine autonomous tractors, drones, and robots. Yet one of the most common problems faced by growers, packhouses, seed companies, and researchers is far simpler: how many objects are there? More specifically — how many round objects are there?

A smartphone can now count round objects — blueberries, soybean and chickpea seeds, peanuts, beans, grapes, nuts, pellets — automatically. Computer vision detects each object individually from a single photo and returns not just a count but average size, the spread of sizes (standard deviation), and a full distribution. With a calibration plate in the frame, those measurements come back in real centimetres.

This long-read explains where smartphone counting started (post-harvest blueberries), why round objects are the ideal first target for computer vision, the four-step capture workflow, why average size alone is misleading and standard deviation matters, why 87% accuracy is often a win rather than a failure, and why a calibration plate is a rule rather than a suggestion.

Key takeaways
  • Round objects — distinct boundaries, predictable shapes, clear separation from a contrasting background — are the easiest target for computer-vision counting.
  • One photo yields far more than a total: count, average diameter and area, minimum and maximum, standard deviation, and a size distribution.
  • Standard deviation reveals uniformity that average size hides — two samples with the same mean can be very different products.
  • A calibration plate is mandatory for real measurements. Without one you still get a count, but area and diameter come back as zeros.

The universal question: how many?

Across agriculture and food processing, thousands of decisions still rest on someone manually counting objects on a table, tray, plate, conveyor, or in the palm of a hand. Blueberries. Soybean seeds. Peas. Beans. Nuts. Pellets. Experimental samples. The counting itself is not hard — the challenge is scale. A single project can involve hundreds or thousands of images, which makes manual counting slow, repetitive, and error-prone.

Thousands of chickpea seeds spread across a black tray with a round Petiole Pro calibration plate at the centre, photographed from above.
Now count these by hand. A single tray of chickpeas can hold thousands of seeds — the exact task that breaks manual counting and where computer vision earns its place.

Whether the objects are berries, seeds, or nuts, the underlying task is identical: count individual circular or near-circular objects from an image. Solve it once and it generalises across domains — soybean seed quality, germination studies, peanut analysis, grain research, breeding programmes, and laboratory experiments.

Where it started: blueberries

At Petiole Pro, one of our earliest counting applications came from post-harvest blueberry quality control. Researchers and industry partners wanted a faster way to quantify berry samples without spending valuable time counting fruit by hand. The workflow was collect a sample, place the berries on a tray, photograph, count, record — repeated across hundreds of images.

Petiole Pro Blueberry QA screen: blueberries on a dark background each circled by the app, with a count of 231, average area 2.63 cm² and standard deviation 0.60.
The Blueberry QA result that started it all: 231 berries counted, average area 2.63 cm², standard deviation 0.60, average diameter 2.28 cm — from one photograph.

The counting was never the hard part — the scale was. Turning a repetitive manual chore into a few seconds of image analysis is what makes the difference at the volumes real quality control demands.

Why round objects are a good starting point

Round objects are among the easiest targets for a computer-vision system. They tend to have distinct boundaries, predictable shapes, relatively consistent sizes, and clear separation from the background. Spread them on a contrasting surface and modern image analysis can identify and count them with impressive accuracy — which is why blueberries, soybean seeds, peas, chickpeas, macadamias, hazelnuts, almonds, fertiliser pellets, and many fruits and berries all work well.

Loose almonds scattered on a cream quilted cloth beside a small round Petiole Pro calibration plate marked with ArUco patterns.
Almonds on a plain background with a calibration plate. Distinct edges and good contrast are exactly what a counting algorithm needs.

This is also why round objects make an honest starting point rather than an over-claim. Their geometry keeps the detection problem tractable, so the models can stay light enough to run on a phone. Irregular, overlapping, and biological shapes — leaves, roots, flowers — are harder, and a topic for another day.

The four-step smartphone workflow

The process is deliberately simple, so it works in a lab, a packhouse, a classroom, or a field. Everything runs from the Petiole Pro app on an ordinary smartphone.

  1. Arrange the sample. Spread the objects in a single layer on a contrasting background — a tray, plate, table, or bench — and add a calibration plate if you want measurements, not just a count.
  2. Capture an image. Photograph from directly above. Consistent light with minimal shadows improves accuracy; daylight is ideal.
  3. Detect individual objects. Rather than treating the sample as one mass, the algorithm finds each berry or seed separately.
  4. Generate measurements. Once objects are detected, the app calculates count, diameter, area, shape metrics, and distribution statistics.
Petiole Pro app home screen showing Leaf Analysis with Area & Perimeter and Greenness cards, a Calibration Store banner, and a Greenhouse section.
The Petiole Pro home screen. Counting modules sit alongside leaf area, greenness, and the built-in calibration store.

Here is a step-2 capture and its step-3 result side by side — a plate of green grapes, then the same plate with every berry detected and measured:

Green grapes arranged on a pale wooden plate on a dark counter, with a round Petiole Pro calibration plate placed below them.
Step 2: arrange and capture. Grapes on a light plate against a dark counter, calibration plate in frame.
Petiole Pro detection of the same grapes: each berry circled in blue, magenta or red by size, with a count of 77, average area 5.02 cm² and standard deviation 1.04.
Step 3–4: detect and measure. 77 grapes counted, average area 5.02 cm², standard deviation 1.04. Colours mark how far each berry sits from the mean (1, 2, or 3 standard deviations).

Beyond a count: size, area, and distribution

This is where image-based counting becomes far more valuable than a total number. From a single image the app can report the number of objects, average size, minimum and maximum size, standard deviation, the full size distribution, and the percentage of objects within specific size classes. Instead of manually counting 500 blueberries, you get a complete statistical summary in seconds.

Petiole Pro QA screen counting nuts, each circled by size, with a Segments panel showing Size, Area and Diameter, a count of 118, average area 3.56 cm² and standard deviation 0.72.
One tap switches between Size, Colour, Area, and Diameter. Here: 118 nuts, average area 3.56 cm², standard deviation 0.72 — with 1SD, 2SD, and 3SD filters to isolate outliers.

The same detection engine scales from dozens of objects to thousands. Dense seed trays are exactly where manual counting collapses and where a light on-device model keeps its footing:

Petiole Pro seed-counting screen with thousands of small tan seeds densely detected and circled, showing a count of 2,063 and an average diameter of 1.11 cm.
Over two thousand seeds detected in a single frame, with average diameter 1.11 cm and a standard deviation of just 0.09 cm — a very uniform sample.

Why standard deviation matters

Suppose two blueberry samples both have an average berry diameter of 16 mm. At a glance they look identical. But in Sample A most berries sit close to 16 mm — highly consistent — while in Sample B some are 10 mm and others 22 mm. Same average, very different product. For growers, packers, and buyers these are not the same thing at all, and that is what standard deviation captures.

Standard deviation measures how much variation exists within a sample. A low value means the objects are similar in size; a high value means they vary considerably. Picture a classroom: if every child is nearly the same height the standard deviation is low; if some are very short and others very tall it is high. The same principle applies to blueberries, seeds, and nuts — and it drives real decisions:

  • Blueberries: retailers prefer uniform packs; a low standard deviation signals consistency.
  • Soybean and chickpea seeds: uniform seed size influences planting performance and processing efficiency.
  • Breeding trials: researchers hunt for varieties that produce more uniform outputs.
  • Food processing: machines run better when raw materials have predictable dimensions.
Petiole Pro QA screen counting strawberries, each circled by size, showing a count of 58, total area 599.91 cm², average area 10.34 cm² and standard deviation 2.75.
Strawberries carry a much wider size spread than seeds: 58 berries, average area 10.34 cm², standard deviation 2.75 — the number that tells a packer how mixed the batch really is.

Because every object is measured against the same calibrated scale, these summaries are directly comparable across samples and crops. A few real Petiole Pro results show how much the spread changes with the product:

Measured with Petiole Pro on a calibrated plate. Chickpeas, by comparison, averaged 1.10 cm in diameter with a standard deviation of just 0.09 cm — among the most uniform samples of all.

87% accuracy: precision vs practicality

Precision matters in agriculture and food processing — but how much precision is enough? Take a real example: counting 1,411 black turtle beans. The app returned 1,228 — that is 87% accuracy. Is that a problem? Not necessarily.

Side-by-side: black turtle beans spread on a white tray with a calibration plate, and the Petiole Pro detection with beans circled, showing a count of 1,228 and total area 919.52 cm².
1,411 turtle beans by hand, 1,228 by app — 87% accuracy — plus total area 919.52 cm², average 0.75 cm², and an average diameter of 1.23 cm the manual count never gives you.

Why accuracy above 85% can be a win:

  • Diminishing returns. Chasing the last 13% can cost more in time and resources than it is worth. 87% allows swift operations without significant compromise — and you can always count the remainder by hand.
  • Nature is not uniform. Slight variation is expected and accounted for in most workflows. Staying above 85% strikes a balance between quality assurance and operational cost.
  • It scales. A smartphone-based approach at this accuracy level holds up as operations grow — whether your QA team is 10 people or 100, the accuracy stays consistent across larger volumes.
Side-by-side Petiole Pro chickpea screens: raw chickpeas on a black tray with a calibration plate, and the detection with every seed circled, showing a count of 2,072 and an average diameter of 1.10 cm.
Context is key. For a uniform, densely packed sample like chickpeas — 2,072 seeds here — the same approach holds its accuracy at scale.

Context is everything. Some industries demand higher precision; many thrive at this level. The skill is understanding your specific needs and optimising accordingly — not treating 100% as the only acceptable target.

The calibration-plate rule

Can the app count berries in a box, on a tray, or in a clump? Yes — it can count in almost any condition. But the moment you want measurements — diameter, average area, standard deviation — a calibration plate stops being a recommendation and becomes a rule.

Petiole Pro Blueberry QA on a dense clump of blueberries with no calibration plate: 239 berries are counted, but total area, average and standard deviation all read 0.00, with a note explaining the missing plate.
The tell-tale sign: 239 berries counted, but area, average, and standard deviation all read 0.00. No calibration plate in the photo means no measurements.

A calibration plate acts as a measuring standard — a ruler the algorithm can trust. It tells the AI the real-world size of objects in the photo, so pixels convert into centimetres. No plate, no measurements: you will get zeros for area and diameter every time. (It is possible to measure size without a plate using a depth camera, but real-time depth processing on a phone or tablet needs extra hardware and budget.)

A free printable calibration plate ships inside the app, and sturdier acrylic plates can be purchased from the Petiole Pro store. If you are weighing up whether you need one for your workflow, we walk through the decision in detail in do I need a calibration plate for Petiole Pro?

What you can count today

The counting modules already span berries, seeds, and nuts, with dedicated quality-assurance flows in the app. Each one counts and measures; several also assess appearance and colour.

Petiole Pro catalogue screen showing Blueberries modules (Berry QA, Yield Prediction) and a Viticulture Canopy module.
Blueberry Berry QA and yield prediction, plus viticulture — a growing catalogue of computer-vision modules.
Petiole Pro catalogue screen showing a Peanut Peanuts QA module and a Soybean Seeds QA module.
Peanuts QA and soybean Seeds QA — count, measure, and appearance-based quality assurance.

Counting is only half the story: modules such as Peanuts QA also read colour in RGB, HSV, and LAB space for appearance-based grading, and berry modules support visual quality checks that affect shelf life and marketability.

Side-by-side Petiole Pro Peanuts QA: red-skinned peanuts on white with a calibration plate, and a colour-analysis panel using LAB space with 448 objects counted.
Peanuts QA counting 448 nuts and analysing skin colour in LAB space — appearance grading on top of the count.
Side-by-side Petiole Pro raspberry analysis: raspberries arranged in a grid on white with a calibration plate, and the detection showing 56 berries counted with average area 5.99 cm².
Raspberries counted and measured — 56 berries, average area 5.99 cm² — for sorting, grading, and consistent pack quality.

Round objects are only the beginning. Their relatively simple shape makes them an ideal entry point for automated counting and measurement, and the same thinking already extends to related tasks such as AI germination counting. Future work will tackle harder targets: irregular objects, overlapping structures, leaves, roots, and flowers.

Built for blueberries first — but the modules are extensible. If you count a specific round object that is not yet covered, a dedicated module can often be created for it.

Petiole Pro for counting & QA

Stop counting seeds by hand

Count and measure blueberries, seeds, nuts, beans, and berries from your phone with the free Petiole Pro app — count, average size, and standard deviation from a single photo. Add a calibration plate for real cm², or send us a batch of images and get clean results back as CSV.

Counting a round object we do not cover yet, or planning a research trial or QA line around image-based counting? We are a UK-based company glad to build a tailored module or join a project. Write to us at [email protected].

Frequently asked questions

What round objects can Petiole Pro count?

Petiole Pro counts round and near-round objects such as blueberries, strawberries, raspberries, grapes, soybean and chickpea seeds, peanuts, beans, almonds and other nuts, pellets, and similar samples. Objects with distinct boundaries and clear separation from a contrasting background work best.

How accurate is smartphone-based counting?

Accuracy depends on the sample and conditions, but a well-captured image typically lands above 85%. In one example, counting 1,411 black turtle beans returned 1,228 — 87% accuracy. For many operations that is a good trade-off between speed and precision, and any remainder can be counted manually. Uniform, well-separated samples on a contrasting background score highest.

Do I need a calibration plate to count objects?

Not to count — you can get a count without one. But to measure size (diameter, area, standard deviation) a calibration plate is mandatory: it gives the algorithm a known real-world scale so pixels convert into centimetres. Without a plate in the photo, the measurements return 0.00. A free plate is built into the app, and acrylic plates are available in the Petiole Pro store.

What is standard deviation and why does it matter for quality control?

Standard deviation measures how much object sizes vary within a sample. A low value means uniform sizes; a high value means mixed sizes. Two samples can share the same average size but differ greatly in consistency — which matters to retailers, packers, seed companies, and processors who depend on uniformity. It reveals what an average alone cannot.

Can the app count objects in a clump, box, or tray?

Yes — Petiole Pro can count objects in almost any condition, including clumps and boxes, without spacing every item apart. However, for size measurements you still need a calibration plate in the frame; otherwise you get a count but zeros for area and diameter.

How do I count seeds or berries with my smartphone?

Spread the sample in a single layer on a contrasting background, add a calibration plate, and photograph from directly above in consistent light (daylight is ideal). Open the relevant module in the Petiole Pro app, upload the photo, and read the count and statistics on screen. Taking a few photos and keeping the best result is a good practice.

Is Petiole Pro counting free?

The Petiole Pro mobile app is free and includes a printable calibration plate. Sturdier acrylic plates can be purchased, and for large or specialised workflows — including custom modules for a specific round object — you can contact the team.