Combining specific regions of multiple images in a stripe pattern.

1 回表示 (過去 30 日間)
Will Dampier
Will Dampier 2011 年 5 月 26 日
[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 Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by