Browse Source

* filter_equalize -> filter_threshold

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@482 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 19 years ago
parent
commit
c97e07681f
12 changed files with 16 additions and 16 deletions
  1. +2
    -2
      src/authimage.c
  2. +1
    -1
      src/clubic.c
  3. +1
    -1
      src/common.h
  4. +1
    -1
      src/filter.c
  5. +1
    -1
      src/linuxfr.c
  6. +1
    -1
      src/livejournal.c
  7. +1
    -1
      src/phpbb.c
  8. +1
    -1
      src/slashdot.c
  9. +1
    -1
      src/test.c
  10. +1
    -1
      src/tickets.c
  11. +2
    -2
      src/vbulletin.c
  12. +3
    -3
      src/xanga.c

+ 2
- 2
src/authimage.c View File

@@ -42,9 +42,9 @@ char *decode_authimage(struct image *img)
tmp = image_dup(img); tmp = image_dup(img);
filter_scale(tmp, 2.0); filter_scale(tmp, 2.0);
getpixel(tmp, 0, 0, &r, &g, &b); getpixel(tmp, 0, 0, &r, &g, &b);
filter_equalize(tmp, r * 3 / 4);
filter_threshold(tmp, r * 3 / 4);
filter_smooth(tmp); filter_smooth(tmp);
filter_equalize(tmp, 220);
filter_threshold(tmp, 220);


for(i = 0; i < 6; i++) for(i = 0; i < 6; i++)
{ {


+ 1
- 1
src/clubic.c View File

@@ -32,7 +32,7 @@ char *decode_clubic(struct image *img)
strcpy(result, " "); strcpy(result, " ");


tmp = image_dup(img); tmp = image_dup(img);
filter_equalize(tmp, 200);
filter_threshold(tmp, 200);
find_glyphs(tmp); find_glyphs(tmp);


image_free(tmp); image_free(tmp);


+ 1
- 1
src/common.h View File

@@ -72,7 +72,7 @@ void filter_fill_holes(struct image *img);
void filter_scale(struct image *img, float ratio); void filter_scale(struct image *img, float ratio);
void filter_black_stuff(struct image *img); void filter_black_stuff(struct image *img);
void filter_detect_lines(struct image *img); void filter_detect_lines(struct image *img);
void filter_equalize(struct image *img, int threshold);
void filter_threshold(struct image *img, int threshold);
void filter_trick(struct image *img); void filter_trick(struct image *img);
void filter_smooth(struct image *img); void filter_smooth(struct image *img);
void filter_median(struct image *img); void filter_median(struct image *img);


+ 1
- 1
src/filter.c View File

@@ -201,7 +201,7 @@ void filter_detect_lines(struct image *img)
image_free(dst); image_free(dst);
} }


void filter_equalize(struct image *img, int threshold)
void filter_threshold(struct image *img, int threshold)
{ {
struct image *dst; struct image *dst;
int x, y; int x, y;


+ 1
- 1
src/linuxfr.c View File

@@ -43,7 +43,7 @@ char *decode_linuxfr(struct image *img)
stats = malloc(img->height * sizeof(int)); stats = malloc(img->height * sizeof(int));


tmp = image_dup(img); tmp = image_dup(img);
filter_equalize(tmp, 150);
filter_threshold(tmp, 150);


for(y = 0; y < tmp->height; y++) for(y = 0; y < tmp->height; y++)
{ {


+ 1
- 1
src/livejournal.c View File

@@ -37,7 +37,7 @@ char *decode_livejournal(struct image *img)
filter_median(tmp); filter_median(tmp);
// filter_smooth(tmp); // filter_smooth(tmp);
// filter_contrast(tmp); // filter_contrast(tmp);
filter_equalize(tmp, 128);
filter_threshold(tmp, 128);
image_save(tmp, "foo.bmp"); image_save(tmp, "foo.bmp");
find_glyphs(tmp); find_glyphs(tmp);




+ 1
- 1
src/phpbb.c View File

@@ -44,7 +44,7 @@ char *decode_phpbb(struct image *img)
tmp2 = image_new(img->width, img->height); tmp2 = image_new(img->width, img->height);


filter_smooth(tmp1); filter_smooth(tmp1);
filter_equalize(tmp1, 128);
filter_threshold(tmp1, 128);


for(x = 0; x < img->width; x++) for(x = 0; x < img->width; x++)
for(y = 0; y < img->height; y++) for(y = 0; y < img->height; y++)


+ 1
- 1
src/slashdot.c View File

@@ -49,7 +49,7 @@ char *decode_slashdot(struct image *img)
/* Detect small objects to guess image orientation */ /* Detect small objects to guess image orientation */
tmp2 = image_dup(tmp1); tmp2 = image_dup(tmp1);
filter_median(tmp2); filter_median(tmp2);
filter_equalize(tmp2, 200);
filter_threshold(tmp2, 200);
count_objects(tmp2); count_objects(tmp2);


/* Invert rotation and find glyphs */ /* Invert rotation and find glyphs */


+ 1
- 1
src/test.c View File

@@ -31,7 +31,7 @@ char *decode_test(struct image *img)
tmp = image_dup(img); tmp = image_dup(img);
filter_smooth(tmp); filter_smooth(tmp);
filter_median(tmp); filter_median(tmp);
filter_equalize(tmp, 130);
filter_threshold(tmp, 130);
filter_median(tmp); filter_median(tmp);


image_free(tmp); image_free(tmp);


+ 1
- 1
src/tickets.c View File

@@ -46,7 +46,7 @@ char *decode_tickets(struct image *img)


/* captcha is jpeg; threshold the image */ /* captcha is jpeg; threshold the image */
tmp = image_dup(img); tmp = image_dup(img);
filter_equalize(tmp, 127);
filter_threshold(tmp, 127);


/* Guess all glyphs */ /* Guess all glyphs */
curx = 50; curx = 50;


+ 2
- 2
src/vbulletin.c View File

@@ -42,9 +42,9 @@ char *decode_vbulletin(struct image *img)
tmp = image_dup(img); tmp = image_dup(img);
getpixel(tmp, 0, 0, &r, &g, &b); getpixel(tmp, 0, 0, &r, &g, &b);
if(r < 50) if(r < 50)
filter_equalize(tmp, 128);
filter_threshold(tmp, 128);
else else
filter_equalize(tmp, -128);
filter_threshold(tmp, -128);


/* Remove garbage around the cells */ /* Remove garbage around the cells */
for(x = 0; x < tmp->width; x++) for(x = 0; x < tmp->width; x++)


+ 3
- 3
src/xanga.c View File

@@ -35,7 +35,7 @@ char *decode_xanga(struct image *img)
tmp = image_dup(img); tmp = image_dup(img);
image_save(tmp, "xanga1.bmp"); image_save(tmp, "xanga1.bmp");
/* Clean image a bit */ /* Clean image a bit */
// filter_equalize(tmp, 200);
// filter_threshold(tmp, 200);
filter_contrast(tmp); filter_contrast(tmp);
//filter_detect_lines(tmp); //filter_detect_lines(tmp);
image_save(tmp, "xanga2.bmp"); image_save(tmp, "xanga2.bmp");
@@ -47,14 +47,14 @@ image_save(tmp, "xanga3.bmp");
//filter_detect_lines(tmp); //filter_detect_lines(tmp);
// filter_median(tmp); // filter_median(tmp);
//image_save(tmp, "xanga4.bmp"); //image_save(tmp, "xanga4.bmp");
// filter_equalize(tmp, 128);
// filter_threshold(tmp, 128);
filter_contrast(tmp); filter_contrast(tmp);
image_save(tmp, "xanga4.bmp"); image_save(tmp, "xanga4.bmp");


#if 0 #if 0
/* Detect small objects to guess image orientation */ /* Detect small objects to guess image orientation */
filter_median(tmp); filter_median(tmp);
filter_equalize(tmp, 200);
filter_threshold(tmp, 200);


/* Invert rotation and find glyphs */ /* Invert rotation and find glyphs */
filter_median(tmp); filter_median(tmp);


Loading…
Cancel
Save