title: Fast OpenCV Array Increment for Repeated Indices (C++)
body: <p>I need to increment an OpenCV array <code>image</code> according to indices held in another object Y. Now Y, may contain <em>repeated indices</em> i.e. these locations should be incremented multiple times. Y is typically 100000 elements. Currently this is solved with a simple for loop as follows:</p>
  <pre><code>for (const auto&amp; e: Y)
  {
     image.at&lt;float&gt;(e.y, e.x) += 1; 
  }
  </code></pre>
  <p>This piece of code is called many times and is currently a bottleneck in my application. Is there a quicker way to do this?</p>