Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Merge d765497 into 41a99bc
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed May 30, 2019
2 parents 41a99bc + d765497 commit 84ed91c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/image-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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) {
Expand Down

0 comments on commit 84ed91c

Please sign in to comment.