Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

distanceTransform not working in Xcode

From my understanding if I have an image like this original image and it uses OpenCV distanceTransform to process the image, it should look like distanceTransform image

But when I tried to use distanceTransform in Xcode it will never return an image to my imageview.

I have tried to change distanceTransformMat in UIImage *outputImg = MatToUIImage(distanceTransformMat); to thresholdMat.

To check for which line of code is wrong, I have changed UIImage *outputImg = MatToUIImage(thresholdMat); instead of distanceTransformMat and threshholdMat is able to get a return

Does anyone know why is this happening?