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

3 次查看(过去 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)

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by