Understanding visibility reasoning in CRAM
I am trying to understand how visual perception of CRAM works. Following the tutorial about simple plans, I found this file where the actual perception seems to take place. In calculate-object-visibility
, the comment states the following:
;; This method works by creating three rendered images. First it
;; renderes the object centered in the camera. Then it renders the
;; object with the correct camera. And finally it renders the
;; complete scene with each object in a different color. Everything
;; is rendered without lighting. To calculate the visibility ratio,
;; the ratio of visible pixels of `object' in the complete scene to
;; pixels that belong to the object (by using the first image) is
;; calculated. To calculate which objects are occluding `object',
;; image 2 is used. All pixels that are set there and don't belong
;; to `object' in image 3 are occluding pixels and hence the
;; corresponding object is occluding `object.
And have a bit of trouble understanding this procedure. I have rendered the images:
https://pasteboard.co/Ib1G4JQ.png "obj-total" in code / Image 1
https://pasteboard.co/Ib1FPPQ.png "obj-only" in code / Image 2
https://pasteboard.co/Ib1GfL7.png "scene" in code / Image 3
After going through the code, my guess is that
obj-total is an image with the object centered, so what the object would look like if it was in the center of the FOV. It acts as "base level" for the object's visibility
scene is used to see what the robot can actually see, rather than a hypothetical "full view" on the object. The object-colored pixels are counted as the visible pixels
the differences between obj-only and scene that are non-black pixels are occluding objects and their color is saved and mapped back to the objects.
Am I correct? And if so, what is the advantage of using the obj-total over just using the robot's view as base? I found this image from a different perspective rather confusing and I am still not sure if I understood it correctly, so any help is much appreciated!