Alexandre Guimar=E3es wrote: >=20 > Hi, >=20 > > I have done 'camera tricks' but I used a PIC only once (to interface = the > > PC that was doing the tricks with the camera controls). > > > > I think that something very crude can be done but by the time you wan= t to > > determine part orientation you start to need MIPS and room. If the pa= rt > > orientation is not a problem (already aligned) then it might work. >=20 > Do you have references or source code for the position and orientat= ion > determination ?? I have been looking at it since Roman gave that idea b= ut > have not been able to find much. Seem like everyone is trying to do fac= e > recognition nowadays and are not working with rectangles anymore :-( Relax with the angular orientation stuff! ;o) It's very easy, as is finding the center of mass. The rectangle (SMD part on camera) has 90 degree sides, and only one side needs to be analysed to give orientation. With a 0805 etc sized SMD part, orientation is not critical and 64 rotary positions are acceptable. So you only need to be able to identify 64/2 =3D 32 actual orientations, probably by a simple lookup table. For centre of mass you average the positions of all the highest pixels, and lowest pixels, then average them together. A few additions and subtractions. Besides being a TV technician I did a couple years as a 2d game graphics programmer. :o) -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.