Using Data to reconstruct an image

4 views (last 30 days)
David Harra
David Harra on 17 Aug 2022
Answered: sudobash on 19 Aug 2022
I have 2 images of grains, one that contains smaller and one that contains significanlty larger. Each material is achieved via a rectilinear grid of coordinates. I want to merge the 2 images into one, in such a way I can remove an area of smaller grains and replace them by one of the larger features. I am wondering if anyone knows any methods or has came across examples like this? The end goal would be to have large features surrounded by all the smaller ones. The two images can be seen below to visualise it better
Any help would be greatly appreciated.
Dave :)

Accepted Answer

sudobash
sudobash on 19 Aug 2022
Hello!
As per my understanding, the output image needs to have some large blobs of the second image with all the other pixels from the first image.
You could segment out the large blob from the second image and superimpose it onto the first image.
Approach 1:
If all the colours on the second image are unique, then you could simply create a mask and set the pixel value of the mask to your desired colour on the first image.
Approach 2:
If all the colours on the second image are not unique, you could use watershed segmentation to obtain each region. After which, create a mask and set the pixel value of the mask to your desired colour on the first image.
Hope this helps!

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!