I’m calculating the mutual information between two images, however for some reason the code in a double for loop is not executed
function [s:scalar] = MI3(im1:mat,im2:mat,nbins:scalar)
h1 = imhist(im1,linspace(0,255,nbins))
h2 = imhist(im2,linspace(0,255,nbins))
jointh = imjointhist(im1,im2,linspace(0,255,nbins),linspace(0,255,nbins))
if(jointh[cntx,cnty] != 0 &&(h1[cntx]*h2[cnty])!=0)
mi is an integer, so that all accumulation operations have no effect. If you define as
mi = 0.0, there should be a non-zero result for s.
“bla” is printed from within a kernel, normally the result should be visible in the console. In windows it is handled correctly. In linux the result may be buffered. Will check.
By changing mi to 0.0 I do get a different solution, however the printing does not show in the immediate window, as I would expect it would.
Part of my confusion is probably also due to the fact that my breakpoints in the loop are ignored by the debugger. If you want to do this by design, i would advise to place the red dot (breakpoint) at at the end of the for loop. But I seem to remember that normally quasar was able to debug parallellized for loops (true simulation)?