title: Numpy substract element wise from another tensor element
body: <p>I am not sure how to title my question. Only terms I know are <code>broadcasting</code> and <code>element wise</code>. Please correct my title if is not accurate.</p>
  
  <p><strong>Background:</strong><br>
  Previously I was working on text detection. However, detected picture is a bit smaller I can't get the whole information from the <code>cropped image</code>. I understand that I am using English based classifier to do word detection. </p>
  
  <p>Therefore I have to fine tune the cropped coords a bit for overlapping Thai sentence. Here is the example of a bit smaller cropped area. You can see punctuation and tone sign are partially lost</p>
  
  <p><a href="https://i.stack.imgur.com/9TC4d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9TC4d.png" alt="cropped picture"></a></p>
  
  <p>I have 3 squares represented in array called <code>pts</code></p>
  
  <pre class="lang-py prettyprint-override"><code>ipdb&gt; pts
  array([[[ 436, 3085],
          [2968, 3081],
          [2968, 3227],
          [ 436, 3232]],
  
         [[1222,  397],
          [1833,  400],
          [1833,  498],
          [1221,  496]],
  
         [[  86, 3275],
          [2968, 3268],
          [2968, 3421],
          [  87, 3427]]], dtype=int32)
  ipdb&gt; pts.shape
  (3, 4, 2)
  </code></pre>
  
  <p>Later on I do a calculation to find the center of them using
  <code>np.sum(pts, axis=1) / 4.0</code>. I put it to <code>center_pts</code></p>
  
  <pre class="lang-py prettyprint-override"><code>ipdb&gt; center_pts
  array([[1702.  , 3156.25],
         [1527.25,  447.75],
         [1527.25, 3347.75]])
  ipdb&gt; center_pts.shape
  (3, 2)
  </code></pre>
  
  <p><strong>Ultimate Goal:</strong><br>
  I want to cover the losing punctuation and tone sign</p>
  
  <p><strong>Attempt:</strong><br>
  I am trying to do subtraction to make a vector reference from center of the square and point to each corner. And times with small factor to cover the lost part of cropped image. </p>
  
  <p>My first idea is sacrifice one for loop and the use element wise to take advantage of broadcasting like this.</p>
  
  <pre class="lang-py prettyprint-override"><code>pts[0] - center_pts[0]
  array([[-1266.  ,   -71.25],
         [ 1266.  ,   -75.25],
         [ 1266.  ,    70.75],
         [-1266.  ,    75.75]])
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xTwgM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xTwgM.png" alt="vectors pointing to 4 corners"></a></p>
  
  <p><strong>Questions:</strong><br>
  1. Is it possible to do it without <code>for-loop</code>?<br>
  2. Are they any more productive to expand my square?</p>