bug fix: need num of rows

`detectors` is a matrix with dimensions `nDetectors x 6`
`length()` gives the larger dimension, so this would simply give 6 as `nDetectors` if running with small number of images that lead to small number of detections (<6)