I have question on how to edit pictures. What i am trying to do is read in two images to matlab and i am trying to replace a part a part one the first picture with a part from the second image.

3 visualizaciones (últimos 30 días)
For example, If the first image is of the car and it car a toyota sign on the car, and the second image has a sign of honda. I want to be able to replace the toyota sign on the first image with the honda sign from the second image. If anyone could please give me a step by step on how to do this please.

Respuestas (1)

Jeff E
Jeff E el 19 de Nov. de 2013
Below is a simple way to just swap a portion of toyota_image, given the coordinates of a boundingbox (ttop = y coordinate of top edge, tright = x coordinate of right edge) with a portion of honda_image of the same size, again given a second set of boundingbox coordinates.
toyota_img(ttop : tbottom , tleft : tright , :) = honda_image(htop : hbottom , hleft : hright , :);
Swapping out portions of images becomes a bit more difficult if they are not boxes. Let us know if that is your use case.

Community Treasure Hunt

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

Start Hunting!

Translated by