2016-10-09 17:14:49 -0600 | asked a question | Line segmentation in handwritten text I'm developing a simple script for extracting features of each of the lines of a image that contains handwritten text. After thresholding the image I add to the Numpy matrix a complete white row and complete black row (first two rows). I want to calculate pairwise the cosine similarity of the white row and each of the the rows of the image matrix, I want to do the same with the black row. I want to use the cosine similarity (black row and white row) as input feature in order to train a Knn with scikit learn. The code: The problem is cdist is all 0. I don't get the expected values. What am I missing? Are there any other techniques to consider when splitting an image with text into lines? Thank you. |