1. <i id='Mwcac'><tr id='Mwcac'><dt id='Mwcac'><q id='Mwcac'><span id='Mwcac'><b id='Mwcac'><form id='Mwcac'><ins id='Mwcac'></ins><ul id='Mwcac'></ul><sub id='Mwcac'></sub></form><legend id='Mwcac'></legend><bdo id='Mwcac'><pre id='Mwcac'><center id='Mwcac'></center></pre></bdo></b><th id='Mwcac'></th></span></q></dt></tr></i><div id='Mwcac'><tfoot id='Mwcac'></tfoot><dl id='Mwcac'><fieldset id='Mwcac'></fieldset></dl></div>
    <tfoot id='Mwcac'></tfoot>

    <small id='Mwcac'></small><noframes id='Mwcac'>

      <legend id='Mwcac'><style id='Mwcac'><dir id='Mwcac'><q id='Mwcac'></q></dir></style></legend>

        <bdo id='Mwcac'></bdo><ul id='Mwcac'></ul>
    1. 在 M X N 矩阵中查找 m x n 子矩阵的最快方法

      时间:2023-09-18
    2. <tfoot id='RIDZW'></tfoot>
    3. <legend id='RIDZW'><style id='RIDZW'><dir id='RIDZW'><q id='RIDZW'></q></dir></style></legend>
      <i id='RIDZW'><tr id='RIDZW'><dt id='RIDZW'><q id='RIDZW'><span id='RIDZW'><b id='RIDZW'><form id='RIDZW'><ins id='RIDZW'></ins><ul id='RIDZW'></ul><sub id='RIDZW'></sub></form><legend id='RIDZW'></legend><bdo id='RIDZW'><pre id='RIDZW'><center id='RIDZW'></center></pre></bdo></b><th id='RIDZW'></th></span></q></dt></tr></i><div id='RIDZW'><tfoot id='RIDZW'></tfoot><dl id='RIDZW'><fieldset id='RIDZW'></fieldset></dl></div>

              <tbody id='RIDZW'></tbody>
              <bdo id='RIDZW'></bdo><ul id='RIDZW'></ul>

              <small id='RIDZW'></small><noframes id='RIDZW'>

                本文介绍了在 M X N 矩阵中查找 m x n 子矩阵的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在考虑一种在更大的 mtrix M 中查找子矩阵 m 的快速方法.我还需要确定部分匹配.

                I was thinking of a fast method to look for a submatrix m in a bigger mtrix M. I also need to identify partial matches.

                我能想到的几种方法是:

                Couple of approaches I could think of are :

                1. 优化普通暴力破解,仅处理增量行和列.
                2. 可能会将 Rabin-karp 算法扩展到二维,但不确定如何处理部分匹配.

                我相信这是图像处理中经常遇到的问题,如果有人能倾诉他们的意见或向我指出有关此主题的资源/论文,我将不胜感激.

                I believe this is quite frequently encountered problem in image processing and would appreciate if someone could pour in their inputs or point me to resources/papers on this topic.

                较小的例子:

                更大的矩阵:
                1 2 3 4 5
                4 5 6 7 8
                9 7 6 5 2

                Bigger matrix:
                1 2 3 4 5
                4 5 6 7 8
                9 7 6 5 2

                较小的矩阵:
                7 8
                5 2

                Smaller Matrix:
                7 8
                5 2

                结果:(row: 1 col: 3)

                Result: (row: 1 col: 3)

                在 (1, 3) 处符合部分匹配条件的 Smaller 矩阵示例:
                7 9
                5 2

                An example of Smaller matrix which qualifies as a partial match at (1, 3):
                7 9
                5 2

                如果超过一半的像素匹配,则视为部分匹配.

                If More than half of pixels match, then it is taken as partial match.

                谢谢.

                推荐答案

                我建议在 Internet 上搜索2d 模式匹配算法".你会得到很多结果.我只会链接谷歌上的第一个点击,一篇论文,为您的问题提供了一种算法.

                I recommend doing an internet search on "2d pattern matching algorithms". You'll get plenty of results. I'll just link the first hit on Google, a paper that presents an algorithm for your problem.

                您还可以查看论文末尾的引文,以了解其他现有算法.

                You can also take a look at the citations at the end of the paper to get an idea of other existing algorithms.

                摘要:

                提出了一种在二维 n x n 文本中搜索二维 m x m 模式的算法.它的平均比较次数少于文本大小:n^2/m 使用 m^2 额外空间.基本上,它仅在文本的 n/m 行上使用多个字符串匹配.它最多运行 2n^2 次,并且接近许多模式的最佳 n^2 次.它稳步扩展到具有类似最坏情况的与字母表无关的算法.实验结果包含一个实用版本.

                An algorithm for searching for a two dimensional m x m pattern in a two dimensional n x n text is presented. It performs on the average less comparisons than the size of the text: n^2/m using m^2 extra space. Basically, it uses multiple string matching on only n/m rows of the text. It runs in at most 2n^2 time and is close to the optimal n^2 time for many patterns. It steadily extends to an alphabet-independent algorithm with a similar worst case. Experimental results are included for a practical version.

                这篇关于在 M X N 矩阵中查找 m x n 子矩阵的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:现代 OpenGL:VBO、GLM 和矩阵堆栈 下一篇:使用 Eigen C++ 库将每个矩阵列与每个向量元素相乘

                相关文章

                最新文章

                  1. <legend id='N7wEc'><style id='N7wEc'><dir id='N7wEc'><q id='N7wEc'></q></dir></style></legend>
                    • <bdo id='N7wEc'></bdo><ul id='N7wEc'></ul>
                    <tfoot id='N7wEc'></tfoot>
                  2. <small id='N7wEc'></small><noframes id='N7wEc'>

                    <i id='N7wEc'><tr id='N7wEc'><dt id='N7wEc'><q id='N7wEc'><span id='N7wEc'><b id='N7wEc'><form id='N7wEc'><ins id='N7wEc'></ins><ul id='N7wEc'></ul><sub id='N7wEc'></sub></form><legend id='N7wEc'></legend><bdo id='N7wEc'><pre id='N7wEc'><center id='N7wEc'></center></pre></bdo></b><th id='N7wEc'></th></span></q></dt></tr></i><div id='N7wEc'><tfoot id='N7wEc'></tfoot><dl id='N7wEc'><fieldset id='N7wEc'></fieldset></dl></div>