ChosunTruck
ChosunTruck copied to clipboard
Linux Make Issue
I am getting stumped by this error. Log provided below.
~/ChosunTruck/linux$ make mkdir -p build g++ -c src/main2.cc
pkg-config opencv --cflags --libs -std=c++11 -lX11 -Wall -fopenmp -O3 -march=native -o build/main2.o src/main2.cc: In function ‘int main(int, char**)’: src/main2.cc:128:32: error: ‘CV_RGBA2RGB’ was not declared in this scope cv::cvtColor(image, sendImg, CV_RGBA2RGB); ^~~~~~~~~~~ src/main2.cc:128:32: note: suggested alternative: ‘CV_RGB’ cv::cvtColor(image, sendImg, CV_RGBA2RGB); ^~~~~~~~~~~ CV_RGB src/main2.cc:182:44: error: ‘CV_THRESH_BINARY’ was not declared in this scope cv::threshold(sobel, contours, 145, 255, CV_THRESH_BINARY); ^~~~~~~~~~~~~~~~ src/main2.cc:240:8: warning: unused variable ‘degree’ [-Wunused-variable] int degree = atan2 (last_centerline - first_centerline, count_centerline) * 180 / PI; ^~~~~~ src/main2.cc:42:7: warning: unused variable ‘python_on’ [-Wunused-variable] bool python_on = false; ^~~~~~~~~ src/main2.cc:76:10: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result] system("python tensorbox/Car_detection.py"); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Am I doing something wrong here? I followed the steps and correctly installed opencv and tensorflow.
If the log isn't readable, here's a ghostbin link: https://ghostbin.com/paste/9p8h4/raw
Disclaimer: I haven't built ChosunTruck on Linux in a while and I don't have a Linux machine to test this on.
I think the issue is that OpenCV 3.0+ might not have the "CV_" prefix for those functions. For example, change "CV_RGBA2RGB" to "RGBA2RGB"
Actually it might be "COLOR_RGBA2RGB"
And replace "CV_THRESH_BINARY" to "THRESH_BINARY" as that is the correct function in opencv 3+
OpenCV 3.4 documentation:
https://docs.opencv.org/3.4/dd/d46/imgproc_8hpp.html
cv::COLOR_RGBA2RGB
https://docs.opencv.org/3.4/de/d25/imgproc_color_conversions.html#color_convert_rgb_gray
cvtColor(src, bwsrc, cv::COLOR_RGB2GRAY);
https://docs.opencv.org/3.4/d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a147222a96556ebc1d948b372bcd7ac59
THRESH_BINARY
OpenCV 2.4 documentation:
https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html?
cvtColor(src, bwsrc, CV_RGB2GRAY);
https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold
int threshold_type=CV_THRESH_BINARY,
Yea, this doesn't seem to fix it, same issue.
Can you run
dpkg -l | grep libopencv
And tell me what that returns?
You can try to add
cv::
To the functions I named above.
Ok so I had this issue with a different project called mxnet. It's the same deal in OpenCV 4.0.0
Indeed the correct version is cv::COLOR_RGBA2RGB And that applies to anything in the color conversion functions.
THRESH_BINARY is also the correct form.
Anyway should we close this issue now?