For my handwriting recognition system, my partner and I were tasked with creating 5 search algorithms for the program to work, choosing the fastest while most accurate search function to be the main searching function. These 5 functions were: Linear Search, Binary Search, Tree Search, Table Search, and an Alternative Search. When discussing the Alternative Search, I will address how we created this searching function. Per the instructors request, I cannot and will not release my code.
For the Linear Search Function, the search algorithm simply performed a linear search of all images in over vector set of images. With this implementation, we experienced the highest accuracy as each image in the set was compared to each other, checking for the closest possible image. As a result of searching through every single image, which was 60,000 images in our case, this was the slowest search algorithm. With each comparision, there are a few calculations that needed to be addressed before moving onto the next image, with the most important calculation being the intensity of the image. This intensity told the the user and the program what the value of each pixel was, and when compared to another image using the find closest function we designed, it told us how similar each image was, while only returning the closest image in the set.
For the Binary Search Function, we needed to do one important step first: sort the vector of images. Using the merge sort function I created in an earlier assignment, we implemented the sort function to correctly sort the images in the vector set by comparing the intensities of each image. By doing so, we were able to sort the vector of images in an ascending order, with the images with the lowest intensity at the beginning and the images with the highest intensities at the end. With the vector now sorted, we recursively sorted through the vector, trying to find the closest image based. However, by doing this step alone, the function has a very low accuracy as it cannot distinguish between small changes in intensities. To fix this issue, we incorporated a linear search function that would check the immediate 500 images greater than and 500 values less than the image found with the recursive search. This greatly increased our accruacy. As a result, our functions search time dramatically improved over the linear search, as instead of searching through 10,000 images for each search, we could now search over only one thousand images.
For the Tree Search Function,
For my handwriting recognition system, my partner and I were tasked with creating 5 search algorithms for the program to work, choosing the fastest while most accurate search function to be the main searching function. These 5 functions were: Linear Search, Binary Search, Tree Search, Table Search, and an Alternative Search. When discussing the Alternative Search, I will address how we created this searching function.