SSARCandy / Coherent-Line-Drawing

🖼✨Automatically generates line drawing from a photograph
https://ssarcandy.tw/2017/06/26/Coherent-Line-Drawing/
MIT License
556 stars 61 forks source link

add cv:: prefix to constants #32

Closed kylemcdonald closed 3 years ago

kylemcdonald commented 3 years ago

These changes were required for me to build against Opencv 4.5.1. Without these changes I got the following errors:

$ ./build.sh -c
/usr/bin/nproc
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /usr (found version "4.2.0") 
-- Found wxWidgets: -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk3u_xrc-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_qa-3.0;-lwx_gtk3u_adv-3.0;-lwx_gtk3u_core-3.0;-lwx_baseu_xml-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0 (found version "3.0.4") 
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0")  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kyle/Coherent-Line-Drawing/build
Scanning dependencies of target cld
Scanning dependencies of target Coherent-Line-Drawing
[  9%] Building CXX object CMakeFiles/cld.dir/src/cmd.cpp.o
[ 18%] Building CXX object CMakeFiles/Coherent-Line-Drawing.dir/src/main.cpp.o
/home/kyle/Coherent-Line-Drawing/src/cmd.cpp: In function ‘int main(int, char**)’:
/home/kyle/Coherent-Line-Drawing/src/cmd.cpp:87:42: error: ‘CV_GRAY2RGB’ was not declared in this scope
   87 |     cv::cvtColor(cld.result, cld.result, CV_GRAY2RGB);
      |                                          ^~~~~~~~~~~
/home/kyle/Coherent-Line-Drawing/src/cmd.cpp:97:40: error: ‘CV_GRAY2BGR’ was not declared in this scope
   97 |         cv::cvtColor(vis_etf, vis_etf, CV_GRAY2BGR);
      |                                        ^~~~~~~~~~~
make[2]: *** [CMakeFiles/cld.dir/build.make:63: CMakeFiles/cld.dir/src/cmd.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/cld.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 27%] Building CXX object CMakeFiles/Coherent-Line-Drawing.dir/src/ETF.cpp.o
[ 36%] Building CXX object CMakeFiles/Coherent-Line-Drawing.dir/src/CLD.cpp.o
/home/kyle/Coherent-Line-Drawing/src/ETF.cpp: In member function ‘void ETF::initial_ETF(std::string, cv::Size)’:
/home/kyle/Coherent-Line-Drawing/src/ETF.cpp:33:47: error: ‘CV_INTER_LINEAR’ was not declared in this scope
   33 |     cv::resize(flowField, flowField, s, 0, 0, CV_INTER_LINEAR);
      |                                               ^~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/Coherent-Line-Drawing.dir/build.make:76: CMakeFiles/Coherent-Line-Drawing.dir/src/ETF.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/kyle/Coherent-Line-Drawing/src/CLD.cpp: In member function ‘void CLD::readSrc(std::string)’:
/home/kyle/Coherent-Line-Drawing/src/CLD.cpp:52:36: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
   52 |     originalImg = cv::imread(file, CV_LOAD_IMAGE_GRAYSCALE);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/Coherent-Line-Drawing.dir/build.make:89: CMakeFiles/Coherent-Line-Drawing.dir/src/CLD.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/Coherent-Line-Drawing.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
codecov[bot] commented 3 years ago

Codecov Report

Merging #32 (8022c08) into master (162c08c) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   98.00%   98.00%           
=======================================
  Files           6        6           
  Lines         300      300           
=======================================
  Hits          294      294           
  Misses          6        6           
Impacted Files Coverage Δ
src/CLD.cpp 99.15% <100.00%> (ø)
src/ETF.cpp 100.00% <100.00%> (ø)
src/cmd.cpp 92.42% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 162c08c...8022c08. Read the comment docs.

SSARCandy commented 3 years ago

thanks for your contribution! looks good to me 👍