Combining specific regions of multiple images in a stripe pattern.

1 view (last 30 days)
[EDIT: 20110526 15:43 CDT - reformat - WDR]
I'm trying to combine images into a "stripe" pattern. Below are two example images. However, in normal use I'll need to expand this two ~6-12 images.
I can guarantee that the images are the same size, the text lines up, etc. What I am looking to do is merge the colored boxes so that each image is represented as a "stripe".
I tried something where I made stripes of the entire image and compositing them:
nimg = zeros(size(img1));
stripes = floor(linspace(1, size(img1,2), 500));
for i = 1:length(stripes)-1
inds = stripes(i):stripes(i+1);
if mod(i,2) == 0
nimg(:,inds,:) = img1(:,inds,:);
else
nimg(:,inds,:) = img2(:,inds,:);
end
end
But this doesn't work very well since the boxes don't line-up.
I assume I need to do some image-processing to extract the colored regions and then only slice those regions up. However, I don't have much experience with the image-processing toolbox. If anyone can point me to a set of functions for extracting the positions of the boxes I would greatly appreciate it.
Thanks,
-Will
  1 Comment
Will Dampier
Will Dampier on 26 May 2011
Also, I don't know a priori which colors will be present in each image however I do know that the desired color is the only thing that differs between the images.

Sign in to comment.

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!