Question

I am working on opencv sgbm(semi global block matching) function. Here two parameters (minDisparity and numberOfDisparities) are used. In that why numberOfDisparities values should be divisible by 16?

Was it helpful?

Solution

Probably to simplify the code internally, which uses SSE2. In general, SSE2 instructions:

  • Work on multiple numbers simultaneously; having the total number of pieces of information be evenly divisible makes things simpler.
  • SSE2 requires 128-bit (16 byte) memory alignment; alignment can be more easily maintained when things are nice multiples of 16...

If you examine the OpenCV source code, you'll see lots of SSE2 code for the SGBM algorithm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top