6 min read · Machine vision

Buyers of cut flowers usually set the spathe size and stem length for each grade. Measuring by hand is slow and each person reads differently. A camera can measure quickly and to one standard, but its readings can be trusted only if the system is calibrated and regularly checked against the real thing.
The examples in this article are hypothetical. All figures are made up to explain the reasoning. They are not results from a real growing plot or a customer project.
How a camera measures length
A camera sees pixels, not millimetres. Something of known real size has to be in the image so pixel counts can be converted to length. That object is a calibration target, for example a plate with a circle or grid of measured size. The principle and how to verify measurement accuracy are in the article on camera calibration for measurement.
Suppose the calibration target has a circle 50 millimetres in diameter, and the circle is 400 pixels wide in the image. Each pixel is then 50 ÷ 400 = 0.125 mm. If the spathe is 560 pixels wide, its width is 560 × 0.125 = 70 mm.
Set up the system to be repeatable
- Mount the camera on a rigid stand that does not move. The distance from the camera to the table must be the same every time
- Have the camera look straight down at the table to reduce perspective tilt
- Use a plain background colour that differs strongly from the flower and stem, so the edges are sharp
- Use soft, even lighting so that shadows are not read as part of the flower
- Put the calibration target in every image, or fix it permanently at a corner of the table, at a height close to the part being measured
- Mark the position for the flower so every flower is placed in the same spot and the same orientation
Choosing the lens and the field of view to get enough resolution is covered in the article on Lens Resolution and Field of View.
Curved and tilted flowers distort the reading
An ordinary camera sees a flat image. If the spathe is tilted or curved, the visible size is shorter than the real size, and the more it tilts the bigger the error. If the stem is bent, the length in the image is not the same as the stem's real length when straightened.
In a hypothetical example, a flat spathe is 70 mm wide. If it is tilted by 30 degrees, a camera looking from above sees a width of about 70 × 0.866 = 60.6 mm. The error is about 9.4 mm, or roughly 13% of the true value, which could put the flower in the wrong grade.
Another issue is height. A part of the flower that sits higher than the calibration target is closer to the camera, so it looks larger. Suppose the camera is 500 mm above the calibration target, but the top of the spathe is 20 mm above the plate. The camera is then 480 mm from the top of the spathe, and the apparent size is larger by 500 ÷ 480 ≈ 1.042 times. A true width of 70 mm would read as about 72.9 mm.
- Lay the flower so the spathe is as flat as possible, for example with a light press or a clear glass plate on top
- Place the calibration target at a height close to the part being measured
- If a strongly curved flower must be measured, consider two cameras or a 3D camera. See the comparison in 2D vs 3D Machine Vision
- Accept that some flowers need to be re-measured by a person, and set clear conditions for which flowers are passed to a person
Check against a ruler regularly
Do not trust camera readings without checking. Have a procedure that compares against an accepted ruler or vernier caliper, done on a schedule, for example at the start of every shift and whenever someone moves the stand or changes the lens.
| Check | How | Frequency | Who |
|---|---|---|---|
| Check the scale with an object of known size | Place a bar or plate of known length and see whether the camera reads it correctly | Start of shift | Quality operator |
| Compare against a ruler | Pick flowers at random, have a person measure them with a ruler or vernier caliper, and compare with the camera | Weekly or as agreed | Quality operator |
| Check camera position | Check that the stand, camera and calibration target are in their original positions | Start of shift | Floor operator |
| Check flowers near a grade boundary | Have a person re-measure every flower whose value is close to a grade limit | Always | Quality operator |
| Record and review the trend | Record the difference between camera and ruler and see whether it is growing | Monthly | Quality supervisor |
Hypothetical example: comparing 5 flowers
Suppose an operator randomly measures the spathe width of 5 flowers with both the camera and a vernier caliper. The differences between camera and vernier are +1, +0, −1, +2 and −1 mm. The sum of the differences is 1 + 0 − 1 + 2 − 1 = 1 mm, the mean is 1 ÷ 5 = 0.2 mm, and the largest difference is 2 mm. If the team has set a tolerance of no more than 3 mm, this set passes, but the flower with the 2 mm difference should be examined to see whether tilt caused it. All figures are hypothetical examples.
Limitations and cautions
A camera measures only what is visible in the image, and the result is a size on the calibrated plane. Curved or tilted flowers, or bent stems, will be measured with error, so there must be a step where a person helps check. All figures in this article, such as the 50 mm circle, 400 pixels, 560 pixels, 70 mm, the 30 degree angle, the 500 and 480 mm distances, and the 5-flower comparison, are hypothetical examples to explain the reasoning. They are not results from a real BT San project and not any buyer's grading criteria. Use the criteria agreed with your own buyers.
Starting references
- Wikipedia — Anthurium
- Wikipedia — Camera resectioning
- Wikipedia — Cut flowers




