Showing posts with label OpenCV. Show all posts
Showing posts with label OpenCV. Show all posts

2015/05/24

OpenCL platform for OpenCV 3.0

http://opencv.org/platforms/opencl.html

OpenCV 3.0 is coming.

Currently OpenCV 3.0 rc1 is open.

The most noticeable change in OpenCV 3.0 is transparent API.(tapi)

OpenCV 2.x version supports different namespace API for each platforms.
For CUDA module, gpu:: namespace is used. For OpenCL module, ocl:: namespace is provided.

However, tapi allows typical API to be used for multi platform such as CUDA and OpenCL.

For more information :
https://docs.google.com/presentation/d/1qoa29N_B-s297-fp0-b3rBirvpzJQp8dCtllLQ4DVCY/present?slide=id.p14

2015/02/03

[OpenCV]The reason why you should use Mat class instead of Iplimage

According to OpenCV tutorial( http://docs.opencv.org/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.html ), you are recommended to use Mat class instead of typical IplImage class.

There are important reasons why you should use Mat class.



1. memory copy issue

Since processing mass data like image requires heavy load due to data copy, minimizing memory copy issue is important.

Mat class basically supports mechanism to minimize memory copy between image processing steps.

For this, Mat class consists of header and data space.
To move to next step of image processing, Mat class just switches headers which have address pointing actual image data.



2. memory management

Memory leak problem is critical In image processing application because size of the leak is mass.

Furthermore, frequent memory allocation and releasing wastes a lot of processor resource and memory management is not easy in multitasking structure.

Thus, smart pointer is a good solution for this issue.
Mat class uses memory reference counter like boost shared pointer which supports automatic releasing unused memory that allows users to access memory space without concerning memory management.



3. good match with c++

Basically, old Iplimage structure is designed for C language.
APIs for Iplimage is c style fuctions such as cvImageload, cvCvtColor.

However, Mat class is designed for object oriented language, C++.
APIs for Mat class is surely object oriented style.




For these reasons, OpenCV tutorial recommends to use Mat class if you are not programming based on C language for embedded system.

2014/08/31