--- title: 'anaconda Opencv4.5 環境架設(Windows 10)' disqus: hackmd --- anaconda Opencv4.5 環境架設(Windows 10) === [TOC] ## 1. Anaconda 下載與安裝 [Anaconda下載](https://www.anaconda.com/products/individual#windows)  增加環境變數至系統 選取環境變數   [環境變數參考網站](https://ithelp.ithome.com.tw/articles/10218384) ## 2. 使用 Anaconda Prompt(anaconda3) 創建 python 環境 搜尋 Anacoda 打開下方 terminal  Anaconda Prompt ### 創建 python opencv4.5 環境 :::info 下列創建指令 opencv4.5 是名稱可任意取名 ::: 可以框住如下命令在使用ctrl+c ,然後在 terminal 上按下右鍵即可貼上 框住  按下右鍵貼上  ```gherkin= conda create -n opencv4.5 python=3.8 ```  按下y安裝基本套件 檢查目前電腦安裝的 conda 虛擬環境列表 ```gherkin= conda env list ``` 可看到剛剛建立的環境名稱  若要移除環境可使用下列指令 ```gherkin= conda env remove -n opencv4.5 ``` ### 進入環境並安裝相關套件 ```gherkin= conda activate opencv4.5 ``` 若進入成功可看到命令列旁邊由 base 變為 opencv4.5  查詢opencv 版本 ```gherkin= pip install opencv-python== ``` 底下會顯示版本,需安裝 4.5.1.48  安裝相關套件 ```gherkin= conda install -c conda-forge jupyterlab -n opencv4.5 pip install opencv-python==4.5.1.48 pip install opencv-contrib-python==4.5.1.48 pip install matplotlib pip install sklearn pip install scikit-image pip install imutils pip install tk pip install easygui pip install numpy pip install pandas pip install pyinstaller pip install openpyxl ``` 若要移除opencv更新版本可參考如下指令 ```gherkin= pip uninstall -y opencv-contrib-python pip uninstall -y opencv-python ``` ## 3. 下載 git bash 與 source code [網址](https://git-scm.com/downloads)  安裝後到此 [github](https://github.com/masteree108?tab=repositories) 下載 source code,請參考下列步驟 到要下載資料的位置按下右鍵,選擇 git bash here  會彈出 terminal ,輸入如下指令下載 source code ex: 貼上後按下 enter  會開始下載 source code 直到完成  關於 ORB 特徵擷取ID 比對 ```gherkin= git clone https://github.com/masteree108/ORB_personID_UBU18.git ``` 關於 SIFT 特徵擷取ID 比對 ```gherkin= git clone https://github.com/masteree108/SIFT_personID_UBU18.git ``` 關於 HOG 特徵擷取ID 比對 ```gherkin= git clone https://github.com/masteree108/HOG_personID_UBU18.git ``` ## 4. 使用 jupyter-lab 執行 source code 以下使用 SIFT 那包當範例 打開 Anaconda Prompt  假設資料放在D磁碟,可直接輸入D:,若是在C磁碟,直接輸入C:,依此類推  ```gherkin= D: ``` 由於 Anaconda Prompt 沒有支援類linux 語法,若想知道資料夾可在git bash 內容可以使用如下指令 ls 可觀察此資料夾有哪些檔案, cd 則是進入資料夾指令 ```gherkin= ls cd temp/SIFT_personID_UBU18 ```  回到 Anaconda Prompt ```gherkin= cd temp/SIFT_personID_UBU18 ```  執行 jupyter-lab 命令 ```gherkin= jupyter-lab ``` 會打開瀏覽器   若太亮可調整暗黑模式如下  打開 SIFT_espcn_find_id.ipynb  運行程式,若正確可一路執行看到比對結果  ## 5. git commit 新增帳號 若之後使用 git commit 若沒加上使用者 會詢問如下  請輸入如下指令 ```gherkin= git config --global user.email "你的mail" git config --global user.email "你的名字" ``` ## 6. 參考文件 [jupyter-lab window10 安裝](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html) 如何在 anaconda prompt 進入其他磁碟  [win10 jupyter-lab 使用教學 ](https://www.youtube.com/watch?v=5mDYijMfSzs) ###### tags: `setup`, `Python`
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.