Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaceIdentification make error #198

Open
erikaemma opened this issue Jul 11, 2018 · 2 comments
Open

FaceIdentification make error #198

erikaemma opened this issue Jul 11, 2018 · 2 comments

Comments

@erikaemma
Copy link

‘imread’ is not a member of ‘cv’
‘resize’ is not a member of ‘cv’

System: Ubuntu 16.04, Opencv 3.3.1

All 4 errors are on SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp file

@beantowel
Copy link

I added these lines at the end of the CMakeLists.txt, and it worked on Ubuntu 17.10, Opencv 3.1.0

find_package(OpenCV)
if (NOT OpenCV_FOUND)
  message(WARNING "OpenCV not found. Test will not be built.")
else()
  include_directories(${OpenCV_INCLUDE_DIRS})
  link_libraries(${OpenCv_LIBS})
endif()

@johhnry
Copy link

johhnry commented Oct 27, 2018

I am experiencing the same problem as @erikaemma

@beantowel
I did what you did but it doesn't work :

cmake .. && make
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.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
STATUS "other platform: Linux"
./test_face_recognizer.cpp./test_face_verification.cpp
-- Found OpenCV: /usr/local (found version "4.0.0") 
CMake Warning (dev) at src/test/CMakeLists.txt:11 (add_executable):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "./test_face_recognizer.bin" is reserved or not valid for
  certain CMake features, such as generator expressions, and may result in
  undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/test/CMakeLists.txt:11 (add_executable):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "./test_face_verification.bin" is reserved or not valid for
  certain CMake features, such as generator expressions, and may result in
  undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/build
Scanning dependencies of target viplnet
[  4%] Building CXX object CMakeFiles/viplnet.dir/src/bias_adder_net.cpp.o
[  9%] Building CXX object CMakeFiles/viplnet.dir/src/blob.cpp.o
[ 14%] Building CXX object CMakeFiles/viplnet.dir/src/bn_net.cpp.o
[ 19%] Building CXX object CMakeFiles/viplnet.dir/src/common_net.cpp.o
[ 23%] Building CXX object CMakeFiles/viplnet.dir/src/conv_net.cpp.o
[ 28%] Building CXX object CMakeFiles/viplnet.dir/src/eltwise_net.cpp.o
[ 33%] Building CXX object CMakeFiles/viplnet.dir/src/inner_product_net.cpp.o
[ 38%] Building CXX object CMakeFiles/viplnet.dir/src/log.cpp.o
[ 42%] Building CXX object CMakeFiles/viplnet.dir/src/math_functions.cpp.o
[ 47%] Building CXX object CMakeFiles/viplnet.dir/src/max_pooling_net.cpp.o
[ 52%] Building CXX object CMakeFiles/viplnet.dir/src/net.cpp.o
[ 57%] Building CXX object CMakeFiles/viplnet.dir/src/pad_net.cpp.o
[ 61%] Building CXX object CMakeFiles/viplnet.dir/src/spatial_transform_net.cpp.o
[ 66%] Building CXX object CMakeFiles/viplnet.dir/src/tform_maker_net.cpp.o
[ 71%] Building CXX object CMakeFiles/viplnet.dir/tools/aligner.cpp.o
[ 76%] Building CXX object CMakeFiles/viplnet.dir/tools/face_identification.cpp.o
[ 80%] Linking CXX shared library libviplnet.so
[ 80%] Built target viplnet
Scanning dependencies of target test_face_recognizer.bin
[ 85%] Building CXX object src/test/CMakeFiles/./test_face_recognizer.bin.dir/test_face_recognizer.cpp.o
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp: In function ‘void FaceRecognizerTest_CropFace_Tester()’:
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:109:27: error: ‘imread’ is not a member of ‘cv’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:109:27: note: suggested alternative: ‘read’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
                           read
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp: In function ‘void FaceRecognizerTest_ExtractFeature_Tester()’:
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:175:27: error: ‘imread’ is not a member of ‘cv’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:175:27: note: suggested alternative: ‘read’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
                           read
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:177:9: error: ‘resize’ is not a member of ‘cv’
     cv::resize(src_img, src_img, cv::Size(face_recognizer.crop_height(),
         ^~~~~~
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:177:9: note: suggested alternative: ‘reduce’
     cv::resize(src_img, src_img, cv::Size(face_recognizer.crop_height(),
         ^~~~~~
         reduce
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp: In function ‘void FaceRecognizerTest_ExtractFeatureWithCrop_Tester()’:
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:244:27: error: ‘imread’ is not a member of ‘cv’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
/home/joseph/Documents/FACE_RECOGNITION/SeetaFaceEngine/FaceIdentification/src/test/test_face_recognizer.cpp:244:27: note: suggested alternative: ‘read’
     cv::Mat src_img = cv::imread(test_dir + img_name, 1);
                           ^~~~~~
                           read
src/test/CMakeFiles/./test_face_recognizer.bin.dir/build.make:62: recipe for target 'src/test/CMakeFiles/./test_face_recognizer.bin.dir/test_face_recognizer.cpp.o' failed
make[2]: *** [src/test/CMakeFiles/./test_face_recognizer.bin.dir/test_face_recognizer.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'src/test/CMakeFiles/./test_face_recognizer.bin.dir/all' failed
make[1]: *** [src/test/CMakeFiles/./test_face_recognizer.bin.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants