GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Median filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Median filter" Watch "Median filter" New topic
Author

Median filter

Maria Stella
Greenhorn

Joined: May 09, 2014
Posts: 14
I have to implement the median filter. I found an example on the internet but it does not run, I do not see the image, where am I wrong?



Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I don't really understand the question. The code you posted (as far as I can see) just modifies an image. (At least it modifies an Immagine, whatever that is. Looks like image processing to me though.) There isn't any code there which displays an image and there isn't any code which calls that method. Perhaps you have that code? If you do, then the problem where it does not run must be in the unposted code, which perhaps doesn't call that method. And the problem where you do not see the image must also be in the unposted code.

Perhaps you could post the code you are running which you expect to call that method, and the code which is supposed to display the image? If you could produce an SSCCE (<-- follow and read that link), that would be extremely useful.
Maria Stella
Greenhorn

Joined: May 09, 2014
Posts: 14
The code entered is not just a call to action in this way.



I've done other filters that work and are invoked in the same way, I think that the error of the median filter is right in the code that allows you to make the filter, but I do not understand where is the error. Can you help?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I don't know if I can help. Let me try this. You have this code which calls the method from your original post:



So the method from your original post modifies the state of the object which "immagine" refers to. However after that, you don't use that object any more. At least not in the code you posted. So you aren't going to see the result of those changes.
Maria Stella
Greenhorn

Joined: May 09, 2014
Posts: 14
Sorry in the various tests done I copied the wrong code.
The call to the correct method is the following median_RGB



Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

So your problem is solved? Glad to hear it.
Maria Stella
Greenhorn

Joined: May 09, 2014
Posts: 14
No my problem is not solved, I tried but did not succeed.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Then perhaps you could explain your problem again. All we have so far is a code fragment, a problem statement which probably refers to some other unposted code, and the possibility that you changed that code fragment in some way.
Maria Stella
Greenhorn

Joined: May 09, 2014
Posts: 14
Carry all your code in order.
The way to calculate the median filter is:



The method is invoked in the action in this way

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Median filter