How can I use a statistical approach to match patterns in a 3x3 grid?

Click For Summary
SUMMARY

The discussion focuses on using statistical methods to match patterns in a 3x3 grid, particularly in the context of optical character recognition (OCR). A specific approach involves calculating the Euclidean distance between a candidate pattern and a reference pattern, where a distance of 0 indicates an exact match. The formula used is the square root of the sum of squared differences between corresponding elements of the flattened matrices. This method allows for the identification of the closest matching pattern from a set of candidates based on their distances.

PREREQUISITES
  • Understanding of Euclidean distance calculation
  • Familiarity with matrix representation and manipulation
  • Basic knowledge of optical character recognition (OCR) principles
  • Experience with statistical pattern recognition techniques
NEXT STEPS
  • Research advanced statistical methods for pattern recognition
  • Explore machine learning algorithms for character recognition
  • Learn about dimensionality reduction techniques for pattern matching
  • Investigate the use of convolutional neural networks (CNNs) in OCR applications
USEFUL FOR

This discussion is beneficial for data scientists, machine learning engineers, and software developers working on optical character recognition systems or any project requiring pattern matching in grid-based data structures.

squaremeplz
Messages
114
Reaction score
0

Homework Statement



If I have a 3*3 grid, or 3*3 matrix, which records clicked points.
I.e.

Pattern T =

[1,1] = 1
[1,2] = 1
[1,3] = 1
[2,1] = -1
[2,2] = 1
[2,3] = -1
[3,1] = -1
[3,2] = 1
[3,3] = -1

or

1 1 1
-1 1 -1
-1 1 -1

What is the best way to statistically match x = 1 vs x = not 1
 
Last edited by a moderator:
Physics news on Phys.org
squaremeplease said:

Homework Statement



If I have a 3*3 grid, or 3*3 matrix, which records clicked points.
I.e.

Pattern T =

[1,1] = 1
[1,2] = 1
[1,3] = 1
[2,1] = -1
[2,2] = 1
[2,3] = -1
[3,1] = -1
[3,2] = 1
[3,3] = -1

or

1 1 1
-1 1 -1
-1 1 -1

What is the best way to statistically match x = 1 vs x = not 1

What do you mean "statistically match"?
 
Last edited:
I.e.

A new sequence is entered and we wish to identify group membership to T or C based on sample data for T and C. SInce T and C won't necessarily consist of 2 example database( 1 for each) but rather 1000 for T and 1000 C examples, how does one accurately calculate a match?
 
Last edited by a moderator:
I still don't have a clue what you're trying to do.
 
Last edited:
My question is related to optical character recognition. So if I draw a T, how do I match it to T that accurately reflects the entire training data?

I.e. if I have pattern T1, pattern T2, .., are the sequences for n T's.
C1, C2,..,CN is C training points for n C's.

If I feed a single C sequence in now, how do I weigh my decision most accurately?
 
Last edited by a moderator:
OK, now I understand. At the risk of oversimplification, let me define T this way:
Pattern T =

1 1 1
0 1 0
0 1 0

To match this pattern, a candidate pattern A should have a distance of 0 from this pattern, with distance calculated as
\sqrt{(a_0 - t_0)^2 + (a_1 - t_1)^2 + (a_2 - t_2)^2 + ... + (a_8 - t_8)^2}

In this formula I have flattened out your matrix to a one-dimensional array. The ti values are from pattern T, and the ai values are from the candidate pattern A.

If you get a "distance" of 0, the two patterns match exactly. If you have several candidate patterns with nonzero distances, pick the one with the smaller "distance."

That's how I would approach it.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
8K
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K