forked from kocica/DatasetGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
108 lines (73 loc) · 2.54 KB
/
Makefile
File metadata and controls
108 lines (73 loc) · 2.54 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
###############################################################
# @file Makefile #
# @author Filip Kocica #
# @date 05/10/2018 #
# #
# Dataset generator makefile #
###############################################################
################## Build constants ##############
BIN_NAME = datagen
DOC = doc
SRC = src
CC = g++
CFLAGS = -std=c++17
LDFLAGS = `pkg-config --libs opencv` -lstdc++fs
HEADERS = $(wildcard $(SRC)/*.h)
SOURCES = $(wildcard $(SRC)/*.cpp)
OBJS = $(patsubst %.cpp, %.o, $(SOURCES))
# Generated image has random Width and Height
#CFLAGS += -DRANDOM_W_H
# Using transparent images with alpha channel
CFLAGS += -DIMG_TRANSPARENT
# Selection of ROIs where signs are generated
#CFLAGS += -DROI_SELECTION
# Debug info, show annotation bounding-boxes
#CFLAGS += -DGENERATOR_DEBUG
# Blue traffic signs
#CFLAGS += -DBLUR
# Rotate TS in Y axis
CFLAGS += -DROTATE_Y
# Rotate TS in Z axis
CFLAGS += -DROTATE_Z
# Modify brightness and contrast of inserted signs
CFLAGS += -DBIGHTCONTRAST
# Correction of gamma channel of inserted signs
CFLAGS += -DGAMMACORRECT
# Modify hue of inserted signs
CFLAGS += -DHUE
# Additive Gaussian noise
CFLAGS += -DGAUSSNOISE
# Additive Salt and pepper noise
CFLAGS += -DPEPPERNOISE
# Traffic sign brightness gradient
CFLAGS += -DGRADIENT
# Modify luminescence of the traffic sign according to brightness in the image
CFLAGS += -DREALISTIC_LIGHTNING
# Add partial traffic sign to dataset
CFLAGS += -DPARTIAL_TS
# The closer to middle of image TS is, the smaller is
#CFLAGS += -DREALISTIC_SIZE
# Seamless cloning of cropped signs to background
CFLAGS += -DSEAMLESS_CLONE
# Create annotation file for each generated image
CFLAGS += -DANNOTATION
################## Compilation ##################
all: $(BIN_NAME)
$(BIN_NAME): $(HEADERS) $(SOURCES) $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
################## Pack/Clean/Run ##################
.PHONY: clean
# Clean compiled objects and binary
clean:
rm -f $(BIN_NAME) $(SRC)/*.o
# Clean output folder (generated images & annotations)
cleanout:
rm -rf out/*
# Run transparent generator
runt:
./$(BIN_NAME) data/backgrounds/ data/transparent
# Run cropped generator
runc:
./$(BIN_NAME) data/backgrounds/ data/cropped