과제 제안서 쓸 때, 통계자료 등 을 구하기가 참 어렵다
이럴때 사용하자..

삼성 경제 연구소
http://www.seri.org/

LG 경제 연구원
http://www.lgeri.com/

부품소재통계 종합 정보망
http://www.mctnet.org/
복소수 1+1i 가 주어졌을때

>> A=1+1i;                  %복소수
>> mag=abs(A)          %복소수의 크기
>> phase=angle(A)     %복소수의 위상 (rad)
>> reA=mag*exp(i*pahse)  %다시 복소수 만들기
http://liverex.tistory.com/313 참고
윈도우7 32bit 에서 메모리 3기가 이상 인식해서 사용 할 수 있도록 해주는 프로그램
matlab 에서 gray image 는  class 가(즉, 변수종류가) unit8 인 변수에 저장된다.

intArray = uint8(array)

ex)

sample =uint8([  41   42   68  126
                        56   87  110  125
                       101  123  113  117
                        88  102   74  102]);
imshow(sample);

3차원 배열의 크기를 가지는 RGB (color) image 를
2차원 배열의 크기를 가지는 gray image 로 변환한다.

ex)

peppers_rgb=imread(peppers.png');    % peppers_rgb -> 384x512x3 크기를 가지는 3차원 배열
peppers_gray=rgb2gray(peppers_rgb);    % peppers_gray -> 384x512    크기를 가지는 2차원 배열
figure
subplot(2,1,1); imshow(peppers_rgb);
subplot(2,1,2); imshow(peppers_gray);

matlab 을 이용하여
Target image 에서 template image 의 NCC (normalized cross correlation) 분석

normxcorr2  명령을 사용하여 NCC의 수행이 가능하다.


ex)

clear all; clc; close all;

%% 이미지가 너무 크므로 작게 자르고 template 과 scene image 를 분리
template = rgb2gray(imread('onion.png'));
scene = rgb2gray(imread('peppers.png'));

rect_template = [111 33 65 58];
rect_scene = [163 47 143 151];
template = imcrop(template,rect_template);
scene = imcrop(scene,rect_scene);

figure, imshow(template)
figure, imshow(scene)
%% NCC
c = normxcorr2(template,scene);
figure, surf(c), shading flat
%%
[max_c, imax] = max(abs(c(:)));
[row_peak, column_peak] = ind2sub(size(c),imax);

row_begin = row_peak-size(template,1)+1;
row_end   = row_peak;
column_begin = column_peak-size(template,2)+1;
column_end   = column_peak;

recovered_template = scene;
recovered_template(row_begin:row_end,column_begin:column_end) = template;

recovered_template(row_begin:row_end ,column_begin)=0;
recovered_template(row_end           ,column_begin:column_end)=0;
recovered_template(row_begin:row_end ,column_end)=0;
recovered_template(row_begin,column_begin:column_end)=0;


figure, imshow(recovered_template)




 

 

matlab 에서 imread 명령을 사용하여
color image 를 불러 올 수 있으며
그 결과는 R,G,B 각각에 대한 0~255 의 값을 가지는 intensity 로 표현된다.


ex)

clear all; clc; close all;
color_image=imread('onion.png'); % color image 를 불러온다.
                                 % 아래와 같이 3차원 행렬로 저장된다
                                 % (:,:,1)  : Red
                                 % (:,:,2)  : Green
                                 % (:,:,3)  : Blue

r=color_image; r(:,:,[2 3])=0;   % Red   요소만 남기고 모두 0으로 만든다.
g=color_image; g(:,:,[1 3])=0;   % Green 요소만 남기고 모두 0으로 만든다.
b=color_image; b(:,:,[1 2])=0;   % Blue  요소만 남기고 모두 0으로 만든다.

subplot(2,3,2); imshow(color_image);
subplot(2,3,4); imshow(r);
subplot(2,3,5); imshow(g);
subplot(2,3,6); imshow(b);

아래 그림으로 간단히 설명 된다.

'[old 정리중] study > matlab' 카테고리의 다른 글

MATLAB으로 Microsoft Kinect 사용하기  (0) 2013.08.17
복소수의 변환 abs, angle, exp()  (0) 2011.07.19
dot ( dot(A,B) )  (0) 2011.06.21
sum ( sum(X) , sum(X,DIM) )  (0) 2011.06.21
matlab 코드 수행시간 측정  (1) 2011.05.19
내일은 비 - 부활
내 머리속의 지우개 OST 중...

'[old 정리중] entertainment > music' 카테고리의 다른 글

선데이 브런치 - 200 Km/h  (0) 2011.10.09
필연 - 행복해야되  (6) 2011.08.03
Cassie - Not What Love Is  (0) 2011.06.10
만약 A 와 B 가  같은 크기의 (n by n) 정방 행렬 이라면,

A의 n번째 열과 B의 n번째 열의 dot product 가 이루어져
결과는 (1 by n) 의 vector 가 만들어진다.

ex) A=[a  b               B=[e  f
           c  d];                 g  h];

일 때,

dot(A,B) 의 결과는  [ e*conj(a) + g*conj(c), f*conj(b) + h*conj(d)]


즉, [   [a  c][e    ,   [b  d][f       ]  의 결과가 된다.
                   g]                 h]

+ Recent posts