Page 1 of 1

remove object from image with other image?

Posted: 2015-08-21T03:37:22-07:00
by arane27
Hello guys,
I can't find the solution for this....

I have 2 images:

1º Image:

Image


2º image:

Image




I need to replace "Object C" from 1º image to white pixels using 2º image...


Sorry for my English...

Re: remove object from image with other image?

Posted: 2015-08-21T04:17:22-07:00
by Bonzo
I think you should post an actual example.

How do you know where OBJECT C is in OBJECT A - is it always in the same place, do you have the co ordinates or will Imagemagick have to find it?

Re: remove object from image with other image?

Posted: 2015-08-21T04:22:27-07:00
by arane27
Bonzo wrote:I think you should post an actual example.

How do you know where OBJECT C is in OBJECT A - is it always in the same place, do you have the co ordinates or will Imagemagick have to find it?

IM has to find object C.
I'm using the command -->

Code: Select all

compare -subimage-search source.jpg objToFind.jpg out.jpg
IM finds the difference, but how can I replace the found difference with white pixels or just blur that region, is there anyway?

wich -metric should I use?

Thanks for quick reply!!

Re: remove object from image with other image?

Posted: 2015-08-21T04:29:34-07:00
by arane27
Here is an example.


I have these images -->


Image
Image

And here is the region to find and detele/blur/change -->
Image


With command I wrote above I get this result -->
Image

Re: remove object from image with other image?

Posted: 2015-08-21T04:34:44-07:00
by snibgo
For the original post:

Code: Select all

compare -metric RMSE first.jpg objects_To_Remove.jpg -subimage-search NULL:
The result is:

Code: Select all

1092.34 (0.0166681) @ 31,279
So the found image is positioned at (31,279).

Code: Select all

convert first.jpg ( objects_To_Remove.jpg -fill Red -colorize 100 ) -geometry +31+279 -composite z.png
This paints a red rectangle over the area. I choose red, so you can see it. Change "red" to "white" if you want.