How to Add an Additional Coin in the Image?

4 Ansichten (letzte 30 Tage)
Angie
Angie am 19 Apr. 2018
Beantwortet: Walter Roberson am 19 Apr. 2018

_ I am trying to add an additional coin in the image._ I have found the regionfill Region of interest function and I was thinking that it may be the opposite of this, where instead of masking a coin, I am adding one. If you can help, I would greatly appreciate it.

I = imread('eight.tif');
imshow(I);
mask=roipoly(I); 
figure,imshow(mask)
J = regionfill(I,mask);
figure, imshow(J)
  4 Kommentare
Walter Roberson
Walter Roberson am 19 Apr. 2018

No, no -- there is mathematics behind the Vanishing Leprechaun illusion, and in at least some cases you could arrange such that the additional coin was there if you move pieces of your image one way, but gone if you move pieces of your image another way.

But as to the practicality with your image... well, we haven't seen your image. Your image is in hiding, like Leprechauns.

Angie
Angie am 19 Apr. 2018
I have added the image.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 19 Apr. 2018

Create a mask where the coins are. Use those as the targets for https://www.mathworks.com/help/images/ref/bwdistgeodesic.html. The result, for each point, will be the distance to the edge of the nearest coin. Look for points where that distance exceeds the radius of the coins. The places that meet the criteria are places where it would be possible to copy in a coin without it touching any of the existing coins.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by