For others, it appears that C (=constant) was originally the binary image segmentation threshold.
I have modified my version of the code as follows:
replace:
sIM=mIM-IM-C;
bw=im2bw(sIM,0);
with:
sIM=mIM-IM;
thresh=graythresh(sIM);
bw=im2bw(sIM,thresh);
This now uses the adaptive (mean) filter to highlight image features (i.e. mIM-IM) and then the Otsu threshold to segment and generate a binary image.
this works quite well for my application but can anyone explain to me what the algorithm is doing exactly?
I understand that the algorithm generates a local mean filtered image by iterating over each pixel for user window size but what is line:
sIM=mIM-IM-C
this subtracts the original image and a constant, C, from the local mean filtered image. What is C and why do this?
4
17 Oct 2013
Despiking
This function remove spike noise from data.
Dear Mr. Mori, dear all,
When looking at these scripts, I found a difference with the algorith of Goring and Nikora (2002), and I wonder if there is a certain reason why it is so.
In these scripts, an ellipsoide is constructed with axes lambda*sigma_u , lambda*sigma_du and lambda*sigma_d2u. However, in the article of Goring and Nikora the ellipsoide has axes 'a', lambda*sigma_du and 'b', with 'a' and 'b' defined by their equations 9 and 10. The axes 'a' and 'b' are chosen so that the maxima of the ellipse, i.e. the points with extreme values of u and d2u, are equal to lambda*sigma_u and lambda*sigma_d2u. Note that these maxima points are in general not equal to the main axes.
It is a very subtile but fundamental difference, and I wonder if there is a certain reason why this change has been made?
A good thing about these scripts is that it circumvents a problem with the algorithm of Goring and Nikora: if sigma_u and sigma_d2u substantially differ, the latter algorithm can not define a proper ellipsoide. I face this problem with my ADV data, and that's why I am interested in your method. The algorithm in these scripts can always produce an ellipsoide.
I would like to stress that this alternative in these scripts is not 'erroneous', since it uses a certain logic, just as the algorith of Goring an Nikora uses a logic. Since despiking is not an exact science, it is still open for debate which logic is best.
Only one should be aware that these scripts do not implement the method of Goring and Nikora (2002), but an alternative.
I look forward to your comments and ideas.
Kind regards,
Laurent Schindfessel
Ghent University
Comment only
13 Aug 2013
Despiking
This function remove spike noise from data.
The despiking process is 3 times faster if lines 100-106 in function "func_excludeoutlier_ellipsoid3d.m"
>> z2 = -sqrt(zt);
elseif z1 > 0
z2 = sqrt(zt);
else
z2 = 0;
end
are replaced by this one-liner:
z2=sign(z1)*sqrt(zt);
Thanks for these functions.
Comment only