Can the Propeller chip process images?
SciTech02
Posts: 154
Does it have enough processing power to do so?· I wanted it to act like a "Framegraber"·so it would·process the images, can I do that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is always an answer.
There is always a way.
There is always a reason.··· -SciTech02.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is always an answer.
There is always a way.
There is always a reason.··· -SciTech02.
Comments
One of the common image processing algorithms I can think of looks at the current pixel value, and compares it to the surrounding 8 pixels. A result based off of that comparison is written to a result array. Each cog could get a common "Start" pixel indice into a pixel array (making up an image) and then each cog goes to work looking at a different offset from the initial value.
Say you have a 256x256 array. Start at the upper left hand corner for arbitrary reasons. That is pixel 0. The ones above and to the left of it are exceptions that need to be handled. The one to the right is pixel 1, and the one beneath pixel 0 is pixel 256. The one beneath that is pixel 512.
The process looks like this for a 256 x 256 image (WARNING!!! bad pseudo code ahead!).
Define
Foo(x , y , z), addr , byte , addr;
x addr /"This is the location in memory being examined.
y byte /"This is the offset in memory of the result array.
z addr /"This is the location in memory it is compared with.
a byte /"The value of the location being examined.
b byte /"The value of the location in memory it is being compared with.
c byte /"This is the result of the comparison.
{ a ==GetMemVal(x);
b ==Get MemVal(z);
c == YourComparisonHere(a DELTA b); /"DELTA is whatever comparison you want to make.
PutMemVal((x + (65536 * y) , c);
}
End Foo
Define
Array_Proc (done), Boole;
{While (x++) /= 65536 do:
Cog0 (foo(x , 1 , (x-257));
Cog1 (foo(x , 2 , (x-256));
Cog2 (foo(x , 3 , x-255));
Cog3 (foo(x , 4 , x-1));
Cog4 (foo(x , 5 , x+1));
Cog5 (foo(x , 6 , x+255));
Cog6 (foo(x , 7 , x+256));
Cog7 (foo(x , 8 , x+257));
} end of while;
So you end up with 8 new arrays beginning at multiples of 65536 from the input array, each array is the result of a comparison between a pixel being tested and another pixel.
If each pixel takes 50 assembly instructions, then that's one pixel array (a 256x256 image) in under 1/6th of a second.
Now really with the cog structure you'd only need about 6 or 8 intructions to do the index/lookup functions, and I bet most image processing operations could be done in 8 to 12 assembly math instructions, more like 20 instructions overall and 15 images per second.
Yours, TDP, ml, msl, & pfpp
PS. On the likelihood I've screwed that up, someone please correct me. For example with 32kb of RAM, internal memory can only hold half a single 256x256 array, so fetches and stores to external RAM might screw the whole thing, duration wise.
Post Edited (tperkins) : 4/24/2006 9:51:40 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is always an answer.
There is always a way.
There is always a reason.··· -SciTech02.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
Yech.
I just meant to get across it will be much better at image processing than a single processor. In fact it will be almost 8 times better.
Yours, TDP, ml,msl, & pfpp
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...