Files
opencv-MIRROR/modules/core/src
Arnesh Banerjee ba5b40b1a2 core: restore in-place support for extractChannel (#29568)
extractChannel() stopped supporting in-place operation (dst aliasing
src) after commit 416bf3253 (PR #23473), which replaced

    Mat src = _src.getMat();
    _dst.create(src.dims, &src.size[0], depth);

with a single up-front

    _dst.createSameSize(_src, depth);
    ...
    Mat src = _src.getMat();

When _src and _dst reference the same array, the up-front reallocation
reshapes the shared buffer to a single channel before the multi-channel
source header is fetched. mixChannels() then sees a 1-channel source and
throws for any coi >= 1.

Move createSameSize() back to after the source Mat/UMat is obtained, so
the source header keeps the original multi-channel data alive across the
destination reallocation. This preserves the 0D/1D handling introduced
by createSameSize while restoring the pre-existing in-place contract.

Adds regression test Core_Mat.extractChannel_inplace_29568.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-30 03:09:43 +05:30
..
2026-05-20 17:57:51 +03:00
2026-07-09 12:17:24 +03:00
2023-01-09 11:08:02 +00:00
2024-11-14 08:33:22 +03:00
2018-09-07 20:33:52 +09:00
2026-05-20 17:29:34 +05:30
2026-05-20 17:29:34 +05:30
2019-03-05 14:47:04 +03:00
2026-07-28 20:28:24 +05:30
2022-03-03 07:21:53 +09:00
2019-12-27 12:46:53 +00:00
2026-05-24 17:28:53 +03:00
2026-07-22 11:44:27 +02:00
2025-09-26 12:10:49 +03:00
2026-07-09 12:17:24 +03:00
2026-07-09 12:17:24 +03:00
2026-07-14 09:19:26 +03:00
2026-07-09 12:17:24 +03:00
2025-05-07 13:17:42 +03:00
2026-07-09 12:17:24 +03:00
2026-07-09 12:17:24 +03:00
2024-02-12 14:20:35 +03:00
2026-02-14 15:37:33 +03:00
2024-11-14 08:33:22 +03:00
2026-07-09 12:17:24 +03:00
2018-02-12 14:14:08 +03:00
2018-08-27 14:42:18 +03:00
2025-06-10 10:16:50 +03:00
2026-07-09 12:17:24 +03:00
2014-08-15 12:09:16 +04:00
2026-05-20 17:57:51 +03:00
2022-02-22 19:55:26 +00:00