Hi i would like to know how to divide a pixel into subpixels and then randomly assign 0 and 1 to the subpixels
4 次查看(过去 30 天)
显示 更早的评论
Iv got an image and i hv to divide its pixels into subpixels in a matrix form and then randomly assign 0 and 1 to its rows and columns.
0 个评论
采纳的回答
Image Analyst
2016-3-31
编辑:Image Analyst
2016-3-31
subpixels = randi(1, rows, columns);
where rows and columns are some number more than the rows and columns of the original image. For example
[originalRows, originalColumns, numColors] = size(grayImage);
rows = 2 * originalRows;
columns = 2 * originalColumns;
subpixelImage = randi(1, rows, columns);
Now each pixel will be "occupied" by 4 pixels of the higher resolution subpixelImage.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!