Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image or Pattern recognition in Matlab

Status
Not open for further replies.

hixee

Mechanical
Nov 1, 2012
2
I am attempting to write a code to recognise silverware. I am hoping to be able to have something set up where I can tell Matlab where the reference images are, then simply open/import the image I want to be 'recognised' and Matlab will run a code and determine the type.

This is for a proof of concept project for a silverware identification system. It will only be receiving one item at once, so Matlab just needs to be able to identify if the image is of a knife, fork or spoon. The silverware in the reference folder will be the same as the silverware being identified, however I am struggling to go about writing the code. Below is a sample of the reference images (stitched into one at the moment), and the images Matlab will be given to recognise will be very similar to these images.

Can anyone help me or point me in the right direction as to how to go about this?

silverwareguide.jpg


Thanks

Matt
 
Replies continue below

Recommended for you

If it is not an exercise then their computer vision and image analysis toolboxes (not sure about the names) will do that simple job in about 3 lines of code.

That being said identifying a knife vs a spoon is a bit subtle.




Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Well the easiest way is make masks by cropping the images, for example one fork mask, one spoon mask and one knife mask. Then take your unknown cutlery image and cross-correlate it with the three masks, and see which of the three has the largest response.

But this will only find your original fork, un-rotated and un-scaled. I believe in matlab you can use the xcorr2 function and max(max(x)) the output image to get the response.

D
 
Thanks for the responses. I've managed to get it to work by using the "corner" function then comparing the number of corners MATLAB finds in the reference files to the input ones.

Its not perfect, as the input images aren't as 'perfect' as the reference ones, but it's near enough for the time being.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor