title: how to detect irregular shape in image and add value to its interior?
body: <p>There are two images, one is original image with value, another let's call it shape image, with irregular shapes. I want to detect the shape, and add different value to the value img, corresponding to the shape img. shapes won't intersect with each other.
  I've been looking through multiple libs, including open cv2, yet find hard to accomplish this goal. Would anyone be able to help? Thanks.</p>
  
  <p>possible shape image</p>
  
  <p><img src="https://i.stack.imgur.com/usGfq.png" alt="possible shape image"></p>
  
  <p>I wish to add +1/-1 alternatively from outside to inside</p>
  
  <p><img src="https://i.stack.imgur.com/jQZma.png" alt="I wish to add +1/-1 alternatively from outside to inside"></p>