From d765497fb81e25d451244016fa728461d51473e0 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 30 May 2019 14:47:49 +0900 Subject: [PATCH] fix typo for occurrences message --- lib/image-util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/image-util.js b/lib/image-util.js index 8fdf7d1f..e265184a 100644 --- a/lib/image-util.js +++ b/lib/image-util.js @@ -429,6 +429,7 @@ async function getImageOccurrence (fullImgData, partialImgData, options = {}) { const matched = await fullImg.matchTemplateAsync(partialImg, cv.TM_CCOEFF_NORMED); const minMax = await matched.minMaxLocAsync(); if (minMax.maxVal < threshold) { + // Below error message, `Cannot find any occurrences` is referenced in find by image throw new Error(`Cannot find any occurrences of the partial image in the full ` + `image above the threshold of ${threshold}. Highest match value ` + `found was ${minMax.maxVal}`); @@ -440,7 +441,8 @@ async function getImageOccurrence (fullImgData, partialImgData, options = {}) { height: partialImg.rows }; } catch (e) { - throw new Error(`Cannot find any occurences of the partial image in the full image. ` + + // Below error message, `Cannot find any occurrences` is referenced in find by image + throw new Error(`Cannot find any occurrences of the partial image in the full image. ` + `Original error: ${e}`); } if (visualize) {