biigle / laserpoints

:m: BIIGLE module to perform a heuristic laser point detection on images
GNU General Public License v3.0
0 stars 0 forks source link

IndexError: tuple index out of range #7

Closed mzur closed 7 years ago

mzur commented 7 years ago

A new kind of unexpected error appeared in the log:

[2016-11-08 16:10:48] production.ERROR: Fatal error with laserpoint detection (code 1). {"command":"/usr/bin/python /vol/uwi/www/bias/vendor/dias/laserpoints/src/config/../resources/scripts/detect.py \"/vol/uwi/images/hausgarten/OFOS_2015/N3/PS93_062_1/Haul_1/OFOS_IV/2015_08_03//ARK29_HGN3_22_40_36_3348.JPG\" 50 \"[]\" 2>&1","output":["Traceback (most recent call last):","  File \"/vol/uwi/www/bias/vendor/dias/laserpoints/src/config/../resources/scripts/detect.py\", line 16, in <module>","    img[:, 0:int(img.shape[1] * 0.15), :] = 0","IndexError: tuple index out of range"]} 
[2016-11-08 16:16:48] production.ERROR: Fatal error with laserpoint detection (code 1). {"command":"/usr/bin/python /vol/uwi/www/bias/vendor/dias/laserpoints/src/config/../resources/scripts/detect.py \"/vol/uwi/images/hausgarten/OFOS_2015/N3/PS93_062_1/Haul_1/OFOS_IV/2015_08_03//ARK29_HGN3_20_39_59_2828.JPG\" 50 \"[[3311,1145],[3193,2536],[2025,1884]]\" 2>&1","output":["Traceback (most recent call last):","  File \"/vol/uwi/www/bias/vendor/dias/laserpoints/src/config/../resources/scripts/detect.py\", line 16, in <module>","    img[:, 0:int(img.shape[1] * 0.15), :] = 0","IndexError: tuple index out of range"]}

The first one occurred with a heuristic LP detection and the second one with manually set points.

dlangenk commented 7 years ago

The image files are corrupt. I could ignore it and read only the non-corrupt part but that might be not a good idea. I just check if the image is loaded. If it isn't i assume it is corrupt and issue a message. identify: Premature end of JPEG file /vol/uwi/images/hausgarten/OFOS_2015/N3/PS93_062_1/Haul_1/OFOS_IV/2015_08_03//ARK29_HGN3_22_40_36_3348.JPG' @ warning/jpeg.c/JPEGWarningHandler/352. identify: Corrupt JPEG data: premature end of data segment/vol/uwi/images/hausgarten/OFOS_2015/N3/PS93_062_1/Haul_1/OFOS_IV/2015_08_03//ARK29_HGN3_22_40_36_3348.JPG' @ warning/jpeg.c/JPEGWarningHandler/352.