I was trying to make a mechanism (I don't think it should be called a robot) to find a certain pattern from an image & take an appropriate action, I defined the action as shooting with a laser light on the target pattern found. The pattern have to be printed on paper & pasted on a board. The mechanism will contain a stepper motor at the center & on the motor an webcam have to be set (may be using a long rod of wood or anything else). A laser light have to be placed linearly with camera so it may faces the same the camera faces. With appropriate circuits of relay or transistor the motor & the laser have to be connected to PC's parallel port & camera to pc's usb port. Then running the function worknew will set the mechanism in action.
Three images are included. The humangunman1.jpg is the original target, target_final is the boundary image & target_final1 is the modified version of it for easy comparison.
Functions boundaries, invmoments, bound2im are used from DIPUM Toolbox, which is available to the purchasers of 'Digital Image Processing Using Matlab' by Rafael C. Gonzalez, Richard E. Woods & Steven L. Eddins. Thanks to them. They will also need some nested functions which are all included in DIPUM toolbox & in the book. For copyright law I'm not including the functions.
It's a very tiny project & doesn't have so much significance. But I wrote & provided it here so that it may come to anyone's help.
Anyone needing additional materials like physical model, mechanism image may add comment specifying needs. I'll try to provide them.
Please forgive me if you find any mistakes.