フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Naarani P
Naarani P 2016 年 3 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by