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

1 view (last 30 days)
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".

Accepted Answer

Image Analyst
Image Analyst on 1 Mar 2022
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 Comment
MatlabUser
MatlabUser on 1 Mar 2022
Edited: MatlabUser on 1 Mar 2022
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?

Sign in to comment.

More Answers (1)

yanqi liu
yanqi liu on 1 Mar 2022
may use imdilate to dilate image by ones(2,2)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!