pixel conversion

View: New views
2 Messages — Rating Filter:   Alert me  

pixel conversion

by AGD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Is there a direct command to convert an entire matrix of 0's and 1's to 0's and 255's respectively?
And is there a way to invert the pixel values of 1 and 0 in the matrix? (32X32)

Thanks

Re: pixel conversion

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

man, 03 08 2009 kl. 22:51 -0700, skrev AGD:
> Is there a direct command to convert an entire matrix of 0's and 1's to 0's
> and 255's respectively?

B = 255 * A;

> And is there a way to invert the pixel values of 1 and 0 in the matrix?
> (32X32)

B = 1 - A;

Søren

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave