Jump to content
Brian Enos's Forums... Maku mozo!
FingerBlaster

Machine vision to sort by headstamp

Recommended Posts

I'd like to try and make something to do this.

 

I recall having seen a post somewhere where someone did this, but can't find it. I think they used a cognex camera, but I don't know where to start with the software.

 

I can do basic Arduino and Ras pi programming.

 

 

 

Sent from my Pixel 2 XL using Tapatalk

 

 

Share this post


Link to post
Share on other sites

There seems to be quite a few OCR softwares out there and many are free.  How to make it actually activate something is beyond me (for now).

I'll be following this thread though.  Thanks

Share this post


Link to post
Share on other sites

OCR software would be the way to go. Use a case feeder ot funnel into a single file line of cases with a window for the camera to look at the headstamp. Then use some sort of arm to sort towards the right pile.

Share this post


Link to post
Share on other sites

Raspi and raspi camera with a servo driver or solenoid driver board (depending on how your mechanical design works.) Some python code... probably use opencv template matching or some such Google is your friend there.  

 

 

The harder part would be the mechanical design of the selector/gate mechanism and chutes to get the brass in N different buckets (assuming you wanted to sort  the brass in 1 pass instead of 2 or more.)

 

 

 

 

 

 

Edited by caspian guy

Share this post


Link to post
Share on other sites

It's one of those things that seems like it should be simple, but ends up being complicated. 

The leading visual inspection/sorter companies in the industry are Mectron and GI.  Both are fairly expensive machines even in their most basic form. 

 

If someone developed an affordable, effective, fast, visual sorting machine, they would have quite a few ammunition companies attention. 

Share this post


Link to post
Share on other sites

 No doubt and speed of processing would be a big issue... don't expect opencv on a raspi to be fast.

Share this post


Link to post
Share on other sites

I know i've seen someone who has done this before , i was thinking maybe @jmorris but i might only be thinking him because he's done so much cool stuff around here.  

 

I'm sure anything i DIY will be slow, cumbersome and complex.  But sorting brass by headstamp is just soo tedious.  The issue is the range i buy brass from has started using federal NT... and with the different size flash hole it's basically a necessity.

Share this post


Link to post
Share on other sites

I've looked at youtube "sortinator" and they have a few videos - one is just on the software but they are not sharing since the machine they made is for sale at $3k - which I believe is nuts and I don't care for their mechanical design.

I've seen others that once recognized, the case could run down a short conveyor to be ejected or sidetracked like mail or packages at Amazon. 

Getting the software to activate servos upon recognition is all I'd like to see, the mechanics should be the easy part.

Share this post


Link to post
Share on other sites
Quote

The harder part would be the mechanical design of the selector/gate mechanism and chutes to get the brass in N different buckets (assuming you wanted to sort  the brass in 1 pass instead of 2 or more.)

 

Come up with the OCR, electronics/program to read the headstamp and output for a number of like headstamps (like A, B, C, D, E, F, G, everything else) and I’ll come up with the mechanical part that looks at every case and diverts it to where the others like it are.

Edited by jmorris

Share this post


Link to post
Share on other sites
On 3/2/2018 at 8:25 PM, StratRider said:

I've looked at youtube "sortinator" and they have a few videos - one is just on the software but they are not sharing since the machine they made is for sale at $3k - which I believe is nuts and I don't care for their mechanical design.

I've seen others that once recognized, the case could run down a short conveyor to be ejected or sidetracked like mail or packages at Amazon. 

Getting the software to activate servos upon recognition is all I'd like to see, the mechanics should be the easy part.

The moving arm of the "sortinator" seems like it wastes too much time moving around. Something like this (top view) would reduce the amount of time spent per a case by having linear movement and using a series of trap doors to drop the case down into a tube chute that could be redirected to 5 gallon buckets.
sorter.png.632b61f3021e8bab03337a5aeb3cc176.png

Share this post


Link to post
Share on other sites

I would use the case feeder to orient and singulate the  cases.  Now that we have all the cases  in one orientation in a single file line, use a starwheel or roller to create uniform space between the cases.  After this, is your inspection camera followed by a series of air or mechanical 'blow offs' that push the cases off the conveyor and down a chute to a collection bin.

Share this post


Link to post
Share on other sites

I was thinking of something more like the decap/primer picket sorter I built.

 

 

 

Except instead of a probe, you have the camera to capture the image and instead of just an “L” or “s” bin have them drop into a device that can further divide them.  A number of different options exist for that part.

 

 

 

Share this post


Link to post
Share on other sites

Honestly I'm tempted to do this.

 

I am planning an open gun build and the prospect of sorting 9mm brass by headstamp is just nauseating.

 

I don't even care about speed (although I think I could get this operating pretty quickly). It's more about reliability.

 

Maybe I'll make a separate thread about how to DIY this.

Share this post


Link to post
Share on other sites
On 11/13/2018 at 6:44 AM, StandardError said:

Honestly I'm tempted to do this.

 

I am planning an open gun build and the prospect of sorting 9mm brass by headstamp is just nauseating.

 

I don't even care about speed (although I think I could get this operating pretty quickly). It's more about reliability.

 

Maybe I'll make a separate thread about how to DIY this.

i searched, but did not find a follow up thread to this.  Has anyone carried the torch forward on this?

Share this post


Link to post
Share on other sites

I'm ironically busy with my PhD projects (involving machine learning) and haven't had a chance to. Although I think the greater challenges are in the physical design rather than the computation.

Share this post


Link to post
Share on other sites
On 2/21/2019 at 5:13 PM, StandardError said:

I'm ironically busy with my PhD projects (involving machine learning) and haven't had a chance to. Although I think the greater challenges are in the physical design rather than the computation.

Yes I completely agree.

Share this post


Link to post
Share on other sites
On 2/21/2019 at 5:13 PM, StandardError said:

I'm ironically busy with my PhD projects (involving machine learning) and haven't had a chance to. Although I think the greater challenges are in the physical design rather than the computation.

 

On 2/22/2019 at 5:14 PM, Laxman2809 said:

Yes I completely agree.

While interesting, that doesn't really help us dunderheads here at ground zero :)

Share this post


Link to post
Share on other sites
38 minutes ago, muncie21 said:

 

While interesting, that doesn't really help us dunderheads here at ground zero :)

 

Muncie, I promise I'll get to this.

 

But how much of a necessity is it? I only shoot 9 minor for USPSA so I have no clue. But my 3 gun friends tell me that they have to sort .223 by headstamp, sometimes. And I know the desire for 9 mm brass sorting isn't ubiquitous.

 

 

By your estimation, how much of an "issue" is efficiently sorting brass by headstamp?

Share this post


Link to post
Share on other sites
2 minutes ago, StandardError said:

By your estimation, how much of an "issue" is efficiently sorting brass by headstamp?

Personally, it's a non-issue for me, as I reload all cases (that meet spec) regardless of headstamp.

 

Now this particular thread was created to explore/define how to sort cases via headstamps.  While unnecessary for me, it is an interesting idea, considering my background is in industrial automation and controls.

 

It seems there are some competitors that wish to sort cases by headstamp, this thread is for them.

Share this post


Link to post
Share on other sites

Doesn't take too long to do a 5 gallon plastic bucket full !  Just put a bunch of little tubs around the 5 gallon one and get too it.  Hardest part is remembering which little tub which headstamp goes into.  Gets easier after you get started.

Share this post


Link to post
Share on other sites
On 2/24/2019 at 3:32 PM, StandardError said:

 

But how much of a necessity is it? I only shoot 9 minor for USPSA so I have no clue. But my 3 gun friends tell me that they have to sort .223 by headstamp, sometimes. And I know the desire for 9 mm brass sorting isn't ubiquitous.

By your estimation, how much of an "issue" is efficiently sorting brass by headstamp?

Well, necessity isn't really the issue here.  Some of us would like to do it for fun.  I sort my brass by headstamp and if there is an easier way - and really cool way - to do that, I'm all in.

When I do load workups, I always use the same headstamp just to eliminate another variable.  For matches, I do the same.  It's just one of those OCD things that makes me feel better.

I believe that you thought the mechanical part was the hard part, where others of us can deal with the mechanics - just not the OCR part.  It's nice when we can all work together.

Your input will be quite enlightening.  Thanks for helping with the challenge (when you get time of coarse) 😀

Share this post


Link to post
Share on other sites
On 2/21/2019 at 4:13 PM, StandardError said:

I'm ironically busy with my PhD projects (involving machine learning) and haven't had a chance to. Although I think the greater challenges are in the physical design rather than the computation.

 

Figure out the computation part and I’ll knock out the physical part.

 

I did get a little further on my sort by weight project but it’s still not much more than proof of concept at this point.

 

https://www.youtube.com/watch?v=1V_Hm3oqlO4

Share this post


Link to post
Share on other sites

It's funny that this subject came up as I was thinking about this concept just the other day, but didn't knows this thread even existed. Although I thought that pattern recognition would be better than OCR.

Share this post


Link to post
Share on other sites
Just now, AdamM said:

It's funny that this subject came up as I was thinking about this concept just the other day, but didn't knows this thread even existed. Although I thought that pattern recognition would be better than OCR.

 

My question about how 'necessary' it was is more driven by the fact that I'm going to start reloading 9 major and don't want to end up with a case head separation. But it also brings up the question of marketability and maybe why there haven't been more attempts at this?

 

Either way, there are some very good OCR packages out there right now which are very fast, but the issue is that they're pretty poor when it comes to reading text that is tilted, skewed, or rotated.

 

Which makes sense. OCR was designed to be highly accurate at reading pages fed through a copymachine-type image scanner which leads to some hardcoded assumptions about axes of text, etc.

 

The way that I'd approach this is through capturing the image of the case head and then running it through a trained neural network.

 

Like Adam mentioned, this is nothing more than fancy pattern recognition. Albeit very powerful. The main challenges I've foreseen, though, is consistent image quality, speed, and training.

 

In regards to image quality, this is probably an OK issue if you presuppose that the brass is cleaned before sorting and if the images are capture in a very high amount of light/magnification to help show important features.

 

For speed, this is a bigger deal. You could probably do this reasonably quickly (I'm saying 2-3 pieces of brass a second) if you ran any image classification off of a laptop. But once you try to bring it to smaller electronics (think Raspberry Pi) then you're running into memory and processor issues. Assuming you could get a neural network on the embedded processor, the speed might degrade significantly.

 

And training is another issue. Robustness of classification comes from a large sample size. I would probably want 100 - 1000 unique images of brass per headstamp. Maybe on the end closer to 100 if you can do sample augmentation by rotating them. And then training a network would be a process of semi trial and error but also be computationally expensive. 2-3 days minimum to 1 week + on a modern laptop, dedicated.

 

These are the ideas off the top of my head. There's probably more complication I'm not considering accurately.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...