The error says it all : Assertion failed (data.dims <= 2 && type == CV_32F && K > 0)
These are very simple rules for understanding, the function will work only if:
From what you stated on this, it seems that:
IplImage* iplImage = cvLoadImage("C:/TestImages/rainbox_box.jpg");`
uploads the image as IPL_DEPTH_8U by default, not IPL_DEPTH_32F . This means that mImage also IPL_DEPTH_8U , so your code does not work.
karlphillip
source share