Skip to content

And识别器中的Or识别器结果不符合预期 #1313

@overflow65537

Description

@overflow65537

问题类型 / Issue Type

识别问题 / Recognition Issue

问题描述及复现步骤 / Problem Description & Reproduction Steps

前置步骤
and识别器的条件0是一个简单识别节点,or识别器中的所有节点都基于条件0产生的结果
or识别器中是两个基于条件0结果偏移识别的节点(条件1和条件2)

预期行为:
条件0识别出多个结果,or识别器会按顺序将条件1和条件2运算完毕(如果条件1则命中短路,如果未命中则识别条件2)

实际行为:
条件0识别出多个结果,or识别器在识别第一个结果的时候,条件1未命中,条件2可命中
但or识别器在识别条件1未命中后,转而去识别第二个结果的条件1

MaaFramework 版本 / Version

5.10.2

日志文件 / Log Files

maafw.log

Pipeline JSON

{
    "测试": {
        "recognition": {
            "type": "And",
            "param": {
                "all_of": [
                    "GrowthChamberSelectTarget",
                    "GrowthChamberValidator"
                ],
                "box_index": 1
            }
        },
        "action": {
            "type": "Click"
        }
    },
    "GrowthChamberSelectTarget": {
        "desc": "[培养舱·培养] 识别可选择的培养对象",
        "recognition": {
            "type": "OCR",
            "param": {
                "roi": [
                    91,
                    218,
                    289,
                    250
                ],
                "expected": [
                    // @i18n-skip
                    "菌$",
                    "石$",
                    "叶$",
                    "葉$",
                    "stone$",
                    "site$",
                    "gela$",
                    "leaf$",
                    "garic$",
                    "cap$",
                    "nyx$",
                    "endra$",
                    "lete$"
                ],
                "order_by": "Vertical"
            }
        },
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0
    },
    "GrowthChamberValidator": {
        "desc": "[培养舱·培养] 验证培养对象是否有效",
        "recognition": {
            "type": "Or",
            "param": {
                "any_of": [
                    "GrowthChamberQuantitySeedValidator",
                    "GrowthChamberQuantityCropValidator"
                ]
            }
        }
    },
    "GrowthChamberQuantityCropValidator": {
        "desc": "[培养舱·培养] 作物数量验证器",
        "recognition": {
            "type": "OCR",
            "param": {
                "roi": "GrowthChamberSelectTarget",
                "roi_offset": [
                    -69,
                    46,
                    25,
                    -2
                ],
                "expected": [
                    "^拥有\\s*[1-9]\\d*$",
                    "^持有\\s*[1-9]\\d*$",
                    "(?i)^Owned\\s*[1-9]\\d*$",
                    "^総在庫\\s*[1-9]\\d*$"
                ],
                "only_rec": true,
                "order_by": "Vertical"
            }
        }
    },
    "GrowthChamberQuantitySeedValidator": {
        "desc": "[培养舱·培养] 基核数量验证器",
        "recognition": {
            "type": "OCR",
            "param": {
                "roi": "GrowthChamberSelectTarget",
                "roi_offset": [
                    31,
                    41,
                    23,
                    0
                ],
                "expected": [
                    "^[^0].*$"
                ],
                "only_rec": true,
                "order_by": "Vertical"
            }
        }
    }
}

崩溃 Dump 文件 / Crash Dump (仅崩溃问题 / Crash only)

No response

Draw 调试图片 / Draw Debug Images (仅识别问题 / Recognition only)

条件0识别结果
Image

对第一个结果进行的条件1识别
Image

对第二个结果进行的条件1识别(其实这里就不对了,应该去识别第一个结果的条件2)
Image

对第三个结果进行的条件1识别
Image

debug识别结果

[
  {
    "algorithm": "OCR",
    "box": [
      173,
      227,
      50,
      23
    ],
    "detail": {
      "all": [
        {
          "box": [
            99,
            223,
            18,
            18
          ],
          "score": 0.110297,
          "text": ""
        },
        {
          "box": [
            173,
            227,
            50,
            23
          ],
          "score": 0.999812,
          "text": "星门菌"
        },
        {
          "box": [
            188,
            267,
            13,
            10
          ],
          "score": 0.054932,
          "text": "1"
        },
        {
          "box": [
            205,
            270,
            117,
            20
          ],
          "score": 0.972655,
          "text": "0/1+43:42:23"
        },
        {
          "box": [
            109,
            271,
            52,
            26
          ],
          "score": 0.998017,
          "text": "拥有6"
        },
        {
          "box": [
            101,
            302,
            15,
            15
          ],
          "score": 0.538863,
          "text": ""
        },
        {
          "box": [
            172,
            305,
            36,
            23
          ],
          "score": 0.999303,
          "text": "燎石"
        },
        {
          "box": [
            183,
            340,
            23,
            23
          ],
          "score": 0.360465,
          "text": ""
        },
        {
          "box": [
            103,
            348,
            62,
            28
          ],
          "score": 0.997812,
          "text": "拥有28"
        },
        {
          "box": [
            208,
            348,
            113,
            20
          ],
          "score": 0.977727,
          "text": "4/1 +51:39:10"
        },
        {
          "box": [
            100,
            379,
            17,
            17
          ],
          "score": 0.086519,
          "text": ""
        },
        {
          "box": [
            172,
            382,
            51,
            24
          ],
          "score": 0.995112,
          "text": "重黯石"
        },
        {
          "box": [
            205,
            425,
            116,
            22
          ],
          "score": 0.974108,
          "text": "3/1+39:40:57"
        },
        {
          "box": [
            104,
            427,
            61,
            25
          ],
          "score": 0.997397,
          "text": "拥有32"
        },
        {
          "box": [
            94,
            454,
            24,
            13
          ],
          "score": 0.050451,
          "text": "D"
        }
      ],
      "best": {
        "box": [
          173,
          227,
          50,
          23
        ],
        "score": 0.999812,
        "text": "星门菌"
      },
      "filtered": [
        {
          "box": [
            173,
            227,
            50,
            23
          ],
          "score": 0.999812,
          "text": "星门菌"
        },
        {
          "box": [
            172,
            305,
            36,
            23
          ],
          "score": 0.999303,
          "text": "燎石"
        },
        {
          "box": [
            172,
            382,
            51,
            24
          ],
          "score": 0.995112,
          "text": "重黯石"
        }
      ]
    },
    "name": "GrowthChamberSelectTarget",
    "reco_id": 400000002
  },
  {
    "algorithm": "Or",
    "box": [
      203,
      346,
      59,
      23
    ],
    "detail": [
      {
        "algorithm": "OCR",
        "box": [
          203,
          346,
          59,
          23
        ],
        "detail": {
          "all": [
            {
              "box": [
                204,
                268,
                73,
                23
              ],
              "score": 0.948397,
              "text": "0/1+43"
            },
            {
              "box": [
                203,
                346,
                59,
                23
              ],
              "score": 0.983964,
              "text": "4/1+"
            },
            {
              "box": [
                203,
                423,
                74,
                24
              ],
              "score": 0.979116,
              "text": "3/1+39"
            }
          ],
          "best": {
            "box": [
              203,
              346,
              59,
              23
            ],
            "score": 0.983964,
            "text": "4/1+"
          },
          "filtered": [
            {
              "box": [
                203,
                346,
                59,
                23
              ],
              "score": 0.983964,
              "text": "4/1+"
            },
            {
              "box": [
                203,
                423,
                74,
                24
              ],
              "score": 0.979116,
              "text": "3/1+39"
            }
          ]
        },
        "name": "GrowthChamberQuantitySeedValidator",
        "reco_id": 400000004
      }
    ],
    "name": "GrowthChamberValidator",
    "reco_id": 400000003
  }
]

模板图片 / Template Images (仅识别问题 / Recognition only)

Image

其他信息 / Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions