Using the latest Calise 0.4.0 in Ubuntu 12.04 32bit, the calibration fails at step 6, here's the output:
Step 6 of 7
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
This passage lets the program be aware of the lower lightness that can be registered by the camera to contrast its white balance feature.
Cover the webcam and then press ENTER or RETURN
Now calibrating, do not uncover the webcam...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 275, in run
self.average = sum(self.data) / len(self.data)
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "/usr/bin/calise", line 120, in <module>
CliCalibration(defName, brPath=calise.options.arguments.path)
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 426, in __init__
self.OffsetPassage()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 739, in OffsetPassage
self.offset = valThread.average
AttributeError: 'calCapture' object has no attribute 'average'
And speaking of calibration, I see that you've implemented getting the latitude and longitude via geoip lookup. But the message "The program has found these coordinates (44.4333, 26.1) through geoip lookup, would you like to use these value? [Y/n]" is not very descriptive, shouldn't it say the name of the city too, so the user knows if those values are correct or not?
mmm, it means that the var that stores captures has no data. Has this happened once or happens everytime? Normal usage (not on calibration) works?
Anyway, for now, I'll put *works for me* since I just tested few calibrations on my machine and everything went fine.
About geoip you're right, I'll open a feature request ASAP, thanks.
I've had Calise 0.3.0 installed, I've then installed 0.4.0 and it worked. I've then removed the config file, to try and see if the automatic lat/long feature was implemented and now I get this error each time I try to run the calibration (it occured 4 times out of 4 tries). So right now I can't run calise anymore because I can't calibrate it.
clear enough *Accepted*. I'll fix that as soon as I can.
Should be fixed with that: http://sourceforge.net/projects/calise/files/calise-beta/0.4.0/iss3543055.fix.diff
Btw it was a bug indeed, I did not consider cameras with low fps.
Let me know if that fixed the bug.
Now I don't get the error, but it segfaults:
Step 6 of 7
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
This passage lets the program be aware of the lower lightness that can be registered by the camera to contrast its white balance feature.
Cover the webcam and then press ENTER or RETURN
Now calibrating, do not uncover the webcam...
Segmentation fault
Simple camera test script
Bad news.
I attached a simple python2 script to test calise camera module.
Please run (maybe few times) and report results, if it *always* segfaults fixing will take time (and you'd not be able to run 0.4.0)
Here's the output:
andrei@andrei-desktop:~/Desktop$ python camera_test.py
opening path...
initializing...
Traceback (most recent call last):
File "camera_test.py", line 12, in <module>
a.initialize()
cameramodule.CameraError: (16, 'VIDIOC_S_FMT error: Device or resource busy\n')
*** glibc detected *** python: double free or corruption (!prev): 0x09a1b670 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x73e42)[0xb7367e42]
python[0x813b954]
python[0x813babd]
python[0x8076f22]
python(PyDict_SetItem+0x50)[0x81ab0c0]
python(_PyModule_Clear+0x180)[0x80e1f10]
python(PyImport_Cleanup+0x5b0)[0x80e2520]
python(Py_Finalize+0x1a7)[0x8171f47]
python(Py_Main+0x3d5)[0x815a355]
python(main+0x1b)[0x805e78b]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb730d4d3]
python[0x805e7b1]
======= Memory map: ========
08048000-0829f000 r-xp 00000000 08:01 6685902 /usr/bin/python2.7
0829f000-082a0000 r--p 00256000 08:01 6685902 /usr/bin/python2.7
082a0000-082f5000 rw-p 00257000 08:01 6685902 /usr/bin/python2.7
082f5000-08301000 rw-p 00000000 00:00 0
09975000-09a58000 rw-p 00000000 00:00 0 [heap]
b7025000-b7225000 r--p 00000000 08:01 6691905 /usr/lib/locale/locale-archive
b7225000-b72a9000 rw-p 00000000 00:00 0
b72a9000-b72d3000 r-xp 00000000 08:01 2103619 /lib/i386-linux-gnu/libm-2.15.so
b72d3000-b72d4000 r--p 00029000 08:01 2103619 /lib/i386-linux-gnu/libm-2.15.so
b72d4000-b72d5000 rw-p 0002a000 08:01 2103619 /lib/i386-linux-gnu/libm-2.15.so
b72d5000-b72f1000 r-xp 00000000 08:01 2097294 /lib/i386-linux-gnu/libgcc_s.so.1
b72f1000-b72f2000 r--p 0001b000 08:01 2097294 /lib/i386-linux-gnu/libgcc_s.so.1
b72f2000-b72f3000 rw-p 0001c000 08:01 2097294 /lib/i386-linux-gnu/libgcc_s.so.1
b72f3000-b72f4000 rw-p 00000000 00:00 0
b72f4000-b7493000 r-xp 00000000 08:01 2098164 /lib/i386-linux-gnu/libc-2.15.so
b7493000-b7495000 r--p 0019f000 08:01 2098164 /lib/i386-linux-gnu/libc-2.15.so
b7495000-b7496000 rw-p 001a1000 08:01 2098164 /lib/i386-linux-gnu/libc-2.15.so
b7496000-b7499000 rw-p 00000000 00:00 0
b7499000-b74ad000 r-xp 00000000 08:01 2098223 /lib/i386-linux-gnu/libz.so.1.2.3.4
b74ad000-b74ae000 r--p 00013000 08:01 2098223 /lib/i386-linux-gnu/libz.so.1.2.3.4
b74ae000-b74af000 rw-p 00014000 08:01 2098223 /lib/i386-linux-gnu/libz.so.1.2.3.4
b74af000-b7641000 r-xp 00000000 08:01 2112370 /lib/i386-linux-gnu/libcrypto.so.1.0.0
b7641000-b7650000 r--p 00192000 08:01 2112370 /lib/i386-linux-gnu/libcrypto.so.1.0.0
b7650000-b7657000 rw-p 001a1000 08:01 2112370 /lib/i386-linux-gnu/libcrypto.so.1.0.0
b7657000-b765a000 rw-p 00000000 00:00 0
b765a000-b76a9000 r-xp 00000000 08:01 2107993 /lib/i386-linux-gnu/libssl.so.1.0.0
b76a9000-b76aa000 ---p 0004f000 08:01 2107993 /lib/i386-linux-gnu/libssl.so.1.0.0
b76aa000-b76ac000 r--p 0004f000 08:01 2107993 /lib/i386-linux-gnu/libssl.so.1.0.0
b76ac000-b76b0000 rw-p 00051000 08:01 2107993 /lib/i386-linux-gnu/libssl.so.1.0.0
b76b0000-b76b2000 r-xp 00000000 08:01 2103693 /lib/i386-linux-gnu/libutil-2.15.so
b76b2000-b76b3000 r--p 00001000 08:01 2103693 /lib/i386-linux-gnu/libutil-2.15.so
b76b3000-b76b4000 rw-p 00002000 08:01 2103693 /lib/i386-linux-gnu/libutil-2.15.so
b76b4000-b76b5000 rw-p 00000000 00:00 0
b76b5000-b76b8000 r-xp 00000000 08:01 2103618 /lib/i386-linux-gnu/libdl-2.15.so
b76b8000-b76b9000 r--p 00002000 08:01 2103618 /lib/i386-linux-gnu/libdl-2.15.so
b76b9000-b76ba000 rw-p 00003000 08:01 2103618 /lib/i386-linux-gnu/libdl-2.15.so
b76ba000-b76d1000 r-xp 00000000 08:01 2103683 /lib/i386-linux-gnu/libpthread-2.15.so
b76d1000-b76d2000 r--p 00016000 08:01 2103683 /lib/i386-linux-gnu/libpthread-2.15.so
b76d2000-b76d3000 rw-p 00017000 08:01 2103683 /lib/i386-linux-gnu/libpthread-2.15.so
b76d3000-b76d5000 rw-p 00000000 00:00 0
b76f0000-b76f2000 rw-p 00000000 00:00 0
b76f2000-b76f5000 r-xp 00000000 08:01 6817115 /usr/lib/python2.7/dist-packages/calise/camera.so
b76f5000-b76f6000 r--p 00002000 08:01 6817115 /usr/lib/python2.7/dist-packages/calise/camera.so
b76f6000-b76f7000 rw-p 00003000 08:01 6817115 /usr/lib/python2.7/dist-packages/calise/camera.so
b76f7000-b76f8000 r--p 005e0000 08:01 6691905 /usr/lib/locale/locale-archive
b76f8000-b76fa000 rw-p 00000000 00:00 0
b76fa000-b76fb000 r-xp 00000000 00:00 0 [vdso]
b76fb000-b771b000 r-xp 00000000 08:01 2097215 /lib/i386-linux-gnu/ld-2.15.so
b771b000-b771c000 r--p 0001f000 08:01 2097215 /lib/i386-linux-gnu/ld-2.15.so
b771c000-b771d000 rw-p 00020000 08:01 2097215 /lib/i386-linux-gnu/ld-2.15.so
bf907000-bf928000 rw-p 00000000 00:00 0 [stack]
Aborted
that error is something else, camera device is being used (blocked) by some other process (and btw, as you can see, it gets cought as custom cameramodule.CameraError).
If you have the possibility of doing that I'd suggest a reboot and then a retry. I mean, it can be difficult to track and be able to stop a (eventually) locked process (blocking the camera)
Mmm, weird, no camera app is running, but I'll try a restart
After a restart, I got this:
Step 6 of 7
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
This passage lets the program be aware of the lower lightness that can be registered by the camera to contrast its white balance feature.
Cover the webcam and then press ENTER or RETURN
Now calibrating, do not uncover the webcam...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 276, in run
self.average = sum(self.data) / len(self.data)
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "/usr/bin/calise", line 120, in <module>
CliCalibration(defName, brPath=calise.options.arguments.path)
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 427, in __init__
self.OffsetPassage()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 740, in OffsetPassage
self.offset = valThread.average
AttributeError: 'calCapture' object has no attribute 'average'
lol so it hasn't got fixed... :) funny.
ok, really last thing you can try
edit file /usr/lib/python2.7/dist-packages/calise/calibration.py
comment out line 274 like that:
- del self.data[:-(int(10 * fps))]
+ #del self.data[:-(int(10 * fps))]
I think you have to reboot again... probably was that not correctly terminated calise session blocking the camera.
sorry I meant *comment* not comment-out
It still doesn't work:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 276, in run
self.average = sum(self.data) / len(self.data)
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "/usr/bin/calise", line 120, in <module>
CliCalibration(defName, brPath=calise.options.arguments.path)
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 427, in __init__
self.OffsetPassage()
File "/usr/lib/python2.7/dist-packages/calise/calibration.py", line 740, in OffsetPassage
self.offset = valThread.average
AttributeError: 'calCapture' object has no attribute 'average'
ok, then so you truly have no captures inside self.data...
so, more than before, I need the output of the simple script I attached there.
Here it is:
python camera_test.py
opening path...
initializing...
starting capture...
taking a frame...
brightness value found: 54
stopping capture...
uninitializing...
closing path...
ok, that means *everything ok*
Try to run this other script I attached.