2D texture to mat type issue

Might want to check in on this mega thread:

YEARS of good historic advice and code snippets… just takes some time to peruse.

My team and I used it back in 2015…