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

Ubuntu: ./AAMED OpenCV 3.1 "Assertion failed", core dumped #6

Open
drscotthawley opened this issue Nov 19, 2020 · 1 comment
Open

Comments

@drscotthawley
Copy link

drscotthawley commented Nov 19, 2020

Hi. Thanks for sharing your software and writing instructions. I was wondering if you could advise me of an error that occurs when I try to execute AAMED.

On my Ubuntu system, I installed and built OpenCV 3.1.0 in ~/opencv-3.1.0/, which built to 100%.
Then I set my environment variable OpenCV_DIR to point to the build/ directory for OpenCV.
Then downloaded & built AAMED. But when I try to run it I get a failed assertion. Log follows:

$ git clone https://github.com/Li-Zhaoxi/AAMED.git
Cloning into 'AAMED'...
remote: Enumerating objects: 240, done.
remote: Counting objects: 100% (240/240), done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 240 (delta 86), reused 209 (delta 59), pack-reused 0
Receiving objects: 100% (240/240), 1.04 MiB | 4.58 MiB/s, done.
Resolving deltas: 100% (86/86), done.

$ cd AAMED/cmake-build

$ cmake ..
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/shawley/Downloads/AAMED/cmake-build

$ make 
make[1]: Entering directory '/home/shawley/Downloads/AAMED/cmake-build'
make[2]: Entering directory '/home/shawley/Downloads/AAMED/cmake-build'
Scanning dependencies of target AAMED
make[2]: Leaving directory '/home/shawley/Downloads/AAMED/cmake-build'
make[2]: Entering directory '/home/shawley/Downloads/AAMED/cmake-build'
[  6%] Building CXX object CMakeFiles/AAMED.dir/src/main.cpp.o
[ 13%] Building CXX object CMakeFiles/AAMED.dir/src/adaptApproximateContours.cpp.o
[ 20%] Building CXX object CMakeFiles/AAMED.dir/src/adaptApproxPolyDP.cpp.o
[ 26%] Building CXX object CMakeFiles/AAMED.dir/src/Contours.cpp.o
[ 33%] Building CXX object CMakeFiles/AAMED.dir/src/EllipseNonMaximumSuppression.cpp.o
[ 40%] Building CXX object CMakeFiles/AAMED.dir/src/FLED.cpp.o
[ 46%] Building CXX object CMakeFiles/AAMED.dir/src/FLED_drawAndWriteFunctions.cpp.o
/home/shawley/Downloads/AAMED/src/FLED_drawAndWriteFunctions.cpp: In member function ‘void FLED::drawFSA_ArcContours()’:
/home/shawley/Downloads/AAMED/src/FLED_drawAndWriteFunctions.cpp:153:22: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  153 |   sprintf(arcnum, "%d", i);
      |                      ^
In file included from /usr/include/stdio.h:866,
                 from /usr/include/c++/10/cstdio:42,
                 from /usr/include/c++/10/ext/string_conversions.h:43,
                 from /usr/include/c++/10/bits/basic_string.h:6535,
                 from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from /home/shawley/Downloads/AAMED/src/FLED.h:3,
                 from /home/shawley/Downloads/AAMED/src/FLED_drawAndWriteFunctions.cpp:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:34: note: ‘__builtin___sprintf_chk’ output between 2 and 11 bytes into a destination of size 10
   38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 53%] Building CXX object CMakeFiles/AAMED.dir/src/FLED_PrivateFunctions.cpp.o
[ 60%] Building CXX object CMakeFiles/AAMED.dir/src/Group.cpp.o
[ 66%] Building CXX object CMakeFiles/AAMED.dir/src/LinkMatrix.cpp.o
[ 73%] Building CXX object CMakeFiles/AAMED.dir/src/Node_FC.cpp.o
[ 80%] Building CXX object CMakeFiles/AAMED.dir/src/Segmentation.cpp.o
[ 86%] Building CXX object CMakeFiles/AAMED.dir/src/Validation.cpp.o
[ 93%] Building CXX object CMakeFiles/AAMED.dir/src/FLED_Initialization.cpp.o
[100%] Linking CXX executable AAMED
make[2]: Leaving directory '/home/shawley/Downloads/AAMED/cmake-build'
[100%] Built target AAMED
make[1]: Leaving directory '/home/shawley/Downloads/AAMED/cmake-build'

$ ./AAMED 
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in ipp_cvtColor, file /home/shawley/opencv-3.1.0/modules/imgproc/src/color.cpp, line 7456
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/shawley/opencv-3.1.0/modules/imgproc/src/color.cpp:7456: error: (-215) scn == 3 || scn == 4 in function ipp_cvtColor

Aborted (core dumped)

Any suggestions on how to recover from this? Thanks.

(P.S.- The only binaries for opencv-dev for my Ubuntu 20.10 system is OpenCV 4. So to get version 3.1 instead, I had to build it from source.)

@Li-Zhaoxi
Copy link
Owner

@drscotthawley

this error indicates that the function cvtColor cannot convert image from rgb to gray, please check whether the image mentioned in main.cpp exist.

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

2 participants