전체보기 293

grep으로 파일 내용 검색

m 파일 , txt 파일, log 파일 등에 포함된 문자 검색 가능특정 실험을 수행한 소스 코드를 찾을 때 유용 ex) 실험 결과를 _save.jpg로 저장했는데, 이 것을 실험한 소스를 찾고 싶을때, 소스는 /data/experiments 안에 있다는 것을 아는 상황 터미널에서 아래 명령어 입력grep -r "_save.jpg" /data/experiments r option : recursive하게 찾는 옵션 참고 http://askubuntu.com/questions/55325/how-to-use-grep-command-to-find-text-including-subdirectories

연구관련/Ubuntu 2015.12.04

OpenCV 3.0 + Visual Studio 2013 으로 Compile

OpenCV 3.0이 공개되었다.http://opencv.org/http://docs.opencv.org/3.0.0/https://github.com/itseez/opencv 튜토리얼http://docs.opencv.org/3.0.0/d9/df8/tutorial_root.htmlhttp://docs.opencv.org/3.0.0/d9/d97/tutorial_table_of_content_features2d.html 기존 버젼의 경우 주로 이미 빌드된 binary를 사용하고,OpenCV 내부 소스 변경이 필요한 경우 가끔 빌드했었는데,아래 2가지 이유 때문에, 내 입장에선 이번엔 직접 빌드하는 것이 필수가 됨. 1) OpenCV 3.0의 경우 Visual Studio 2012, 2013 용으로 바이너리 제..

[MATLAB] cell 관련 이것저것 (2) - 계층 구조 cell

* 아래 링크에서 계층 구조 cell로 되어 있는 경우http://zacurr.tistory.com/544 * 비계층 구조 cell data access에 비해 훨씬 직관적임 1. cell array 저장 data= cell(1,3);data{1} = cell(10,1); % 계층 구조로 cell 생성data{2} = cell(10,1);data{3} = cell(10,1); 중략 save('data_file.mat','data'); 2. cell array 로드 load('data_file.mat')(data라는 이름으로 로드 됨) 3. cell column copy data 는 1x3 cell 내부에 10x1 cell 이 3개 있음 이 중 2번째 column을 다른 변수로 저장하고 싶을 경우 a=da..

[MATLAB] 여러개의 cell, 하나로 합치기 (계층/비계층 구조 cell)

아래 10x1 cell이 3개가 있다고 가정 d=cell(10,1); e=cell(10,1); f=cell(10,1); .. (중략) (값입력) .. 3개 cell을 하나의 cell로 합치기 1) 계층 구조 cell로 합치기 g = {d e f}; g = 1x3 cell 이고 아래와 같이 각 원소에 계층적으로 다시 cell이 들어 있음 * 장점 : cell 분리 , logic 연산 등을 위한 접근이 편하다 2) 비계층 구조 cell로 합치기 g = {d{:}; e{:}; f{:}} => 3x10 cellg = {d{:}; e{:}; f{:}}' => 10x3 cell * 10x3 cell 일 때 * 장점 : data를 눈으로 바로 확인 가능

[MATLAB] textscan 사용 시 header 부분 혹은 특정 부분 skip하여 읽기

* 참고 : textscan 파일에 쓰여진 문자열 읽기http://zacurr.tistory.com/411 * Header 부분 skip 하여 읽기아래와 같은 txt 파일의 내용을 읽는다고 가정했을 때,상위 4줄 즉, header는 skip하고 , 5번째 줄의 본문부터 읽고 싶을 경우 test.txt Reading the database...972 images loaded.DB name : samplesCurrent Mode:6[1/25]-(1)GS3_201845.2_445889.6_1_0.jpgA009151.885283[1/25]-(2) GS3_201845.2_445889.6_1_0.jpgA002291.528227[1/25]-(3) GS3_201845.2_445889.6_1_0.jpgA007541.49..

[MATLAB] cell 관련 이것저것 (1) - 비계층 구조 cell

* 아래 링크에서 비계층 구조 cell로 되어 있는 경우http://zacurr.tistory.com/544 1. cell array 저장 data= cell(100,5); 중략 save('data_file.mat','data'); 2. cell array 로드 load('data_file.mat')(data라는 이름으로 로드 됨) 3. cell column copy data 는 100x5 cell이 중 n번째 column을 다른 변수로 저장하고 싶을 경우 a=data(:,n); (a는 data의 n번째 column이 저장된 100x1 cell) * mat으로 저장하고 싶을 경우a=[data{:,n}]; 4. cell column sum sum_value = sum([a{:}]);혹은sum_value =..

[MATLAB] figure를 이미지 파일로 저장

figure(1);imshow(img);hold on;h = line([xa' ; xb'], [ya' ; yb']) ;set(h,'linewidth', 2, 'color', 'b') ; saveas(gcf,'img_line.jpg'); 참고http://kr.mathworks.com/help/matlab/ref/savefig.html 저장 이미지 해상도를 조절하고 싶을 경우print 함수 사용http://kr.mathworks.com/help/matlab/ref/print.html?searchHighlight=print * 저장된 이미지에서 white margin 을 없애고 싶은 경우http://tipstrickshowtos.blogspot.kr/2010/08/how-to-get-rid-of-white-m..