Answers.Body: <p>Each computed mask is simply resized to the corresponding computed bounding-box. For example, using OpenCV:</p>
  <pre><code>mask = cv2.resize(mask, (bboxW, bboxH), interpolation=cv2.INTER_NEAREST)
  </code></pre>
  <p>Then, after converting it to a binary mask by thresholding it, you can overlay this mask on the input image using the coordinates of the corresponding computed bounding-box.</p>
  <p>See <a href="https://pyimagesearch.com/2018/11/19/mask-r-cnn-with-opencv/" rel="nofollow noreferrer">here</a> for more details.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-19T08:47:20.673Z
Answers.LastActivityDate: 2022-02-20T10:33:30.813Z
Answers.LastEditDate: 2022-02-20T10:33:30.813Z
Answers.UserDisplayName: kuzand
Body: <p>The computed masks by Mask R-CNN are of fixed size <span class="math-container">$m \times m$</span> each. How are they projected back to the image?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-18T09:10:31.243Z
Comments.Text: Is this the same question as your previous one [https://ai.stackexchange.com/q/34551/2444](https://ai.stackexchange.com/q/34551/2444)? If not, can you clarify why. If yes, I recommend that you delete one of the two.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-19T06:16:44.113Z
Comments.Text: No it's a different question, about how the masks are back-projected to the input image.
Comments.UserDisplayName: orbit
Tags: <deep-learning><object-detection><instance-segmentation><mask-rcnn>
Title: Mask R-CNN: How are the computed masks projected back to the input image?
UserDisplayName: orbit
ThreadText: # Mask R-CNN: How are the computed masks projected back to the input image?
  
  (Asked by: username_0 on 2022-02-17)
  
  The computed masks by Mask R-CNN are of fixed size $m \times m$ each. How are they projected back to the image?
  
  **Tags:** deep-learning, object-detection, instance-segmentation, mask-rcnn
  
  > **Comments:**
  > **username_1**: Is this the same question as your previous one [https://ai.stackexchange.com/q/34551/2444](https://ai.stackexchange.com/q/34551/2444)? If not, can you clarify why. If yes, I recommend that you delete one of the two.  
  > **username_0**: No it's a different question, about how the masks are back-projected to the input image.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-02-19. Score: 0
  
  Each computed mask is simply resized to the corresponding computed bounding-box. For example, using OpenCV:
  
  ```
  mask = cv2.resize(mask, (bboxW, bboxH), interpolation=cv2.INTER_NEAREST)
  
  ```
  
  Then, after converting it to a binary mask by thresholding it, you can overlay this mask on the input image using the coordinates of the corresponding computed bounding-box.
  
  See [here](https://pyimagesearch.com/2018/11/19/mask-r-cnn-with-opencv/) for more details.
  
  
  ---
  
  