Try asking in the Photoshop Scripting forum. I seem to remember threads that address subjects like this.
Also Photoshop extended has some Analysis functions which may be of use. I never had extended now I have CC so I have Analysis but have no idea of how to use it or what it can do. It name Analysis suggest it may be able to look at image histogram and pixels and reveal some information. I see it in the image menu.
Message was edited by: JJMack