How do I vertically segment a image in three parts?

Illustration
Cataleya - 2020-10-31T10:12:15+00:00
Question: How do I vertically segment a image in three parts?

One of the module of my project requires me to divide a page into three parts, and then discard the middle one. Then I have to work with the 1st and the 3rd part? How do I segment my image into three parts?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

You didn't provide the actual image but gave a mapped image I used it instead.
Here is the code:
% paper split
img = imread('paper.jpg');
%imshow(img, []);
[nrows ncols dim] = size(img);
% Get the slices colums wise split equally
img1 = img(:,1:ncols/3,:);
img2 = img(:,(ncols/3)+1:2*ncols/3,:);
img3 = img(:,(2*ncols/3)+1:ncols,:);
figure,
subplot(1,3,1), imshow(img1,[]); title('first part');
subplot(1,3,2), imshow(img2,[]); title('second part');
subplot(1,3,3), imshow(img3,[]); title('third part');

vertically segment


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!