The computed masks by Mask R-CNN are of fixed size $m \times m$ each. How are they projected back to the image?
$\begingroup$
$\endgroup$
2
-
$\begingroup$ Is this the same question as your previous one https://ai.stackexchange.com/q/34551/2444? If not, can you clarify why. If yes, I recommend that you delete one of the two. $\endgroup$– nbroFeb 18, 2022 at 9:10
-
$\begingroup$ No it's a different question, about how the masks are back-projected to the input image. $\endgroup$– orbitFeb 19, 2022 at 6:16
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
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 for more details.