The following is the code you shared.
Please tell us which function call causes the issue and provide the log. Thanks.
//
// Created by hunglx on 31/03/2021.
//
#include <dw/Driveworks.h>
#include <dw/core/VersionCurrent.h>
#include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
#define DW_CALL_CHECK(call) { dw_ck((call), __FILE__, __LINE__); }
inline void dw_ck(dwStatus code, const char *file, int line, bool abort=true)
{
if (code != DW_SUCCESS)
{
fprintf(stderr,"DW: %s %d. %d\n", file, line, code);
if (abort)
{
exit(code);
}
}
}
int main() {
dwContextHandle_t sdk = DW_NULL_HANDLE;
dwContextParameters sdk_params = {};
dwVersion sdkVersion;
DW_CALL_CHECK(dwGetVersion(&sdkVersion));
DW_CALL_CHECK(dwInitialize(&sdk, DW_VERSION, &sdk_params));
dwClustererHandle_t clusterer = DW_NULL_HANDLE;
dwClustererParams params;
DW_CALL_CHECK(dwClusterer_initParams(¶ms));
cout << params.epsilon << endl;
cout << params.maxSampleCount << endl;
cout << params.minSamples << endl;
cout << params.minSumOfWeights << endl;
DW_CALL_CHECK(dwClusterer_initialize(&clusterer, ¶ms, sdk));
vector<dwRectf> boxes;
vector<float32_t> weights;
for (int i = 0; i < 100; i++) {
dwRectf box;
box.x = float(rand() % 500 + 1);
box.y = float(rand() % 500 + 1);
box.width = float(rand() % 500 + 1);
box.height = float(rand() % 500 + 1);
boxes.push_back(box);
weights.push_back(1.0f / 100);
}
DW_CALL_CHECK(dwClusterer_bindInput(reinterpret_cast<const dwRectf *const *>(boxes.data()),
reinterpret_cast<const float32_t *const *>(weights.data()),
reinterpret_cast<const uint32_t *>(boxes.size()), clusterer));
uint32_t clusterLabelsCount;
uint32_t clusterCount;
int32_t *clusterLabels = nullptr;
DW_CALL_CHECK(dwClusterer_bindOutput(&clusterLabels, &clusterLabelsCount, &clusterCount, clusterer));
DW_CALL_CHECK(dwClusterer_process(clusterer));
cout << "done" << endl;
}