Julio, voce teria alguma aplicação em Java disso ai? Por exemplo, carregando as imagens, aplicando os filtros etc etc
Valeu!
J
juliocbq
No próprio hipr tem o source code e exemplos em applets
No ítem Interactive Experimentation, ao final do artigo sobel.
J
juliocbq
Esse código é o do artigo sobel.
É apenas uma classe, que herda uma thread, para ter processamento independente.
o método apply_sobel(int [] src_1d, int width, int height, double sobscale,
float offsetval)
recebe os bytes da iamgem digital, largura, altura e ajuste fino.
importjava.applet.*;importjava.awt.*;importjava.awt.image.*;importjava.net.*;importjava.util.*;importjava.io.*;/** *Sobel is an algorithm to apply the sobel edge detector operator *@author:Timothy Sharman *@see code.iface.sobel */publicclassSobelextendsThread{//The width and height of the outputprivateintd_w;privateintd_h;privateint[]dest_1d;/** *apply_sobel applies a sobel operator to an image *@param src_1d The source image as a pixel array *@param width width of the destination image in pixels *@param height height of the destination image in pixels *@param sobscale A scale factor for the image *@param offsetval The offset to be added to the output * *@return A pixel array containing the output image *///Bob's sobel algorithm../*a) assume the image is grey level (hence RR=GG=BB) b) use value &0x000000ff to get the BB value c) apply the operation (eg sobel). d) return the result */publicint[]apply_sobel(int[]src_1d,intwidth,intheight,doublesobscale,floatoffsetval){inti_w=width;inti_h=height;d_w=width;d_h=height;dest_1d=newint[d_w*d_h];for(inti=0;i<src_1d.length;i++){try{inta=src_1d[i]&0x000000ff;intb=src_1d[i+1]&0x000000ff;intc=src_1d[i+2]&0x000000ff;intd=src_1d[i+i_w]&0x000000ff;inte=src_1d[i+i_w+2]&0x000000ff;intf=src_1d[i+2*i_w]&0x000000ff;intg=src_1d[i+2*i_w+1]&0x000000ff;inth=src_1d[i+2*i_w+2]&0x000000ff;inthor=(a+d+f)-(c+e+h);if(hor<0)hor=-hor;intvert=(a+b+c)-(f+g+h);if(vert<0)vert=-vert;shortgc=(short)(sobscale*(hor+vert));gc=(short)(gc+offsetval);if(gc>255)gc=255;dest_1d[i]=0xff000000|gc<<16|gc<<8|gc;//reached borders of image so goto next row//(see Convolution.java)if(((i+3)%i_w)==0){dest_1d[i]=0;dest_1d[i+1]=0;dest_1d[i+2]=0;i+=3;}}catch(ArrayIndexOutOfBoundsExceptione){//if reached row boudary of image return.i=src_1d.length;}}returndest_1d;}}
Aqui tmb tem muito exemplos, e filtros incríveis. Mas ae tem um foco diferente do científico. A aplicação para o design e edição de imagens.