That looks like the problem. To create an image, you need to use the imaq or frc function. Try this instead:
Code:
Image* processedImage = imaqCreateImage(IMAQ_IMAGE_U8, 3);
imaqMorphology(processedImage, bImage -> GetImaqImage(), IMAQ_ERODE, sElement);
When you wish to dispose of the image, you can then use
Code:
imaqDispose(processedImage);