Skip to content

Clean Imgproc module #25001

Open
Open
@vpisarev

Description

@vpisarev

Describe the feature and motivation

Image processing (imgproc) is one of OpenCV flagship modules, actively used by many people, even in deep-learning era. Most of the stuff it contains is quite useful, but there is some old, obsolete functionality.

Let's clean it up a bit in OpenCV5. Namely:

  • Move old corner detectors to opencv_contrib/ximgproc: cornerMinEigenVal, cornerHarris, cornerEigenValsAndVecs, preCornerDetect. Those functions are all well replaced with goodFeaturesToTrack.
  • Move accumulate*() to opencv_contrib (or to some compatibility header). accumulate() and accumulateWeighted() are already covered by add() and addWeighted(). The other 2 can be replaced with slightly less efficient combination of 2 functions: multiply() and add(). There is no much use for those functions currently.
  • move EMD (Earth mover distance) to opencv_contrib.
  • possibly remove compeltely pyrMeanShiftFiltering. It's very old algorithm for image segmentation that gives very poor quality by today's standards.
  • move moments() and HuMoments() to opencv_contrib.
  • move HoughLines (all variations), HoughCircles(), GeneralizedHoughTransform and LSD (line segment detector) to opencv_contrib. Currently there are significantly, incomparably better deep learning methods to detect lines, circles and other simple objects that with proper optimizations and some tricks can be made as efficient as the traditional methods (or even more efficient when using dedicated accelerators). See https://arxiv.org/pdf/2003.04676.pdf for example
  • not to remove, but we need to normalize color conversion API. The new cvtColor() should take 2 color spaces, input and output, and choose the proper conversion algorithm. It should cover different variations of YUV color space, including subsampled options like 4:2:0, 4:2:2 etc. Color space conversion should also be able to convert the result to proper data type (e.g. FP16 or FP32) with or without scaling. All steps of a complicated color space transformation can likely be fused into a single parallel loop. See also New shiny Imgproc module for OpenCV 5.0 #25012

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode cleanup (e.g, drop legacy C-API, legacy unmaintained code)feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions