In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Coriolis wrote: Yes it should be relatively easy to do, and you shouldn't need external memory. This is because you are only concerned with a binary value for each capsule, is it there one or not. Your SX would sync to the camera's output, then sample an 8x8 pixel swatch at each capsule's location. Then use a classifier function on the swatch, there are many different functions that can classify the swatch: majority rule, average, bayesian etc. Then once you determine whether the capsule is there you set or clear a bit in a variable. The SX28 has 128 bytes of variable space (plus a few more global variables). You wont be able to implement a true Bayesian classifier (requires full sample set, of which two swatches would completely fill the SX's memory). But you could easily implement the others, average is self explanitory, majority rule would go like this: sample video stream at capsule location eight times each time threshold the value (so you get a value of 0 or 255), find whether that row has majority dark or light pixels and store a 0 or 255 for that row, if it's a tie, store 128 for the row. You do this for each row (8 in total) after all 8 are done this way, do a majority rule for all of the rows, and set the value for the capsule position to true or false (values of 0 and 255 are totaled, values of 128 are ignored). If they are equally numbered (4 white, 4 black) then its a tie and the classifier failed. If you are clever with your variable use (and reuse variable when possible) you should be able to implement majority rule and average classifiers, where when there is a tie by majority rule, the average classifier breaks the tie. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=92979#m93136 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)