Software Listing of Author : "Damien Garcia"
- Discrete (co)sine transform (and its inverse)
- License: Shareware
- Price:


Y = DCTN(X) returns the discrete cosine transform (DCT) of X. X = IDCTN(Y) returns the inverse discrete cosine transform (IDCT) of Y. Y = DSTN(X) returns the discrete sine transform (DST) of X. X = IDSTN(Y) returns the inverse discrete sine transform (IDST) of Y. X and Y can be N-dimensional. D = DSTMTX(k) returns the k-by-k DST transform matrix. Enter "help dctn", "help dstn", "help idctn", "help idstn" and "help dstmtx" in the Matlab command window for complete information. Example ------- RGB = imread('autumn.tif'); I = rgb2gray(RGB); J = dstn(I); imshow(log(abs(J)),[]), colormap(jet), colorbar The commands below set values less than magnitude 10 in the DST matrix to zero, then reconstruct the image using the inverse DST. J(abs(J)<10) = 0; K = idstn(J); figure, imshow(I) figure, imshow(K,[0 255]) ------...
- Publisher: Damien Garcia
- Date Released: 13-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Hybrid median filtering
- License: Shareware
- Price:


B = HMF(A,N) performs hybrid median filtering of the matrix A using a NxN box. Hybrid median filtering preserves edges better than a NxN square kernel-based median filter because data from different spatial directions are ranked separately. Three median values are calculated in the NxN box: MR is the median of horizontal and vertical R pixels, and MD is the median of diagonal D pixels. The filtered value is the median of the two median values and the central pixel C: median([MR,MD,C]). B = HMF(A) uses N = 5 (default value). A can be a 2-D array or an RGB image. If A is an RGB image, hybrid median filtering is performed in the HSV color space. Notes ------ 1) N must be odd. If N is even then N is incremented by 1. 2) The Image Processing Toolbox is required. 3) If the function NANMEDIAN exists (Statistics Toolbox), NaNs are treated...
- Publisher: Damien Garcia
- Date Released: 20-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Image segmentation using Otsu thresholding
- License: Shareware
- Price:


IDX = OTSU(I,N) segments the image I into N classes by means of Otsu's N-thresholding method. OTSU returns an array IDX containing the cluster indices (from 1 to N) of each point. IDX = OTSU(I) uses two classes (N=2, default value). [IDX,sep] = OTSU(I,N) also returns the value (sep) of the separability criterion within the range [0 1]. Zero is obtained only with data having less than N values, whereas one (optimal value) is obtained only with N-valued arrays. If I is an RGB image, a Karhunen-Loeve transform is first performed on the three R,G,B channels. The segmentation is then carried out on the image component that contains most of the energy. Example: --------- load clown subplot(221) X = ind2gray(X,map); imshow(X) title('Original','FontWeight','bold') for n = 2:4 IDX = otsu(X,n); subplot(2,2,n) imagesc(IDX), axis...
- Publisher: Damien Garcia
- Date Released: 20-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Inpaint over missing data in N-D arrays
- License: Shareware
- Price:


Y = INPAINTN(X) replaces the missing data in X by extra/interpolating the non-missing elements. The non finite values (NaN or Inf) in X are considered as missing data. X can be any N-D array. Important note: ---------------- INPAINTN uses an iterative process that converges toward the solution. Y = INPAINTN(X,N) uses N iterations. By default, N = 100. If you estimate that INPAINTN did not totally converge, then increase N: Y = INPAINTN(X,1000); Notes: ----- INPAINT_NANS and INPAINT_NANS3 are faster than INPAINTN when the number of NaN elements is (relatively) small. However, because INPAINT_NANS and INPAINT_NANS3 both involve huge matrices, they can be limited with large datasets. Example: -------- %% ---- 3-D data ---- %% load wind xmin = min(x(:)); xmax = max(x(:)); zmin = min(z(:)); ymax = max(y(:)); %-- wind velocity vel0 =...
- Publisher: Damien Garcia
- Date Released: 15-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Label connected components in 2-D array
- License: Shareware
- Price:


LABEL is a generalization of BWLABEL: BWLABEL works with 2-D binary images only, whereas LABEL works with 2-D arrays of any class. L = LABEL(I,N) returns a matrix L, of the same size as I, containing labels for the connected components in I. Two adjacent components (pixels), of respective indexes IDX1 and IDX2, are connected if I(IDX1) and I(IDX2) are equal. N can have a value of either 4 or 8, where 4 specifies 4-connected objects and 8 specifies 8-connected objects; if the argument is omitted, it defaults to 8. Important remark: ----------------------- NaN values are ignored and considered as background. Because LABEL works with arrays of any class, the 0s are NOT considered as the background. Note: ------ The elements of L are integer values greater than or equal to 0. The pixels labeled 0 are the background (corresponding to...
- Publisher: Damien Garcia
- Date Released: 05-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Noise variance estimation
- License: Freeware
- Price: 0.00


Suppose that you have a signal Y (Y can be a time series, a parametric surface or a volumetric data series) corrupted by a Gaussian noise with unknown variance. It is often of interest to know more about this variance. EVAR(Y) thus returns an estimated variance of the additive noise. EVAR provides better results if the original function (i.e. the function without noise) is relatively smooth i.e. has continuous derivatives up to some order. Several tests, however, showed that EVAR works well even with multiple discontinuities. Note: EVAR only works with evenly-gridded data in one and higher dimensions. See also ESTIMATENOISE (file #16683) Here are two examples: %-- Let us estimate the noise variance from a corrupt signal -- % First create a time signal t = linspace(0,100,1e6); y = cos(t/10)+(t/50); % Make this signal corrupted by a...
- Publisher: Damien Garcia
- Date Released: 08-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Polynomial curve fitting
- License: Freeware
- Price: 0.00


LABEL is a generalization of BWLABEL: BWLABEL works with 2-D binary images only, whereas LABEL works with 2-D arrays of any class. L = LABEL(I,N) returns a matrix L, of the same size as I, containing labels for the connected components in I. Two adjacent components (pixels), of respective indexes IDX1 and IDX2, are connected if I(IDX1) and I(IDX2) are equal. N can have a value of either 4 or 8, where 4 specifies 4-connected objects and 8 specifies 8-connected objects; if the argument is omitted, it defaults to 8.
- Publisher: Damien Garcia
- Date Released: 15-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Post-processing of PIV data
- License: Shareware
- Price:


[Vx2,Vy2] = PPPIV(Vx1,Vy1) carries out robust post-processing of 2-D PIV velocity data. Vx1 and Vy1 must be two matrices of same size that contain the x- and y-components of the velocities at equally spaced points in the Cartesian plane. PPPIV uses a robust penalized least squares method that makes the smoothed output (Vx2,Vy2) no dependent upon the outlying (spurious) vectors: outliers are replaced and velocity vectors are smoothed using a single automated process. MISSING DATA: Non finite (NaN or Inf) values in (Vx1,Vy1) are considered as missing velocities. The algorithm replaces them automatically. PPPIV uses SMOOTHN. See SMOOTHN for more details: http://www.mathworks.com/matlabcentral/fileexchange/25634 [Vx2,Vy2] = PPPIV(Vx1,Vy1,ROI) post-processes (Vx1,Vy1) in the region of interest defined by the binary matrix ROI: 1 =>...
- Publisher: Damien Garcia
- Date Released: 07-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Resize any arrays and images
- License: Shareware
- Price:


Y = RESIZE(X,NEWSIZE) resizes input array X using a DCT (discrete cosine transform) method. X can be any array of any size. Output Y is of size NEWSIZE. Input and output formats: Y has the same class as X. As an example, if you want to multiply the size of an RGB image by a factor N, use the following syntax: newsize = size(I).*[N N 1]; J = resize(I,newsize); ------ % Upsample and stretch an RGB image I = imread('onion.png'); sizeJ = size(I).*[2 2 1]; J = resize(I,sizeJ); sizeK = size(I).*[1/2 2 1]; K = resize(I,sizeK); figure,imshow(I),figure,imshow(J),figure,imshow(K) ------ Enter "help resize" to obtain other examples. ------ The functions DCTN and IDCTN are required. Visit: http://www.biomecardio.com/matlab ------
- Publisher: Damien Garcia
- Date Released: 16-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Robust spline smoothing for 1-D to N-D data
- License: Freeware
- Price: 0.00


SMOOTHN provides a fast, unsupervised and robust discretized spline smoother for data of any dimension. SMOOTHN(Y) automatically smoothes the uniformly-sampled array Y. Y can be any N-D noisy array (time series, images, 3D data,...). SMOOTHN can deal with missing (NaN) values (see screenshot, top panels). SMOOTHN(...,'robust') carries out a robust smoothing that minimizes the influence of outlying data (see screenshot, bottom right panel). SMOOTHN is made automated by the minimization of the generalized cross-validation score. Enter "help smoothn" in the Matlab command window for complete instructions and 1-D to 3-D examples. ------ Here is an example that requires the Image Processing Toolbox. The example below applies SMOOTHN to an image of Saturn that has had Gaussian noise added. Read the "Saturn" image from Matlab I =...
- Publisher: Damien Garcia
- Date Released: 15-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Screenshot Impulse response invariant discretization of distributed order low-pass filter
- License: Freeware
- Price: 0.00


Y = DCTN(X) returns the discrete cosine transform (DCT) of X. X = IDCTN(Y) returns the inverse discrete cosine transform (IDCT) of Y. Y = DSTN(X) returns the discrete sine transform (DST) of X. X = IDSTN(Y) returns the inverse discrete sine transform (IDST) of Y. X and Y can be N-dimensional. D = DSTMTX(k) returns the k-by-k DST transform matrix. Enter "help dctn", "help dstn", "help idctn", "help idstn" and "help dstmtx" in the Matlab command window for complete information. Example ------- RGB = imread('autumn.tif'); I = rgb2gray(RGB); J = dstn(I); imshow(log(abs(J)),[]), colormap(jet), colorbar The commands below set values less than magnitude 10 in the DST matrix to zero, then reconstruct the image using the inverse DST. J(abs(J)<10) = 0; K = idstn(J); figure, imshow(I) figure, imshow(K,[0 255])
- Publisher: Damien Garcia
- Date Released: 03-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts

