Page 1 of 1

Few additional tools for selecting objects

Posted: Thu Nov 06, 2014 12:58 pm
by RobH616
Hi Daniel,

I have a few idea's for additional tools in CC (but currently and cannot add them myself due to lack of knowledge and time... hopefully this will change soon). These are additional tools for selecting parts of point cloud and mesh's in a box. Apologies if similar tools already exist and I just haven't found them:

(1) So I found that if you hold "alt" down you can drag a box over things you would like to select, however I see that if the box touch a part of an object, the whole object is selected. I think a few additional tools for selecting things in boxes would be useful:
(a) - a selection tool that only selects the mesh's in the box *if* the whole mesh is in that box (at present if a tiny part of the mesh is in the box it is selected. ( this would also be useful for point clouds as a "quick" version of the segmentation tool)
(b) - A selection tool in this box that can either select the points/mesh's in the users view or in a box bounded in 2D but extends along the line of sight (i.e. if there are points or mesh's behind the object that the user can't see but inside the solid angle of the box then you can either choose to select only the ones seen or all ).

(2) I've also been playing around with computing cloud2cloud and cloud2mesh distances and this tool works brilliantly and the color key is a fantastic way to see large deviations over large surfaces. It becomes a little tricky to quantify small variations and so I think it would be use to have another selection tool where the user can select a small defined region of points (similar to the segmentation tool - but only for the "surface" points i.e. ones you can see) and calculates a simple average of the C2C/C2M distances for those points. Maybe this could be extended to define two small regions and the tool gives the difference of the averages.

Any thoughts on this ?? I don't yet have a good understanding of how hard these would be to implement.

I've been playing around with various programs that can manipulate point clouds and I've got to say my favorite is CloudCompare by a very long way! (Honestly, some of the trial versions of other software that I've tried (not naming any names) is just slow, jerky, doesn't accept a wide range of file types and terrible documentation/support. If you manage to get it to do what you want it comes out with almost exactly the same result as CC (if not worse!)... Don't understand how some of these companies exist! And for that I have the highest regard for you and this program.

Best Regards,
Rob

Re: Few additional tools for selecting objects

Posted: Thu Nov 06, 2014 5:17 pm
by daniel
Hi Rob,

At least you don't lack ideas ;)

1.a - in fact, for picking we always use OpenGL that simply tells us which entities the drawn pixels (either around the cursor or in the box) belongs to. So it's very easy to 'select' those entities. But determining if the whole entity falls inside the picking area is much more difficult (or slow if you do this in a 'brute-force' way). Of course, if you find a proper way to do this, we'd be glad to integrate it. We'll also have to figure out how to activate it (a different shortcut?)

1.b - For now you can't select a subset of points (or triangles) this way. You can only pick entities. And for entities, we have the same issue as above: with OpenGL we don't necessarily know all the entities falling inside this 'extended' box (we only get the visible one, and potentially some others falling behind but there's no guarantee as it depends on the display order). So to do this properly we would need to use the octree. It's a little bit easier than 1.a (but it's still a lot of work ;)

2 - I like the idea of being able to get an average of the scalar field values over a small patch. We could implement this rather easily by extending the concept of '2D Labels'. For clouds, keeping only the 'visible points' is possible at least in perspective mode (see the qHPR plugin). I wonder if this algorithm can be extended to orthographic mode. In the worst case and in a first attempt it may be simpler to simply get all the points inside a sphere around the picked point.

For the 'comparison of two small regions' it's less clear to me how it could be implemented (especially regarding the graphical interface and user manipulations).

Re: Few additional tools for selecting objects

Posted: Fri Nov 07, 2014 12:07 pm
by RobH616
Hi Daniel,

Thanks for the quick reply.

CC appears to be very quick at cycling calculations repeated on millions of points in a point-cloud, for example registration or distance calculation or even simply just rotating or translating a PC with 20-million points seems very smooth etc..
So I'm finding it hard to believe that the 'brute force' method of doing 1.a. would be slow at all. If it's quick to access all the entities in a box, then surely it's not *that* much slow to run through each vertex of each entity and access whether it's in the box and selecting only those entities with all vertices inside a box. I guess this massively depends on how many vertices are on the mesh so maybe a cruder but quicker way would be to get the dimensions of the bounding box of each entity and then simply have a check to see if the bounding box falls inside the selected box (or selected box extended along line of sight). (Does this make sense ???)

I've not come across 2D labels yet or the qHPR plugin. I'll look into it.

P.S. I understand this isn't an easy question to answer but assuming one is fairly competent at C++ but hasn't come across CloudCompare source code or Qt before, how many weeks/months do you think it would take to get a (somewhat) complete understanding of the CC source code (assuming said person was doing this 9-5 on weekdays) ??

Regards,
Rob

Re: Few additional tools for selecting objects

Posted: Fri Nov 07, 2014 2:03 pm
by daniel
Well, it all depends what you find acceptable for a picking tool ;). Moreover, don't forget that you would have to project all 3D points in 2D (screen coordinates). But as I said, if you want to try it (and if you found a neat way to integrate it in the current interface) don't hesitate.

And to answer your P.S. question:
  • Qt is very simple, apart maybe for the signal/slot mechanism. Anyway, with good tutorials you can get the grasp over it in a few hours.
  • CC is of course more messy, with several layers and appendices. And even if I am the main developer (roughly 95% of the code) over 10 years my coding style, my habits and my motivation for writing commentaries changed a lot! But it's not so complicated and I would say than you can master most of the code in one or two weeks (of course you should first skip the plugins, the I/O filters. ccViewer, etc.). The most interesting parts are CC_CORE_LIB (most of the algorithms and base interfaces), QCC_IO_DB (for the entities) and QCC_GL_LIB (for the display). The CloudCompare project itself mainly consists in linking the former libraries with the graphical interface.

Re: Few additional tools for selecting objects

Posted: Fri Nov 07, 2014 2:10 pm
by RobH616
Hi Daniel,

Understood, Thanks for the info. I'll see what I can do ( although it won't be nearly 9-5 ).

Regards,
Rob