Tuesday, April 17, 2012

MATLAB Code to scale down the image height and scale up

% Read the image
Img = imread('plato.jpg');

% Downscale it
ihalf = Img(1 : 2 : end, :, :);
% Display the image
imshow(ihalf);

% Get the height and width of the original image
[height width dim] = size(Img);
ifull = zeros(height, width, dim);
% Upscale the image
ifull(1 : 2 : end, :, :) = ihalf;
ifull(2 : 2 : end, :, :) = ihalf;
ifull = uint8(ifull);
figure;
imshow(ifull);

Hope this works. Happy coding!!!

1 comment:

Unknown said...

You want to achieve in Embedded System and Technologies .We are providing industrial training with 100% Job Opportunities in Core Industries. Sessions will be practical on software as well as hardware. We are providing on microcontrollers such as 8051, PIC, AVR, ARM7, ARM9, ARM11 and RTOS with 100% Placement Assistance

Contact : +91-9940426826 / 044-26209369.

Website : www.bestembeddedsystemtraininginchennai.com