Were beginers in matlab we would like to use Hough Transformation in Staff detection and removal of staffline using this code
BW = edge(rotI,'canny');[H,T,R] = hough(BW);%imshow(H,[],'XData',T,'YData',R,...
% 'InitialMagnification','fit');
axis on, axis normal, hold on;P = houghpeaks(H,100,'threshold',ceil(0.3*max(H(:))));x = T(P(:,2)); y = R(P(:,1));plot(x,y,'s','color','white');% Find lines and plot them
lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);%figure, imshow(rotI), hold on
imshow(rotI, 'Parent', handles.blank),hold onfor k = 1:length(lines)xy = [lines(k).point1; lines(k).point2];plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');% Plot beginnings and ends of lines
plot(xy(1,1),xy(1,2),'x','LineWidth',2,'Color','yellow');plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red');
This is the sample image:
We only need to detect all the stafflines and then remove it! thanks in advance.
Best Answer