title: ValueError: zero-size array to reduction operation maximum which has no identity
body: <p>I am using some scripts from Github for a Telecine project, and am running into the following error (traceback included:)</p>
  
  <pre><code>/usr/lib/python2.7/dist-packages/picamera/encoders.py:544: 
  PiCameraResolutionRounded: frame size rounded up from 3280x2464 to 3296x2464
  width, height, fwidth, fheight)))
  
  Traceback (most recent call last):
  File "tc-setupjob.py", line 253, in mouse_handler
  pf.findFirstFromCoords(img,(x,y),20)
  File "/home/pi/rpiTelecine/rpiTelecine/perforation.py", line 230, in 
  findFirstFromCoords
  threshVal = int(vROI.max()*self.thresholdVal)
  File "/usr/lib/python2.7/dist-packages/numpy/core/_methods.py", line 17, in 
  _amax
  out=out, keepdims=keepdims)
  ValueError: zero-size array to reduction operation maximum which has no 
  identity
  </code></pre>
  
  <p>This is supposed to be a script which detects the perforation on a strip of film and takes that and determines the crop area when you click on the image area in the preview it generates. </p>
  
  <p>The scripts in question are from github located here:</p>
  
  <p><a href="https://github.com/Alexamder/rpitelecine/blob/master/tc-setupjob.py" rel="nofollow noreferrer">https://github.com/Alexamder/rpitelecine/blob/master/tc-setupjob.py</a></p>
  
  <p>Which calls on this one, which seems to be where the problem lies:</p>
  
  <p><a href="https://github.com/Alexamder/rpitelecine/blob/master/rpiTelecine/perforation.py" rel="nofollow noreferrer">https://github.com/Alexamder/rpitelecine/blob/master/rpiTelecine/perforation.py</a></p>
  
  <p>I came across a suggestion to catch the exception and ignore it from someone encountering a similar error for a different application and thought I might just be able to add an exception:</p>
  
  <pre><code>   #take a vertical section of pixels from the ROI and threshold it
  try:
      vROI = self.ROIimg[:,xStart-win:xStart+win]
      threshVal = int(vROI.max()*self.thresholdVal)
  except ValueError:
      pass
  </code></pre>
  
  <p>By default that code just looks like this:</p>
  
  <pre><code>  #take a vertical section of pixels from the ROI and threshold it
          vROI = self.ROIimg[:,xStart-win:xStart+win]
          threshVal = int(vROI.max()*self.thresholdVal)
  </code></pre>
  
  <p>If I add the exception I get this error:</p>
  
  <pre><code>pi@raspberrypi:~/rpiTelecine $ sudo python tc-setupjob.py -s8 fats
  Traceback (most recent call last):
    File "tc-setupjob.py", line 44, in &lt;module&gt;
      from tc_common import *
    File "/home/pi/rpiTelecine/tc_common.py", line 39, in &lt;module&gt;
      import rpiTelecine
    File "/home/pi/rpiTelecine/rpiTelecine/__init__.py", line 44, in &lt;module&gt;
      from rpiTelecine.perforation import (
    File "/home/pi/rpiTelecine/rpiTelecine/perforation.py", line 54, in &lt;module&gt;
      class telecinePerforation():
    File "/home/pi/rpiTelecine/rpiTelecine/perforation.py", line 230, in telecinePerforation
      vROI = self.ROIimg[:,xStart-win:xStart+win]
  NameError: name 'self' is not defined
  </code></pre>
  
  <p>I'm new to dealing with Python so at the moment I am shooting in the dark and would greatly appreciate it if someone could point me in the right direction. </p>