I am trying to do very simple (LUT-like) operations on a 16-bit OpenCV Mat-scale, which is efficient and does not slow down the debugger.
Despite the fact that the documentation has a detailed page devoted to this particular problem, it is not indicated that most of these methods are available on 8-bit images (including the ideal, optimized LUT function).
I tried the following methods:
uchar* p = mat_depth.data;
for (unsigned int i = 0; i < depth_width * depth_height * sizeof(unsigned short); ++i)
{
*p = ...;
*p++;
}
Really fast, unfortunately, only uchart support (exactly the same as LUT).
int i = 0;
for (int row = 0; row < depth_height; row++)
{
for (int col = 0; col < depth_width; col++)
{
i = mat_depth.at<short>(row, col);
i = ..
mat_depth.at<short>(row, col) = i;
}
}
Adapted from this answer: qaru.site/questions/1574474 / ... . It didn’t work for me, and it was very slow.
cv::MatIterator_<ushort> it, end;
for (it = mat_depth.begin<ushort>(), end = mat_depth.end<ushort>(); it != end; ++it)
{
*it = ...;
}
It works well, however it uses a lot of CPU and makes the debugger super slow.
qaru.site/questions/1574474/... LUT , , IPP OpenCL.
, , - , , ushorts.
? , - .data.