Are there any algorithms that would find the following ASCII-art image?
+
+
+++
+++++++
++ ++
++ + ++
++ +++ ++
++ + ++
++ ++
+++++++
+++
Inside the following body of text?
+ + + ++ + +++ + +
+ ++ + + ++++ + + + + + + +++ +++ +
+ + + ++ ++ ++ + ++ + + + + +
+ ++ + ++ + + + ++ ++ + +
++++++ + + + ++ + + + + ++ + + +
+ + + + + ++ + ++ + + + +
+++ + ++ + + + +++ + + ++ +
+++++ + + + + + + + +
+ + + + + + + + + + + +
++ + + + ++ + + + ++
I must highlight the ASCII art image in yellow which corresponds to the complete shape. See the picture attached:
I have to search a file which contains the rough shape, but not completely, a number of +
can be missing). The tolerance for a missing +
in the shape should be set by hand.
Now, I have two 2D arrays data array: [100][100] and the SlimeTorpedo array: [13][11].
Code for how to make the detection as stated by @kjartan (3-4 bullet):
int match = 0;
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
//Compare DataArr[i][j] with SlimeTorpedoArr[i][j]
//Look for "checked" position in the picture ("+"),
//which corresponds to a checked position in the
//slime torpedo array.
//match++;
}
}
What would be general guidance for how to approach this problem?