I have 4 handwritten images (I have their unique centroids and radius range in a table as a .mat file) and standard images from A to Z.
I want to compare the unique centroids and also the radius range of each 4 handwritten images with standard images based on a condition. The comparison is shown below in the fig. :
As you can see I have compared the handwritten image 1 with Standard image A, then handwritten image 2 is compared with standard image A, then handwritten image 3 is compared with Standard image A, then handwritten image 4 is compared with standard image A.
Next, handwritten image 1 is compared with Standard image B, then handwritten image 2 is compared with standard image B, then handwritten image 3 is compared with Standard image B, then handwritten image 4 is compared with standard image B.
Likewise, it goes upto standard image Z.
I was trying to automate this process using functions, but could not figure it out.
Also, I want to see the output in a table form like this:
Hanwritten Standard Score
- image 1 std A 3
- image 2 std A 0
- image 3 std A 6
- image 4 std A 8
--------------------------------------------------------------------------------------------
5. image 1 std B 6
6. image 2 std B 2
7. image 3 std B 4
8. image 4 std B 2
Here is the code to compare between a handwritten image and a standard image, and in result showing the similarity score for the matching results:
Also if possible I want a range of distance threshold between 10 - 15 and radius threshold between 2 - 5.
load('result_table_stdA.mat');
load('result_table_8827.mat');
for i = 1:height(result_table_8827)
current_centroid = result_table_8827{i, 'Unique_Centroids'};
current_x_coordinate = current_centroid(1);
current_y_coordinate = current_centroid(2);
current_radius_range = result_table_8827.Range(i, :);
for j = 1:height(result_table_stdA)
centroid1 = result_table_stdA{j, 'Unique_Centroids'};
centroid1_x_coordinate = centroid1(1);
centroid1_y_coordinate = centroid1(2);
radius_range1 = result_table_stdA.Range(j, :);
if pdist2([current_x_coordinate, current_y_coordinate], [centroid1_x_coordinate, centroid1_y_coordinate]) <= distance_threshold && abs(current_radius_range(1) - radius_range1(1)) <= radius_threshold && abs(current_radius_range(2) - radius_range1(2)) <= radius_threshold
similarity_score = similarity_score + 1;