Changeset 389 for pwntcha/trunk/src/slashdot.c
- Timestamp:
- Jan 3, 2005, 10:48:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pwntcha/trunk/src/slashdot.c
r387 r389 31 31 /* Global stuff */ 32 32 struct { int xmin, ymin, xmax, ymax; } objlist[100]; 33 int objects = 0, first = -1, last = -1;33 int objects, first, last; 34 34 char *result; 35 35 … … 37 37 char * decode_slashdot(struct image *img) 38 38 { 39 struct image *tmp, *tmp2; 39 struct image *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7; 40 41 /* Initialise local data */ 42 objects = 0; 43 first = -1; 44 last = -1; 40 45 41 46 /* Slashdot captchas have 7 characters */ … … 43 48 44 49 /* Clean image a bit */ 45 tmp = filter_detect_lines(img);46 tmp = filter_fill_holes(tmp);50 tmp1 = filter_detect_lines(img); 51 tmp2 = filter_fill_holes(tmp1); 47 52 48 53 /* Detect small objects to guess image orientation */ 49 tmp 2 = filter_median(tmp);50 tmp 2 = filter_equalize(tmp2);51 count_objects(tmp 2);54 tmp3 = filter_median(tmp2); 55 tmp4 = filter_equalize(tmp3, 200); 56 count_objects(tmp4); 52 57 53 58 /* Invert rotation and find glyphs */ 54 tmp = rotate(tmp); 55 tmp = filter_median(tmp); 56 tmp = find_glyphs(tmp); 59 tmp5 = rotate(tmp2); 60 tmp6 = filter_median(tmp5); 61 tmp7 = find_glyphs(tmp6); 62 63 /* Clean up our mess */ 64 image_free(tmp1); 65 image_free(tmp2); 66 image_free(tmp3); 67 image_free(tmp4); 68 image_free(tmp5); 69 image_free(tmp6); 70 image_free(tmp7); 71 72 /* aaaaaaa means decoding failed */ 73 if(!strcmp(result, "aaaaaaa")) 74 result[0] = '\0'; 57 75 58 76 return result;
Note: See TracChangeset
for help on using the changeset viewer.