필터 지우기
필터 지우기

text detection in matlab

조회 수: 1 (최근 30일)
annmaria
annmaria 2015년 7월 27일
편집: annmaria 2015년 7월 27일
I am comparing different images inorder to done text recognition. I found out the matched images.figure1,figure2,figure3 are the input images as shown in the code. Is it possible to find the hierarchial centroid and distance of figure1,figure2,figure3 in a loop. Is it possible to display it in a single line. Now it is obtain like A B C are in different lines I want to obtain ABC.And also in between B and C I want to put a space also Is it possible in matlab Please help me I am new in matlab.Thanks in advance
clc,clear all,close all
plotFlag = 1;
depth = 6;
alef1 = im2bw(imread('figure1.bmp'));
alef2 = im2bw(imread('figure2.bmp'));%%Binary image
alef3=im2bw(imread('figure3.bmp'));
vec1 = hierarchicalCentroid(alef1,depth,plotFlag);
vec11 = hierarchicalCentroid(alef2,depth,plotFlag);
vec12 = hierarchicalCentroid(alef3,depth,plotFlag);
% subplot(1,3,1);
A=[];
vec2=[];
dist_1_1=[];
for ii=1:22
A{ii} = imread(['image' num2str(ii) '.bmp']);
% subplot(1,3,2);
vec2{ii} = hierarchicalCentroid(A{ii},depth,plotFlag);
dist_1_1{ii} = sum((vec1 - vec2{ii}) .^ 2);
dist_1_2{ii} = sum((vec11 - vec2{ii}) .^ 2);
dist_1_3{ii} = sum((vec12 - vec2{ii}) .^ 2);
end
[m,I]=min(cell2mat(dist_1_1));
[m,O]=min(cell2mat(dist_1_2));
[m,P]=min(cell2mat(dist_1_3));
if I==1
disp('A');
end
if O==2
disp('B')
end
if P==3
disp('C')
end
figure;
subplot(1,2,1);imshow(alef1);
subplot(1,2,2);imshow(A{I});
subplot(1,2,1);imshow(alef2);
subplot(1,2,2);imshow(A{O});
subplot(1,2,1);imshow(alef3);
subplot(1,2,2);imshow(A{P});

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by