title: Python OpenCV thresholding by logical indexing
body: <p>I am trying to threshold certain values in a grayscale image. So far I have been successful by inputting certain ranges of numbers, but I want to take the values that are between 50 and 150 and multiply them by 1.2. I am not sure how I can access the number within the vector to then multiply it by 1.2. </p>
  
  <pre><code>myimg[myimg &lt;= 50] = 0
  myimg[myimg &gt; 150 ] = 255
  myimg[50&lt;myimg&lt;=150] = myimg * 1.2 #this line produces this error: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() 
  </code></pre>