Question

I am very much new to matlab.i am working on retinal image analysis .I want to find the maximum response of an image.I have 12 images .Now i have to compare all these images and find the maximum pixel at each point and write it to a new image so that my new image is formed by maximum pixels.I am using matlab for this

            eg if my pixel value in 1 image is

    [9 8 6 3 2]
    and my 2 image is 
    [5 6 7 9 0].
   Now my 3rd new image should be

    [9 8 7 9 2]          %here i compare these two images on pixel by pixel conversion 
                          ie i compare 9 with 5 and write maximum value 9 to my new                    
                           image .next with 8 and 6 i take 8 since it is maximum.

this is just my own idea..Can this be done..How do i do it ny idea. I have to comapre 10 images all together and create 11 image so far i have tried this

          A = getimage();
          I=A(:,:,2);
          lambda  = 8;
          theta   = 0;
          psi     = [0,pi/2];
          gamma   = 0.5;
          bw      = 1;
          N       = 12;
          angle = 0;
             theMaxValues = zeros(1, N);
        img_in = I;
       img_out = zeros(size(img_in,1), size(img_in,2), N);
        for n=1:N
         gb = gabor_fn(bw,gamma,psi(1),lambda,theta);

          %theMaxValues(n) = max(gb(:));
        I TRIED THIS WAY
        matrix(:,:,1) = gb;
       it gives me error..

 theta = angle+pi/180;
 angle= angle + 15;

      end
        [overallMax, index] = max(theMaxValues);
         thetaOfMax = theta(index);
         final_gb = gabor_fn(bw,gamma,psi(1),lambda,thetaOfMax); 
          figure;
         imshow(final_gb);
        title('final image');
Was it helpful?

Solution

You can add all your images into one Matrix, where the third dimension reprents the number ouf your image.

 matrix[:,:,1] %first image
 matrix[:,:,2] %second image and so on

Then you can simply search the maximum value at each Pixel along the third axis using

C = max(matrix,[],3)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top