fixed gpu module compilation
removed internal_header.hpp - it produces many warnings
fixed warnings
Remove inline sorting algorithms from core headers
fixed bug in TVL1 optical flow:

initial optical flow was not cleaned during the second call
Add specialization for << operator for writing std::string to FileStorage
Merge pull request #704 from taka-no-me:folders
Merge pull request #707 from pengx17:2.4_surf
Merge pull request #718 from apavlenko:java_tests_fix
Merge pull request #711 from taka-no-me:move_keypoint_dmatch
Merge pull request #717 from ryanobjc:patch-1
Merge pull request #719 from jet47:gpu-fix-build
Merge pull request #694 from mistydemeo:fix_java_detection
Update operations_on_arrays.rst

Remove weirdo unicode – and just use a normal -(cherry picked from commit 0d49de51b79eacccf5b93a6fa67478a59ffd246d)
Fix ant/Java detection in cmake scripts

Mac OS X 10.7 and newer don't come with Java installed. They do
include some stub binaries, which ask the user if they want to
install Java when run.

OpenCV's cmake script just checks for the existence of an ant
binary and assumes that Java's available if ant is. As a result,
cmake will configure the build to use Java and it will fail once
it tries to compile the Java bindings.

This fixes the issue by checking for the exit status of
`ant -version` - it exits 0 if Java is installed, or 1
otherwise.(cherry picked from commit a423afddc143f4b10e09e7b253a420b29f877b6c)
Merge branch '2.4'
In response to Bug #2927 

change to reject contours with moms.m00 = 0.0
Port dft.py sample from cv to cv2
Fix typo leading to heap corruption in OutputArray::create
Merge pull request #723 from virtuald:2.4