how to repeat the same pixel values of one image region (e.g., one superpixel) into another one?

1 回表示 (過去 30 日間)
given an image that has been segmented into smaller regions (superpixels). How to repeat same content (color pixel values) of one region in the image (e.g., superpixel with id = 1) into another one (e.g., superpixel with id=2) if the sizes of them are slightly different,
"interpolation or padding are allowed".

採用された回答

Image Analyst
Image Analyst 2022 年 3 月 1 日
Well the shapes of each superpixel will be different so what are your plans regarding the different shapes?
Anyway, for what it's worth, attached is my demo for copying and pasting irregularly shaped regions.
  1 件のコメント
MatlabUser
MatlabUser 2022 年 3 月 1 日
編集済み: MatlabUser 2022 年 3 月 1 日
thanks a lot for your answers,
I like your copy_paste_image_freehand example...
It is near to what I want to achieve, I only still need to deal with the size differences between the two superpixels, since i have the mask for both of them I just want to compensate any pixels that does not have corresponding pixels in the first superpixels by interpolation or padding or any other idea?

サインインしてコメントする。

その他の回答 (1 件)

yanqi liu
yanqi liu 2022 年 3 月 1 日
may use imdilate to dilate image by ones(2,2)
  1 件のコメント
MatlabUser
MatlabUser 2022 年 3 月 1 日
I have color images, I think morphological operation in color images will generate artifacts,

サインインしてコメントする。

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by