From ea7efd57d890f73e00ff2130baf303d81964adb9 Mon Sep 17 00:00:00 2001 From: tkram01 Date: Wed, 22 Mar 2023 09:50:58 +0300 Subject: [PATCH] Fix for using sampleIdx to limit training data --- modules/ml/src/data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/data.cpp b/modules/ml/src/data.cpp index a5dd101f1d..d8b41ed91c 100644 --- a/modules/ml/src/data.cpp +++ b/modules/ml/src/data.cpp @@ -904,7 +904,7 @@ public: if( s ) { j = s[i]; - CV_Assert( 0 <= j && j < nsamples ); + CV_Assert( 0 <= j && j < ((layout == ROW_SAMPLE) ? samples.rows : samples.cols) ); } values[i] = src[j*sstep]; if( values[i] == MISSED_VAL )