###### Software installation guide####################################
Check versions #2023 Feb 15
>conda -V #inside conda, check conda version, e.g., conda 22.9.0
>python #go inside python , its version will be shown, .e.g  pythion 3.9.13
   >>> import cv2 #start opencv
   >>> cv2.__version__ #will show opencv version. E.g. python-opencv-'4.7.0'
>>> control_Z to quit python

#######################################################
###                     Important notes, 2023 Feb 15                                  #

##############################################################
Public domain software.pptx

inside cuhk you need to use --proxy for installation, i.e., to install graphviz

pip  install --proxy http://proxy.cse.cuhk.edu.hk:8000 graphviz


# if you work inside CUHK, you should specify proxy in the  file ".condarc" .
ssl_verify: false
channels:
  - defaults
proxy_servers:
    http: http://proxy.cse.cuhk.edu.hk:8000
    https: http://proxy.cse.cuhk.edu.hk:8000

###############################################################
###                    
Installation and testing of colab (2023 Feb. 7)          ########
###############################################################


1.    Open a Gmail account
2.    You should be provided with a google drive.
3.    There are plenty of tutorials, such as https://www.youtube.com/watch?v=RLYoEyIHL6A
4.    Now you can start to try some tutorials of colab. Such as
    a.    https://colab.research.google.com/#scrollTo=-gE-Ez1qtyIA
    b.    You may choose tutorial such as MNIST.ipynb in https://colab.research.google.com/github/skorch-dev/skorch/blob/master/notebooks/MNIST.ipynb

Using colab to try the demo of decision tree in sklearn
https://colab.research.google.com/github/jackqk/sklearn-note/blob/master/Decision_Tree.ipynb


###############################################################
###                    
Installation anaconda (2023 Jan. 10)   and opencv ########
###############################################################


    Install anaconda first: https://www.anaconda.com/products/distribution,   https://www.datacamp.com/tutorial/installing-anaconda-windows

Fix: https://stackoverflow.com/questions/71204741/how-to-fix-error-module-cv2-has-no-attribute-legacy-on-python-3-7-9-and-w 
==== python version problem, if you need python 3.7 (or some other versions) for your application, you may change it inside "anaconda power prompt"  do

To use  aruco tracker in https://github.com/njanirudh/Aruco_tracker , use python 3.7.13, opencv-contrib-python==3.4.5.20 (tested ok)

>conda install python=3.7.13
    
> pip uninstall opencv-contrib-python #remove other version first. 

> pip install opencv-contrib-python==3.4.5.20
///////////////
###############################################################
### Setup Virtual environment under conda 2023. Feb 15                ########
###############################################################

>conda -V                  # Step 1: ?conda is installed,version

>conda update conda        #Step 2: Update conda
>conda search “^python$”   #Step 3: check possible python ver.
>conda create -n envname python=x.x anaconda #Setup vir.Env.
>conda activate your_envname #Step 4: Activate virtual envir.

# now in your envi. called your_envname
>conda install -n your_envname package  #install pacakges

#if you are in cuhk, you need to specify proxy
>conda install --proxy http://proxy.cse.cuhk.edu.hk:8000 -n your_envname package

>conda deactivate #Step 6: Deactivate. your_envnem and quit virt.

#IF you need this environment anymore
>conda remove -n envname -all


###############################################################
### Setup opencv microsoft visual studio,cpp python 2023,  Jan 10   ######
###############################################################

vs2017-opencv-Installation.docx ,

vs2019-opencv-Installation.docx ,(2023 Jan 10)

opencv4_sample_run_result.docx

###############################################################
### Others                                                                                                ######
###############################################################

Python tricks:
>autopep8 fact.py  --in-place #auto fix python file format, fix space tab problems
>2to3 -w frame.py # fix python 2 programs to python3

On Visual studio:sing Visual Studio Professional 2019 (version 16.11) https://my.visualstudio.com/Downloads?q=Visual%20Studio%202019

Source: https://docs.microsoft.com/en-us/visualstudio/releases/2019/history


vs2019

To enter arguments to a program under visual studio IDE


Download the lk_track , camshift sample code from OpenCV Github repository 

  ( https://github.com/opencv/opencv ) (C++ or Python), After unzip , python samples codes are in \opencv-4.x\samples\python

Demos: run lk_track.py, lk_track_save_data.py (http://www.cse.cuhk.edu.hk/~khwong/www2/cmsc5711/lk_track_save_data.py) and camshift.py


§  =========== Updated 2022.3.12, if you have problem using opencv (4.4.x.x etc), try to install an older version, follow the following methods

§  conda> pip uninstall opencv-python

§  conda> pip uninstall opencv-contrib-python

§   

§  conda > pip install opencv-python==3.4.2.17  ,

§  conda > pip install opencv-contrib-python==3.4.2.17 

§  =====

§  You may try the following samples from

§  https://github.com/opencv/opencv/tree/4.x/ (download the zip file and find the sample codes)

§  conda> python camshift.py 0   # camshift using camera 0 , use mouse to select area to track

§  conda> python lk_track.py 0 # lk tracker for using camera 0 (laptop camera)

§  conda> python calibrate.py #using input image files from ..\data, you  my use your own ima

///////////////////////////////////////////////////////////////////////////////////////////////////////////

/////////// Opengl installation under anaconda and python if you have problems of using opengl in python////
Install opengl using anaconda_python.
Step1: Check your python version, assume you are in “D:\_project223\teapot_py”
(base) PS D:\_project223\teapot_py >>python –version
e..g you get : Python 3.7.11
////////////////////////////////////////////////////////////////////////////////////////////////////////
step2a: check your python version:
(base) PS D:\_project223\teapot_py> python
Python 3.7.11 (default, Jul 27 2021, 09:42:29) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
The above shows it is 64 bit (AMD).
////////////////////////////////////////////////////////////////////////////////////////////////////////
step2b: check tensorflow version if you have installed tensorfow
>>pip show tensorflow
or
>>pip list
//////////////////////////////////////////////
Step3 : download files, goto  https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl
find the suitable 2 files for installation, since we use python 3.7.11/64 bit ,use cp37, and 64bit AMD
conda >> pip install PyOpenGL_accelerate-3.1.6-cp37-cp37m-win_amd64.whl
conda >> pip install PyOpenGL-3.1.6-cp37-cp37m-win_amd64.whl
If you are successfully then you are ok. If not you may get the wrong version of .whl, check again.

Demo programs
teapot_test.py

demo_opengl.zip


///////////////////////////////////////////////////////////////////////////////////////////////////////////

/////////// CPP (C++) (32-bit) Opengl installation
Unzip Glew and Glut.zip and place the whole directory in c:\Glew and Glut
In visual studio (e.g. vs2019 ) set the correct directories in C++,and link_dir of the project see the example (see .sln): opengl1_teapot.zip



























////////////////////////  older ///////////////////////////////

----  Dec 2016/ 2017-------



.



Summer project webpage 2013 (summer)


Python+OpenCV on Linux by Bill yau

latest version of ba ba810c.zip


---------2014--------------------------------------------------------------------

Open source Vision and Image Processing library (OSVIP)

 Updated 25.11.2014

Download sites (share_vision), KK

Demos



--------------------------------------------------------------------------------------------------------------------------


   
(ver. 1.1, 1 June 2011)

  1. Read and display images
  2. Camera
    1. Projection
    2. Camera calibration

                                                    i.     Using calibrated 3D objects

                                                  ii.     Using calibrated planar object

                                                iii.     Auto-calibration (with specific object)

  1. Edge detection
    1. First order
    2. Second order
    3. Gaussian filtering
  2. Gray level processing
    1. Histogram
    2. Histogram equalization
    3. Image back-projection
  3. Color processing
    1. Conversion RGB-> HSV etc
  4. Object  tracking
    1. Mean-shift
    2. Cam-shift
    3. Particle filter/Kalman filter based object tracking
  5. Feature detection
    1. Harris operator
    2. Point features

                                                    i.     Kalman filtering tracking (Edward)

    1. Line features

                                                    i.     Quadrangle detection

    1. Blob detection
  1. Feature tracking
    1. Point features

                                                    i.     KLT

                                                  ii.     Kalman

                                                iii.     Condensation/particle filter

    1. Line Tracking

                                                    i.     Kalman

                                                  ii.     IMM Kalman

  1. Stereo
    1. Essential matrix
    2. Fundamental matrix
    3. Image homography
    4. Image warping
  2. Structure from motion SfM using
    1. Stereo images
    2. Three images (Trifocal tensor)
    3. N images

                                                    i.     Factorization

                                                  ii.     Bundle adjustment

1.     Alternating (extended Lowe)

2.     Full Bundle adjustment

                                                iii.     Kalman EKF filtering approach

1.     One camera SfM

2.     Stereo Sfm

3.     Trifocal tensor

4.     Unscented Kalman Filter

  1. Projector-camera systems
    1. System calibration and projection geometry
    2. Projection image warping
  2. Advanced topics
    1. Face detection
    2. Face tracking
    3. Face recognition