Files
opencv/modules/core/test
Arnesh BanerjeeandClaude Opus 4.8 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-02-20 22:05:35 +03:00
2026-07-28 20:28:24 +05:30
2018-02-12 07:09:43 -05:00
2026-05-24 17:28:53 +03:00
2026-02-20 22:05:35 +03:00
2026-05-25 17:49:25 +03:00
2026-05-25 17:49:25 +03:00
2024-08-28 15:06:19 +03:00
2024-01-23 17:06:52 +03:00
2018-02-03 19:39:47 +00:00
2025-11-18 08:51:08 +03:00