2D Gaussian filter는 Separable 하기 때문에


이를 이용하면 다음과 같이 연산량을 줄일 수 있다.


n addition to being circularly symmetric, the Gaussian blur can be applied to a two-dimensional image as two independent one-dimensional calculations, and so is termed separable. That is, the effect of applying the two-dimensional matrix can also be achieved by applying a series of single-dimensional Gaussian matrices in the horizontal direction, then repeating the process in the vertical direction. In computational terms, this is a useful property, since the calculation can be performed in O\left(w_\text{kernel}  w_\text{image}  h_\text{image}\right) + O\left(h_\text{kernel}  w_\text{image}  h_\text{image}\right) time (where his height and w is width; see Big O notation), as opposed to O\left(w_\text{kernel} h_\text{kernel} w_\text{image} h_\text{image}\right) for a non-separable kernel.


출처 : http://en.wikipedia.org/wiki/Gaussian_blur


반면 Laplacian은 non-separable하기 때문에 연산량이 많다.


이는 LoG를 DoG로 approximation 하는 이유이기도 하다.


출처 : http://math.stackexchange.com/questions/132183/laplacian-2d-kernel-is-it-separable


Log -> DoG approximation 참고

http://www.cse.psu.edu/~rcollins/CSE486/lecture11_6pp.pdf

http://en.wikipedia.org/wiki/Laplacian_of_Gaussian#The_Laplacian_of_Gaussian

http://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf


http://blog.naver.com/PostView.nhn?blogId=aik1919&logNo=140068508527

http://dong3640.com.ne.kr/laboratory/imageprocessing/2nd-Log.htm

http://fourier.eng.hmc.edu/e161/lectures/gradient/node10.html

http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm

Posted by 우주여행가
,

%%# Read an image
I = imread('peppers.png');
%# Create the gaussian filter with hsize = [5 5] and sigma = 2
G = fspecial('gaussian',[5 5],2);
%# Filter it
Ig = imfilter(I,G,'same');
%# Display
imshow(Ig)

Posted by 우주여행가
,

http://www.mathworks.co.kr/kr/help/images/ref/imnoise.html


imnoise

Add noise to image

Syntax

J = imnoise(I,type)
J = imnoise(I,type,parameters
J = imnoise(I,'gaussian',m,v)
J = imnoise(I,'localvar',V)
J = imnoise(I,'localvar',image_intensity,var)
J = imnoise(I,'poisson')
J = imnoise(I,'salt & pepper',d)
J = imnoise(I,'speckle',v)

Description

J = imnoise(I,type) adds noise of a given type to the intensity image Itype is a string that can have one of these values.

Value

Description

'gaussian'

Gaussian white noise with constant mean and variance

'localvar'

Zero-mean Gaussian white noise with an intensity-dependent variance

'poisson'

Poisson noise

'salt & pepper'

On and off pixels

'speckle'

Multiplicative noise

J = imnoise(I,type,parametersDepending on type, you can specify additional parameters to imnoise. All numerical parameters are normalized; they correspond to operations with images with intensities ranging from 0 to 1.

J = imnoise(I,'gaussian',m,v) adds Gaussian white noise of mean m and variance v to the image I. The default is zero mean noise with 0.01 variance.

J = imnoise(I,'localvar',V) adds zero-mean, Gaussian white noise of local variance V to the image IV is an array of the same size as I.

J = imnoise(I,'localvar',image_intensity,var) adds zero-mean, Gaussian noise to an image I, where the local variance of the noise,var, is a function of the image intensity values in I. The image_intensity and var arguments are vectors of the same size, andplot(image_intensity,var) plots the functional relationship between noise variance and image intensity. The image_intensity vector must contain normalized intensity values ranging from 0 to 1.

J = imnoise(I,'poisson') generates Poisson noise from the data instead of adding artificial noise to the data. If I is double precision, then input pixel values are interpreted as means of Poisson distributions scaled up by 1e12. For example, if an input pixel has the value5.5e-12, then the corresponding output pixel will be generated from a Poisson distribution with mean of 5.5 and then scaled back down by 1e12. If I is single precision, the scale factor used is 1e6. If I is uint8 or uint16, then input pixel values are used directly without scaling. For example, if a pixel in a uint8 input has the value 10, then the corresponding output pixel will be generated from a Poisson distribution with mean 10.

J = imnoise(I,'salt & pepper',d) adds salt and pepper noise to the image I, where d is the noise density. This affects approximatelyd*numel(I) pixels. The default for d is 0.05.

J = imnoise(I,'speckle',v) adds multiplicative noise to the image I, using the equation J = I+n*I, where n is uniformly distributed random noise with mean 0 and variance v. The default for v is 0.04.

    Note   The mean and variance parameters for 'gaussian''localvar', and 'speckle' noise types are always specified as if the image were of class double in the range [0, 1]. If the input image is of class uint8 or uint16, the imnoise function converts the image todouble, adds noise according to the specified type and parameters, and then converts the noisy image back to the same class as the input.

Class Support

For most noise types, I can be of class uint8uint16int16single, or double. For Poisson noise, int16 is not allowed. The output image J is of the same class as I. If I has more than two dimensions it is treated as a multidimensional intensity image and not as an RGB image.

Examples

I = imread('eight.tif');
J = imnoise(I,'salt & pepper',0.02);
figure, imshow(I)
figure, imshow(J)

Posted by 우주여행가
,

http://hanb.co.kr/exam/1632

Posted by 우주여행가
,

http://psi.cse.tamu.edu/people/ricardo-gutierrez-osuna/

Posted by 우주여행가
,

http://cmp.felk.cvut.cz/cmp/software/stprtool/

Posted by 우주여행가
,

출처 : http://cafe.naver.com/opencv/1837


컴퓨터 비전, 영상처리 관련해서 여러분들이 좋다 라고 알고 계시는,

또 여러분의 연구실에서 여기가 좋다라고 흔히들 하는
좋은 학회와 저널에 대한 연구원들의 지식을 공유하려고 합니다.

Impact Factor 까지 알고 계시면 함께 적어주시면 더 좋고요~

꼭 CV 여기만 아니더라도 특정 분야에 관련된 Workshop 라도 좋습니다.

제가 최고라고 생각하는 곳은 바로 아래 CV 학회 리스트를 모아 놓은 사이트입니다.

최근까지도 업데이트도 되고요. 이 곳 하나만 알고 있으면 든든합니다.

Computer Vision Conferences List
http://iris.usc.edu/Information/Iris-Conferences.html 
CV Conference 리스트입니다. 계속 업데이트됩니다. 메이저급 구분도 되어 있으니 정말 추천~!!

Computer Vision Journal List & Impact Factor

http://kucg.korea.ac.kr/publication/SCI_table.shtml
CV 저널명과 Impact Factor 가 나와 있어서 좋습니다. 그런데 IF 가 업데이트가 안되는 것 같아요.

CVPR

IEEE Conference on Computer Vision and Pattern Recognition


ICCV

IEEE International Conference on Computer Vision

 


IJCV

International Journal Of Computer Vision

 
SIGCHI
http://sigchi.org
Special Interest Group on Computer-Human Interaction

SIGGRAPH

http://www.siggraph.org


UIST
ACM Symposium on User Interface Software and Technology

ISMAR
IEEE and ACM International Symposium on Mixed and Augmented Reality

'연구관련' 카테고리의 다른 글

패턴인식 자료 참고  (0) 2013.03.25
Statistical Pattern Recognition Toolbox (matlab)  (0) 2013.03.25
ECCV 2012 Oral Presentation Video Lectures  (0) 2012.11.13
유명대학 온라인 무료 강의  (0) 2012.05.30
Video Google 데모  (0) 2012.05.25
Posted by 우주여행가
,

input.txt를 output.txt 로 통채로 카피하고 싶을때  

(파일의 종류는 무엇이 되든 상관없음. 사진이든 뭐든 상관없음))


copyfile('input.txt','output.txt');


주의, copyfile의 두 인자는 파일의 이름 (m파일과 같은 폴더에 있는 경우) 

       혹은 주소를 넣어주어야 한다.




COPYFILE   Copy file or directory.

    [SUCCESS,MESSAGE,MESSAGEID] = COPYFILE(SOURCE,DESTINATION,MODE) copies

    the file or directory SOURCE to the new file or directory DESTINATION.

    Both SOURCE and DESTINATION may be either an absolute pathname or a

    pathname relative to the current directory. When the MODE is set to

    'f', COPYFILE copies SOURCE to DESTINATION, even when DESTINATION is

    read-only. The DESTINATION's writable attribute state is preserved. 

 

    [SUCCESS,MESSAGE,MESSAGEID] = COPYFILE(SOURCE) attempts to copy SOURCE

    to the current directory.

 

    [SUCCESS,MESSAGE,MESSAGEID] = COPYFILE(SOURCE, DESTINATION) attempts to

    copy SOURCE to DESTINATION. If SOURCE constitutes a directory or

    multiple files and DESTINATION does not exist, COPYFILE attempts to

    create DESTINATION as a directory and copy SOURCE to DESTINATION. If

    SOURCE constitutes a directory or multiple files and DESTINATION exists

    as a directory, COPYFILE attempts to copy SOURCE to DESTINATION. If

    SOURCE constitutes a directory or multiple files and none of the above

    cases on DESTINATION applies, COPYFILE fails.

 

    [SUCCESS,MESSAGE,MESSAGEID] = COPYFILE(SOURCE,DESTINATION,'f') attempts

    to copy SOURCE to DESTINATION, as above, even if DESTINATION is

    read-only. The status of the writable attribute of DESTINATION will be

    preserved.

 

    INPUT PARAMETERS:

        SOURCE:      1 x n string, defining the source file or directory.

        DESTINATION: 1 x n string, defining destination file or directory.

                     The default is the current directory. 

        MODE:        character scalar defining copy mode.

                     'f' : force SOURCE to be written to DESTINATION. If

                     omitted, COPYFILE respects the current writable status

                     of DESTINATION. 

 

    RETURN PARAMETERS:

        SUCCESS:     logical scalar, defining the outcome of COPYFILE.

                     1 : COPYFILE executed successfully. 0 : an error

                     occurred.

        MESSAGE:     string, defining the error or warning message.

                     empty string : COPYFILE executed successfully. message

                     : an error or warning message, as applicable.

        MESSAGEID:   string, defining the error or warning identifier.

                     empty string : COPYFILE executed successfully. message

                     id: the MATLAB error or warning message identifier

                     (see ERROR, MException, WARNING, LASTWARN).

 

    NOTE 1: Except where otherwise stated, the rules of

            the underlying system on the preservation of attributes are

            followed when copying files and directories.

    NOTE 2: The * wildcard is supported in the filename or extension.

 

    See also cd, delete, dir, fileattrib, mkdir, movefile, rmdir.


    Reference page in Help browser

       doc copyfile

Posted by 우주여행가
,

- 특정 폴더 안의 모든 파일을 저장할 때


cmd를 실행시키고 해당 폴더로 directory 이동 후


dir /s/b >list.txt


(list.txt에 저장된다.)


- 특정 폴더 안의 특정 확장자에 해당하는 파일을 저장할 때


cmd를 실행시키고 해당 폴더로 directory 이동 후


dir *.jpg /s/b >list.txt


(폴더 안의 jpg 파일만 골라서 list.txt에 저장)


Posted by 우주여행가
,

img.txt 라는 파일에 아래 내용이 저장되어 있다고 하자.


D:\DB\oxford\jpg\bark_img1.jpg

D:\DB\oxford\jpg\bark_img2.jpg

D:\DB\oxford\jpg\bark_img3.jpg

D:\DB\oxford\jpg\bark_img4.jpg

D:\DB\oxford\jpg\bark_img5.jpg



load(img.txt) 를 사용하면 에러 발생 (숫자만 읽어들일 수 있다고 한다)


fopen , fread 혹은 fscanf 해서 한라인씩 읽어들이려니 설정해줄 것도 많고 귀찮다. 


조금 잘못하면 에러 난다...


textscan 함수를 사용해보자.


fp = fopen('img.txt','r');

imFilelist = textscan(fp,'%s')


여기서 imFilelist는 cell 형식


cnt = length(imFilelist{1});  


이렇게하면 cnt에는 전체 string의 수가 저장된다.


for i = 1: cnt

%    imFile = cell2mat(imFilelist{1}(i)); % 뒤에 {} 괄호로 쓰면 cell2mat 안해도 되는 듯... 

    imFile = imFilelist{1}{i};

    ....

end


이렇게 하면 list에서 하나하나 파일을 꺼내올 수 있다.


* 참고로 엑셀파일을 불러올때는 xlsread 함수가 유용


* 참고로 여러 유형의 data가 섞여 있을 때는 아래와 같이 형식 지정해서 읽을 것

    fp = fopen(matched_ref_list{i},'r');

    imfilelist = textscan(fp,'%s\t%f');

 아래와 같은 식으로 access 가능

imfilelist{1}{j}

imfilelist{2}{j}




TEXTSCAN Read formatted data from text file or string.

    C = TEXTSCAN(FID,'FORMAT') reads data from an open text file identified

    by FID into cell array C. Use FOPEN to open the file and obtain FID. 

    The FORMAT is a string of conversion specifiers enclosed in single 

    quotation marks. The number of specifiers determines the number of 

    cells in the cell array C.  For more information, see "Format Options."

    

    C = TEXTSCAN(FID,'FORMAT',N) reads data from the file, using the FORMAT

    N times, where N is a positive integer. To read additional data from 

    the file after N cycles, call TEXTSCAN again using the original FID.

 

    C = TEXTSCAN(FID,'FORMAT','PARAM',VALUE) accepts one or more

    comma-separated parameter name/value pairs. For a list of parameters 

    and values, see "Parameter Options."

 

    C = TEXTSCAN(FID,'FORMAT',N,'PARAM',VALUE) reads data from the 

    file, using the FORMAT N times, and using settings specified by pairs

    of PARAM/VALUE arguments.

 

    C = TEXTSCAN(STR,...) reads data from string STR. You can use the 

    FORMAT, N, and PARAM/VALUE arguments described above with this syntax.

    However, for strings, repeated calls to TEXTSCAN restart the scan from 

    the beginning each time. (To restart a scan from the last position, 

    request a POSITION output.  See also Example 3.)

 

    [C, POSITION] = TEXTSCAN(...) returns the file or string position at 

    the end of the scan as the second output argument. For a file, this is 

    the value that FTELL(FID) would return after calling TEXTSCAN. For a 

    string, POSITION indicates how many characters TEXTSCAN read.  

Posted by 우주여행가
,