Ir para conteúdo
Fórum Script Brasil

marcelo_barros

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre marcelo_barros

marcelo_barros's Achievements

0

Reputação

  1. É pessoal a coisa ta feia... pesquisei a informação passada pelo nosso amigo e juntei com um código q achei na net... segue a função que esqueletiza (afina) uma imagem: procedure TForm1.BtEsqueletizarClick(Sender: TObject); var turn, y, x, j, i, blackPixel, whitePixel, z: integer; finishProcessAllPixel: boolean; pixelOnFlag: array [0..256,0..256] of integer; pixelValue: array [0..256,0..256] of integer; kernelValue: array [0..256] of integer; begin turn := 0; finishProcessAllPixel := false; while(finishProcessAllPixel = false) do begin finishProcessAllPixel := true; turn := (turn+1) mod 2; for y:=1 to Image1nova.height-2 do //initialize the pixelOnFlag to false begin for x:=1 to Image1nova.width-2 do pixelOnFlag[y,x] := 0; end; for y:=1 to Image1nova.height-2 do begin for x:=1 to Image1nova.width-2 do begin if(pixelValue[y,x] = 0)then //pixel preto begin blackPixel := 0; for j:=0 to 2 do begin for i:=0 to 2 do begin if(pixelValue[y+j-1,x+i-1] = 0) then blackPixel:= blackPixel + 1; end; end; if((blackPixel > 2) and (blackPixel < 8))then begin kernelValue[0] := pixelValue[y-1,x-1]; kernelValue[5] := pixelValue[y+1,x ]; kernelValue[1] := pixelValue[y-1,x ]; kernelValue[6] := pixelValue[y+1,x-1]; kernelValue[2] := pixelValue[y-1,x+1]; kernelValue[7] := pixelValue[y ,x-1]; kernelValue[3] := pixelValue[y ,x+1]; kernelValue[8] := pixelValue[y-1,x-1]; kernelValue[4] := pixelValue[y+1,x+1]; whitePixel := 0; for z:=0 to 7 do if((kernelValue[z] = 255) and (kernelValue[z+1] = 0))then whitePixel := whitePixel + 1; if(whitePixel = 1)then begin if( (turn=0) and ((kernelValue[3]=255) or (kernelValue[5]=255) or (kernelValue[1]=255) and (kernelValue[7]=255)) ) then begin pixelOnFlag[y,x] := 1; finishProcessAllPixel := false; end else if ( (turn=1) and ((kernelValue[1]=255) or (kernelValue[7]=255) or (kernelValue[3]=255) and (kernelValue[5]=255)) ) then begin pixelOnFlag[y,x] := 1; finishProcessAllPixel := false; end; end; end; end; end; end; for y:=1 to Image1nova.height-2 do for x:=1 to Image1nova.width-2 do if(pixelOnFlag[y,x] = 1) then pixelValue[y,x] := 255; //deleta o pixel end; end; se alguém tive alguma sugestão para que funcione pois o que ele esta fazendo é pegar a imagem binarizada e o resultado da sua esqueletizacao é uma imagem toda preta com uma linha pontilhada branca na diagonal. grato a todos....
  2. ok vou dar uma olhada dpois posto aki o que achei... vlw.....
  3. boa tarde a todos... estou desenvolvendo um projeto em delphi q consiste em: - captar uma imagem (impressao digital) salva no pc; - converter-la em tons de cinza que consiste em melhor a imagem para os proximos passos (essa parte já esta ok); - binarizar a imagem que consistem em transformar a imagem em preto e branco (tambem esta ok); - esqueletizar a imagem que consistem em afinar a imagem já binarizada (não consegui); - extrair as minucias da imagem esqueletizada (ainda não cheguei); a minha duvida é a seguinte: existe bibliotecas que já fazem isso e eu estou perdendo tempo ou tem q programar na unha mesmo? grato a todos.
×
×
  • Criar Novo...