1 | initial version |
yes, there are a lot of arguments against your approach:
in general:
avoid per-pixel operations at all cost, in 90% cases, there's a high-level, optimized function for this already in opencv
get a row ptr(), and access the desired type directly, like explained here
don't try to be smart. don't try to be smarter than the devs.