Skip to content

Commit

Permalink
Split highgui module to videoio and highgui
Browse files Browse the repository at this point in the history
  • Loading branch information
vbystricky authored and VBystricky committed Jul 14, 2014
1 parent f773cd9 commit d58f736
Show file tree
Hide file tree
Showing 149 changed files with 1,673 additions and 1,309 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ OCV_OPTION(WITH_TIFF "Include TIFF support" ON
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build VideoIO with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF)
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# Or you can search for specific OpenCV modules:
#
# FIND_PACKAGE(OpenCV REQUIRED core highgui)
# FIND_PACKAGE(OpenCV REQUIRED core imgcodecs)
#
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
#
Expand Down
15 changes: 8 additions & 7 deletions cmake/OpenCVFindLibsVideo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if(WITH_1394)
if(HAVE_DC1394_2)
ocv_parse_pkg("libdc1394-2" "${DC1394_2_LIB_DIR}/pkgconfig" "")
ocv_include_directories(${DC1394_2_INCLUDE_PATH})
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES}
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES}
"${DC1394_2_LIB_DIR}/libdc1394.a"
"${CMU1394_LIB_DIR}/lib1394camera.a")
endif(HAVE_DC1394_2)
Expand Down Expand Up @@ -234,7 +234,7 @@ if(WITH_FFMPEG)
endif()
endif(FFMPEG_INCLUDE_DIR)
if(HAVE_FFMPEG)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
"${FFMPEG_LIB_DIR}/libswscale.a")
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
Expand All @@ -253,14 +253,15 @@ if(WITH_MSMF)
check_include_file(Mfapi.h HAVE_MSMF)
endif(WITH_MSMF)

# --- Extra HighGUI libs on Windows ---
# --- Extra HighGUI and VideoIO libs on Windows ---
if(WIN32)
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32 vfw32)
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32)
list(APPEND VIDEOIO_LIBRARIES vfw32)
if(MINGW64)
list(APPEND HIGHGUI_LIBRARIES avifil32 avicap32 winmm msvfw32)
list(REMOVE_ITEM HIGHGUI_LIBRARIES vfw32)
list(APPEND VIDEOIO_LIBRARIES avifil32 avicap32 winmm msvfw32)
list(REMOVE_ITEM VIDEOIO_LIBRARIES vfw32)
elseif(MINGW)
list(APPEND HIGHGUI_LIBRARIES winmm)
list(APPEND VIDEOIO_LIBRARIES winmm)
endif()
endif(WIN32)

Expand Down
4 changes: 2 additions & 2 deletions cmake/OpenCVModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ function(ocv_add_accuracy_tests)
__ocv_parse_test_sources(TEST ${ARGN})

# opencv_imgcodecs is required for imread/imwrite
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_highgui ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${test_deps})

if(OCV_DEPENDENCIES_FOUND)
Expand Down Expand Up @@ -811,7 +811,7 @@ function(ocv_add_samples)
string(REGEX REPLACE "^opencv_" "" module_id ${the_module})

if(BUILD_EXAMPLES AND EXISTS "${samples_path}")
set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_imgcodecs opencv_highgui ${ARGN})
set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_imgcodecs opencv_videoio opencv_highgui ${ARGN})
ocv_check_dependencies(${samples_deps})

if(OCV_DEPENDENCIES_FOUND)
Expand Down
3 changes: 3 additions & 0 deletions cmake/OpenCVUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,19 @@ macro(CHECK_MODULE module_name define)
set(${define} 1)
foreach(P "${ALIAS_INCLUDE_DIRS}")
if(${P})
list(APPEND VIDEOIO_INCLUDE_DIRS ${${P}})
list(APPEND HIGHGUI_INCLUDE_DIRS ${${P}})
endif()
endforeach()

foreach(P "${ALIAS_LIBRARY_DIRS}")
if(${P})
list(APPEND VIDEOIO_LIBRARY_DIRS ${${P}})
list(APPEND HIGHGUI_LIBRARY_DIRS ${${P}})
endif()
endforeach()

list(APPEND VIDEOIO_LIBRARIES ${${ALIAS_LIBRARIES}})
list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES}})
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/templates/OpenCVConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# Or you can search for specific OpenCV modules:
#
# find_package(OpenCV REQUIRED core highgui)
# find_package(OpenCV REQUIRED core videoio)
#
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
#
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
endif()
endforeach()

set(FIXED_ORDER_MODULES core imgproc imgcodecs highgui video calib3d features2d objdetect ml flann photo stitching nonfree contrib legacy)
set(FIXED_ORDER_MODULES core imgproc imgcodecs videoio highgui video calib3d features2d objdetect ml flann photo stitching nonfree contrib legacy)

list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})

Expand Down
2 changes: 2 additions & 0 deletions doc/check_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"../modules/video/include/opencv2/video/background_segm.hpp",
"../modules/objdetect/include/opencv2/objdetect.hpp",
"../modules/imgcodecs/include/opencv2/imgcodecs.hpp",
"../modules/videoio/include/opencv2/videoio.hpp",
"../modules/highgui/include/opencv2/highgui.hpp",
]

Expand All @@ -26,6 +27,7 @@
"video",
"objdetect",
"imgcodecs",
"videoio",
"highgui",
"ml"
]
Expand Down
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@
'basicstructures' : ('http://docs.opencv.org/modules/core/doc/basic_structures.html#%s', None),
'oldbasicstructures' : ('http://docs.opencv.org/modules/core/doc/old_basic_structures.html#%s', None),
'readwriteimage' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html#%s', None),
'readwritevideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html#%s', None),
'readwritevideo' : ('http://docs.opencv.org/modules/videoio/doc/reading_and_writing_video.html#%s', None),
'operationsonarrays' : ('http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#%s', None),
'utilitysystemfunctions' : ('http://docs.opencv.org/modules/core/doc/utility_and_system_functions_and_macros.html#%s', None),
'imgprocfilter' : ('http://docs.opencv.org/modules/imgproc/doc/filtering.html#%s', None),
'svms' : ('http://docs.opencv.org/modules/ml/doc/support_vector_machines.html#%s', None),
'drawingfunc' : ('http://docs.opencv.org/modules/core/doc/drawing_functions.html#%s', None),
'xmlymlpers' : ('http://docs.opencv.org/modules/core/doc/xml_yaml_persistence.html#%s', None),
'rwimg' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html#%s', None),
'hgvideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html#%s', None),
'hgvideo' : ('http://docs.opencv.org/modules/videoio/doc/reading_and_writing_video.html#%s', None),
'gpuinit' : ('http://docs.opencv.org/modules/gpu/doc/initalization_and_information.html#%s', None),
'gpudatastructure' : ('http://docs.opencv.org/modules/gpu/doc/data_structures.html#%s', None),
'gpuopmatrices' : ('http://docs.opencv.org/modules/gpu/doc/operations_on_matrices.html#%s', None),
Expand Down Expand Up @@ -420,7 +420,7 @@
'background_subtractor' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractor#backgroundsubtractor%s', None),
'background_subtractor_mog' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractorMOG#backgroundsubtractormog%s', None),
'background_subtractor_mog_two' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractorMOG2#backgroundsubtractormog2%s', None),
'video_capture' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html?highlight=videocapture#videocapture%s', None),
'video_capture' : ('http://docs.opencv.org/modules/videoio/doc/reading_and_writing_video.html?highlight=videocapture#videocapture%s', None),
'ippa_convert': ('http://docs.opencv.org/modules/core/doc/ipp_async_converters.html#%s', None),
'ptr':('http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=Ptr#Ptr%s', None)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ As a test case where to show off these using OpenCV I've created a small program
:language: cpp
:linenos:
:tab-width: 4
:lines: 1-14, 28-29, 31-205
:lines: 1-15, 29-31, 33-208

How to read a video stream (online-camera or offline-file)?
===========================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ classes we're going to use:
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (import '[org.opencv.core Mat Size CvType]
'[org.opencv.highgui Highgui]
'[org.opencv.imgcodecs Imgcodecs]
'[org.opencv.imgproc Imgproc])
org.opencv.imgproc.Imgproc
Expand Down
6 changes: 3 additions & 3 deletions doc/tutorials/introduction/desktop_java/java_dev_intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ Now modify src/main/java/HelloOpenCV.java so it contains the following Java code
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.objdetect.CascadeClassifier;
//
Expand All @@ -387,7 +387,7 @@ Now modify src/main/java/HelloOpenCV.java so it contains the following Java code
// Create a face detector from the cascade file in the resources
// directory.
CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("/lbpcascade_frontalface.xml").getPath());
Mat image = Highgui.imread(getClass().getResource("/lena.png").getPath());
Mat image = Imgcodecs.imread(getClass().getResource("/lena.png").getPath());
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
Expand All @@ -404,7 +404,7 @@ Now modify src/main/java/HelloOpenCV.java so it contains the following Java code
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
Imgcodecs.imwrite(filename, image);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Now here's our recommendation for the structure of the tutorial (although, remem
:language: cpp
:linenos:
:tab-width: 4
:lines: 1-8, 21-22, 24-
:lines: 1-8, 21-23, 25-
After the directive you specify a relative path to the file from what to import. It has four options: the language to use, if you add the ``:linenos:`` the line numbers will be shown, you can specify the tab size with the ``:tab-width:`` and you do not need to load the whole file, you can show just the important lines. Use the *lines* option to do not show redundant information (such as the *help* function). Here basically you specify ranges, if the second range line number is missing than that means that until the end of the file. The ranges specified here do no need to be in an ascending order, you may even reorganize the structure of how you want to show your sample inside the tutorial.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Image Watch works with any existing project that uses OpenCV image objects (for

#include <iostream> // std::cout
#include <opencv2/core/core.hpp> // cv::Mat
#include <opencv2/highgui/highgui.hpp> // cv::imread()
#include <opencv2/imgcodecs/imgcodecs.hpp> // cv::imread()
#include <opencv2/imgproc/imgproc.hpp> // cv::Canny()

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/ios/video_processing/video_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ We add a camera controller to the view controller and initialize it when the vie
.. code-block:: objc
:linenos:
#import <opencv2/highgui/cap_ios.h>
#import <opencv2/videoio/cap_ios.h>
using namespace cv;
Expand Down
1 change: 1 addition & 0 deletions include/opencv2/opencv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"

Expand Down
2 changes: 1 addition & 1 deletion modules/core/doc/basic_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2981,7 +2981,7 @@ The class provides the following features for all derived classes:

* so called "virtual constructor". That is, each Algorithm derivative is registered at program start and you can get the list of registered algorithms and create instance of a particular algorithm by its name (see ``Algorithm::create``). If you plan to add your own algorithms, it is good practice to add a unique prefix to your algorithms to distinguish them from other algorithms.

* setting/retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV highgui module, you are probably familar with ``cvSetCaptureProperty()``, ``cvGetCaptureProperty()``, ``VideoCapture::set()`` and ``VideoCapture::get()``. ``Algorithm`` provides similar method where instead of integer id's you specify the parameter names as text strings. See ``Algorithm::set`` and ``Algorithm::get`` for details.
* setting/retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV videoio module, you are probably familar with ``cvSetCaptureProperty()``, ``cvGetCaptureProperty()``, ``VideoCapture::set()`` and ``VideoCapture::get()``. ``Algorithm`` provides similar method where instead of integer id's you specify the parameter names as text strings. See ``Algorithm::set`` and ``Algorithm::get`` for details.

* reading and writing parameters from/to XML or YAML files. Every Algorithm derivative can store all its parameters and then read them back. There is no need to re-implement it each time.

Expand Down
3 changes: 2 additions & 1 deletion modules/core/doc/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ OpenCV has a modular structure, which means that the package includes several sh
* **calib3d** - basic multiple-view geometry algorithms, single and stereo camera calibration, object pose estimation, stereo correspondence algorithms, and elements of 3D reconstruction.
* **features2d** - salient feature detectors, descriptors, and descriptor matchers.
* **objdetect** - detection of objects and instances of the predefined classes (for example, faces, eyes, mugs, people, cars, and so on).
* **highgui** - an easy-to-use interface to video capturing, image and video codecs, as well as simple UI capabilities.
* **highgui** - an easy-to-use interface to simple UI capabilities.
* **videoio** - an easy-to-use interface to video capturing and video codecs.
* **gpu** - GPU-accelerated algorithms from different OpenCV modules.
* ... some other helper modules, such as FLANN and Google test wrappers, Python bindings, and others.

Expand Down
2 changes: 1 addition & 1 deletion modules/cudacodec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(the_description "CUDA-accelerated Video Encoding/Decoding")

ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef)

ocv_add_module(cudacodec opencv_highgui OPTIONAL opencv_cudev)
ocv_add_module(cudacodec OPTIONAL opencv_cudev)

ocv_module_include_directories()
ocv_glob_module_sources()
Expand Down
Loading

0 comments on commit d58f736

Please sign in to comment.