Code covered by the BSD License  

Highlights from
Vibration from frames

image thumbnail

Vibration from frames

by

 

this can be used to extract the frequency of a simple harmonic vibrations from frames

Y=line_detect_fct(Image)
function Y=line_detect_fct(Image)

[accum, axis_rho, axis_theta, lineprm,linessg] = Hough_Grd(Image,8,0.04);
% DrawLines_2Ends(linessg);
% imagesc(I_gray_crop)
% axis image
% DrawLines_2Ends(linessg);
[m,n]=size(linessg);
slope=zeros(m,1);
for i=1:m
    xxyy=linessg(i,:);
    slope(i)=rad2deg(atan2((xxyy(4)-xxyy(3)),(xxyy(2)-xxyy(1))));
end
% figure
% plot(slope)
j=find(abs(slope)<30);
linessg=linessg(j,:);
% figure
% imshow(I_gray_crop)
% axis image
% DrawLines_2Ends(linessg);

% [m,n]=size(linessg);
y1=linessg(:,3);
y2=linessg(:,4);
Y=(mean(y1)+mean(y2))/2;

Contact us