Cavewhere / cavewhere

3D Cave Mapping Software
https://cavewhere.com
GNU General Public License v3.0
34 stars 8 forks source link

Support Projected Profiles For Scrap Types #186

Open vpicaver opened 4 years ago

vpicaver commented 4 years ago

It would be nice to support Projected Profiles. This would enable cross-sections and other Projected Profiles in CaveWhere. This is the same warping algorithm as plan, but the view is different.

echarlie commented 3 years ago

I've put some testing on the (partial?) implementation of this in 26b1b9862e6a3947c489b8123546fc3c4438699a through 19db0c48c3a7c2a090dc87252edae217ad7b334a. Thus far it seems to work well. however, 1) the UI is less-than-intuitive (I don't know how to fix that other than documentation; I figured it out eventually), and 2) it would be nice if it guessed projection plane based on shots.

vpicaver commented 3 years ago

I'm currently working on a blog post and video now. The biggest issue is the the user currently has to select a valid azimuth for the profile. Do you remember what you tried first, because that's usually most intuitive approach. It's a good idea, if CaveWhere could automatically guess the profile plane's azimuth.

echarlie commented 3 years ago

I thought L->R or R->L would end up being the most sane, but quickly figured out it was easiest to just manipulate the 3d viewer to set view az to what I recalled the cross-section as being, and then plugging that in to "looking at"; starting from the shot azimuth may work just as well. It's also a little harder to get reasonable results, since guessing up and scale doesn't work as predictably as in profile or plan; it was mostly a matter of trial and error.

vpicaver commented 3 years ago

So I've been playing around with this tonight. I think the azimuth can also be auto calculated if using sketched-to-scale sketch. Below is an example projected profile: Profile

I've iterated through all the azimuths and graphed the error generate by each azimuth. There's two error components for the note transform:

  1. Scale error
  2. Direction error

Error

These errors can be normalized and summed. From some brief experimentation with real cave data, I've found that Minimizing the Direction error tends to give the best results. The algorithm only works for good sketches. Poorly sketched sketches, can produce bad results.

vpicaver commented 3 years ago

I basically need to write an algorithm that quickly iterates through azimuths and choose the best azimuth by minimizing the error. The example above, the correct answer is azimuth 135 degrees.

vpicaver commented 3 years ago

I think the only case, where this algorithm would fail, is if projected profile is UP or DOWN shot. Then the projection plan could be any azimuth.

vpicaver commented 3 years ago

@echarlie CaveWhere now automatically find the correct azimuth for the Project Profile Projection in 9fa93a05aeff7b119f087b80a23108620ea59288

echarlie commented 3 years ago

I gave it a quick spin with some data I had with 2-4 stations in the cross section: usually it ended up off by 40° (for all "orientations" of l-r, r-l, and "looking at"). This may be a consequence of the sketches not being accurately to scale; I'll give it a go with some constructed data.

vpicaver commented 3 years ago

The algorithm tries to minimize the variance in the rotation, so the length of the shots don't matter as much as the direction of the shots. I was actually thinking about adding the per shot variances as an output so users could see how sketched-to-scale the sketch is. Then CaveWhere could make a database of good sketchers vs bad sketchers (hahaha).

On Tue, Dec 8, 2020 at 3:19 PM echarlie notifications@github.com wrote:

I gave it a quick spin with some data I had with 2-4 stations in the cross section: usually it ended up off by 40° (for all "orientations" of l-r, r-l, and "looking at"). This may be a consequence of the sketches not being accurately to scale; I'll give it a go with some constructed data.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Cavewhere/cavewhere/issues/186#issuecomment-740969874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKKDA3FC5ZUJZRHH4X2QXLST2C35ANCNFSM4R7V53EQ .

echarlie commented 3 years ago

c.f. Bristol's comment about "prolific sketchers who don't use protractors"... This was mostly for near-horizontal shots and stations practically in-plane with each other: what should be almost perfect conditions. So I was surprised.

vpicaver commented 3 years ago

Do you think it's better than not trying to find it the azimuth automatically?