Image Segmentation 1 What is Image Segmentation Image

- Slides: 1

Image Segmentation 1. What is Image Segmentation? Image Segmentation is extracting computer data from some image and distinguishing noise and data. Segmentation is important because It makes many computer design possible. Image Segmentation uses variational method to get new image. We repeat variational method to get rid of noise in the image. We can control the variable to get clear image. S 2016160135 물리학과 마 현 준 3. Image Segmentation Result with Different Images. Image ‘book. gif’ data *Lambda=2 2. Matlab Cord This is cord for Image Segmentation programmed by Matlab. Following cord after % is a comment on the code clear all; clf; hold on % Initialization cord. hold on new axis. f=imread('book. gif'); % Extract ’book. gif’ f=double(f); % Doubles all data of f. f 0=(f-min(f)))/(max(f))-min(f))); % f 0 : Normalization of f which is it’s range is 0 to 1 f 0=2*f 0 -1 %new f 0 : Standardization of f which is it’s range is -1 to 1 Nx=size(f, 1); Ny=size(f, 2); % Define Nx, Ny as size of f f 0=-f 0; % Turn over image. f 0=f 0+0. 3*(rand(Nx, Ny)-0. 5); h=1. 0; eps 2=h^2 x=linspace(-0. 5*h, h*(Nx+0. 5), Nx+2); % x’s range , with ghost cell. y=linspace(-0. 5*h, h*(Ny+0. 5), Ny+2); % y’s range , with ghost cell. mesh(f 0') % Plot f 0, as 3 dimension image. u(1: Nx+2, 1: Ny+2)=-1; u(2: Nx+1, 2: Ny+1)=f 0; % Define u. dt=0. 1; v=u; lambda=2; for k=1: 100 % repeat the below cord 100 times. c 1 = sum(f 0. *(1. 0+u(2: Nx+1, 2: Ny+1)))). . . % Define c 1. /sum(1. 0+u(2: Nx+1, 2: Ny+1))); c 2 = sum(f 0. *(1. 0 -u(2: Nx+1, 2: Ny+1)))). . . % Define c 2. /sum(1. 0 -u(2: Nx+1, 2: Ny+1))); for i=2: Nx+1 for j=2: Ny+1 v(i, j)=u(i, j)+dt/h^2*(u(i-1, j)+u(i+1, j). . . % Changing all data u into v +u(i, j-1)+u(i, j+1)-4*u(i, j)). . . to use variational method +dt*u(i, j)*(1+u(i, j))*(1 -u(i, j))/eps 2. . . -dt*lambda*((1. 0+u(i, j))*(f 0(i-1, j-1)-c 1)^2. . -(1. 0 -u(i, j))*(f 0(i-1, j-1)-c 2)^2); end u=v; % change v into u as new data. u(1, : )=u(2, : ); u(Nx+2, : )=u(Nx+1, : ); . % Make ghost cell’s data into first cell’s data u(: , 1)=u(: , 2); u(: , Ny+2)=u(: , Ny+1); mesh(x, y, u') % Plot u, 3 dimension image. axis([x(1) x(end) y(1) y(end) -1 1]) view(-37, 14) pause(0. 1) end Image ‘book. gif’ data *Lambda=5 Image ‘illuminati. gif’ data *Lambda=2 4. Reference [1] 25시간만에 배우는 머신러닝 예제