| Revision 605,
944 bytes
checked in by literalka, 16 months ago
(diff) |
|
more sorting, jesus fuck
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * test.c: test captchas |
|---|
| 3 | * $Id: test.c 41 2005-11-13 22:37:35Z sam $ |
|---|
| 4 | * |
|---|
| 5 | * Copyright: (c) 2004 Sam Hocevar <sam@zoy.org> |
|---|
| 6 | * This program is free software; you can redistribute it and/or |
|---|
| 7 | * modify it under the terms of the Do What The Fuck You Want To |
|---|
| 8 | * Public License as published by Banlu Kemiyatorn. See |
|---|
| 9 | * http://sam.zoy.org/projects/COPYING.WTFPL for more details. |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | #include <stdio.h> |
|---|
| 13 | #include <stdlib.h> |
|---|
| 14 | #include <string.h> |
|---|
| 15 | #include <limits.h> |
|---|
| 16 | #include <math.h> |
|---|
| 17 | |
|---|
| 18 | #include "config.h" |
|---|
| 19 | #include "common.h" |
|---|
| 20 | |
|---|
| 21 | /* Main function */ |
|---|
| 22 | char *decode_test(struct image *img) |
|---|
| 23 | { |
|---|
| 24 | char *result; |
|---|
| 25 | struct image *tmp; |
|---|
| 26 | |
|---|
| 27 | /* phpBB captchas have 6 characters */ |
|---|
| 28 | result = malloc(7 * sizeof(char)); |
|---|
| 29 | result[0] = 0; |
|---|
| 30 | |
|---|
| 31 | tmp = image_dup(img); |
|---|
| 32 | filter_smooth(tmp); |
|---|
| 33 | filter_median(tmp); |
|---|
| 34 | filter_equalize(tmp, 130); |
|---|
| 35 | filter_median(tmp); |
|---|
| 36 | |
|---|
| 37 | image_free(tmp); |
|---|
| 38 | |
|---|
| 39 | return result; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | /* The following functions are local */ |
|---|
| 43 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.