Skip to content

Commit

Permalink
Update Makefile and qrcode_detection to support opencv4
Browse files Browse the repository at this point in the history
  • Loading branch information
glddiv committed Dec 4, 2020
1 parent ee81282 commit 60fd954
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions RPI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ CROSS_PREFIX ?=
CC := $(CROSS_COMPILE)gcc
CXX := $(CROSS_COMPILE)g++
CFLAGS ?= -I. -g -O0 -std=gnu11
CXXFLAGS?= -I. -g -std=gnu++11 `pkg-config --cflags --libs opencv`

OPENCV_LIB = $(shell pkg-config --cflags --libs opencv)
ifeq ($(OPENCV_LIB), )
OPENCV_LIB = $(shell pkg-config --cflags --libs opencv4)
endif

CXXFLAGS?= -I. -g -std=gnu++11 ${OPENCV_LIB}
LDFLAGS ?=
LIBS := -larducam_mipicamera -lpthread #-lwiringPi
OLIB := lib
OLIB := lib
examples:= video4cameras arducamstill capture video list_format capture_raw raw_callback yuv_callback read_write_sensor_reg ov9281_external_trigger 2MPGlobalShuterDemo preview-camera0 preview-dualcam capture-dualcam video2stdout capture2opencv opencvGui qrcode_detection
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
Expand Down
4 changes: 2 additions & 2 deletions RPI/qrcode_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main(int argc, char **argv) {
void QRCodeDecode(ImageScanner &scanner, cv::Mat &frame)
{
cv::Mat grey;
cv::cvtColor(frame, grey, CV_BGR2GRAY);
cv::cvtColor(frame, grey, cv::COLOR_BGR2GRAY);

int width = frame.cols;
int height = frame.rows;
Expand Down Expand Up @@ -134,4 +134,4 @@ void QRCodeDecode(ImageScanner &scanner, cv::Mat &frame)
}
}

}
}

0 comments on commit 60fd954

Please sign in to comment.