AMC fails to identify scans (Bug #348)


Added by Jose Goicolea over 9 years ago. Updated over 9 years ago.


Status:Closed Start date:04/18/2015
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-

Description

I am using auto-multiple-choice version 1.2.1_1 on OS-X macports version 2.3.3. It has been working fine up to now, but it now fails to analyse the scans and identify the layouts and zooms. I guess this is probably due to the upgrade of some of the modules for analysing the images but I cannot find out which.

I enclose a debug .log file when analysing one of the scans, it fails to identify it according to the layouts.

I have copied the same project directory to a linux ubuntu machine and there it worked fine, without problems.


AMC-DEBUG-oDibkuKY.log - log file when attempting to identify and analyse scan response sheet. (64 kB) Jose Goicolea, 04/18/2015 11:58 pm

AMC-bug-report.zip - zip package with project, log files, screen saves (800 kB) Jose Goicolea, 04/22/2015 09:01 am

gdb-output.txt - gdb output (1.2 kB) Jose Goicolea, 04/22/2015 11:24 am

t6_0000.tif - sample scan file (25.7 kB) Jose Goicolea, 04/22/2015 11:16 pm

load.c (147 Bytes) Alexis Bienvenüe, 04/23/2015 02:06 pm

k.tif - tif file which works ok (490 kB) Jose Goicolea, 04/23/2015 10:53 pm


History

Updated by Jose Goicolea over 9 years ago

Further information to facilitate the analysis of this error:

  • The error occurs only in the macports version (Mac OS X 10.7.5), probably due to some of the auxiliary system programs.
  • I have prepared a slimmed-down project which reproduces the error, in a directory called "k".
  • I include screensave files showing the error on mac OSX and the correct processing of the same project on linux ubuntu.
  • I also include the log files for both systems.

All the files together with the .AMC.d configuration directory are included as a .zip package

Any help would be very welcome!

Updated by Alexis Bienvenüe over 9 years ago

On MacOSX, can you type the following command in a terminal?

/opt/local/lib/AMC/exec/AMC-detect -x 2480.31494396015 -y 3507.87397260274 -d 42.519511994409 -p 0.2 -m 0.2 -t 0.6 -o 1

It should not return, but let you type some commands: type
load /Users/goico/AMC/k/scans/t6_0000.tif

(followed by <return>) and tell us if you get any output.

Updated by Jose Goicolea over 9 years ago

Thanks for the attention, here is the result of these commands:

goico@trueno:~/AMC$ /opt/local/lib/AMC/exec/AMC-detect -x 2480.31494396015 -y 3507.87397260274 -d 42.519511994409 -p 0.2 -m 0.2 -t 0.6 -o 1
TX=2480.31 TY=3507.87 DIAM=42.52
load /Users/goico/AMC/k/scans/t6_0000.tif
Segmentation fault: 11
goico@trueno:~/AMC$ 

Updated by Alexis Bienvenüe over 9 years ago

Can you test the same with gdb?

gdb --args /opt/local/lib/AMC/exec/AMC-detect -x 2480.31494396015 -y 3507.87397260274 -d 42.519511994409 -p 0.2 -m 0.2 -t 0.6 -o 1

then, type run at the (gdb) prompt, and continue like before.

Updated by Jose Goicolea over 9 years ago

Thanks, I attach the output using gdb in a separate file

Updated by Alexis Bienvenüe over 9 years ago

What is the output of backtrace inside gdb after the crash?

Updated by Jose Goicolea over 9 years ago

here is the output of backtrace:

load /Users/goico/AMC/k/scans/t6_0000.tif

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000010730e180
0x0000000100618adc in put1bitbwtile ()
(gdb) backtrace
#0  0x0000000100618adc in put1bitbwtile ()
#1  0x00000001006167b0 in gtStripContig ()
#2  0x000000010061453d in TIFFReadRGBAStrip ()
#3  0x000000010028a264 in cv::TiffDecoder::readData ()
#4  0x000000010026da9a in cv::imread_ ()
#5  0x000000010027151f in cvLoadImage ()
#6  0x00000001000053be in main ()
(gdb) 

Updated by Alexis Bienvenüe over 9 years ago

It seems that the problem comes from OpenCV (using cvLoadImage to load your TIF scan file)…
Is it possible to try with another version of the OpenCV port (you will have to recompile AMC)?

Updated by Jose Goicolea over 9 years ago

Great!! the problem is solved, many, many thanks.

The opencv port in macports was updated recently to version 2.4.11_0, the previous version from 5 months ago was 2.4.10_0. I downloaded the older version and installed it, deactivating the newer version, as can be seen:

goico@trueno:~$ port installed opencv
The following ports are currently installed:
  opencv @2.4.10_0 (active)
  opencv @2.4.11_0
goico@trueno:~$ 

Then I uninstalled auto-multiple-choice and installed it again (I'm not sure this is necessary, just in case). After this everything works fine as it used to!!

Many thanks for your great help. AMC is a really fantastic tool and we use it a lot in our group at the technical university of Madrid. So we are really grateful, and even more so taking into account the attention to solving problems like these.

Best regards

Updated by Alexis Bienvenüe over 9 years ago

Great!! the problem is solved

Good.
However, it could be interesting to see what is the problem with opencv @2.4.11_0, and report it to MacPorts or OpenCV. Can you send me the scan file, so that I can have a look one day?

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Updated by Jose Goicolea over 9 years ago

Of course, I enclose the scan as an attached file.

I could report it also to MacPorts, but I don't know how to reproduce the task directly from opencv calls. If you can give me this info I can undertake to report the problem

Updated by Alexis Bienvenüe over 9 years ago

Attached is a simple program to use cvLoadImage.
Compile it with something like (I am not sure if the options are the right ones for MacOSX — compare with the arguments used when compiling AMC-detect.cc from AMC):

gcc -I/opt/local/include/opencv -lopencv_core -lopencv_highgui load.c -o load

And call (with the scan file in the same directory)
./load t6_0000.tif

Can you make this work with opencv @2.4.10_0?
Can you reproduce the problem with opencv @2.4.11_0?

Updated by Jose Goicolea over 9 years ago

OK, done. Firstly, the compilation command I have used is

gcc -I/opt/local/include/opencv -I/opt/local/include -L/opt/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc load.c -o load

This compiles successfully for both versions of opencv (@2.4.10_0 and @2.4.11_0). It runs OK under version @2.4.10_0, however no output is printed on the terminal. Under version @2.4.11_0 it fails with "Segmentation fault: 11". The gdb output in this case is:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000010720e180
0x000000010060dadc in put1bitbwtile ()
(gdb) backtrace
#0  0x000000010060dadc in put1bitbwtile ()
#1  0x000000010060b7b0 in gtStripContig ()
#2  0x000000010060953d in TIFFReadRGBAStrip ()
#3  0x000000010027f264 in cv::TiffDecoder::readData ()
#4  0x0000000100262a9a in cv::imread_ ()
#5  0x000000010026651f in cvLoadImage ()
#6  0x000000010000322b in main ()
(gdb) 

I guess this would be ok to report the problem for opencv in macports right?

Regards

Updated by Jose Goicolea over 9 years ago

OK, I have reported the problem to macports, the ticket number is https://trac.macports.org/ticket/47549

Updated by Alexis Bienvenüe over 9 years ago

Very good! Did you try with other TIF files, coming from elsewhere?

Updated by Jose Goicolea over 9 years ago

you're right, with other tiff files it seems to work ok. For instance, with this file which is converted from a jpg file I don't get an error. I guess tiff files can be quite different.

Also available in: Atom PDF