From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Advice needed detecting counterfeit coins

Solved!
Go to solution

I’d like to use image processing to determine counterfeit coins by measuring their diameter and how circular they are.

 

My first attempt was to place the coins on graph paper with 1/4" squares, but ambient lighting often cast shadows. I found that displaying an image of those squares on my smartphone in a dimly lit room eliminates these shadows.

 

That being said, what image processing functions should I use, given the following:

 

1. For each picture I take, the camera will be held by hand so it may be a few degrees off and not directly perpendicular to the plane of the phone.

2. On my smartphone, the pixels are perfect squares, not rectangular. Their size and shape is the one constant I have to work with.

0 Kudos
Message 1 of 7
(5,088 Views)

@bmihura wrote:

I’d like to use image processing to determine counterfeit coins by measuring their diameter and how circular they are.

 

My first attempt was to place the coins on graph paper with 1/4" squares, but ambient lighting often cast shadows. I found that displaying an image of those squares on my smartphone in a dimly lit room eliminates these shadows.

 

That being said, what image processing functions should I use, given the following:

 

1. For each picture I take, the camera will be held by hand so it may be a few degrees off and not directly perpendicular to the plane of the phone.

2. On my smartphone, the pixels are perfect squares, not rectangular. Their size and shape is the one constant I have to work with.


What is the camera that you are using? Try using a high intesity light source and operate in mimum lens aperture.  Try thresholding and circle detection. Post a image is possible

Message 2 of 7
(5,076 Views)

I'll be using a variety of cameras to develop this, but ultimately I'll write this as an Android app. To get the math right, I'll start by using NI's image processing software using your "thresholding" and "circle detection" suggestions. I've attached sample pictures where I use a common quarter.

Download All
0 Kudos
Message 3 of 7
(5,071 Views)
Solution
Accepted by topic author bmihura

Try this for the images you attached

Message 4 of 7
(5,069 Views)

Nice! That worked perfectly, thanks.

0 Kudos
Message 5 of 7
(5,060 Views)

Dont forget to mark the post as solution!!!Smiley Wink

0 Kudos
Message 6 of 7
(5,056 Views)

That worked! Still not sure how to accept your solution though, will hunt around until I get it....

0 Kudos
Message 7 of 7
(5,035 Views)