This commit is contained in:
Andre Meyering 2018-11-15 14:47:47 +01:00
parent 2f0ef234e7
commit ef9e000c65
48 changed files with 2414 additions and 25 deletions

View file

@ -0,0 +1,38 @@
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.filter.*;
public class Kantenschaerfung_2018_11_07 implements PlugInFilter {
ImagePlus imp;
public int setup(String arg, ImagePlus imp) {
this.imp = imp;
return DOES_ALL;
}
public void run(ImageProcessor ip) {
int width = ip.getWidth();
int height = ip.getHeight();
ImageProcessor copy = ip.duplicate();
int[][] L ={{1,1,1},{1,-8,1},{1,1,1}};
for(int m = 1; m < width - 1; m++) {
for(int n = 1; n < height - 1; n++) {
int p = 0;
for(int i = -1; i <= 1; i++) {
for(int j = -1; j <= 1; j++) {
int I = copy.getPixel(m-i,n-j);
p += I * L[i+1][j+1];
}
}
p = copy.getPixel(m,n) - (int) (p * 0.5);
ip.putPixel(m,n,p);
}
}
}
}

View file

@ -0,0 +1,38 @@
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.filter.*;
public class Laplace_2018_11_07 implements PlugInFilter {
ImagePlus imp;
public int setup(String arg, ImagePlus imp) {
this.imp = imp;
return DOES_ALL;
}
public void run(ImageProcessor ip) {
int width = ip.getWidth();
int height = ip.getHeight();
ImageProcessor copy = ip.duplicate();
int[][] L ={{1,1,1},{1,-8,1},{1,1,1}};
for(int m = 1; m < width - 1; m++) {
for(int n = 1; n < height - 1; n++) {
int p = 0;
for(int i = -1; i <= 1; i++) {
for(int j = -1; j <= 1; j++) {
int I = copy.getPixel(m-i,n-j);
p += I * L[i+1][j+1];
}
}
p = p*10 + 128; // Irgendein Faktor
ip.putPixel(m,n,p);
}
}
}
}

View file

@ -0,0 +1,35 @@
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.filter.*;
public class Sobel_2018_10_31 implements PlugInFilter {
ImagePlus imp;
public int setup(String arg, ImagePlus imp) {
this.imp = imp;
return DOES_ALL;
}
public void run(ImageProcessor ip) {
int width = ip.getWidth();
int height = ip.getHeight();
ImageProcessor copy = ip.duplicate();
int[][] H ={{1,0,-1},{2,0,-2},{1,0,-1}};
for(int v = 1; v <= height-2; v++) {
for(int u = 1; u <= width-2; u++) {
int k = 0;
for(int j =-1; j <= 1; j++) {
for(int i =-1; j <= 1; j++) {
int I = copy.getPixel(u-i,v-j);
k = k + I * H[i+1][j+1];
}
}
ip.putPixel(u,v,k);
}
}
}
}

View file

@ -1 +0,0 @@
User plugins go here.