Skip to main content
. 2018 Nov 19;9(12):6359–6373. doi: 10.1364/BOE.9.006359

Algorithm 1.

Cluster-based Speckle Reduction Framework (CSRF)

  Initialization
            I[i,j]
intensity of a pixel at row i and column j in the original OCT image
AC[i,j] The estimated attenuation coefficient of a pixel at row i and column j in the original OCT image
Δ pixel size in mm
R number of pixels in each A-line (number of rows)
C number of A-lines (number of columns)
N total number of pixels in the OCT image (R×C)
F feature vector including (I[i,j], AC[i,j])
K desired number of clusters
CL_KM KM clustering result
Hi,j sliding window around pixel [i,j] in the original image
N1×N2 size of sliding window
Wi,j Weight matrix for pixels in Hi,j
nl Number of pixels in Hi,j that belong to the same cluster as the central pixel
133 A matrix of ones with size 3*3
Average(data,weights)=1/Nddata×weight
1. Feature Extraction
 1.1. For each pixel in position [i,j], calculate and assign a set of features. We only use the attenuation coefficient [38]:
AC[i,j]=12Δln(1+I[i,j]z=i+1I[z,j])
 1.2. For each pixel at position [i,j], assign the feature vector F[i,j]:
F[i,j]=(I[i,j],AC[i,j])
2. Clustering
 2.1. Apply KM clustering which is CL_KM=KM(F,K)

CL_KM=Median_Filter(CL_KM)
3. Apply Filtering: for a sliding window of size N1×N2 around pixel [i,j], Hi,j
 2.2. Apply median filter on the clustering results:
CL_KM=Median_Filter(CL_KM)
3. Apply Filtering: for a sliding window of size N1×N2 around pixel [i,j], Hi,j
 3.1. Estimate the noise variance for each individual cluster σnk2
 3.2. Compute the weight matrix Wi,j for all the pixels in Hi,j. The elements of Wi,j, ω(i,j,p,q)are determined as follows:
  3.2.1. Lee filter (LF): all the pixels in the window are weighted the same
ω(i,j,p,q)=1/N1×N2
  3.2.2. Jin’s adaptive Wiener filter (AWF)
ω(i,j,p,q)=K(i,j)1+a(max[2,(I(i,j)Hi,j(p,q))2])
  3.2.3. Cluster-based LF (CSRF-LF)
ω(i,j,p,q)={1,L(p,q)=L(i,j)0,L(p,q)L(i,j)or(p,q)=(i,j)
  3.2.4. Cluster-based adaptive Wiener filter (CSRF-AWF)
ω(i,j,p,q)=K(i,j){1+a(max[2,(I(i,j)Hi,j(p,q))2]),|L(p,q)=L(i,j)0,|L(p,q)L(i,j)or(p,q)=(i,j)
 3.3. For each window, calculate the local statistics:
μi,j=Average(Hi,j,Wi,j)
σi,j2=Average(Hi,jμ[i,j]2,Wi,j)
 3.4. Calculate the new pixel value:
Iˆ(i,j)=μx+σx2σx2+σn2(I(i,j)μx)
4. Smoothing the cluster edges with a 3 × 3 Mean filter:
Iˆ(i,j)=Average(Hi,j,133)