-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (64 loc) · 2.18 KB
/
Makefile
File metadata and controls
84 lines (64 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright (c) 2024 ZhaoCake
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 使用cmake也可以实现这些运行脚本、直接启动程序等功能,但是需要调用添加自定义目标函数,个人认为更加繁琐一些。
# PROJECT_NAME = contour_inst
BUILD_DIR = build
CONFIG_FILE = "config/config.json"
IMAGE_FILE = "resources/kun.png"
VIDEO_FILE = "/home/cake/traditional-vision/resources/OnlyBasketball.mp4"
SVM_MODEL = "/home/cake/traditional-vision/resources/ball_svm.xml"
# CMake
# 默认目标
all: cmake-build
# 创建构建目录并运行 CMake 配置
cmake-configure:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake ..
# 构建项目
cmake-build: cmake-configure
@cmake --build $(BUILD_DIR)
# 运行项目
contour_inst: cmake-build
@echo "If you are running countour_inst, please make init_contour first."
@cd $(BUILD_DIR) && ./contour_inst
backsub: cmake-build
@cd $(BUILD_DIR) && ./backsub
svm: cmake-build
@cd $(BUILD_DIR) && ./svm
gdb-configure:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug ..
gdb-build: gdb-configure
@cmake --build $(BUILD_DIR)
gdb-contour_inst: gdb-build # 还未验证
@cd $(BUILD_DIR) && gdb ./contour_inst
gdb-backsub: gdb-build
@cd $(BUILD_DIR) && gdb ./backsub
# 运行hsv阈值调试
hsv:
@python3 scripts/hsv.py $(CONFIG_FILE) $(VIDEO_FILE)
on_mouse:
@python3 scripts/on_mouse.py $(IMAGE_FILE)
train_svm:
@python3 scripts/train_svm.py
detect_svm:
@python3 scripts/detect_svm.py $(VIDEO_FILE) $(SVM_MODEL)
init_contour:
@echo "init contour..."
@mkdir -p resources/contour
@rm resources/contour/*.jpg
# 清理构建目录
clean:
@rm -rf $(BUILD_DIR)
.PHONY: all cmake-configure cmake-build run clean hsv