slight tweaks to the tirg text detector so that it can function as a DLL