This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

*/

Window 환경에서 Python, OpenCV 설치하기

설치할 PC환경

OS : Windows 10, 64bit

설치순서

아래와 같이 Python, OpenCV, cmake, dlib순으로 설치한다.

Python설치

먼저 Python 홈페이지에서 Python 실행 파일을 현재 OS에 맞춰 다운받는다.

최신버전이 아니라 특정 버전이 필요할 경우 페이지 아래쪽에서 필요버전을 찾아 다운로드할 수 있다.

여기서는 Python 3.6을 설치하기위해 3.6버전대에서 마지막인 3.6.8버전의 실행 파일을 다운 받아 실행 시킨다.

설치화일에서 우선 아래쪽 "Add Python 3.6 to PATH"를 체크하고, 디폴트로 설치할 경우 "Install Now"를 클릭하고, 무엇을 어떻게 설치하는지 알고싶거나 설치 디렉토리를 변경 혹은 설치항목을 변경하고자할 경우 아래와 같이 "Customize installation"을 클릭한다.

부가적인 사항들을 선택한다. 디폴트로 모든 사항 체크.
다음을 선택하면 고급옵션이 나온다. 여기에서 추가적으로 아래 붉은색으로 표기된 것을 체크해준다. 설치 디렉토리를 변경하고자할 경우 녹색으로 표기된 부분에 원하는 설치 디렉토리를 지정해 준다.
"Install"버튼을 클릭하면 설치가 진행되며, 앞에서 선택한 것이 하나하나 설치된다.
설치가 완료되면 아래와 같이 설치가 완료되었다고 표출된다. "Close"버튼을 누르는 것으로 설치는 다 끝난다.

설치가 완료된후 윈도우 키를 눌러보면 메뉴바에 아래와 같이 Python 3.6이 설치된 것을 볼 수 있다.
Pyphon을 사용하기 위해서는 메뉴에서 IDLE를 실행시키거나, 명령프롬프트(CMD)에서  "python"을 쳐도 실행된다.

OpenCV설치

cmd창에서 pip명령으로 opencv 라이브러리를 설치한다.
pip install opencv-contrib-python


cmake설치

dlib를 설치하기위해서는 먼저 cmake를 설치해야한다
. cmake가 설치되지 않으면 dlib설치시 cmake를 설치하라는 메세지가 나온다.
pip install cmake

dlib설치

pip install dlib


내 PC환경에서 dlib 설치시 위와 같은 오류가 발생했다.

    NMake Makefiles
      does not support platform specification, but platform
        x64
      was specified.

해결 방법 1. 새로운 cmake를 설치
     기존 cmake를 제거 : pip uninstall cmake
     cmake-3.16.2-win64-x64.msi를 다운받아 설치한다.
     환경 설정의 PATH설정에서 새로 설치한 cmake의 PATH를 최상단으로 옮긴다.

   pip install dlib를 해본다.
  ㅡ.ㅡ 똑같다. 실패.

해결 방법 2.
     MS Visual Studio Community Edition을 설치하고 cmake파일 위치를 PATH로 설정

해결 방법 3.
      pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl

     ref : https://stackoverflow.com/questions/48624415/how-to-fix-cmake-error-in-cmakelists-txt-generator-nmake-makefiles-does-not-sup

참조