From cf316e58163ebd8903c2dc394a0882fa27941568 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 Aug 2018 21:22:52 +0200 Subject: [PATCH 1/5] Disabled progress bar for improved performance. Affects: Invoke-WebRequest and Expand-Archive Added extra comments to explain to the user. --- win_build_opencv.cmd | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/win_build_opencv.cmd b/win_build_opencv.cmd index 0e8e03db..7d6c1c18 100644 --- a/win_build_opencv.cmd +++ b/win_build_opencv.cmd @@ -1,13 +1,35 @@ +echo off + if not exist "C:\opencv" mkdir "C:\opencv" if not exist "C:\opencv\build" mkdir "C:\opencv\build" -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/3.4.2.zip -OutFile c:\opencv\opencv-3.4.2.zip" -powershell -command "Expand-Archive -Path c:\opencv\opencv-3.4.2.zip -DestinationPath c:\opencv" +echo Downloading OpenCV sources +echo. +echo For monitor the download progress please check the C:\opencv directory. +echo Not progress bar is provided here. +echo. + +REM This is why there is no progress bar: +REM https://github.com/PowerShell/PowerShell/issues/2138 + +echo Downloading: opencv-3.4.2.zip [91MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/3.4.2.zip -OutFile c:\opencv\opencv-3.4.2.zip" +echo Extracting... +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-3.4.2.zip -DestinationPath c:\opencv" del c:\opencv\opencv-3.4.2.zip /q +echo. -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/3.4.2.zip -OutFile c:\opencv\opencv_contrib-3.4.2.zip" -powershell -command "Expand-Archive -Path c:\opencv\opencv_contrib-3.4.2.zip -DestinationPath c:\opencv" +echo Downloading: opencv_contrib-3.4.2.zip [58MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/3.4.2.zip -OutFile c:\opencv\opencv_contrib-3.4.2.zip" +echo Extracting... +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-3.4.2.zip -DestinationPath c:\opencv" del c:\opencv\opencv_contrib-3.4.2.zip /q +echo. + +echo Done with downloading and extracting sources. +echo. + +echo on cd C:\opencv\build set PATH=%PATH%;C:\Program Files (x86)\CMake\bin;C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin From e4533d89bd636e97dc269a596ed744637ce7e340 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 Aug 2018 21:27:24 +0200 Subject: [PATCH 2/5] Fixed wording --- win_build_opencv.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win_build_opencv.cmd b/win_build_opencv.cmd index 7d6c1c18..54fd6d43 100644 --- a/win_build_opencv.cmd +++ b/win_build_opencv.cmd @@ -5,7 +5,7 @@ if not exist "C:\opencv\build" mkdir "C:\opencv\build" echo Downloading OpenCV sources echo. -echo For monitor the download progress please check the C:\opencv directory. +echo For monitoring the download progress please check the C:\opencv directory. echo Not progress bar is provided here. echo. From 419ca448f5ea5d2bb8329e97578eaff6af4f9f08 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 Aug 2018 21:28:18 +0200 Subject: [PATCH 3/5] Wording fixes again --- win_build_opencv.cmd | 1 - 1 file changed, 1 deletion(-) diff --git a/win_build_opencv.cmd b/win_build_opencv.cmd index 54fd6d43..d7849dd3 100644 --- a/win_build_opencv.cmd +++ b/win_build_opencv.cmd @@ -6,7 +6,6 @@ if not exist "C:\opencv\build" mkdir "C:\opencv\build" echo Downloading OpenCV sources echo. echo For monitoring the download progress please check the C:\opencv directory. -echo Not progress bar is provided here. echo. REM This is why there is no progress bar: From 682534511e031eb42ba554a26384544191912785 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 Aug 2018 21:32:24 +0200 Subject: [PATCH 4/5] Adjusted documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 305ddf3f..21e72c8c 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ The following commands should do everything to download and install OpenCV 3.4.2 chdir %GOPATH%\src\gocv.io\x\gocv win_build_opencv.cmd -It will probably take at least 1 hour to download and build. +It might take up to one hour depending on your download and disk speed. Last, add `C:\opencv\build\install\x64\mingw\bin` to your System Path. From 2973cfabdb5914ec378e52a2f78588a3910fd699 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 Aug 2018 21:35:19 +0200 Subject: [PATCH 5/5] Simplified wording in documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21e72c8c..ee027613 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ The following commands should do everything to download and install OpenCV 3.4.2 chdir %GOPATH%\src\gocv.io\x\gocv win_build_opencv.cmd -It might take up to one hour depending on your download and disk speed. +It might take up to one hour. Last, add `C:\opencv\build\install\x64\mingw\bin` to your System Path.