Measuring cardboard boxes - Page 1
Forum section: electronics / projects

author: bill_c
author_rank: Regular Contributor
timestamp: April 10, 2021, 04:52:48 pm
content: Looking for a way to measure the width, length, and height of a cardboard box (not moving) on a conveyor. sizes near 24" x 36" x 6" but can be 5x5x1 to 48x96x24 (not all max at the same time). Accuracy 1 inch or better. If possible, to scan in 10 seconds or less.Is there a cheap solution already out there?How else could this be done on the cheap? I'm thinking lasers + cameras + some linux compatible software maybe opencv

author: bill_c
author_rank: Regular Contributor
timestamp: April 10, 2021, 06:33:54 pm
content: There are some standard size boxes such as 24x30x4, 24x36x4, and 24x42x4, but also many custom made boxes. Every package is a different weight containing custom made parts (even if the same size). The boxes and packaging is all done by hand so looking for some automatic way to reduce human error. I cant trust them to make the box the right size or to enter the data by hand, humans have failed many times at both. Conveyor also has scale for weight, that part of the problem is already solved for the most part. The volume of packages is usually between 20 and 100 per day, but would like the scan to be quick so they don't have to wait to to process next package. They move the packages by hand on a roller conveyor onto the roller top scale where I would like to measure the package. If I can automatically measure it, I can send the data to PC where I can run some code to put the data in the shipping software (UPS, FedEx, etc). I am terrible at painting the whole picture so ask me 20 questions and I will answer as best I can.

author: bill_c
author_rank: Regular Contributor
timestamp: April 10, 2021, 06:44:55 pm
content: I'm going to test something like this:https://www.pyimagesearch.com/2016/03/28/measuring-size-of-objects-in-an-image-with-opencv/One camera looking at side of box to determine height, one above to get width nad length.But I will need to make the conveyor and surrounding areas a contrasting color, easy enough to solve since all boxes are that brown cardboard color.And I can see a possible problem, each box will have 4x white plastic straps that may confuse opencv, but this may be a simple enough code problem to solve.

author: ejeffrey
author_rank: Super Contributor
timestamp: April 10, 2021, 07:25:12 pm
content: QuoteDefinitely humans can and do make errors, but the frequency of that makes it sound like you have some procedural problems.For the standard size boxes do they have a barcode you can just read, or can you arrange that they do?For the custom made boxes, I would think about using a top mounted system that uses a laser rangefinder for height and a camera to measure X/Y with computer vision. The laser rangefinder will let you correct for the perspective shift since you know the box height. This will also avoid obstructing the conveyor belt on either side if that is an issue, and may be easier to keep a uniform background. You could get rid of the rangefinder completely if you had a known reference image on the top side of the box, like a QR code or something. You could use the apparent size of that on your camera to tell you the height of the box and then extract X and Y the same way.

author: jmelson
author_rank: Super Contributor
timestamp: April 10, 2021, 10:11:18 pm
content: Put an encoder on the conveyor belt rollers. Then, put a vertical string of LEDs and photosensors on opposite sides of the conveyor.When a box comes through, the number of beams it breaks gives you the height. The length of time/encoder counts the beam is broken gives you the length of one side of the box. If the box is not square to the belt, then you get an exaggerated number for length.The width of the box is another issue. Maybe a camera placed above the belt could take a picture of the box and image processing software couldgive width and length.Well, that is several options.Jon

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: April 10, 2021, 10:51:13 pm
content: Sounds like a perfect application for an VL53L sensor from ST. If the box is stationary and aligned straight, you can measure the distance from five sensors (left, right, front, back, top ) or even less if box is resting against a fixed structure like a retractable stopper in the conveyor.These cost 3 dollars a piece and connect via I2C, so you could rig up an arduino and have a solution for less than 20 bucks.Avoid the trap: you have to do the measurents in sequence, the sensors may not be active simultaneously. Not a real issue, a measurement takes just microseconds.Once you have the distances, pre-school math gives you the exact dimensions. Accuracy should be better than half an inch.

author: bill_c
author_rank: Regular Contributor
timestamp: April 11, 2021, 12:30:41 am
content: "sound like you have some procedural problems."Yes! I suggested several ideas such as having someone else verify, but they do not like the idea. So my task is to solve it with hardware."do they have a barcode"Currently no markings on any box, and no practical way to mark custom ones. I cannot count on them to fold the box right face out on standard boxes if they were printed(unless print both sides). I wish I was joking."Put an encoder on the conveyor belt rollers. ... LEDs and photosensors"(I do have something similar on another unrelated machine.)Its a non powered roller conveyor, could be changed but would have to change many other things before and after this section. And we may in fact change some things anyhow. I like the idea that its simple."Sounds like a perfect application for an VL53L sensor"I will look into that as well, an array of those may do the job or help with overhead image."If the box is stationary and aligned straight"Stationary yes due to friction, I can only count on it resting on the conveyor due to gravity. Unless I switch to power driven conveyor, I would assume the box to not be straight. Maybe with many sensors, I could compensate for rotation.Thanks for all the ideas, now I just need time to test some of these.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: April 11, 2021, 01:12:02 am
content: Banner Engineering isn't cheap but they do have a lot of sensor products and example applications:https://www.bannerengineering.com/us/en.htmlhttps://www.bannerengineering.com/us/en/solutions/quality-control/preventing-shipping-errors-at-large-distribution-center.htmlhttps://www.bannerengineering.com/us/en/solutions/smart-sensors/high-speed-package-profiling.html

author: CatalinaWOW
author_rank: Super Contributor
timestamp: April 11, 2021, 01:56:19 am
content: For under $200 you can get a scanning lidar module that will give range to cm accuracy. One module placed near the conveyer can gather width and length data as the box approaches on the conveyer belt. A second module can gather height and confirm one other axis. The modules aren't terribly difficult to interface, but there will be a fair amount of software to interpret the data.Another solution would probably work. Sonar sensors from Maxbotix and others can give high quality data. You would have to verify sufficient return from your cardboard boxes, but I believe the odds are very good on this. It would take six sensors to make the measurement insensitive to box rotation, or you could just arrange your conveyer to push the box into a corner stop and get by with just three. Software with this group of solutions would be trivial.

author: Nusa
author_rank: Super Contributor
timestamp: April 11, 2021, 02:13:40 am
content: And to test the system when you think you're done, send in some hand-made irregular pyramid-shaped boxes and see what happens. Then try round and half-round boxes, both lying on flat sides and balanced on the round side. I could go on, but I suspect you may need to expand from assuming three simple rectangular dimensions.