Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

My task is to segment the line into individual words and display all the words separately. Please help me..

1 vue (au cours des 30 derniers jours)
clc;
clear all;
close all;
warning off;
lin = imread('C:\Users\Sabari\Desktop\proj2\image\line.jpg');
subplot(2,2,1);imshow(lin);
verticalProjection = sum(lin,1);
subplot(2,2,2);
plot(verticalProjection, 'b-');
grid on;
binarySignal = verticalProjection < 100;
% Get rid of runs less than 20
binarySignal = bwareaopen(binarySignal, 20);
% Label and find centroids of remaining big gaps
[labeledSignal,numberOfRegions] = bwlabel(binarySignal);
measurements = regionprops(labeledSignal, 'Centroid');
% Extract word 1 as a new image.
plotLocation = 12;
for band = 1 : numberOfRegions-1
% row1 = yCentroids(band);
% row2 = yCentroids(band+1);
word1 = lin(:, 1:measurements(1).Centroid);
subplot(2,2,3);imshow(word1);
imwrite(word1,'word.jpg');
% subplot(10, 2, plotLocation);
imshow(word1, []);
plotLocation = plotLocation + 2;
end

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by