cv::Mat::forEach() sliding window
Is it possible to access multiple pixels at once (e.g. a 3x3 grid) in Mat::forEach()? I want to implement a simple sliding window algorithm and was wondering, if I can parallelize this (since I am only reading, not modifying the original image).
can you be more explicit about your operation ? some (pseudo) code ?
i don't think it'll work. it's parallelized internally, so your array will be split up into ranges, and those won't respect any 2d border condition.
again, please describe your better, maybe we can find a suitable alternative (e.g., maybe it can be "vectorized" so you don't work on single pixels, but whole image rois)