-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathridgefreq.m
More file actions
23 lines (16 loc) · 767 Bytes
/
ridgefreq.m
File metadata and controls
23 lines (16 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function [freq, medianfreq] = ridgefreq(im, mask, orient, blksze, windsze, ...
minWaveLength, maxWaveLength)
[rows, cols] = size(im);
freq = zeros(size(im));
for r = 1:blksze:rows-blksze
for c = 1:blksze:cols-blksze
blkim = im(r:r+blksze-1, c:c+blksze-1);
blkor = orient(r:r+blksze-1, c:c+blksze-1);
freq(r:r+blksze-1,c:c+blksze-1) = ...
freqest(blkim, blkor, windsze, minWaveLength, maxWaveLength);
end
end
% Mask out frequencies calculated for non ridge regions
freq = freq.*mask;
% Find median freqency over all the valid regions of the image.
medianfreq = median(freq(find(freq>0)));