Skip to content

Commit

Permalink
update opencv version to 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiaoming committed Oct 6, 2020
1 parent 4f1d41e commit c15dfda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 5 additions & 1 deletion Detectors/HandcraftDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def __init__(self, config={}):
fastThreshold=self.config["ORB"]["fastThreshold"])
elif self.config["type"] == "SIFT":
logging.info("creating SIFT detector...")
self.det = cv2.xfeatures2d.SIFT_create(nfeatures=self.config["SIFT"]["nfeatures"],
if cv2.__version__ < '4.4.0':
SIFT_create = cv2.xfeatures2d.SIFT_create
else:
SIFT_create = cv2.SIFT_create
self.det = cv2.SIFT_create(nfeatures=self.config["SIFT"]["nfeatures"],
nOctaveLayers=self.config["SIFT"]["nOctaveLayers"],
contrastThreshold=self.config["SIFT"]["contrastThreshold"],
edgeThreshold=self.config["SIFT"]["edgeThreshold"],
Expand Down
10 changes: 0 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ For feature matchers, we tested the KNN and FLANN mathers implemented in OpenCV,
pip install -r requirements.txt
```

- Build and install OpenCV from source with opencv-contrib and flag `OPENCV_ENABLE_NONFREE=True`
```bash
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv
mkdir build && cd build
cmake .. -DOPENCV_EXTRA_MODULE_PATH=../../opencv_contrib/modules -DOPENCV_ENABLE_NONFREE=True
make -j4 install
```

## Run
1. edit dataset path in `params/*.yaml`;
2. run `python main.py --config params/*.yaml` in terminal.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ numpy~=1.18.3
torch~=1.5.0
matplotlib~=2.1.1
PyYAML>=4.2b1
tqdm~=4.47.0
tqdm~=4.47.0
opencv-python~=4.4.0

0 comments on commit c15dfda

Please sign in to comment.