Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-05-08 10:35:38


On Saturday 06 May 2006 09:53, Guch wrote:
> 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?

What exactly do you mean by this? AFAIK there is no general way to write
matrix.apply_to_all_element( some_functor );

mfg
Gunter