Combining specific regions of multiple images in a stripe pattern.

1 次查看(过去 30 天)
[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 个评论
Will Dampier
Will Dampier 2011-5-26
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by