Note that there are some explanatory texts on larger screens.

plurals
  1. POimage processing algorithm in MATLAB
    primarykey
    data
    text
    <p>I am trying to implement an algorithm described in this paper: </p> <blockquote> <p><a href="http://www.opticsinfobase.org/ol/abstract.cfm?uri=OL-30-13-1641" rel="nofollow noreferrer">Decomposition of biospeckle images in temporary spectral bands</a></p> </blockquote> <p>Here is an explanation of the algorithm:</p> <blockquote> <p>We recorded a sequence of <code>N</code> successive speckle images with a sampling frequency <code>fs</code>. In this way it was possible to observe how a pixel evolves through the <code>N</code> images. That evolution can be treated as a time series and can be processed in the following way: Each signal corresponding to the evolution of every pixel was used as input to a bank of filters. The intensity values were previously divided by their temporal mean value to minimize local differences in reflectivity or illumination of the object. The maximum frequency that can be adequately analyzed is determined by the sampling theorem and s half of sampling frequency <code>fs</code>. The latter is set by the CCD camera, the size of the image, and the frame grabber. The bank of filters is outlined in Fig. 1.</p> <p><img src="https://i.stack.imgur.com/G163I.jpg" alt="bank of filters"></p> <p>In our case, ten 5° order Butterworth filters were used, but this number can be varied according to the required discrimination. The bank was implemented in a computer using MATLAB software. We chose the Butter-worth filter because, in addition to its simplicity, it is maximally flat. Other filters, an infinite impulse response, or a finite impulse response could be used.</p> <p>By means of this bank of filters, ten corresponding signals of each filter of each temporary pixel evolution were obtained as output. Average energy Eb in each signal was then calculated:</p> <p><img src="https://i.stack.imgur.com/kHo5L.png" alt="energy equation"></p> <p>where <code>pb(n)</code> is the intensity of the filtered pixel in the nth image for filter <code>b</code> divided by its mean value and <code>N</code> is the total number of images. In this way, <code>En</code> values of energy for each pixel were obtained, each of hem belonging to one of the frequency bands in Fig. 1.</p> <p>With these values it is possible to build ten images of the active object, each one of which shows how much energy of time-varying speckle there is in a certain frequency band. False color assignment to the gray levels in the results would help in discrimination.</p> </blockquote> <p>and here is my MATLAB code base on that : </p> <pre><code>for i=1:520 for j=1:368 ts = []; for k=1:600 ts = [ts D{k}(i,j)]; %%% kth image pixel i,j --- ts is time series end ts = double(ts); temp = mean(ts); if (temp==0) for l=1:10 filtImag1{l}(i,j)=0; end continue; end ts = ts-temp; ts = ts/temp; N = 5; % filter order W = [0.0 0.10;0.10 0.20;0.20 0.30;0.30 0.40;0.40 0.50;0.50 0.60 ;0.60 0.70;0.70 0.80 ;0.80 0.90;0.90 1.0]; [B,A]=butter(N,0.10,'low'); ts_f(1,:) = filter(B,A,ts); N1 = 5; for ind = 2:9 Wn = W(ind,:); [B,A] = butter(N1,Wn); ts_f(ind,:) = filter(B,A,ts); end [B,A]=butter(N,0.90,'high'); ts_f(10,:) = filter(B,A,ts); for ind=1:10 %Following Paper Suggestion filtImag1{ind}(i,j) =sum(ts_f(ind,:).^2); end end end for i=1:10 figure,imshow(filtImag1{i}); colorbar end pre_max = max(filtImag1{1}(:)); for i=1:10 new_max = max(filtImag1{i}(:)); if (pre_max&lt;new_max) pre_max=max(filtImag1{i}(:)); end end new_max = pre_max; pre_min = min(filtImag1{1}(:)); for i=1:10 new_min = min(filtImag1{i}(:)); if (pre_min&gt;new_min) pre_min = min(filtImag1{i}(:)); end end new_min = pre_min; %normalize for i=1:10 temp_imag = filtImag1{i}(:,:); x=isnan(temp_imag); temp_imag(x)=0; t_max = max(max(temp_imag)); t_min = min(min(temp_imag)); temp_imag = (double(temp_imag-t_min)).*((double(new_max)-double(new_min))/double(t_max-t_min))+(double(new_min)); %median filter %temp_imag = medfilt2(temp_imag); imag_test2{i}(:,:) = temp_imag; end for i=1:10 figure,imshow(imag_test2{i}); colorbar end for i=1:10 A=imag_test2{i}(:,:); B=A/max(max(A)); B=histeq(A); figure,imshow(B); colorbar imag_test2{i}(:,:)=B; end </code></pre> <p>but I am not getting the same result as paper. has anybody has any idea why? or where I have gone wrong? </p> <p><strong>EDIT</strong> by getting help from @Amro and using his code I endup with the following images: here is my Original Image from 72hrs germinated Lentil (400 images, with 5 frame per second): <img src="https://i.stack.imgur.com/RpKKB.png" alt="enter image description here"></p> <p>here is the results images for 10 different band :</p> <p><img src="https://i.stack.imgur.com/pldYX.png" alt="Band1"> <img src="https://i.stack.imgur.com/Xs3hH.png" alt="Band2"> <img src="https://i.stack.imgur.com/Lo9bA.png" alt="Band3"> <img src="https://i.stack.imgur.com/ZpfJZ.png" alt="Band4"> <img src="https://i.stack.imgur.com/2x9IB.png" alt="Band5"> <img src="https://i.stack.imgur.com/w31n1.png" alt="Band6"> <img src="https://i.stack.imgur.com/HLxwT.png" alt="Band7"> <img src="https://i.stack.imgur.com/VpIpj.png" alt="BAnd8"> <img src="https://i.stack.imgur.com/QdfQZ.png" alt="Band9"> <img src="https://i.stack.imgur.com/BgN26.png" alt="Band10"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload