How do I represent an image and add a moire pattern?
Show older comments
Hello,
How can I represent an image(256 x 256 px) and then add a vertical pattern(white,black,white,black,etc) with a dimension of 3px each? Please help me.
Thanks
Accepted Answer
More Answers (1)
Note that 256 is not a multiple of 3 (the width of your columns)
img = repmat([zeros(256, 3), ones(256, 3)], 1, ceil(256/6));
imshow(img);
2 Comments
Grosu Andrei
on 6 Oct 2016
Edited: Grosu Andrei
on 6 Oct 2016
Guillaume
on 7 Oct 2016
Once the stupid typo I made is corrected (one of the zeros should have been ones, you get what you want (sort of, the image is 256x258 since 256 is not a multiple by 3).
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!