Identify irregular holes in paper target (revolver/pistol target)

asked 2018-02-26 08:32:40 -0600

50sman gravatar image

updated 2018-09-21 02:49:44 -0600

I am a newbee with big N. I am trying to explore if it is possible to use openCV for detecting holes in my paper target when practice shooting. I have started with the SimpleBlobDetection and that one works fine with some "tweaking" for calibers over .22 beacuse you get bigger circles with more defined edges if you use .357 or .44. However! For .22 you do not get so defined edges and big contrast. I have looked through the Q&A here like "Recognize basic shapes in binarized image", "Colour + Contour Detection" and "Cell detection improvement" but I cannot egt the n"final" solution from this. Any ideas on how to address it more empirically ? See my example image with .22 cal (this is worst case example). Thanx.

Update! I have added better images that is more "clean"

image description image description

edit retag flag offensive close merge delete

Comments

Yes.You can do on OpenCV 3.4.1. On what languages?

supra56 gravatar imagesupra56 ( 2018-02-26 09:45:43 -0600 )edit

How about you first do a blob detector, than use the shape module to calculate moments, than apply a classifier with the moments as input and a 2 class classification problem (either bullet hole or not). That will quite solve your problem and in a robust manner.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-02-27 06:11:03 -0600 )edit

Long time but Thanx Steve. Is it "rude" to ask if I could get some "start" code? As I wrote - I am a newbee with a big "N". Have improved a lot though these last month. My general "idea" I have is that maybe a comparison between 2 frames where "you" identify pixels that are the same and discard them just leaving the non similar. then do some kind of thresholding just leaving the differenses. Or use color separation with max/min for the black and white. The bullethole is not in the same range (I guess) color wise so that shoul be left. then do some "trix" with that image? How about machine learning? I have started to build a image base with hits. At the moment I have roughly 2500 hits in the black area and 1700 hits in the white area.

50sman gravatar image50sman ( 2018-09-21 02:43:54 -0600 )edit
1

Both images sets with all different situations that can arise like a hit on the lines or a hit on a number. This is for .22 . I will continue to collect for all calibers. If not now then for the "future" when new tecniques comes. I guess Haar cascade is out of the question. How about to use Tensorflow?. I am quite convinced that I need a more advanced technique to cover all different situations that can happen on a target.

50sman gravatar image50sman ( 2018-09-21 02:47:40 -0600 )edit

Yeah you could use object detection models for this task. Training a model with tensorflow is an option - and i think not a bad one.

holger gravatar imageholger ( 2018-09-21 03:37:56 -0600 )edit

Unfortunately I do not have the time to provide start code since I am swamped till the end of 2018 with projects. If someone else is up for helping you out further, I am sure that they will pick up!

StevenPuttemans gravatar imageStevenPuttemans ( 2018-10-17 04:55:30 -0600 )edit