For example.
There is an image matrix
matrix<unsigned char> m(100,100);
......
I want to convert this image into a binary one with threshold 120.
for(int i=0;i<100;i++){
    for(int j=0;j<100;j++){
        if(m(i,j)<120)
                m(i,j)=0;
            else
                m(i,j)=255;
    }
}
 
How can I do this with lambda?
 

Guch
2006-05-06