Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-02-2008
schaka schaka is offline
Miembro
 
Registrado: feb 2008
Posts: 30
Poder: 0
schaka Va por buen camino
Filtro contraste

hola que tal ,tengo un problemita con unos filtros de imagenes con contrsate logaritmico y exponencial, cuando aplico el filtro me pone toda la imagen en negro, ya revise mi codigo y no le encuentro el porque, aqui les pongo mi filtro, espero me puedan ayudar el motivo de pk la pone toda en negro, gracias.
Código SQL [-]procedure TFMain.Contrastelog1Click(Sender: TObject);
var i,j,mayor, menor:integer;

begin mayor:=0; menor:=255; (*SE CALCULARA EL MAXIMO Y MINIMO PIXEL DE UNA IMAGEN Y SE LE ASIGNARA A PIXEL EL VALOR DE LA FORMULA DEL CONTRASTE*) for j := 0 to alto-1 do begin PLine := Bitmap.ScanLine[j]; i:=0; while i<=( (ancho*3)-1) do begin if ((PLine[i]+PLine[i+1]+PLine[i+2]) div 3) > mayor
then begin mayor:= ((PLine[i]+PLine[i+1]+PLine[i+2]) div 3) ; end; (*if mayor*)

if (PLine[i]+PLine[i+1]+PLine[i+2]div 3) < menor
then begin menor:= ((PLine[i]+PLine[i+1]+PLine[i+2]) div 3) ; end; (*if menor*)

if ( mayor+ menor )> 0
then begin pixel :=(mayor-menor)div( mayor+ menor ) ; end;

i:=i+3;
end; (*while*)
end; (*end for j*)



for j := 0 to alto-1 do begin PLine := Bitmap.ScanLine[j]; i:=0; while i<= (ancho*3)-1 do begin if PLine[i] <= 0 then PLine[i]:=1; PLine[i]:= 2*round(ln(pixel)+ln(PLine[i]))+5; if PLine[i] <= 0 then begin PLine[i]:=0; end;

if PLine[i] > 255 then begin PLine[i]:=255;end else begin PLine[i]:= 2*round(ln(pixel)+ln(PLine[i]))+5; end;

if PLine[i+1] <= 0 then PLine[i+1]:=1; PLine[i+1]:= 2*round(ln(pixel)+ln(PLine[i+1]))+5; if PLine[i+1] <= 0 then PLine[i+1]:=0; if PLine[i+1] > 255 then begin PLine[i+1]:=255;end else begin PLine[i+1]:= 2*round(ln(pixel)+ln(PLine[i+1]))+5; end;

if PLine[i+2] <= 0 then PLine[i+2]:=1; PLine[i+2]:= 2*round(ln(pixel)+ln(PLine[i+2]))+5; if PLine[i+2] <= 0 then PLine[i+2]:=0; if PLine[i+2] > 255 then begin PLine[i+2]:=255;end else begin PLine[i+2]:= 2*round(ln(pixel)+ln(PLine[i+2]))+5; end;

i:=i+3;
end;

end;

Image1.Picture.Assign(Bitmap);

end; (*begin metodo*)
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Filtro en tabla cidemente Varios 0 07-06-2007 17:17:15
Ayuda con filtro vhirginia Conexión con bases de datos 10 27-04-2004 21:48:20
Mal filtro vicrati Conexión con bases de datos 2 11-04-2004 19:36:51
Filtro manu Conexión con bases de datos 2 19-11-2003 15:36:57
Filtro y EOF javiermorales Conexión con bases de datos 2 07-10-2003 15:28:08


La franja horaria es GMT +2. Ahora son las 13:08:45.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi