i wrote a code to convert color image into blocks… the output looks like the input image in grayscale with gridlines over it… can i get the output with gridlines over the color input image i give…. please do reply
rgbimage = imread('peppers.png'); patchsize = 10; imsize = 10*25; rgbimage = imresize(rgbimage ,[imsize imsize]); image_out = []; for i = 1:patchsize:imsize image_out_tmp = []; for j = 1:patchsize:imsize tmp_img = rgbimage ((i+1-1):i+patchsize-1,(j+1-1):j+patchsize-1); tmp_img = [ones(patchsize,1) tmp_img ones(patchsize,1)]; tmp_img = [ones(1,patchsize+2);tmp_img;ones(1,patchsize+2)]; image_out_tmp = [image_out_tmp tmp_img]; end image_out = [image_out;image_out_tmp]; end figure;imshow(image_out);
Best Answer