void extract_edges(Pix* pix, // thresholded image BLOCK *block) { // block to scan C_OUTLINE_LIST outlines; // outlines in block C_OUTLINE_IT out_it = &outlines; block_edges(pix, block, &out_it); ICOORD bleft; // block box ICOORD tright; block->bounding_box(bleft, tright); // make blobs outlines_to_blobs(block, bleft, tright, &outlines); }
void extract_edges(Pix* pix, // thresholded image BLOCK *block) { // block to scan C_OUTLINE_LIST outlines; // outlines in block C_OUTLINE_IT out_it = &outlines; // TODO(rays) move the pix all the way down to the bottom. IMAGE image; image.FromPix(pix); block_edges(&image, block, &out_it); ICOORD bleft; // block box ICOORD tright; block->bounding_box(bleft, tright); // make blobs outlines_to_blobs(block, bleft, tright, &outlines); }
DLLSYM void get_outlines( //edge detect #ifndef GRAPHICS_DISABLED WINDOW window, //window for output #endif IMAGE *image, //image to scan IMAGE *t_image, //thresholded image ICOORD page_tr, //corner of page PDBLK *block, //block to scan C_OUTLINE_IT *out_it //output iterator ) { #ifndef GRAPHICS_DISABLED edge_win = window; //set statics #endif outline_it = out_it; block_edges(t_image, block, page_tr); out_it->move_to_first (); #ifndef GRAPHICS_DISABLED if (window != NO_WINDOW) overlap_picture_ops(TRUE); //update window #endif }