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?
댓글 수: 0
채택된 답변
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
2014년 2월 28일
Sure. Feel free to hard code in coordinates if you want, instead of having the user click where to paste it.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!