divImg - out4 = false; case 'lr' % Return the left and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [out1 out2 out3 out4] = divImg(img,mode) f % Find the size [rows cols layers] = size(img); % Find halfway halfrows = round(rows/2); halfcols = round(cols/2); h switch mode %must use switch, because mode is a string that needs to be compared to %multiple cases case 'tb' % Return the top and bottom halves out1 = img(1:halfrows, :, :); %gets the out2 = img(halfrows+1:end, :, :); out3 = false;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: out4 = false; case 'lr' % Return the left and right halves out1 = img(:, 1:halfcols, :); out2 = img(:, halfcols+1:end, :); out3 = false; out4 = false; case 'q' % Return all 4 quadrants out1 = img(1:halfrows, 1:halfcols, :); out2 = img(1:halfrows, halfcols+1:end, :); out3 = img(halfrows+1:end, 1:halfcols, :); out4 = img(halfrows+1:end, halfcols+1:end, :); end...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online