How do I set up a for loop to replace specific pixels of a color image (with a value of 0) with specific pixels of another color image?

2 ビュー (過去 30 日間)
I would like overlap a small picture (200x300) into a specific area of a big picture (2000x2600). How would I set up a for loop to make this action take place with two color photos?

採用された回答

Image Analyst
Image Analyst 2014 年 2 月 28 日
Try this (untested):
% Find logical indexes of where there is 0 in image1.
zeroPixels = image1 == 0;
% Replace them with the same pixels from image 2
image1(zeroPixels) = image2(zeroPixels);
If that doesn't work, let me know.
  5 件のコメント
Image Analyst
Image Analyst 2014 年 2 月 28 日
Sure. Feel free to hard code in coordinates if you want, instead of having the user click where to paste it.
Udaib khan
Udaib khan 2018 年 2 月 21 日
@Image Analyst please have a look at this problem Texture mapping

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by