필터 지우기
필터 지우기

controlling the transparency of the overlay image

조회 수: 22 (최근 30일)
prashant singh
prashant singh 2017년 7월 12일
편집: TheMoralPanda 2018년 1월 22일
I have overlay one RGB image on the top of another RGB image. Result attached. I have issue with the resulting image, The person in the image seems very transparent w.r.t background. How can i control the transparency of the background image and foreground image. I have overlay the image using imfuse(A,B,'blend'). However, i can control the transparency to some extent using set(A, 'Alpha', alphadata), but i don't know how can i save those image
  댓글 수: 1
Jan
Jan 2017년 7월 12일
What is your actual question? "How can i control the transparency" and "i can control the transparency to some extent" sound confusing.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2017년 7월 12일
편집: Jan 2017년 7월 12일
C = imfuse(A,B,'blend');
imwrite(C, 'YouImage.png');
Or perhaps you want:
alpha = 0.6;
C = alpha * A + (1 - alpha) * B;
imwrite(C, 'YouImage.jpg');
  댓글 수: 1
TheMoralPanda
TheMoralPanda 2018년 1월 22일
편집: TheMoralPanda 2018년 1월 22일
Hi Simon, imfuse(A,B,'blend') - blends two images successfully. However, the output image has some part of the image in the original RGB and some part dull region. Is there any way, we can make this dull region look like original one?
imfuse(A,B,'diff') - does it in grayscale.I am looking for something like that with 'blend' method.
Any ideas?
Attached is the image for your reference.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by