Undocumented opencv function? - function

may I know what is the difference between an "UNDOCUMENTED" opencv function with a documented one? I have searched online but apparently I do not get the explanation that is clear enough to make me clear my doubt. Thanks
The function is calcBluriness, which is used to determine the blurriness of a given image. Thanks

This question is rather a non question, but here is an answer anyway in case of future viewers.
All of OpenCV is documented, and documentation is part of the development process, you can access the docs here
As for calcBluriness, it is also documented, you can find that here

Related

MXNet AdamW optimizer

Adam optimizer has flaws when used with weight decay. In 2018, AdamW optimizer has been proposed.
Is there any standard way to implement AdamW in MXNet framework (python implementation)? There is mxnet.optimizer.Adam class, but no mxnet.optimizer.AdamW one (checked in mxnet-cu102==1.6.0, mxnet==1.5.0 package versions).
P.S. I asked this questions on MXNet forum and on datascience.stackexchange.com, but to no avail.
Short answer: There isn't a standard way to use AdamW in Gluon yet, but there is some existing work in that direction that would make that relatively easy to add.
Longer answer:
People have been asking for this feature - a lot :) See: https://github.com/apache/incubator-mxnet/issues/9182
Gluon-NLP has a working version of AdamW - possibly slightly different from the one in the original paper: https://github.com/eric-haibin-lin/gluon-nlp/blob/df63e2c2a4d6b998289c25a38ffec8f4ff647ff4/src/gluonnlp/optimizer/bert_adam.py
The adamw_update() operator was added with this pull request: https://github.com/apache/incubator-mxnet/pull/13728 This is first released in MXNet 1.6.0.
Unfortunately, it looks like there isn't a way to use this with gluon.Trainer directly right now, without copying/modifying the BERTAdam code (or writing something similar from scratch). That would be a very nice thing to add to Gluon.
Please let me know if you get this working, as I'd love to be able to use that as well.

What is __CUDANVVM__ for?

The macros __CUDACC__, __CUDANVVM__, and __CUDA_ARCH__ are used in many places in the CUDA library header files. I am able to find info on __CUDACC__ and __CUDA_ARCH__, but I don't get anything on Google regarding __CUDANVVM__ other than finding it used in the headers. Due to the usage for static/forced-inline of calls through to functions of the form __nv_<base_function_name>, my intuition is that it is used as part of the process of compiling with libdevice and those __nv_* functions are the device-optimized bitcode versions of the functions they correspond to, but I'm not yet sure and so was looking for clarification.
Going by http://docs.nvidia.com/cuda/libdevice-users-guide/function-desc.html#function-desc, it appears that the __nv_* functions are indeed those from libdevice, so it seems my hunch was correct.

ahk - ocr failed with camerb's library

I think that the camerb's library doesn't work very well, you can see the result of ocr in the following picture:
http://i.stack.imgur.com/Kyhqk.jpg
the same result is obtained if I try to do the ocr of a number, especially a float, the comma is often not recognized and the "0" is exchanged with the "o" :(
someone knows a more efficient library? ...thanks for the answers
if you want try the camerb's library, you can download it here:
http://www.autohotkey.com/board/topic/69127-ocrahk-library-for-recognizing-text-in-images/
i have just tried Capture2Text software, it's working pretty good (in a window 650x450) but if i try to do the OCR of a little window (400x320), the maching is not really exactly.
does anyone know if AbbyyFineReader works with command prompt? because the developers of this software tell that it has a precision of 99,8%.

PBKDF2WithHmacSHA1 in AS3

I'm working on a CRAM auth system using a Flash/Flex client and a Java server (Red5). I have used the as3crypto library before, but as far as I know it does not support PBKDF2. This algorithm is suggested for password encryption by NIST so its what I want to use. Does anyone know of an AS3 compatible library with this algorithm, specifically PBKDF2WithHmacSHA1?
Refs:
http://code.google.com/p/as3crypto/
http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf
This one seems OK: http://code.google.com/p/as3-pbkdf2
Did you try putting 'as3 PBKDF2' into google? Took me all of 10 seconds to find these two as they're the top two answers.
The first would suit your needs, but the second seems more versatile as you can specify a hash function.
http://code.google.com/p/as3-pbkdf2/
http://code.google.com/p/as3-pbkdf2-lib/

Studying standard library sources

How does one study open-source libraries code, particularly standard libraries?
The code base is often vast and hard to navigate. How to find some function or class definition?
Do I search through downloaded source files?
Do I need cvs/svn for that?
Maybe web-search?
Should I just know the structure of the standard library?
Is there any reference on it?
Or do some IDEs have such features? Or some other tools?
How to do it effectively without one?
What are the best practices of doing this in any open-source libraries?
Is there any convention of how are sources manipulated on Linux/Unix systems?
What are the differences for specific programming languages?
Broad presentation of the subject is highly encouraged.
I mark this 'community wiki' so everyone can rephrase and expand my awkward formulations!
Update: Probably didn't express the problem clear enough. What I want to, is to view just the source code of some specific library class or function. And the problem is mostly about work organization and usability - how do I navigate in the huge pile of sources to find the thing, maybe there are specific tools or approaches? It feels like there should've long existed some solution(s) for that.
One thing to note is that standard libraries are sometimes (often?) optimized more than is good for most production code.
Because they are widely used, they have to perform well over a wide variety of conditions, and may be full of clever tricks and special logic for corner cases.
Maybe they are not the best thing to study as a beginner.
Just a thought.
Well, I think that it's insane to just site down and read a library's code. My approach is to search whenever I come across the need to implement something by myself and then study the way that it's implemented in those libraries.
And there's also allot of projects/libraries with excellent documentation, which I find more important to read than the code. In Unix based systems you often find valuable information in the man pages.
Wow, that's a big question.
The short answer: it depends.
The long answer:
Some libraries provide documentation while others don't. Standard libraries are usually pretty well documented, whether your chosen implementation of the library includes documentation or not. For instance you may have found an implementation of the c standard library without documentation but the c standard has been around long enough that there are hundreds of good reference books available. Documentation with hyperlinks is a very useful way to learn a new API. In any case the first place I would look is the library's main website
For less well known libraries lacking documentation I find two different approaches very helpful.
First is a doc generator. Nearly every language I know of has one. It basically parses an source tree and creates documentation (usually as html or xml) which can be used to learn a library. Some use specially formatted comments in the code to create more complete documentation. JavaDoc is one good example of this. Doc generators for many other languages borrow from JavaDoc.
Second an IDE with a class browser. These act as a sort of on the fly documentation. Some display just the library's interface. Other's include description comments from the library's source.
Both of these will require access to the libraries source (which will come in handy if you intend actually use a library).
Many of these tools and techniques work equally well for closed/proprietary libraries.
The standard Java libraries' source code is available. For a beginning Java programmer these can be a great read. Especially the Collections framework is a good place to start. Take for instance the implementation of ArrayList and learn how you can implement a resizeable array in Java. Most of the source has even useful comments.
The best parts to read are probably whose purpose you can understand immediately. Start with the easy pieces and try to follow all the steps that are hidden behind that single call you make from your own code.
Something I do from time to time :
apt-get source foo
Then new C++ project (or whatever) in Eclipse and import.
=> Wow ! Browsable ! (use F3)