Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How to convert matlab code in Java??

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    21
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to convert matlab code in Java??

    I have matlab code and i have to convert this code in java.I dont know how to do this.Can you help me please??? here is my Matlab code

    clc;
    clear all;
    close all;
    I=imread('test46.jpg');
    I=imcrop(I);
    I=rgb2gray(I);
    I=im2double(I);
    sigma = 20/255;
    y = I + sigma*randn(size(I));
    %-------------------------------------------------NON LOCAL MEANS
    S = 10;
    P = 3;
    h = 10 * sigma;
    % xx is denoised image
    xx=nonLocalMean(y,h,P,S);
    h = fspecial('gaussian',[5 5],1.9);
    G=conv2(N,h,'same');
    toc
    PSNR_gaussian=PeakSignaltoNoiseRatio(I,G)
    B=bfilter2(N,[5 5],[3 0.2]);
    toc
    PSNR_Bilateral=PeakSignaltoNoiseRatio(I,B)
    PSNR_StandardNLM = PeakSignaltoNoiseRatio1(I,xx)
    %PSNR_NLMMethodNoise=PeakSignaltoNoiseRatio1(I,Fin al)
    %-------------------------------------------
    figure,imshow(I),title('original')
    figure,imshow(y),title('noisy')
    figure,imshow(xx),title('Standard NLM')
    figure,imshow(gg),title('Gaussian blurring')
    figure,imshow(bb),title('Standard NLM')
    %imwrite(xx,'z1.png');


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Saint-Petersburg, Russia
    Posts
    33
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: How to convert matlab code in Java??

    Oh, be sure you need to completely rewrite the stuff. And it would not be an easy matter - especially if you do not know one of the languages. Moreover you'll need to rewrite some math subroutines for java or find libraries for them.

    So you'll better think thoroughly, whether you really need this to be rewritten.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    21
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to convert matlab code in Java??

    How to write Imread code in java???

  4. #4
    Member
    Join Date
    Oct 2013
    Location
    Saint-Petersburg, Russia
    Posts
    33
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: How to convert matlab code in Java??

    Use ImageIO class.

Similar Threads

  1. [SOLVED] Conversion of matlab code in Java
    By Mumpy Zinu in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 2nd, 2013, 10:42 AM
  2. Code conversion (Matlab to Java)
    By Nithyanathan Naiker in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 5th, 2013, 01:43 AM
  3. [SOLVED] How to convert this pseudo code into JAVA
    By MUSKAAN DUTT in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 2nd, 2013, 09:36 AM
  4. [SOLVED] UnsatisfiedLinkError from Matlab code
    By RandalF in forum Java Native Interface
    Replies: 2
    Last Post: August 18th, 2011, 09:42 AM
  5. Convert C/C++ code to Java
    By cristianll in forum What's Wrong With My Code?
    Replies: 13
    Last Post: November 14th, 2009, 02:43 AM