How to predict character using knn algorithm
Show older comments
Hi i have done sucessfully this code till feature extraction
I = imread('C:\Documents and Settings\vijaykumar\Desktop\today\z.bmp');
imshow(I)
Igray = rgb2gray(I);
imshow(Igray)
Ibw = im2bw(Igray,graythresh(Igray));
imshow(Ibw)
Iedge = edge(uint8(Ibw));
imshow(Iedge)
se = strel('square',2);
Iedge2 = imdilate(Iedge, se);
imshow(Iedge2);
Ifill= imfill(Iedge2,'holes');
imshow(Ifill)
[Ilabel num] = bwlabel(Ifill);
disp(num);
Iprops = regionprops(Ilabel);
Ibox = [Iprops.BoundingBox];
Ibox = reshape(Ibox,[4 50]);
imshow(I)
hold on;
for cnt = 1:50
rectangle('position',Ibox(:,cnt),'edgecolor','r');
end
But i my aim is to implement hand written character recognition using knn I mean i want to Predict the character how it is possible using knn algorithm i have seen this KNNCLASSIFY But iam unable to understand suggest me any code how we can do that thanks in advance.
Answers (0)
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!