Define bounding space (or box) in perspective view inside PCL Visualizer
I have captured a point cloud of a scene containing a sphere (yellow ball).
In order to define a bounding box for this sphere, I carried out following
(1) Visualize the point cloud in PCL Visualizer
(2) Used registerPointPickingCallback function to manually record both
diagonal points of the bounding rectangle for the current view inside PCL
(3) Used CropBox filter by providing these two points as limits for the
filter (The z limit for the filter was increased just to be on safe side and
not to crop the sphere on z-axes).
The above doesn't work. In order to debug into the issue, I colored both
diagonal points of the bounding rectangle as red and green. Also, I draw a
cube with the same limits used in CropBox filter. Please see below GIF image
of the visualizer-
Initially, the sphere appeared to be inside the bounding rectangle. But it
was much clear after the view was rotated.
My goal is to define a bounding box for this sphere. I realized that the
problem is arriving due to perspective view hence I tried composing an
affine transformation using camera object, but it didn't work. Below is the