This recreates pull request #2192
to extract object unique id and link index from segmentation mask in getCameraImage