Package jjil.core

Examples of jjil.core.Complex32Image


                    im.toString(),
                    null,
                    null);
        }
        this.fft.push(im);
        Complex32Image cxmIm = (Complex32Image) this.fft.getFront();
        Complex cxIn[] = cxmIm.getData();
        Complex32Image cxmResult = new Complex32Image(im.getWidth(), im.getHeight());
        Complex cxOut[] = cxmResult.getData();
        Complex cxPsfInv[] = this.cxmPsfInv.getData();
        int nPsfSq[] = this.gPsfSq.getData();
        // compute Wiener filter
        for (int i=0; i<im.getWidth() * im.getHeight(); i++) {
            int nMag = cxIn[i].magnitude();
View Full Code Here


                            im.toString(),
                            null,
                            null);
        }
        this.fft.push(im);
        Complex32Image cxmIm = (Complex32Image) this.fft.getFront();
        Complex cxIn[] = cxmIm.getData();
        Complex32Image cxmResult = new Complex32Image(im.getWidth(), im.getHeight());
        Complex cxOut[] = cxmResult.getData();
        // compute inverse filter
        int rnCoeff[] = this.rxnCoeffs[this.nStdDev];

        for (int i=0; i<cxmIm.getHeight(); i++) {
            int nRow = i * cxmIm.getWidth();
 
View Full Code Here

        }
       
        Gray8Image gray = (Gray8Image) im;
        byte data[] = gray.getData();
        // create output
        Complex32Image cxmResult = new Complex32Image(nWidth, nHeight);
        // take FFT of each row
        int nIndex = 0;
        Complex cxRow[] = new Complex[nWidth];
        for (int i=0; i<nHeight; i++) {
            for (int j=0; j<nWidth; j++) {
                // convert each byte to a complex number. Imaginary component is 0.
                // everything gets scaled for accuracy
                cxRow[j] = new Complex((data[nIndex++] - Byte.MIN_VALUE) << SCALE);
            }
            // compute FFT
            Complex cxResult[] = this.fft.fft(cxRow);
            // save result
            System.arraycopy(cxResult, 0, cxmResult.getData(), i*nWidth, nWidth);
        }
        // take FFT of each column
        Complex cxCol[] = new Complex[nHeight];
        for (int j=0; j<nWidth; j++) {
            // copy column into a 1-D array
            for (int i=0; i<nHeight; i++) {
                cxCol[i] = cxmResult.getData()[i*nWidth+j];
            }
            // compute FFT
            Complex cxResult[] = this.fft.fft(cxCol);
            // save result back into column
             for (int i=0; i<nHeight; i++) {
                cxmResult.getData()[i*nWidth+j] = cxResult[i];
            }
       }
       super.setOutput(cxmResult);
    }
View Full Code Here

                    im.toString(),
                    null,
                    null);
        }
        this.fft.push(im);
        Complex32Image cxmIm = (Complex32Image) this.fft.getFront();
        Complex cxIn[] = cxmIm.getData();
        Complex32Image cxmResult = new Complex32Image(im.getWidth(), im.getHeight());
        Complex cxOut[] = cxmResult.getData();
        Complex cxPsfFft[] = this.cxmPsfInv.getData();
        // compute inverse filter
        for (int i=0; i<im.getWidth() * im.getHeight(); i++) {
            int nMag = cxPsfFft[i].magnitude();
            if (nMag * this.nGamma > MathPlus.SCALE) {
View Full Code Here

            this.fft = new Fft1d(Math.max(nWidth, nHeight));
        } else {
            this.fft.setMaxWidth(Math.max(nWidth, nHeight));
        }
         // get access to the complex image
        Complex32Image cxmIn = (Complex32Image) im;
        Complex data[] = cxmIn.getData();
        // create output
        Complex32Image cxmResult = new Complex32Image(nWidth, nHeight);
        // take inverse FFT of each row
        Complex cxRow[] = new Complex[nWidth];
        for (int i=0; i<nHeight; i++) {
            System.arraycopy(data, i*nWidth, cxRow, 0, nWidth);
            // compute inverse FFT
            Complex cxResult[] = this.fft.ifft(cxRow);
            // save result
            System.arraycopy(cxResult, 0, cxmResult.getData(), i*nWidth, nWidth);
        }
        // take inverse FFT of each column
        Complex cxCol[] = new Complex[nHeight];
        for (int j=0; j<nWidth; j++) {
            // copy column into a 1-D array
            for (int i=0; i<nHeight; i++) {
                cxCol[i] = cxmResult.getData()[i*nWidth+j];
            }
            // compute inverse FFT
            Complex cxResult[] = this.fft.ifft(cxCol);
            // save result back into column
             for (int i=0; i<nHeight; i++) {
                cxmResult.getData()[i*nWidth+j] = cxResult[i];
            }
        }
        // convert back to a gray image
        // first convert it to an integer image
        Gray32Image imInteger = new Gray32Image(nWidth, nHeight);
        Complex cxData[] = cxmResult.getData();
        int nData[] = imInteger.getData();
        int nMinVal = Integer.MAX_VALUE;
        int nMaxVal = Integer.MIN_VALUE;
        for (int i = 0; i < nWidth * nHeight; i++) {
            // magnitude is always guaranteed to be >= 0 so we only have to clamp
View Full Code Here

TOP

Related Classes of jjil.core.Complex32Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.