2018년 2월 26일 월요일

[python] opencv SIFT 함수 사용법

일반적으로 아나콘다에서 opencv설치시 이 함수는 포함이 안되어 있다.

먼저
https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

여기서


이파일을 다운 받는다. 
이 파일은 파이썬 3.5 에 contrib이 포함되어 있다. 

이 contrib 에 sift등의 함수들이 포함되어있다. 


conda uninstall opencv 및 
혹시  pip에 opencv-python이 깔려잇으면 지워준다. 
pip uninstall opencv-python 으로.. 

다운 받은 폴더에 가서 

pip install  파일명 

으로 설치를 한다. 

혹시 import cv2  에서  numpy 관련 에러 나올시 

pip install --upgarde numpy
 
로 업글한다. 


[WPF] Hidden window instead of closing window

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
Visibility = Visibility.Collapsed;
}

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
this.Hide();
}

2018년 2월 21일 수요일

docfx 사용법

1.비주얼 스튜디오 내에서 폴더 만들고,

toc.md를 만들어서 헤드 상단 메뉴를 추가할 수 있다.
(md파일은 빌드시 자동으로 html파일로 바뀐다. )

추가한 폴더에 roc.md 에는 다음과 같이 사이드 메뉴를 추가할 수 있다.
메뉴이름. 바인딩 파일 (같은 폴더)
#[mmm1](menu1.md)
#[mmm2](menu2.md)



2.그 후에는 탑레벨 폴더의
toc.yml에 다음을 추가해 준다.


- name: Articles
  href: articles/
- name: API Documentation
  href: obj/api/
- name: ScondMenu 상당 바 메뉴에서 표시될 이름
  href: Second/  폴더이름
  homepage: api/index.md


탑레벨의  Index.md파일은 홈페이지 대문 페이지 이다. 



3. 추가한 폴더에 메뉴 대문용 페이지파일은 만든다. 
ex: intro.md

 
4. 빌드후 _site폴더에 toc.html 을 편집하자. 

여기에 보면 


 
   
     
       
       
     
   
   
     
          
         
           
  •               Articles
               
               
  •               API Documentation
               
               
  •               ScondMenu
               
             
         
       
     

    저부분이 멋대로 써져있는데 이부분은 _site/Second 폴더안의 파일로 바꿔 줘야 한다. 

    bref는 대문용 페이지를 , name 은 toc.html로 바꾼다. 

    그러면 끝
    r

    2018년 2월 18일 일요일

    task cancelation

    void Main()
    {
        Thread thread = null;
    
        Task t = Task.Run(() => 
        {
            //Capture the thread
            thread = Thread.CurrentThread;
    
            //Simulate work (usually from 3rd party code)
            Thread.Sleep(1000);
    
            //If you comment out thread.Abort(), then this will be displayed
            Console.WriteLine("Task finished!");
        });
    
        //This is needed in the example to avoid thread being still NULL
        Thread.Sleep(10);
    
        //Cancel the task by aborting the thread
        thread.Abort();
    }

    2018년 1월 29일 월요일

    바이트 <-> 더블 간 변형 방법

    https://stackoverflow.com/questions/7832120/how-to-convert-a-byte-array-to-double-array-in-c

    바이트 <-> 더블 간 변형 방법

    emgucv stitch

      Mat i1 = new Mat("D:/New folder/images/Fit01.jpg", LoadImageType.Color);
                Mat i2 = new Mat("D:/New folder/images/Fit02.jpg", LoadImageType.Color);
                Mat i3 = new Mat("D:/New folder/images/Fit02.jpg", LoadImageType.Color);
                using (VectorOfMat vmsrc = new VectorOfMat(i1, i2, i3))
                {
                    Image<Bgr, byte> res = new Image<Bgr, byte>(1000, 750);
                    Mat result = new Mat();
                    Stitcher stitcher = new Stitcher(false);
                    stitcher.Stitch(vmsrc, result);
                    ImageViewer.Show(result);
                } 

    2018년 1월 11일 목요일

    Paket에 대해

    paket은 오픈소스 프로젝트로 3년정도 되었다.

    F#으로 작성 되었지만, C#에서도 똑같이 동작한다.

    목적은 복잡한 Dependency를 편하게 관리하도록 하는것이다.

    Nuget과 목적도 같고, Add-on 성격을 지닌고 있다.

    **
    In other words, you can have a dependency on a given file from a specific commit on GitHub. For example, you could have a dependency on the SqlMapper.cs in the Dapper project, instead of downloading a whole NuGet package. Or you could share a single cs file across multiple solutions without the need to have a private NuGet server to share them.

    Nuget의 경우는 만약에 참조중인 프로젝트와 참조한 프로젝트가 같은 dll을 참조하고있고 버전이 다를경우는, 하위버전으로 다 통일 시켜버린다. 


     Paket은 3대의 파일로 이루어져있다. 

    1.  paket.dependencies : 각각의 프로젝트의  dependency에 대한 정보. 
    2. paket.lock : dependency 간의 관계 
    3. paket.references  : 유저가 수정 할 수 있는 파일 

    https://cockneycoder.wordpress.com/2017/08/07/getting-started-with-paket-part-1/