From c97e07681f2a97800c9ec0e9f186437550efd92a Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 30 May 2005 15:22:02 +0000 Subject: [PATCH] * filter_equalize -> filter_threshold git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@482 92316355-f0b4-4df1-b90c-862c8a59935f --- src/authimage.c | 4 ++-- src/clubic.c | 2 +- src/common.h | 2 +- src/filter.c | 2 +- src/linuxfr.c | 2 +- src/livejournal.c | 2 +- src/phpbb.c | 2 +- src/slashdot.c | 2 +- src/test.c | 2 +- src/tickets.c | 2 +- src/vbulletin.c | 4 ++-- src/xanga.c | 6 +++--- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/authimage.c b/src/authimage.c index e3f3bc9..72bd432 100644 --- a/src/authimage.c +++ b/src/authimage.c @@ -42,9 +42,9 @@ char *decode_authimage(struct image *img) tmp = image_dup(img); filter_scale(tmp, 2.0); getpixel(tmp, 0, 0, &r, &g, &b); - filter_equalize(tmp, r * 3 / 4); + filter_threshold(tmp, r * 3 / 4); filter_smooth(tmp); - filter_equalize(tmp, 220); + filter_threshold(tmp, 220); for(i = 0; i < 6; i++) { diff --git a/src/clubic.c b/src/clubic.c index cb3a4f5..576f992 100644 --- a/src/clubic.c +++ b/src/clubic.c @@ -32,7 +32,7 @@ char *decode_clubic(struct image *img) strcpy(result, " "); tmp = image_dup(img); - filter_equalize(tmp, 200); + filter_threshold(tmp, 200); find_glyphs(tmp); image_free(tmp); diff --git a/src/common.h b/src/common.h index c8fe6de..1ac517e 100644 --- a/src/common.h +++ b/src/common.h @@ -72,7 +72,7 @@ void filter_fill_holes(struct image *img); void filter_scale(struct image *img, float ratio); void filter_black_stuff(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_smooth(struct image *img); void filter_median(struct image *img); diff --git a/src/filter.c b/src/filter.c index da5a2d8..b980012 100644 --- a/src/filter.c +++ b/src/filter.c @@ -201,7 +201,7 @@ void filter_detect_lines(struct image *img) image_free(dst); } -void filter_equalize(struct image *img, int threshold) +void filter_threshold(struct image *img, int threshold) { struct image *dst; int x, y; diff --git a/src/linuxfr.c b/src/linuxfr.c index dca8717..9193e9f 100644 --- a/src/linuxfr.c +++ b/src/linuxfr.c @@ -43,7 +43,7 @@ char *decode_linuxfr(struct image *img) stats = malloc(img->height * sizeof(int)); tmp = image_dup(img); - filter_equalize(tmp, 150); + filter_threshold(tmp, 150); for(y = 0; y < tmp->height; y++) { diff --git a/src/livejournal.c b/src/livejournal.c index 51a6494..054a71c 100644 --- a/src/livejournal.c +++ b/src/livejournal.c @@ -37,7 +37,7 @@ char *decode_livejournal(struct image *img) filter_median(tmp); // filter_smooth(tmp); // filter_contrast(tmp); - filter_equalize(tmp, 128); + filter_threshold(tmp, 128); image_save(tmp, "foo.bmp"); find_glyphs(tmp); diff --git a/src/phpbb.c b/src/phpbb.c index 101d674..a9679e6 100644 --- a/src/phpbb.c +++ b/src/phpbb.c @@ -44,7 +44,7 @@ char *decode_phpbb(struct image *img) tmp2 = image_new(img->width, img->height); filter_smooth(tmp1); - filter_equalize(tmp1, 128); + filter_threshold(tmp1, 128); for(x = 0; x < img->width; x++) for(y = 0; y < img->height; y++) diff --git a/src/slashdot.c b/src/slashdot.c index e1e84c5..94a4a7e 100644 --- a/src/slashdot.c +++ b/src/slashdot.c @@ -49,7 +49,7 @@ char *decode_slashdot(struct image *img) /* Detect small objects to guess image orientation */ tmp2 = image_dup(tmp1); filter_median(tmp2); - filter_equalize(tmp2, 200); + filter_threshold(tmp2, 200); count_objects(tmp2); /* Invert rotation and find glyphs */ diff --git a/src/test.c b/src/test.c index 8ef75ba..f95b2ad 100644 --- a/src/test.c +++ b/src/test.c @@ -31,7 +31,7 @@ char *decode_test(struct image *img) tmp = image_dup(img); filter_smooth(tmp); filter_median(tmp); - filter_equalize(tmp, 130); + filter_threshold(tmp, 130); filter_median(tmp); image_free(tmp); diff --git a/src/tickets.c b/src/tickets.c index 7012138..38aacd7 100644 --- a/src/tickets.c +++ b/src/tickets.c @@ -46,7 +46,7 @@ char *decode_tickets(struct image *img) /* captcha is jpeg; threshold the image */ tmp = image_dup(img); - filter_equalize(tmp, 127); + filter_threshold(tmp, 127); /* Guess all glyphs */ curx = 50; diff --git a/src/vbulletin.c b/src/vbulletin.c index 489c426..ae232dc 100644 --- a/src/vbulletin.c +++ b/src/vbulletin.c @@ -42,9 +42,9 @@ char *decode_vbulletin(struct image *img) tmp = image_dup(img); getpixel(tmp, 0, 0, &r, &g, &b); if(r < 50) - filter_equalize(tmp, 128); + filter_threshold(tmp, 128); else - filter_equalize(tmp, -128); + filter_threshold(tmp, -128); /* Remove garbage around the cells */ for(x = 0; x < tmp->width; x++) diff --git a/src/xanga.c b/src/xanga.c index 366cf69..81b71e4 100644 --- a/src/xanga.c +++ b/src/xanga.c @@ -35,7 +35,7 @@ char *decode_xanga(struct image *img) tmp = image_dup(img); image_save(tmp, "xanga1.bmp"); /* Clean image a bit */ -// filter_equalize(tmp, 200); +// filter_threshold(tmp, 200); filter_contrast(tmp); //filter_detect_lines(tmp); image_save(tmp, "xanga2.bmp"); @@ -47,14 +47,14 @@ image_save(tmp, "xanga3.bmp"); //filter_detect_lines(tmp); // filter_median(tmp); //image_save(tmp, "xanga4.bmp"); -// filter_equalize(tmp, 128); +// filter_threshold(tmp, 128); filter_contrast(tmp); image_save(tmp, "xanga4.bmp"); #if 0 /* Detect small objects to guess image orientation */ filter_median(tmp); - filter_equalize(tmp, 200); + filter_threshold(tmp, 200); /* Invert rotation and find glyphs */ filter_median(tmp);