how Can i use in one image only for this code? because it is used in two images

global image1,image2
im1cand2=bitand(image1,image2);
axes(handles.axes3); imshow(im1cand2);
global image1,image2
im1cxor2=bitxor(image1,image2);
axes(handles.axes3); imshow(im1cxor2);
global image1,image2
im1cor2=bitor(image1,image2);
axes(handles.axes3); imshow(im1cor2);
have button.. first select image 1 second selecte image 2 and then button for im1 cand 2 im1 cxor im2 im1 cor im2.. i dont want to make the act between 2 image but one..

7 Comments

I had to make a guess about the formatting of your actual code. Please check to see if I formatted it correctly.
I do not understand what you are asking about using only one image? Are you trying to plot the three results to the same axes? Are you trying to reduce image1 and image2 to a single variable instead of two?
have button..
first select image 1
second selecte image 2
and then button
for im1 cand 2
im1 cxor im2
im1 cor im2..
i dont want to make the act between 2 image but one..how can i do it this?
You want to and the image with itself? That would leave the identical image. xor an image with itself would always leave 0's. or an image with itself would always leave the identical image.
how it is work the cand. the result. cannot be applied only in one image???
Fine.
global image1
im1cand1=bitand(image1,image1);
axes(handles.axes3); imshow(im1cand1);
global image1
im1cxor1=bitxor(image1,image1);
axes(handles.axes3); imshow(im1cxor1);
global image1
im1cor1=bitor(image1,image1);
axes(handles.axes3); imshow(im1cor1);
If you need to see the result for yourself, go ahead. But you will see that the cand and cor always leave the image unchanged and the cxor always leaves the image black.

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!