opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
78.31k stars 55.73k forks source link

Clean Core module #25002

Open vpisarev opened 7 months ago

vpisarev commented 7 months ago

Describe the feature and motivation

core module is the cornerstone of OpenCV. It implements basic functionality and so it's used in any OpenCV-based application. Therefore it makes sense to clean it up in OpenCV 5.0 in order to reduce footprint as much as possible. Sometimes this footprint is not just about the consumed space, but also about the compile time overhead.

Here are the suggested items (these are not all the changes proposed for core module in OpenCV 5, a part of them):

Additional context

No response

fengyuentau commented 7 months ago

parallel/ subdirectory - those details should not be exposed outside of the core module. All modules should use cv::parallelfor().

Probably we should extend cv::parallelfor() as we need a threading cost model analysis like Eigen offers so as to parallelize simple yet potentially large for loop (just like in nary_eltwise_layers.cpp).

opencv-alalek commented 7 months ago

parallel/ subdirectory - those details should not be exposed outside of the core module. All modules should use cv::parallelfor().

Completely wrong assumption. There is API for customized parallel backends. In addition there are samples of minimal parallel_for backends for TBB and OpenMP application-driven shims. Refer to related PR and documentation.