Ive been trying to interpolate a simple matrix that creates a checkerboard pattern.
Currently, Ive been using the matlab's predefined function
I = checkerboard(n,p,q), to create all my checkerboard patterns. However, when I make large checkerboard patterns, and display the image fullscreen, the resolution is slightly distorted, in a sense that, some checks are uneven with respect to other checks. This unevenness presents a problem as I am trying to acheive uniformity.
The problem starts if I have more than 180 checks on one side, i.e.
chk = (checkerboard(1,93,93) > 0.5);
screen_size = get(0, 'ScreenSize'); % this gets the screensize specs
imshow(chk)
imresize(chk, 5.5054) % this is a constant size that i want all checkers to keep
set(figure(1), 'Position', [0 0 screen_size(3) screen_size(4) ] ); % display fullscreen
What i would alternatively like to do when dealing with large checkerboard patterns is to create a growing matrix of ones and zeros, i.e. have some loop that can concatenate a predefined checkerboard pattern. So far I have been experimenting around with something like
black = zeros(2,2); white =ones(2,2); cat(2,black,white);
with this i want to grow my pattern, so that I can have, lets say, 256 checks along one row, and also columns, without pixel distortion,
ultimately,
e.g. black, white, black, white, ....
white, black, white , black, ....
black, white, black, white, ....
..upto as many checks that can possibly fit within a screen.
The distortion is mainly due to the fullscreen resolution, but this is unfortunately something that is very necessary for the program.
I appreciate any hints or any suggestions.
Thanks
The issue is quite easily fixable. For those wanting to know how to get fullscreen capability, the following is an excellent resource:
http://www.mathworks.com/matlabcentral/fileexchange/23404
The problem with checker patterns and displaying images in Matlab in general, is the anti-aliasing caused and the pixel distribution across the screen. When images get very large matlab will compress all the image into its allotted pixels across the monitor, thus "cramping" most of the pixels in, and causing distortion. Therefore, a simple image resize to the native screen settings and a bit of tinkering with the code, the solution can be found :)
I just solved my own problem :D. happy days
"Iyer " <tik...@gmail.com> wrote in message <h62cv4$3dm$1...@fred.mathworks.com>...