Skip to content

Commit

Permalink
all: update for Windows to use OpenCV 4.8.0
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <ron@hybridgroup.com>
  • Loading branch information
deadprogram committed Jul 31, 2023
1 parent c160033 commit 798c14b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ For example:

set CGO_CXXFLAGS="--std=c++11"
set CGO_CPPFLAGS=-IC:\opencv\build\install\include
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core470 -lopencv_face470 -lopencv_videoio470 -lopencv_imgproc470 -lopencv_highgui470 -lopencv_imgcodecs470 -lopencv_objdetect470 -lopencv_features2d470 -lopencv_video470 -lopencv_dnn470 -lopencv_xfeatures2d470 -lopencv_plot470 -lopencv_tracking470 -lopencv_img_hash470
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core480 -lopencv_face480 -lopencv_videoio480 -lopencv_imgproc480 -lopencv_highgui480 -lopencv_imgcodecs480 -lopencv_objdetect480 -lopencv_features2d480 -lopencv_video480 -lopencv_dnn480 -lopencv_xfeatures2d480 -lopencv_plot480 -lopencv_tracking480 -lopencv_img_hash480

Please note that you will need to run these 3 lines of code one time in your current session in order to build or run the code, in order to setup the needed ENV variables. Once you have done so, you can execute code that uses GoCV with your custom environment like this:

Expand Down
2 changes: 1 addition & 1 deletion cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package gocv
#cgo !windows pkg-config: opencv4
#cgo CXXFLAGS: --std=c++11
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core470 -lopencv_face470 -lopencv_videoio470 -lopencv_imgproc470 -lopencv_highgui470 -lopencv_imgcodecs470 -lopencv_objdetect470 -lopencv_features2d470 -lopencv_video470 -lopencv_dnn470 -lopencv_xfeatures2d470 -lopencv_plot470 -lopencv_tracking470 -lopencv_img_hash470 -lopencv_calib3d470 -lopencv_bgsegm470 -lopencv_photo470 -lopencv_aruco470 -lopencv_wechat_qrcode470 -lopencv_ximgproc470
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core480 -lopencv_face480 -lopencv_videoio480 -lopencv_imgproc480 -lopencv_highgui480 -lopencv_imgcodecs480 -lopencv_objdetect480 -lopencv_features2d480 -lopencv_video480 -lopencv_dnn480 -lopencv_xfeatures2d480 -lopencv_plot480 -lopencv_tracking480 -lopencv_img_hash480 -lopencv_calib3d480 -lopencv_bgsegm480 -lopencv_photo480 -lopencv_aruco480 -lopencv_wechat_qrcode480 -lopencv_ximgproc480
*/
import "C"
2 changes: 1 addition & 1 deletion cgo_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ package gocv
#cgo !windows CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4
#cgo !windows LDFLAGS: -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_highgui -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_video -lopencv_videoio -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_wechat_qrcode -lopencv_photo -lopencv_imgproc -lopencv_core -littnotify -llibprotobuf -lIlmImf -lquirc -lippiw -lippicv -lade -lz -ljpeg -ldl -lm -lpthread -lrt -lquadmath
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo470 -lopencv_tracking470 -lopencv_superres470 -lopencv_stitching470 -lopencv_optflow470 -lopencv_gapi470 -lopencv_face470 -lopencv_dpm470 -lopencv_dnn_objdetect470 -lopencv_ccalib470 -lopencv_bioinspired470 -lopencv_bgsegm470 -lopencv_aruco470 -lopencv_xobjdetect470 -lopencv_ximgproc470 -lopencv_xfeatures2d470 -lopencv_videostab470 -lopencv_video470 -lopencv_structured_light470 -lopencv_shape470 -lopencv_rgbd470 -lopencv_rapid470 -lopencv_objdetect470 -lopencv_mcc470 -lopencv_highgui470 -lopencv_datasets470 -lopencv_calib3d470 -lopencv_videoio470 -lopencv_text470 -lopencv_line_descriptor470 -lopencv_imgcodecs470 -lopencv_img_hash470 -lopencv_hfs470 -lopencv_fuzzy470 -lopencv_features2d470 -lopencv_dnn_superres470 -lopencv_dnn470 -lopencv_xphoto470 -lopencv_wechat_qrcode470 -lopencv_surface_matching470 -lopencv_reg470 -lopencv_quality470 -lopencv_plot470 -lopencv_photo470 -lopencv_phase_unwrapping470 -lopencv_ml470 -lopencv_intensity_transform470 -lopencv_imgproc470 -lopencv_flann470 -lopencv_core470 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo480 -lopencv_tracking480 -lopencv_superres480 -lopencv_stitching480 -lopencv_optflow480 -lopencv_gapi480 -lopencv_face480 -lopencv_dpm480 -lopencv_dnn_objdetect480 -lopencv_ccalib480 -lopencv_bioinspired480 -lopencv_bgsegm480 -lopencv_aruco480 -lopencv_xobjdetect480 -lopencv_ximgproc480 -lopencv_xfeatures2d480 -lopencv_videostab480 -lopencv_video480 -lopencv_structured_light480 -lopencv_shape480 -lopencv_rgbd480 -lopencv_rapid480 -lopencv_objdetect480 -lopencv_mcc480 -lopencv_highgui480 -lopencv_datasets480 -lopencv_calib3d480 -lopencv_videoio480 -lopencv_text480 -lopencv_line_descriptor480 -lopencv_imgcodecs480 -lopencv_img_hash480 -lopencv_hfs480 -lopencv_fuzzy480 -lopencv_features2d480 -lopencv_dnn_superres480 -lopencv_dnn480 -lopencv_xphoto480 -lopencv_wechat_qrcode480 -lopencv_surface_matching480 -lopencv_reg480 -lopencv_quality480 -lopencv_plot480 -lopencv_photo480 -lopencv_phase_unwrapping480 -lopencv_ml480 -lopencv_intensity_transform480 -lopencv_imgproc480 -lopencv_flann480 -lopencv_core480 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
*/
import "C"
2 changes: 1 addition & 1 deletion contrib/cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package contrib
#cgo !windows pkg-config: opencv4
#cgo CXXFLAGS: --std=c++11
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core470 -lopencv_face470 -lopencv_videoio470 -lopencv_imgproc470 -lopencv_highgui470 -lopencv_imgcodecs470 -lopencv_objdetect470 -lopencv_features2d470 -lopencv_video470 -lopencv_dnn470 -lopencv_xfeatures2d470 -lopencv_plot470 -lopencv_tracking470 -lopencv_img_hash470 -lopencv_calib3d470 -lopencv_bgsegm470 -lopencv_xphoto470 -lopencv_aruco470 -lopencv_wechat_qrcode470 -lopencv_ximgproc470
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core480 -lopencv_face480 -lopencv_videoio480 -lopencv_imgproc480 -lopencv_highgui480 -lopencv_imgcodecs480 -lopencv_objdetect480 -lopencv_features2d480 -lopencv_video480 -lopencv_dnn480 -lopencv_xfeatures2d480 -lopencv_plot480 -lopencv_tracking480 -lopencv_img_hash480 -lopencv_calib3d480 -lopencv_bgsegm480 -lopencv_xphoto480 -lopencv_aruco480 -lopencv_wechat_qrcode480 -lopencv_ximgproc480
*/
import "C"
2 changes: 1 addition & 1 deletion contrib/cgo_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ package contrib
#cgo !windows CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4
#cgo !windows LDFLAGS: -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_highgui -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_video -lopencv_videoio -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_wechat_qrcode -lopencv_photo -lopencv_imgproc -lopencv_core -littnotify -llibprotobuf -lIlmImf -lquirc -lippiw -lippicv -lade -lz -ljpeg -ldl -lm -lpthread -lrt -lquadmath
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo470 -lopencv_tracking470 -lopencv_superres470 -lopencv_stitching470 -lopencv_optflow470 -lopencv_gapi470 -lopencv_face470 -lopencv_dpm470 -lopencv_dnn_objdetect470 -lopencv_ccalib470 -lopencv_bioinspired470 -lopencv_bgsegm470 -lopencv_aruco470 -lopencv_xobjdetect470 -lopencv_ximgproc470 -lopencv_xfeatures2d470 -lopencv_videostab470 -lopencv_video470 -lopencv_structured_light470 -lopencv_shape470 -lopencv_rgbd470 -lopencv_rapid470 -lopencv_objdetect470 -lopencv_mcc470 -lopencv_highgui470 -lopencv_datasets470 -lopencv_calib3d470 -lopencv_videoio470 -lopencv_text470 -lopencv_line_descriptor470 -lopencv_imgcodecs470 -lopencv_img_hash470 -lopencv_hfs470 -lopencv_fuzzy470 -lopencv_features2d470 -lopencv_dnn_superres470 -lopencv_dnn470 -lopencv_xphoto470 -lopencv_wechat_qrcode470 -lopencv_surface_matching470 -lopencv_reg470 -lopencv_quality470 -lopencv_plot470 -lopencv_photo470 -lopencv_phase_unwrapping470 -lopencv_ml470 -lopencv_intensity_transform470 -lopencv_imgproc470 -lopencv_flann470 -lopencv_core470 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo480 -lopencv_tracking480 -lopencv_superres480 -lopencv_stitching480 -lopencv_optflow480 -lopencv_gapi480 -lopencv_face480 -lopencv_dpm480 -lopencv_dnn_objdetect480 -lopencv_ccalib480 -lopencv_bioinspired480 -lopencv_bgsegm480 -lopencv_aruco480 -lopencv_xobjdetect480 -lopencv_ximgproc480 -lopencv_xfeatures2d480 -lopencv_videostab480 -lopencv_video480 -lopencv_structured_light480 -lopencv_shape480 -lopencv_rgbd480 -lopencv_rapid480 -lopencv_objdetect480 -lopencv_mcc480 -lopencv_highgui480 -lopencv_datasets480 -lopencv_calib3d480 -lopencv_videoio480 -lopencv_text480 -lopencv_line_descriptor480 -lopencv_imgcodecs480 -lopencv_img_hash480 -lopencv_hfs480 -lopencv_fuzzy480 -lopencv_features2d480 -lopencv_dnn_superres480 -lopencv_dnn480 -lopencv_xphoto480 -lopencv_wechat_qrcode480 -lopencv_surface_matching480 -lopencv_reg480 -lopencv_quality480 -lopencv_plot480 -lopencv_photo480 -lopencv_phase_unwrapping480 -lopencv_ml480 -lopencv_intensity_transform480 -lopencv_imgproc480 -lopencv_flann480 -lopencv_core480 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
*/
import "C"
2 changes: 1 addition & 1 deletion cuda/cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package cuda
#cgo !windows pkg-config: opencv4
#cgo CXXFLAGS: --std=c++11
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core470 -lopencv_face470 -lopencv_videoio470 -lopencv_imgproc470 -lopencv_highgui470 -lopencv_imgcodecs470 -lopencv_objdetect470 -lopencv_features2d470 -lopencv_video470 -lopencv_dnn470 -lopencv_xfeatures2d470 -lopencv_plot470 -lopencv_tracking470 -lopencv_img_hash470 -lopencv_calib3d470 -lopencv_bgsegm470 -lopencv_aruco470 -lopencv_wechat_qrcode470 -lopencv_ximgproc470
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core480 -lopencv_face480 -lopencv_videoio480 -lopencv_imgproc480 -lopencv_highgui480 -lopencv_imgcodecs480 -lopencv_objdetect480 -lopencv_features2d480 -lopencv_video480 -lopencv_dnn480 -lopencv_xfeatures2d480 -lopencv_plot480 -lopencv_tracking480 -lopencv_img_hash480 -lopencv_calib3d480 -lopencv_bgsegm480 -lopencv_aruco480 -lopencv_wechat_qrcode480 -lopencv_ximgproc480
*/
import "C"
2 changes: 1 addition & 1 deletion cuda/cgo_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ package gocv
#cgo !windows CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4
#cgo !windows LDFLAGS: -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_highgui -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_video -lopencv_videoio -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_wechat_qrcode -lopencv_photo -lopencv_imgproc -lopencv_core -littnotify -llibprotobuf -lIlmImf -lquirc -lippiw -lippicv -lade -lz -ljpeg -ldl -lm -lpthread -lrt -lquadmath
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo470 -lopencv_tracking470 -lopencv_superres470 -lopencv_stitching470 -lopencv_optflow470 -lopencv_gapi470 -lopencv_face470 -lopencv_dpm470 -lopencv_dnn_objdetect470 -lopencv_ccalib470 -lopencv_bioinspired470 -lopencv_bgsegm470 -lopencv_aruco470 -lopencv_xobjdetect470 -lopencv_ximgproc470 -lopencv_xfeatures2d470 -lopencv_videostab470 -lopencv_video470 -lopencv_structured_light470 -lopencv_shape470 -lopencv_rgbd470 -lopencv_rapid470 -lopencv_objdetect470 -lopencv_mcc470 -lopencv_highgui470 -lopencv_datasets470 -lopencv_calib3d470 -lopencv_videoio470 -lopencv_text470 -lopencv_line_descriptor470 -lopencv_imgcodecs470 -lopencv_img_hash470 -lopencv_hfs470 -lopencv_fuzzy470 -lopencv_features2d470 -lopencv_dnn_superres470 -lopencv_dnn470 -lopencv_xphoto470 -lopencv_wechat_qrcode470 -lopencv_surface_matching470 -lopencv_reg470 -lopencv_quality470 -lopencv_plot470 -lopencv_photo470 -lopencv_phase_unwrapping470 -lopencv_ml470 -lopencv_intensity_transform470 -lopencv_imgproc470 -lopencv_flann470 -lopencv_core470 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo480 -lopencv_tracking480 -lopencv_superres480 -lopencv_stitching480 -lopencv_optflow480 -lopencv_gapi480 -lopencv_face480 -lopencv_dpm480 -lopencv_dnn_objdetect480 -lopencv_ccalib480 -lopencv_bioinspired480 -lopencv_bgsegm480 -lopencv_aruco480 -lopencv_xobjdetect480 -lopencv_ximgproc480 -lopencv_xfeatures2d480 -lopencv_videostab480 -lopencv_video480 -lopencv_structured_light480 -lopencv_shape480 -lopencv_rgbd480 -lopencv_rapid480 -lopencv_objdetect480 -lopencv_mcc480 -lopencv_highgui480 -lopencv_datasets480 -lopencv_calib3d480 -lopencv_videoio480 -lopencv_text480 -lopencv_line_descriptor480 -lopencv_imgcodecs480 -lopencv_img_hash480 -lopencv_hfs480 -lopencv_fuzzy480 -lopencv_features2d480 -lopencv_dnn_superres480 -lopencv_dnn480 -lopencv_xphoto480 -lopencv_wechat_qrcode480 -lopencv_surface_matching480 -lopencv_reg480 -lopencv_quality480 -lopencv_plot480 -lopencv_photo480 -lopencv_phase_unwrapping480 -lopencv_ml480 -lopencv_intensity_transform480 -lopencv_imgproc480 -lopencv_flann480 -lopencv_core480 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
*/
import "C"

0 comments on commit 798c14b

Please sign in to comment.