Fast Image access for binarization



hi,
is there any way to access image data efficiently to speedup the global
binarization code speed. our code is taking abt 40msec right now but we
need to reduce it down to 5-10msec.

our loop is like this:

for(i = 0; i < (width * height); i++)
{
if (image[i] > threshold)
image[i] = 1;
else
image[i] = 0;
}

image size is 512x512 to 4096x4096

there are different checks involved but we r trying to remove them from
the loop completely. this one check however cannot be moved out of the
loop.

is there any platofrm and hardware independent way of speeding up this
code?

any unique solutions to this problem? please help us out.

thanks and regards,
siddharth

.



Relevant Pages

  • Fast Image access for binarization
    ... is there any way to access image data efficiently to speedup the global ... our code is taking abt 40msec right now but we ... the loop completely. ...
    (sci.image.processing)
  • Re: Fast Image access for binarization
    ... use a lookup table and eliminate the compare and branching. ... is there any way to access image data efficiently to speedup the global ... the loop completely. ...
    (sci.image.processing)
  • Re: Fast Image access for binarization
    ... is there any way to access image data efficiently to speedup the global ... the loop completely. ... All other go faster stripes come with machine dependencies of one sort or another. ... Loop unrolling might help (but on modern machines with clever branch prediction and limited instruction cache could also hinder). ...
    (sci.image.processing)