Considering a 2D matrix of positive and negative numbers, how might one draw a rectangle within it whose contents sum higher than all other rectangles'? This fundamental problem, commonly known the maximum rectangle problem or subwindow search, spans many computational domains. Yet, the problem has not been solved without demanding computational resources at least linearly proportional to the size of the matrix. In this work, we present a new approach to the problem which achieves sublinear time and memory complexities by interpolating between a small amount of equidistant sections of the matrix. Applied to natural images, our solution outperforms the state-of-the-art by achieving an 11x increase in speed and memory efficiency at 99% comparative accuracy. In general, our solution outperforms existing solutions when matrices are sufficiently large and a marginal decrease in accuracy is acceptable, such as in many problems involving natural images. As such, it is well-suited for real-time application and in a variety of computationally hard instances of the maximum rectangle problem.
翻译:考虑一个由正数和负数组成的二维矩阵,在其中绘制一个内容总和高于所有其他矩形的矩形,该如何实现?这个基本问题通常称为最大矩形问题或子窗口搜索,它涵盖了许多计算领域。然而,这个问题没有被解决,除非要求的计算资源至少与矩阵的大小成线性比例。在本文中,我们提出了一种新的方法来解决这个问题,通过在矩阵的少量等距切片之间插值来实现次线性的时间和内存复杂度。应用于自然图像,我们的解决方案在99%的比较准确度下,速度和内存效率均提高了11倍,优于现有技术水平。一般地,我们的解决方案在矩阵足够大且能容忍轻微准确度下降的情况下,均优于现有方案,例如在许多涉及自然图像的问题中。因此,它非常适合实时应用和各种计算难度较大的最大矩形问题实例。