Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////LUT.m///////////
- function LUT (image, encode)
- subplot(3, 1, 1);
- plot(encode);
- title('Encode');
- subplot(3, 1, 2);
- imshow(image);
- title('Original');
- subplot(3, 1, 3);
- imshow(intlut(image, encode));
- title('Encoded image');
- end
- ///////////Z1.m///////////
- clearvars;
- close all;
- clc;
- %% LUT
- load funkcjeLUT;
- figure(1);
- plot(kwadratowa);
- %% Read images
- lena = imread("lena.bmp");
- jet = imread("jet.bmp");
- %% LUT
- figure(2);
- LUT(lena, kwadratowa);
- title("kwadratowa");
- figure(3);
- LUT(lena, odwrotna);
- title("odwrotna");
- figure(4);
- LUT(lena, odwlog);
- title("odwlog");
- figure(5);
- LUT(lena, pila);
- title("pila");
- figure(6);
- LUT(lena, wykladnicza);
- title("wykladnicza");
- figure(7);
- LUT(lena, log);
- title("log");
- ///////////Z2.m///////////
- lena = imread("lena.bmp");
- jet = imread("jet.bmp");
- imgAdd = imadd(lena, jet, "uint16");
- figure(1);
- imshow(imgAdd, []);
- title("imadd");
- %% linear combination
- linComb = imlincomb(1, lena, 2.5, jet, "uint16");
- figure(2);
- imshow(linComb, []);
- title("linear combination");
- %% subtract
- imgSub = imsubtract(int16(lena), int16(jet));
- figure(3);
- imshow(imgSub, []);
- title("subtraction");
- %% multiply
- imgMul = immultiply(int16(lena), int16(jet));
- figure(4);
- imshow(imgMul, []);
- title("multiplication");
- imgMul2 = immultiply(int16(lena), 5);
- figure(5);
- imshow(imgMul2, []);
- title("multiply by const");
- mask = imread("kolo.bmp");
- %mask = boolean(mask);
- imgMul3 = immultiply(lena, mask);
- figure(6);
- imshow(imgMul3, []);
- title("multiply by mask");
- imgNeg = imcomplement(lena);
- figure(7);
- imshow(imgNeg);
- title("negative");
- ///////////Z3.m///////////
- clearvars;
- close all;
- clc;
- circle = imread("kolo.bmp");
- square = imread("kwadrat.bmp");
- %circle = boolean(circle);
- %square = boolean(kwadrat);
- notCircle = ~circle;
- figure(1);
- imshow(notCircle);
- title("not operation");
- andImg = circle & square;
- figure(2);
- imshow(andImg);
- title("and operation");
- orImg = circle | square;
- figure(3);
- imshow(orImg);
- title("or operation");
- xorImg = xor(circle, square);
- figure(4);
- imshow(xorImg);
- title("xor");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement