필터 지우기
필터 지우기

The union of 2 images

조회 수: 11 (최근 30일)
John Snow
John Snow 2013년 10월 28일
댓글: John Snow 2013년 10월 28일
Let's say I have an image called A and another constant image of the same size how do I get the set union of those 2 images : the union should be of the same size as image A
Note: when I use union function it gives me an error (A and B must be vectors or 'rows' must be specified.)

채택된 답변

Matt J
Matt J 2013년 10월 28일
편집: Matt J 2013년 10월 28일
the union should be of the same size as image A
Then you have an unconventional definition of a "union". There's no reason they should be the same size. Possibly you want to do a pixel-wise or() operation?
Union = A|B
Otherwise please clarify.
  댓글 수: 5
Matt J
Matt J 2013년 10월 28일
John Snow
John Snow 2013년 10월 28일
Thank you very much this works good

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

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 10월 28일
Maybe you mean something like this:
% Find dark pixels.
binaryImage = skeletonImage < 50; % Or whatever intensity you want.
% Replace dark pixels with pixels from image B.
C_Image = skeletonImage; % Initialize
C_Image(binaryImage) = B_Image(binaryImage); % Replace.
  댓글 수: 1
John Snow
John Snow 2013년 10월 28일
This works ok but i think the "C=max(A,0.5);" command is easier from the other anser is easier but thank you very much for your answer

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by