Comparation of two bimary images

Respected Sir.. I appreciate your quick reply.. i have problem like this.. say A =[4 3 6 8 3 9 6 1 3] B =[3 2 5 6 3 7 8 3 9] I want to compare the value of both A and B pixel by pixel like( in "A" value 4 is compare with "B" value 3) so the value of A which is 4 greater then the value of B which is 3..so we put value 3 in the third image of same size just like A & B..how i will done this in matlab..complete code

3 Comments

compar to image
Halil and Haris, I gave you complete code below. If you don't think so then read the link Walter gave you and elaborate on why it's not what you need.

Sign in to comment.

Answers (1)

Try this:
% Find out where A is greater than B.
AIsBigger = A > B;
% Initialize third image
C = zeros(size(B));
% Assign values of B to C
C(AIsBigger) = B(AIsBigger);

Asked:

on 9 Jan 2016

Commented:

on 1 Feb 2017

Community Treasure Hunt

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

Start Hunting!