How to create a checkerboard pattern for a specific screen size?

2 ビュー (過去 30 日間)
MM
MM 2021 年 9 月 8 日
コメント済み: MM 2021 年 9 月 8 日
I would like to create a checkerboard pattern (1920 X 1760) and save it as an image. Any suggestion on how this can be done?

採用された回答

Image Analyst
Image Analyst 2021 年 9 月 8 日
Try this:
numRows = 8;
numColumns = 8;
rows = 1920;
columns = 1760;
pixelsx = floor(rows / (2*numRows))
grayImage = checkerboard(pixelsx, numRows/2, numColumns/2) > 0;
% Resize to rectangular instead of square.
grayImage = imresize(grayImage, [1920, 1760]);
imshow(grayImage);
impixelinfo;
axis('on', 'image');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by