"be consistent" | |
PerlMonks |
Re^9: Why this code is so slow if run in thread?by BrowserUk (Patriarch) |
on Dec 14, 2016 at 01:18 UTC ( [id://1177753]=note: print w/replies, xml ) | Need Help?? |
One last thought. If you are still hankering for more speed, compile your own PDL modules and are comfortable with C, then you could look to making a custom version of the ccNcompt() routine in PDL::Image2D, that accumulates the component bounds in the same pass as it discovers them. On the basis of a quick look at the source it wouldn't be too hard to modify the routine to do the accumulation; though there are a few complications.
Thanks for posting such an interesting problem. It has given me much mental stimulation of the last week or so. One final, final thought. Many years ago, I wrote some OCR routines in 6502 assembler for a BBC micro. The first part of that process was to isolate the individual characters, essentially the same task as this. However, I was lucky in as much as the stuff I was dealing with was handwritten text and crosses filled into predefined boxes on a form -- multiple choice question papers with boxes for choices, names, id numbers etc. and the positions of those boxes were known a priori to a high degree of accuracy. That made my life simple -- for the first stage at least. It is clear from your sample image that you're not dealing with simple text, but there also appear to be registration marks on the image. If that is true for all your samples, and they are consistent, it might be possible to predefine the areas of interest, rather than needing to discover them new for each image, which would greatly speed up your task. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|