For font recognition thinning will be an appropriate step to extract feature?

조회 수: 1 (최근 30일)
Hi, I am doing a project on Font recognition using HMM model. I have done pre-processing. Converted RGB to Gray,Then Gray to binary, and then binary to thinning. Now I want to extract the feature . My data is a sentence written in Times New Roman .I have written code and each word is having bounding box. I want to extract features of each word to get a feature vector of all words in form of row vector. Thanks in advance

채택된 답변

harjeet singh
harjeet singh 2015년 12월 16일
dear rutika, yes thinning is an appropriate step for extract features unless until you only need geometric features for making a feature vector table.
  댓글 수: 3
Rutika Titre
Rutika Titre 2015년 12월 17일
Sir I have attached my code's output named "untitled.fig" I want to extract the features of each word inside the bounding. Will Area , Eccentricity, Orientation give me features of bounding box? Can you please help me to extarct feature vector of the image I have attached. Thanking you!
Image Analyst
Image Analyst 2015년 12월 17일
Attach an image. Use the green and brown frame icon.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

harjeet singh
harjeet singh 2015년 12월 17일
try to use this code and do include more features for word, i used the number of alphabets a word has and area of the word and center of gravity for written word.
clear all
close all
clc
image=imread('untitled.tif');
figure(1)
imshow(image)
drawnow
img=image(:,:,1)==255 & image(:,:,2)==0 & image(:,:,3)==0;
img=bwareaopen(img,20);
[lab,num]=bwlabel(img);
sub=ceil(sqrt(num));
for i=1:num
[r,c]=find(lab==i);
img_1=image(min(r)+1:max(r)-1,min(c)+1:max(c)-1,:);
figure(2)
subplot(sub,sub,i)
imshow(img_1);
drawnow
img_2=logical(img_1);
[lab1,num1]=bwlabel(img_2(:,:,1));
alphabets=num1;
area=length(r);
cog_r=mean(r);
cog_c=mean(c);
fvt(i,:)=[alphabets area cog_r cog_c];
end
  댓글 수: 1
Rutika Titre
Rutika Titre 2015년 12월 18일
Sir, The code is not working num=0, .Sir there is a technique using sliding window, which mover from left to right and at the same time extracts the features of every word. As, m doing Font recognition I read papers on it. And this sliding window is used. to extract features. Can you help me regarding this technique. Thanking You!

댓글을 달려면 로그인하십시오.


harjeet singh
harjeet singh 2015년 12월 18일
do upload the code you are using for features, and i used the clipped snap which you uploaded as figure, do use this pic for the attache code
clear all
close all
clc
image=imread('untitled.bmp');
figure(1)
imshow(image)
drawnow
img=image(:,:,1)==255 & image(:,:,2)==0 & image(:,:,3)==0;
img=bwareaopen(img,20);
[lab,num]=bwlabel(img);
sub=ceil(sqrt(num));
for i=1:num
[r,c]=find(lab==i);
img_1=image(min(r)+1:max(r)-1,min(c)+1:max(c)-1,:);
figure(2)
subplot(sub,sub,i)
imshow(img_1);
drawnow
img_2=logical(img_1);
[lab1,num1]=bwlabel(img_2(:,:,1));
alphabets=num1;
area=length(r);
cog_r=mean(r);
cog_c=mean(c);
fvt(i,:)=[alphabets area cog_r cog_c];
end
  댓글 수: 2
Rutika Titre
Rutika Titre 2015년 12월 18일
Thank you sir, Actually after I tried the code and my output had come...sorry did not inform you. I think the sliding question was not correct question to ask.Thank-you sir for kind consideration.
Ihtisham Khan
Ihtisham Khan 2018년 7월 30일
Rutika Titre How do you apply these features to the hmm model??? Please help,,,

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by