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.

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.

回答 (1 件)

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.

質問済み:

2013 年 11 月 19 日

回答済み:

2013 年 11 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by