Author Topic: Measuring cardboard boxes  (Read 473 times)

0 Members and 1 Guest are viewing this topic.

Offline bill_c

  • Regular Contributor
  • *
  • Posts: 75
  • Country: us
Measuring cardboard boxes
« on: April 10, 2021, 04:52:48 pm »
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
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 8079
  • Country: us
Re: Measuring cardboard boxes
« Reply #1 on: April 10, 2021, 05:35:13 pm »
Not knowing more about the problem or what the end goal is,  maybe you can constrain the problem to fixed number of size boxes and sort by weight.  If it's 10 boxes, maybe use a human and measure them.
How electrically robust is your meter?? https://www.youtube.com/channel/UCsK99WXk9VhcghnAauTBsbg
Software, documentation and test reports for the low cost NanoVNA & V2 Plus 4 may be found here:
https://github.com/joeqsmith
 

Offline bill_c

  • Regular Contributor
  • *
  • Posts: 75
  • Country: us
Re: Measuring cardboard boxes
« Reply #2 on: April 10, 2021, 06:33:54 pm »
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.
 

Offline bill_c

  • Regular Contributor
  • *
  • Posts: 75
  • Country: us
Re: Measuring cardboard boxes
« Reply #3 on: April 10, 2021, 06:44:55 pm »
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.
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 2548
  • Country: us
Re: Measuring cardboard boxes
« Reply #4 on: April 10, 2021, 07:25:12 pm »
Quote
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

Definitely 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.
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: us
Re: Measuring cardboard boxes
« Reply #5 on: April 10, 2021, 10:11:18 pm »
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 could
give width and length.

Well, that is several options.

Jon
 

Offline BreakingOhmsLaw

  • Regular Contributor
  • *
  • Posts: 190
  • Country: de
  • Certified solder fume addict
Re: Measuring cardboard boxes
« Reply #6 on: April 10, 2021, 10:51:13 pm »
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.
 

Offline bill_c

  • Regular Contributor
  • *
  • Posts: 75
  • Country: us
Re: Measuring cardboard boxes
« Reply #7 on: April 11, 2021, 12:30:41 am »
"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.
 


Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 4181
  • Country: us
Re: Measuring cardboard boxes
« Reply #9 on: April 11, 2021, 01:56:19 am »
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.
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2056
  • Country: us
Re: Measuring cardboard boxes
« Reply #10 on: April 11, 2021, 02:13:40 am »
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.

 
The following users thanked this post: CatalinaWOW


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf