High-Speed Seed Counting With LabVIEW and NI Vision

  Print Print

"We created our seed counter system with LabVIEW and the NI Vision Development Module, which make it simple to perform image analysis on the data and display results to the user."

- Michael D. Coleman, PhD, Coleman Technologies, Inc.

The Challenge:
Developing a system capable of accurately counting seeds at rates up to 1,000 seeds/s for a variety of seed shapes and sizes (0.5 to 20.0 mm).

The Solution:
Using NI Vision Acquisition Software to acquire high-speed, line-scan camera images of seeds falling through a drop zone and combining a 45-degree angle mirror with analysis software to quickly and inexpensively produce a seed counter system.

Michael D. Coleman, PhD - Coleman Technologies, Inc.


The production and preparation of seeds for shipment to retailers and end users involves numerous steps where the seeds must be counted. Traditionally, this process uses photo diode-based counters that are relatively slow and not easy to adapt to a variety of seed shapes and sizes.

An international horticultural company contacted NI Silver Alliance Partner Coleman Technologies (CTI)  to provide multiple high-throughput, high-accuracy seed counting systems. The company selected CTI for two primary reasons: the relatively low cost and unique design of our proposed system and our extensive experience in delivering machine vision applications.

The system requirements included counting accuracy greater than 99 percent, inspection of a variety of seed shapes with dimensions ranging from 0.5 to 20 mm, and seed counting throughputs of up to 1,000 seeds/s.

National Instruments Tools Speed Up Vision Application Development

Our system utilizes a Gigabit Ethernet Basler Runner rul2048-19gm 2,000 pixel line-scan camera with an F mount 75 mm lens to image silhouettes of seeds passing through the drop region in front of a pair of high-intensity backlights. A 45-degree angle mirror splits the field of view so that the charge-coupled device (CCD) can simultaneously view the drop region from two angles 90 degrees apart (see Figure 1). The line scan CCD effectively images a horizontal plane in the drop zone.

Figure 1. Seed Counter Schematic

The ability to view the drop zone from two orthogonal directions significantly enhances the ability of the system’s software to distinguish seeds whose silhouettes overlap in just one view. The utilization of a single camera and mirror, as opposed to two separate cameras, significantly reduces system size and cost, in addition to greatly simplifying alignment and timing of the two orthogonal camera views.

LabVIEW, NI Vision Development Module, and Vision Acquisition Software

NI measurement, automation, and vision acquisition software make it easy to configure and acquire images from a Gigabit Ethernet camera with LabVIEW. In this application, each half of the camera’s field of view acquires images like that shown in Figure 2, which shows round seeds approximately 3 mm in diameter. The line scan camera acquires lines at 19 kHz, the maximum rate of the camera. The resolution of the system in the horizontal direction is 0.125 mm/pixel, which is sufficient to view the smallest seeds. Note that the apparent size in the vertical direction is dependent on the velocity of the seeds. The optimum velocity for our system is 2 to 5 m/sec; the system is able to accurately count seeds at speeds outside this range at reduced seed throughputs (< 1,000 seeds/sec).

Figure 2. View of Falling Seeds

LabVIEW and NI Vision Ensure Quick Development

We created our seed counter system with LabVIEW and the NI Vision Development Module. This add-on to LabVIEW makes it simple to perform image analysis on the data and display results to the user. Figure 3 shows the main application window, which helps the user set a target seed count. Once the count is reached, an on-screen indicator turns green and a digital output line on an NI USB-6008 DAQ device is toggled.

We developed a custom algorithm to associate seeds found in each view with seeds in the other view to avoid double counting seeds and to handle cases where seed silhouettes overlap in one or both views. The software also has filters to avoid counting debris mixed with the seeds.

The application includes displays of the images taken from each view angle along with a plot of the position in the drop zone of each seed, as shown in Figure 3. Additional system features include:

  • Alignment and diagnostic tools
  • Background correction
  • Configurable filtering parameters
  • Count logging to text files

Figure 3. Main Window of the Seed Counter

The production department and R&D currently use three seed counter systems. Our system’s high throughput and flexibility to different seed shapes and sizes removes a major bottleneck associated with previous seed counting methods. This application can easily be adapted to count a variety of other opaque objects, such as small food or manufactured parts, at high throughput rates.

Author Information:
Michael D. Coleman, PhD
Coleman Technologies, Inc.
5131 West Chester Pike
Newton Square, PA 19073
United States

Bookmark and Share

Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI