LIDS-UNICAMP / SICLE

Superpixels through Iterative CLEarcutting (SICLE) framework
MIT License
7 stars 1 forks source link

Failure on valgrind check #1

Open tayllatheodoro opened 1 year ago

tayllatheodoro commented 1 year ago

Hi, Felipe. I ran a valgrind check in my code, and somehow there was an invalid read in the function iftSICLE_CalcTStats.

This is a snippet of the code that I used:

iftSICLEArgs *sargs;
iftSICLE *sicle;

sargs = iftCreateSICLEArgs();
sargs->n0 = num_init_seeds;
sargs->nf = num_superpixels;
//sargs->connopt = IFT_SICLE_CONN_FSUM;

sicle = iftCreateSICLE(img, NULL, p_mask);
v_mask = iftRunSICLE(sicle, sargs);
iftDestroySICLEArgs(&sargs);
iftDestroySICLE(&sicle);

num_init_seeds was 15800 and num_superpixels was 800. The image and mask are volumetric.

tayllatheodoro commented 1 year ago

I think data->root_map is nil for pixels outside the ROI.

tayllatheodoro commented 1 year ago

The command iftSICLE_InROI(sicle, v_index) doesn't prevent that. Sometimes, some indexes are negative in the root map but still defined in the ROI.