![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/732979/image.png)
How to create a checkerboard pattern for a specific screen size?
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/732979/image.png)
추가 답변 (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!