Login  Register

Antwort: Matlab's imresize

Posted by Joachim Wesner on Sep 10, 2009; 1:57pm
URL: http://imagej.273.s1.nabble.com/Matlab-s-imresize-tp3691242p3691243.html

Hi,

even if there is ONE algorithm, implementation details might cause slight
differences....

What kind of differences do you see? What size of difference? Can you post
an example somewhere?

I assume you use FloatProcessor in ImageJ? On Matlab, what is the image
data type?

I could also imagine this depends WHERE exactly the pixel contents is
assumed to be located,
in the center of a "pixel box" or in some edge. This offset normally makes
no difference when reading/writing
 unscaled data,  but might make a difference when resizing by a
(noninteger?) factor!????

Just my 0,02$ (or 0.02€)

Sincerely

Joachim Wesner




                                                                           
             Cihat Eldeniz                                                
             <cihat.eldeniz@GM                                            
             AIL.COM>                                                   An
             Gesendet von:              [hidden email]                
             ImageJ Interest                                         Kopie
             Group                                                        
             <[hidden email].                                       Thema
             GOV>                       Matlab's imresize                  
                                                                           
                                                                           
             10.09.2009 15:40                                              
                                                                           
                                                                           
              Bitte antworten                                              
                    an                                                    
              ImageJ Interest                                              
                   Group                                                  
             <[hidden email].                                            
                   GOV>                                                    
                                                                           
                                                                           




Hello,

Matlab's imresize and FloatProcessor's resize functions are giving
different
results when both are using bilinear interpolation [I didn't try the other
interpolation methods for comparison].

What could be causing this? Are they supposed to be different? I went
through the IJ source code, but I could not do the same in matlab [since I
got stuck in tformarray.m].

For your reference, I am shortly writing down what I am doing:

In Java,

*for(k=0;k<stackSize;k++)
{
    ImageProcessor ip = imp.getStack().getProcessor(k+1);
    ip.setInterpolationMethod(ImageProcessor.BILINEAR);
    ip = ip.resize(128, 128);
    stack.addSlice("NewImage", ip);
}
*
In Matlab,

*for k = 1:numberOfSlices
     NewImage(:,:,k) = imresize(squeeze(originalImage(:,:,k)),[128
128],'bilinear');
end*

I would appreciate any comments. Thank you very much.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________