maelvls / homebrew-amc

🍺 Homebrew formula for auto-multiple-choice 📖
https://www.auto-multiple-choice.net/download-macosx.en
34 stars 10 forks source link

Issue with OpenCV 3.4.1 #4

Closed maelvls closed 6 years ago

maelvls commented 6 years ago

Homebrew updated OpenCV from 3.4.0 to 3.4.1 and it apparently broke something. You will get the following error in the terminal:

OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
libc++abi.dylib: libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type
terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type

There is a similar issue in https://github.com/pjreddie/darknet/issues/518.

Workaround until this is fixed in Homebrew core and in OpenCV:

# brew ls --versions opencv
opencv 3.4.1_1 3.4.0_1 3.4.1_2

At this point, I see that I still have 3.4.1_1 so I can go ahead and use it instead of 3.4.1_2:

# brew switch opencv 3.4.1_1

Now it should work


Note: the issue seems to be in AMC-analyse.cc

auto-multiple-choice analyse --debug /dev/stderr --no-multiple --tol-marque 0.2,0.2 --prop 0.8 --bw-threshold 0.6 --progression-id analyse --progression 1 --n-procs 4 --data /Users/mvalais/MC-Projects/ralph-exemple/data --projet /Users/mvalais/MC-Projects/ralph-exemple/ --cr /Users/mvalais/MC-Projects/ralph-exemple/cr --liste-fichiers /var/folders/8f/mmpn479168g_rtnr15z__0jh0000gn/T/liste-zPGIFw --no-ignore-red --try-three
[  87941,   0.30] [87941]>>
This is AutoMultipleChoice, version 1.3.0+hg2017-10-25 (r:33b2895d5ed5)
Perl: /usr/local/Cellar/perl/5.26.1/bin/perl v5.26.1

========================================

Version: ImageMagick 7.0.7-25 Q16 x86_64 2018-03-04 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
========================================

GraphicsMagick 1.3.28 2018-01-20 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2018 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Native Thread Safe       yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 yes
  Ghostscript (Library)    no
  JBIG                     no
  JPEG-2000                yes
  JPEG                     yes
  Little CMS               no
  Loadable Modules         yes
  OpenMP                   no
  PNG                      yes
  TIFF                     yes
  TRIO                     no
  UMEM                     no
  WebP                     no
  WMF                      no
  X11                      no
  XML                      yes
  ZLIB                     yes

Host type: x86_64-apple-darwin17.3.0

Configured using the command:
  ./configure  '--prefix=/usr/local/Cellar/graphicsmagick/1.3.28_1' '--disable-dependency-tracking' '--enable-shared' '--disable-static' '--with-modules' '--without-lzma' '--disable-openmp' '--with-quantum-depth=16' '--without-gslib' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts' '--with-webp=no' '--without-x' '--without-lcms2' '--without-wmf' 'CC=clang' 'CXX=clang++'

Final Build Parameters:
  CC       = clang
  CFLAGS   = -g -O2 -Wall -D_THREAD_SAFE
  CPPFLAGS = -I/usr/local/opt/freetype/include/freetype2 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2
  CXX      = clang++
  CXXFLAGS = -D_THREAD_SAFE
  LDFLAGS  = -L/usr/local/opt/freetype/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
  LIBS     = -lfreetype -lbz2 -lz -lltdl -lm -lpthread
========================================

[  87941,   0.31] Create progression pipe for  up to 1
[  87941,   0.31] Scan from list : /Users/mvalais/MC-Projects/ralph-exemple/scans/DOC-indiv-solution-1__glissees__copy_0003.tiff
[  87941,   0.33] Connecting to database layout...
[  87941,   0.33] Loading perl module layout...
[  87941,   0.34] Checking database version...
[  87941,   0.34] Opening RO transaction for layout [rVAR]...
[  87941,   0.34] [rVAR] <-  layout
[  87941,   0.34] Closing transaction for layout [rVAR]...
[  87941,   0.34] [rVAR]  X  layout
[  87941,   0.34] variables table present.
[  87941,   0.34] Opening RO transaction for layout [vTRS]...
[  87941,   0.34] [vTRS] <-  layout
[  87941,   0.34] Closing transaction for layout [vTRS]...
[  87941,   0.34] [vTRS]  X  layout
[  87941,   0.34] Module layout loaded.
[  87941,   0.34] Opening RO transaction for layout [cRLY]...
[  87941,   0.34] [cRLY] <-  layout
[  87941,   0.34] Preparing statement COUNT
[  87941,   0.34] 20 layouts
[  87941,   0.34] Preparing statement studentPage
[  87941,   0.34] Preparing statement dims
[  87941,   0.34] Preparing statement mark
[  87941,   0.34] Preparing statement digitInfo
[  87941,   0.34] Closing transaction for layout [cRLY]...
[  87941,   0.34] [cRLY]  X  layout
[  87941,   0.34] Queue RUN
[  87941,   0.34] MAJ :
[  87941,   0.34] Fork : 87945
[  87941,   0.34] MAJ : 87945
[  87945,   0.00] Analysing scan /Users/mvalais/MC-Projects/ralph-exemple/scans/DOC-indiv-solution-1__glissees__copy_0003.tiff
[  87945,   0.00] Connecting to database layout...
[  87945,   0.00] Loading perl module layout...
[  87945,   0.00] Checking database version...
[  87945,   0.00] Opening RO transaction for layout [rVAR]...
[  87945,   0.00] [rVAR] <-  layout
[  87945,   0.00] Closing transaction for layout [rVAR]...
[  87945,   0.00] [rVAR]  X  layout
[  87945,   0.00] variables table present.
[  87945,   0.00] Opening RO transaction for layout [vTRS]...
[  87945,   0.00] [vTRS] <-  layout
[  87945,   0.00] Closing transaction for layout [vTRS]...
[  87945,   0.00] [vTRS]  X  layout
[  87945,   0.00] Module layout loaded.
[  87945,   0.00] Exec subprocess...
[  87945,   0.00] /usr/local/Cellar/auto-multiple-choice/1.3.0.2161_1/lib/AMC/exec/AMC-detect -x 2550 -y 3299.999958489 -d 42.5195119944089 -p 0.2 -m 0.2 -c 3 -t 0.6 -o 1
[  87945,   0.00] PID=87946 : GLOB(0x7ff73320a118) --> GLOB(0x7ff73320a100)
[  87945,   0.00] CMD : load /Users/mvalais/MC-Projects/ralph-exemple/scans/DOC-indiv-solution-1__glissees__copy_0003.tiff
[  87945,   0.00] |> TX=2550.00 TY=3300.00 DIAM=42.52
[  87945,   0.00] |> : Image background loaded
[  87945,   0.00] |> : loading /Users/mvalais/MC-Projects/ralph-exemple/scans/DOC-indiv-solution-1__glissees__copy_0003.tiff ...
[  87945,   0.00] |> : Image max = 255.000
[  87945,   0.00] |> : Image loaded
[  87945,   0.00] |> Morph: +2 -3
[  87945,   0.00] |> Target size: 17.0 ; 25.5
[  87945,   0.00] |> Detected connected components:
[  87945,   0.00] |> (1106;1540)+(20;22)
[  87945,   0.00] |> (148;1540)+(20;22)
[  87945,   0.00] |> (665;1369)+(24;25)
[  87945,   0.00] |> (194;1243)+(25;25)
[  87945,   0.00] |> (194;1212)+(25;25)
[  87945,   0.00] |> (665;1150)+(24;24)
[  87945,   0.00] |> (392;1052)+(24;25)
[  87945,   0.00] |> (508;464)+(25;25)
[  87945,   0.00] |> (366;464)+(25;25)
[  87945,   0.00] |> (224;464)+(25;25)
[  87945,   0.00] |> (1106;135)+(20;22)
[  87945,   0.00] |> (148;135)+(20;22)
[  87945,   0.00] |> (588;97)+(21;21)
[  87945,   0.00] |> Frame[0]: 157.5 ; 145.5
[  87945,   0.00] |> Frame[1]: 1115.5 ; 145.5
[  87945,   0.00] |> Frame[2]: 1115.5 ; 1550.5
[  87945,   0.00] |> Frame[3]: 157.5 ; 1550.5
[  87945,   0.00] |> __END__
[  87945,   0.00] Global frame:
[  87945,   0.00] (157.50,145.50) (1115.50,145.50) (1115.50,1550.50) (157.50,1550.50)
[  87945,   0.00] CMD : optim 316.54,291.94 2233.46,291.94 2233.46,3101.57 316.54,3101.57
[  87945,   0.00] |> Transfo:
[  87945,   0.00] |> a=0.499760
[  87945,   0.00] |> b=0.000000
[  87945,   0.00] |> c=0.000000
[  87945,   0.00] |> d=0.500066
[  87945,   0.00] |> e=-0.694040
[  87945,   0.00] |> f=-0.489223
[  87945,   0.00] |> MSE=0.000000
[  87945,   0.00] |> Back:
[  87945,   0.00] |> a'=2.000960
[  87945,   0.00] |> b'=-0.000000
[  87945,   0.00] |> c'=-0.000000
[  87945,   0.00] |> d'=1.999737
[  87945,   0.00] |> e'=1.388747
[  87945,   0.00] |> f'=0.978317
[  87945,   0.00] |> __END__
[  87945,   0.00] MSE=0.000000
[  87945,   0.00] CMD : mesure0 0.8 square 744.334181694135 782.13030988124 195.91514075229 233.711268939394
[  87945,   0.00] |> TCORNER 371.294,97.481
[  87945,   0.00] |> TCORNER 390.183,97.481
[  87945,   0.00] |> TCORNER 390.183,116.382
[  87945,   0.00] |> TCORNER 371.294,116.382
[  87945,   0.00] |> COIN 373.183,99.371
[  87945,   0.00] |> COIN 388.295,99.371
[  87945,   0.00] |> COIN 388.295,114.492
[  87945,   0.00] |> COIN 373.183,114.492
[  87945,   0.00] |> PIX 0 225
[  87945,   0.00] |> __END__
[  87945,   0.00] Binary box 1:1: 0/225 = 0.0000
[  87945,   0.00] CMD : mesure0 0.8 square 783.79072456154 821.586852748645 195.91514075229 233.711268939394
[  87945,   0.00] |> TCORNER 391.013,97.481
[  87945,   0.00] |> TCORNER 409.902,97.481
[  87945,   0.00] |> TCORNER 409.902,116.382
[  87945,   0.00] |> TCORNER 391.013,116.382
[  87945,   0.00] |> COIN 392.902,99.371
[  87945,   0.00] |> COIN 408.013,99.371
[  87945,   0.00] |> COIN 408.013,114.492
[  87945,   0.00] |> COIN 392.902,114.492
[  87945,   0.00] |> PIX 0 240
[  87945,   0.00] |> __END__
[  87945,   0.00] Binary box 1:2: 0/240 = 0.0000
[  87945,   0.00] CMD : mesure0 0.8 square 823.247267428945 861.043395616049 195.91514075229 233.711268939394
[  87945,   0.00] |> TCORNER 410.732,97.481
[  87945,   0.00] |> TCORNER 429.621,97.481
[  87945,   0.00] |> TCORNER 429.621,116.382
[  87945,   0.00] |> TCORNER 410.732,116.382
[  87945,   0.00] |> COIN 412.621,99.371
[  87945,   0.00] |> COIN 427.732,99.371
[  87945,   0.00] |> COIN 427.732,114.492
[  87945,   0.01] |> COIN 412.621,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:3: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 862.70381029635 900.499938483454 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 430.451,97.481
[  87945,   0.01] |> TCORNER 449.340,97.481
[  87945,   0.01] |> TCORNER 449.340,116.382
[  87945,   0.01] |> TCORNER 430.451,116.382
[  87945,   0.01] |> COIN 432.340,99.371
[  87945,   0.01] |> COIN 447.451,99.371
[  87945,   0.01] |> COIN 447.451,114.492
[  87945,   0.01] |> COIN 432.340,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:4: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 902.160353163754 939.956481350859 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 450.170,97.481
[  87945,   0.01] |> TCORNER 469.059,97.481
[  87945,   0.01] |> TCORNER 469.059,116.382
[  87945,   0.01] |> TCORNER 450.170,116.382
[  87945,   0.01] |> COIN 452.059,99.371
[  87945,   0.01] |> COIN 467.170,99.371
[  87945,   0.01] |> COIN 467.170,114.492
[  87945,   0.01] |> COIN 452.059,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:5: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 941.616896031159 979.413024218264 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 469.888,97.481
[  87945,   0.01] |> TCORNER 488.777,97.481
[  87945,   0.01] |> TCORNER 488.777,116.382
[  87945,   0.01] |> TCORNER 469.888,116.382
[  87945,   0.01] |> COIN 471.777,99.371
[  87945,   0.01] |> COIN 486.889,99.371
[  87945,   0.01] |> COIN 486.889,114.492
[  87945,   0.01] |> COIN 471.777,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:6: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 981.073438898564 1018.86956708567 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 489.607,97.481
[  87945,   0.01] |> TCORNER 508.496,97.481
[  87945,   0.01] |> TCORNER 508.496,116.382
[  87945,   0.01] |> TCORNER 489.607,116.382
[  87945,   0.01] |> COIN 491.496,99.371
[  87945,   0.01] |> COIN 506.607,99.371
[  87945,   0.01] |> COIN 506.607,114.492
[  87945,   0.01] |> COIN 491.496,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:7: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 1020.52998176597 1058.32610995307 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 509.326,97.481
[  87945,   0.01] |> TCORNER 528.215,97.481
[  87945,   0.01] |> TCORNER 528.215,116.382
[  87945,   0.01] |> TCORNER 509.326,116.382
[  87945,   0.01] |> COIN 511.215,99.371
[  87945,   0.01] |> COIN 526.326,99.371
[  87945,   0.01] |> COIN 526.326,114.492
[  87945,   0.01] |> COIN 511.215,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:8: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 1059.98652463337 1097.78265282048 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 529.045,97.481
[  87945,   0.01] |> TCORNER 547.934,97.481
[  87945,   0.01] |> TCORNER 547.934,116.382
[  87945,   0.01] |> TCORNER 529.045,116.382
[  87945,   0.01] |> COIN 530.934,99.371
[  87945,   0.01] |> COIN 546.045,99.371
[  87945,   0.01] |> COIN 546.045,114.492
[  87945,   0.01] |> COIN 530.934,114.492
[  87945,   0.01] |> PIX 0 240
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:9: 0/240 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 1099.44306750078 1137.23919568788 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 548.764,97.481
[  87945,   0.01] |> TCORNER 567.653,97.481
[  87945,   0.01] |> TCORNER 567.653,116.382
[  87945,   0.01] |> TCORNER 548.764,116.382
[  87945,   0.01] |> COIN 550.653,99.371
[  87945,   0.01] |> COIN 565.764,99.371
[  87945,   0.01] |> COIN 565.764,114.492
[  87945,   0.01] |> COIN 550.653,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:10: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 1138.89961036818 1176.69573855529 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 568.482,97.481
[  87945,   0.01] |> TCORNER 587.371,97.481
[  87945,   0.01] |> TCORNER 587.371,116.382
[  87945,   0.01] |> TCORNER 568.482,116.382
[  87945,   0.01] |> COIN 570.371,99.371
[  87945,   0.01] |> COIN 585.483,99.371
[  87945,   0.01] |> COIN 585.483,114.492
[  87945,   0.01] |> COIN 570.371,114.492
[  87945,   0.01] |> PIX 0 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:11: 0/225 = 0.0000
[  87945,   0.01] CMD : mesure0 0.8 square 1178.35615323559 1216.15228142269 195.91514075229 233.711268939394
[  87945,   0.01] |> TCORNER 588.201,97.481
[  87945,   0.01] |> TCORNER 607.090,97.481
[  87945,   0.01] |> TCORNER 607.090,116.382
[  87945,   0.01] |> TCORNER 588.201,116.382
[  87945,   0.01] |> COIN 590.090,99.371
[  87945,   0.01] |> COIN 605.201,99.371
[  87945,   0.01] |> COIN 605.201,114.492
[  87945,   0.01] |> COIN 590.090,114.492
[  87945,   0.01] |> PIX 225 225
[  87945,   0.01] |> __END__
[  87945,   0.01] Binary box 1:12: 225/225 = 1.0000
[  87945,   0.01] CMD : mesure0 0.8 square 744.334181694135 782.13030988124 245.728341250422 283.524469437526
[  87945,   0.01] |> TCORNER 371.294,122.391
[  87945,   0.01] |> TCORNER 390.183,122.391
[  87945,   0.02] |> TCORNER 390.183,141.292
[  87945,   0.02] |> TCORNER 371.294,141.292
[  87945,   0.02] |> COIN 373.183,124.281
[  87945,   0.02] |> COIN 388.295,124.281
[  87945,   0.02] |> COIN 388.295,139.402
[  87945,   0.02] |> COIN 373.183,139.402
[  87945,   0.02] |> PIX 0 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:1: 0/225 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 783.79072456154 821.586852748645 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 391.013,122.391
[  87945,   0.02] |> TCORNER 409.902,122.391
[  87945,   0.02] |> TCORNER 409.902,141.292
[  87945,   0.02] |> TCORNER 391.013,141.292
[  87945,   0.02] |> COIN 392.902,124.281
[  87945,   0.02] |> COIN 408.013,124.281
[  87945,   0.02] |> COIN 408.013,139.402
[  87945,   0.02] |> COIN 392.902,139.402
[  87945,   0.02] |> PIX 0 240
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:2: 0/240 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 823.247267428945 861.043395616049 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 410.732,122.391
[  87945,   0.02] |> TCORNER 429.621,122.391
[  87945,   0.02] |> TCORNER 429.621,141.292
[  87945,   0.02] |> TCORNER 410.732,141.292
[  87945,   0.02] |> COIN 412.621,124.281
[  87945,   0.02] |> COIN 427.732,124.281
[  87945,   0.02] |> COIN 427.732,139.402
[  87945,   0.02] |> COIN 412.621,139.402
[  87945,   0.02] |> PIX 0 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:3: 0/225 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 862.70381029635 900.499938483454 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 430.451,122.391
[  87945,   0.02] |> TCORNER 449.340,122.391
[  87945,   0.02] |> TCORNER 449.340,141.292
[  87945,   0.02] |> TCORNER 430.451,141.292
[  87945,   0.02] |> COIN 432.340,124.281
[  87945,   0.02] |> COIN 447.451,124.281
[  87945,   0.02] |> COIN 447.451,139.402
[  87945,   0.02] |> COIN 432.340,139.402
[  87945,   0.02] |> PIX 0 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:4: 0/225 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 902.160353163754 939.956481350859 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 450.170,122.391
[  87945,   0.02] |> TCORNER 469.059,122.391
[  87945,   0.02] |> TCORNER 469.059,141.292
[  87945,   0.02] |> TCORNER 450.170,141.292
[  87945,   0.02] |> COIN 452.059,124.281
[  87945,   0.02] |> COIN 467.170,124.281
[  87945,   0.02] |> COIN 467.170,139.402
[  87945,   0.02] |> COIN 452.059,139.402
[  87945,   0.02] |> PIX 0 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:5: 0/225 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 941.616896031159 979.413024218264 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 469.888,122.391
[  87945,   0.02] |> TCORNER 488.777,122.391
[  87945,   0.02] |> TCORNER 488.777,141.292
[  87945,   0.02] |> TCORNER 469.888,141.292
[  87945,   0.02] |> COIN 471.777,124.281
[  87945,   0.02] |> COIN 486.889,124.281
[  87945,   0.02] |> COIN 486.889,139.402
[  87945,   0.02] |> COIN 471.777,139.402
[  87945,   0.02] |> PIX 225 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 2:6: 225/225 = 1.0000
[  87945,   0.02] CMD : mesure0 0.8 square 981.073438898564 1018.86956708567 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 489.607,122.391
[  87945,   0.02] |> TCORNER 508.496,122.391
[  87945,   0.02] |> TCORNER 508.496,141.292
[  87945,   0.02] |> TCORNER 489.607,141.292
[  87945,   0.02] |> COIN 491.496,124.281
[  87945,   0.02] |> COIN 506.607,124.281
[  87945,   0.02] |> COIN 506.607,139.402
[  87945,   0.02] |> COIN 491.496,139.402
[  87945,   0.02] |> PIX 225 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 3:1: 225/225 = 1.0000
[  87945,   0.02] CMD : mesure0 0.8 square 1020.52998176597 1058.32610995307 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 509.326,122.391
[  87945,   0.02] |> TCORNER 528.215,122.391
[  87945,   0.02] |> TCORNER 528.215,141.292
[  87945,   0.02] |> TCORNER 509.326,141.292
[  87945,   0.02] |> COIN 511.215,124.281
[  87945,   0.02] |> COIN 526.326,124.281
[  87945,   0.02] |> COIN 526.326,139.402
[  87945,   0.02] |> COIN 511.215,139.402
[  87945,   0.02] |> PIX 225 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 3:2: 225/225 = 1.0000
[  87945,   0.02] CMD : mesure0 0.8 square 1059.98652463337 1097.78265282048 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 529.045,122.391
[  87945,   0.02] |> TCORNER 547.934,122.391
[  87945,   0.02] |> TCORNER 547.934,141.292
[  87945,   0.02] |> TCORNER 529.045,141.292
[  87945,   0.02] |> COIN 530.934,124.281
[  87945,   0.02] |> COIN 546.045,124.281
[  87945,   0.02] |> COIN 546.045,139.402
[  87945,   0.02] |> COIN 530.934,139.402
[  87945,   0.02] |> PIX 240 240
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 3:3: 240/240 = 1.0000
[  87945,   0.02] CMD : mesure0 0.8 square 1099.44306750078 1137.23919568788 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 548.764,122.391
[  87945,   0.02] |> TCORNER 567.653,122.391
[  87945,   0.02] |> TCORNER 567.653,141.292
[  87945,   0.02] |> TCORNER 548.764,141.292
[  87945,   0.02] |> COIN 550.653,124.281
[  87945,   0.02] |> COIN 565.764,124.281
[  87945,   0.02] |> COIN 565.764,139.402
[  87945,   0.02] |> COIN 550.653,139.402
[  87945,   0.02] |> PIX 225 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 3:4: 225/225 = 1.0000
[  87945,   0.02] CMD : mesure0 0.8 square 1138.89961036818 1176.69573855529 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 568.482,122.391
[  87945,   0.02] |> TCORNER 587.371,122.391
[  87945,   0.02] |> TCORNER 587.371,141.292
[  87945,   0.02] |> TCORNER 568.482,141.292
[  87945,   0.02] |> COIN 570.371,124.281
[  87945,   0.02] |> COIN 585.483,124.281
[  87945,   0.02] |> COIN 585.483,139.402
[  87945,   0.02] |> COIN 570.371,139.402
[  87945,   0.02] |> PIX 0 225
[  87945,   0.02] |> __END__
[  87945,   0.02] Binary box 3:5: 0/225 = 0.0000
[  87945,   0.02] CMD : mesure0 0.8 square 1178.35615323559 1216.15228142269 245.728341250422 283.524469437526
[  87945,   0.02] |> TCORNER 588.201,122.391
[  87945,   0.02] |> TCORNER 607.090,122.391
[  87945,   0.02] |> TCORNER 607.090,141.292
[  87945,   0.02] |> TCORNER 588.201,141.292
[  87945,   0.02] |> COIN 590.090,124.281
[  87945,   0.02] |> COIN 605.201,124.281
[  87945,   0.02] |> COIN 605.201,139.402
[  87945,   0.02] |> COIN 590.090,139.402
[  87945,   0.03] |> PIX 0 225
[  87945,   0.03] |> __END__
[  87945,   0.03] Binary box 3:6: 0/225 = 0.0000
Page : +1/1/60+
[  87945,   0.03] Found binary ID: +1/1/60+
[  87945,   0.03] Opening RO transaction for layout [cFLY]...
[  87945,   0.03] [cFLY] <-  layout
[  87945,   0.03] Preparing statement exists
[  87945,   0.03] Closing transaction for layout [cFLY]...
[  87945,   0.03] [cFLY]  X  layout
[  87945,   0.03] CMD : rotateOK
[  87945,   0.03] |> __END__
[  87945,   0.03] Opening RO transaction for layout [cELY]...
[  87945,   0.03] [cELY] <-  layout
[  87945,   0.03] Preparing statement dims
[  87945,   0.03] Preparing statement mark
[  87945,   0.03] Preparing statement digitInfo
[  87945,   0.03] Preparing statement boxInfo
[  87945,   0.03] Preparing statement namefieldInfo
[  87945,   0.03] Closing transaction for layout [cELY]...
[  87945,   0.03] [cELY]  X  layout
[  87945,   0.03] Connecting to database capture...
[  87945,   0.03] Loading perl module capture...
[  87945,   0.03] Checking database version...
[  87945,   0.03] Opening RO transaction for capture [rVAR]...
[  87945,   0.03] [rVAR] <-  capture
[  87945,   0.04] Closing transaction for capture [rVAR]...
[  87945,   0.04] [rVAR]  X  capture
[  87945,   0.04] variables table present.
[  87945,   0.04] Opening RO transaction for capture [vTRS]...
[  87945,   0.04] [vTRS] <-  capture
[  87945,   0.04] Closing transaction for capture [vTRS]...
[  87945,   0.04] [vTRS]  X  capture
[  87945,   0.04] Module capture loaded.
[  87945,   0.04] CMD : zooms /var/folders/8f/mmpn479168g_rtnr15z__0jh0000gn/T/sLvBMTnDTC
[  87945,   0.04] |> __END__
[  87945,   0.04] CMD : id 1 1 10 3
[  87945,   0.04] |> __END__
[  87945,   0.04] CMD : mesure0 0.8 square 1332.03103464142 1376.70210556847 2301.67053302719 2346.34160395425
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type

[  87945,   0.04] |> TCORNER 665.002,1150.498
[  87945,   0.04] |> TCORNER 687.327,1150.498
[  87945,   0.04] |> TCORNER 687.327,1172.836
[  87945,   0.04] |> TCORNER 665.002,1172.836
[  87945,   0.04] |> COIN 667.234,1152.731
[  87945,   0.04] |> COIN 685.094,1152.731
[  87945,   0.04] |> COIN 685.094,1170.602
[  87945,   0.04] |> COIN 667.234,1170.602
[  87945,   0.04] |> : Saving zoom to /var/folders/8f/mmpn479168g_rtnr15z__0jh0000gn/T/sLvBMTnDTC/10-3.png
[  87945,   0.04] |> : Z=(663,1148)+(26,26)
[  87945,   0.04] CMD : id 1 1 8 8
[  87941,   0.56] MAJ :
[  87941,   0.56] Leaving queue.
====+1

maelvls commented 6 years ago

Here is the interesting snippet:

[  87945,   0.04] CMD : mesure0 0.8 square 1332.03103464142 1376.70210556847 2301.67053302719 2346.34160395425
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type
maelvls commented 6 years ago

AMC-detect.cc, lines 1264-1291:

if(sscanf(commande, "mesure0 %lf %s %lf %lf %lf %lf",
                       &prop, shape_name,
                       &xmin, &xmax, &ymin, &ymax) == 6) {
        /* "mesure0" and 6 arguments: proportion, shape, xmin, xmax, ymin, ymax
           return: number of black pixels and total number of pixels */
        transforme(&transfo, xmin, ymin, &box[0].x, &box[0].y);
        transforme(&transfo, xmax, ymin, &box[1].x, &box[1].y);
        transforme(&transfo, xmax, ymax, &box[2].x, &box[2].y);
        transforme(&transfo, xmin, ymax, &box[3].x, &box[3].y);

        if(strcmp(shape_name,"oval") == 0) {
          shape_id = SHAPE_OVAL;
        } else {
          shape_id = SHAPE_SQUARE;
        }

        /* output transformed points */
        for(i = 0; i < 4; i++) {
          printf("TCORNER %.3f,%.3f\n", box[i].x, box[i].y);
        }

        mesure_case(src, illustr, illustr_mode,
                    student, page, question, answer,
                    prop, shape_id,
                    xmin, xmax, ymin, ymax, &transfo_back,
                    box, dst, zooms_dir, view);
        student = -1;
      }

The error seems to come before TCORNER is displayed, so probably in transforme()

maelvls commented 6 years ago

Narrowed it to cvSaveImage!

maelvls commented 6 years ago

Ok, I issued a bug ticket to the OpenCV project: https://github.com/opencv/opencv/issues/11076 Update: for short, they do not provide support for the C API for 5 years now. We should move away from the C API in AMC I guess

maelvls commented 6 years ago

Bug fixed in PR 53 (bitbucket). We simply rewrote the C calls into C++ calls.