You are here: Start » Program Examples » Shipment Verification
Shipment Verification
Aim:
The aim of the program is to count the number of boxes in a container and mark each of them with a stripe.
Input:
An image of boxes in a container.
Output:
Detected boxes and their count.
Hints:
The easiest and the quickest way to achieve this goal is to use 1D Edge Detection technique and detect boxes as stripes.
Labeling connections is explained in this article.
Solution (AVS):
- Add the LoadImage filter. Please, remember about setting directory to the images in the Properties window of the filter.
- Add the ScanMultipleStripes filter.
- Connect the outImage from the first filter with the inImage of the second one.
- Click on the ScanMultipleStripes. In Properties window (in the bottom left corner) make these changes:
- Define a scanning path in the inScanPath horizontally so that it embraces all the boxes.
- Set the inStripeScanParams.MinMagnitude to 10, which is the approximate minimum value of transition between bright stripes and dark gaps.
- Set the inStripeScanParams.StripePolarity to Bright because we want to find the bright stripes.
- Set the inStripeScanParams.MinStripeWidth to 40. The width of the box is about 42-43, so it is a safe lower limit.
- Set the inStripeScanParams.MaxStripeWidth to 50. It is a safe upper limit - without it, some wider stripes might be detected.
- Right-click on the outStripes, find Property outputs and select the outStripes.Count
Macrofilter Main
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
LoadImage | Loads a single image from a file. |
![]() |
ScanMultipleStripes | Very fast detection of multiple pairs of opposite edges - usually for counting or width measurements. |
Further Readings
- 1D Edge Detection - The article explaining how edge detection filters work.