Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % ----- lab 9
- % L = imread('Krakow_1.jpg');
- % L = rgb2gray(L);
- % figure;
- % imshow(L);
- % hold on;
- % setmask = [strcat('m = [str2num(get(t1,''String'')), str2num(get(t2,''String'')), str2num(get(t3,''String''));',...
- % 'str2num(get(t4,''String'')), str2num(get(t5,''String'')), str2num(get(t6,''String''));',...
- % 'str2num(get(t7,''String'')), str2num(get(t8,''String'')), str2num(get(t9,''String''))];',...
- % 'L1 = filter2(m,L); L1 = mat2gray(L1); imshow(L1)')];
- % t1 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [10 120 30 30], 'Callback', setmask);
- % t2 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [50 120 30 30], 'Callback', setmask);
- % t3 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [90 120 30 30], 'Callback', setmask);
- % t4 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [10 80 30 30], 'Callback', setmask);
- % t5 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [50 80 30 30], 'Callback', setmask);
- % t6 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [90 80 30 30], 'Callback', setmask);
- % t7 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [10 40 30 30], 'Callback', setmask);
- % t8 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [50 40 30 30], 'Callback', setmask);
- % t9 = uicontrol('Style', 'edit', 'String', num2str(1), 'Position', [90 40 30 30], 'Callback', setmask);
- % L=imread('portret.jpg');
- % figure(1);
- % imshow(L);
- % Maska1=[-1,-1,-1; 0, 1, 0; 1, 1, 1];
- % L1=filter2(Maska1, L);
- % L1=L1/255;
- % figure(2); imshow(L1);
- % L=imread('Krakow_3.jpg');
- % figure(1);
- % imshow(L);
- %
- % Maska1=[-1,-1,-1; -1,8,-1; -1,-1,-1];
- % L1=imfilter(L,Maska1);
- % figure(2); imshow(L1);
- %
- %
- % Maska2=[1,-2,1; -2,4,-2; 1,-2,1];
- % L2=imfilter(L,Maska2);
- % figure(3); imshow(L2);
- %
- % level = graythresh(L2);
- % L3 = im2bw(L2,level);
- % figure;
- % imshow(L3);
- % L=imread('portret.jpg');
- % imshow (L), title('obraz zrodlowy');
- % h=ones(5)/25; %dzielenie przez sumę współczynników
- % L1=imfilter(L,h);
- % figure;
- % imshow(L1), title ('obraz bez powielania pikseli brzegowych');
- % L2=imfilter(L, h, 'replicate');
- % figure;
- % imshow (L2), title ('obraz z powielonymi pikselami brzegowymi');
- % L = imread('portret.jpg');
- % h = fspecial('unsharp');
- % L1 = imfilter(L,h,'replicate');
- % imshow(L);
- % figure, imshow(L1);
- %
- % h = fspecial('average');
- % L2 = imfilter(L,h,'replicate');
- % figure, imshow(L2);
- %
- % h = fspecial('gaussian');
- % L3 = imfilter(L,h,'replicate');
- % figure, imshow(L3);
- %
- % h = fspecial('laplacian');
- % L4 = imfilter(L,h,'replicate');
- % figure, imshow(L4);
- %
- % h = fspecial('motion');
- % L5 = imfilter(L,h,'replicate');
- % figure, imshow(L5);
- % L=imread('portret.jpg');
- % figure(1);
- % imshow(L);
- % L1=medfilt2(L, [5,5]);
- % L1=mat2gray(L1);
- % figure(2); imshow(L1);
- % L=imread('kwadrat.bmp');
- % figure(1);
- % imshow(L);
- % L1=medfilt2(L, [75,75]);
- % L1=mat2gray(L1);
- % figure(2); imshow(L1);
- % L=ones([16, 16])*256;
- % L(6:11, 6:11)=(0:43:256)'*ones([1 6]);
- % L(14,14)=0;
- % L=uint8(L);
- % figure(1);
- % imshow(L, 'InitialMagnification', 'fit');
- % L1=imnoise(L, 'salt & pepper', 0.3);
- % figure(2);
- % imshow(L1,'InitialMagnification', 'fit');
- % Maska=[3,3]
- % L2=nlfilter(L1, Maska, 'min(x(:))');
- % L2=mat2gray(L2);
- % figure(3); imshow(L2,'InitialMagnification', 'fit');
- % Maska=[10,10];
- % L3=nlfilter(L1, Maska, 'min(x(:))');
- % L3=mat2gray(L3);
- % figure(4); imshow(L3, 'InitialMagnification', 'fit');
- %
- % L=imread('Krakow_3.jpg','jpg');
- % L=rgb2gray(L);
- % L1=imnoise(L, 'salt & pepper', 0.9);
- % figure;
- % imshow(L1);
- %
- % L2=medfilt2(L1, [25,25]);
- % L2=mat2gray(L2);
- % figure(2); imshow(L2);
- % ----- lab 5 ----
- % [L1,map1]=imread('Victoire.tif');
- % L1=ind2rgb(L1,map1);
- % figure;
- % imshow(L1);
- % L1r=L1(:,:,1);
- % L1g=L1(:,:,2);
- % L1b=L1(:,:,3);
- % figure;
- % [x,y]=hist(L1r(:));
- % bar(y,x,1/255);
- % xlabel('Nasycenie koloru czerwonego','FontSize',13,'FontName','ArialCE');
- % ylabel('Ilość pikseli[/]','FontSize',13,'FontName','Arial CE');
- % L2r=histeq(L1r);
- % L2g=histeq(L1g);
- % L2b=histeq(L1b);
- % figure;
- % imshow(cat(3,L2r,L1g,L1b));
- % figure;
- % imshow(cat(3,L1r,L2g,L1b));
- % figure;
- % imshow(cat(3,L1r,L1g,L2b));
- % figure;
- % [x,y]=imhist(L2r(:));
- % bar(y,x,1/255);
- % xlabel('Nasycenie koloru czerwonego','FontSize',13,'FontName','ArialCE');
- % ylabel('Ilość pikseli[/]','FontSize',13,'FontName','Arial CE');
- % L1=imread('portret.jpg');
- % figure
- % imshow(zeros(800,800));
- % [r c] = size(L1);
- % [x,y] = meshgrid(0:c-1,0:r-1);
- % z = double(L1);
- % surfc(x,y,z);
- % axis([0 c 0 r 0 255])
- % L2 = imresize(L1,size(L1)/8,'nearest');
- % figure
- % imshow(zeros(800,800));
- % [r c] = size(L2);
- % [x,y] = meshgrid(0:c-1,0:r-1);
- % z = double(L2);
- % surfc(x,y,z);
- % axis([0 c 0 r 0 255])
- % colormap(jet)
- % L1 = imread('portret.jpg');
- % figure; imshow(L1);
- % L1 = double(L1)/255;
- % hold on
- % setbright = ['w = get(suwak,''Value''); L2 = L1; L2 = L2 + w; imshow(L2)'];
- % suwak = uicontrol('Style','Slider',...
- % 'Position',[10 40 25 400],...
- % 'Min',-1,'Max',1,'Value',0,...
- % 'Callback',setbright);
- L1 = imread('Krakow_3.jpg');
- figure; imshow(L1);
- L1 = double(L1)/255;
- hold on
- % r_img = L1;
- % r_img(:,:,[2 3]) = 0;
- g_img = L1;
- g_img(:,:,[1 3]) = 0;
- b_img = L1;
- b_img(:,:,[1 2]) = 0;
- setGreen = ['w = get(suwakGreen,''Value''); r_img = L1; r_img(:,:,[2 3]) + w; imshow(cat(3,r_img,g_img,b_img))'];
- suwakGreen = uicontrol('Style','Slider',...
- 'Position',[10 40 25 400],...
- 'Min',-1,'Max',1,'Value',0,...
- 'Callback',setGreen);
- % setRed = ['w = get(suwakRed,''Value''); L2 = L1; L2 = L2 + w; ;)'];
- % suwakRed = uicontrol('Style','Slider',...
- % 'Position',[50 40 25 400],...
- % 'Min',-1,'Max',1,'Value',0,...
- % 'Callback',setRed);
- %
- % setBlue = ['w = get(suwakBlue,''Value''); L2 = L1; L2 = L2 + w; imshow(L2)'];
- % suwak = uicontrol('Style','Slider',...
- % 'Position',[100 40 25 400],...
- % 'Min',-1,'Max',1,'Value',0,...
- % 'Callback',setBlue);
- %
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement