feler404 / ocvl-addon

Framework to ease manage OpenCV algorithms based on Blender
https://www.ocvl.teredo.tech/
GNU General Public License v3.0
58 stars 11 forks source link

Blender Node FindContours and DrawContours error #21

Open enzyme69 opened 5 years ago

enzyme69 commented 5 years ago

I keep getting error when trying to process a simple contour output:

Screen Shot 2019-08-09 at 11 25 34 am
2019-08-09 11:19:54,737 [WARNING] ocvl.core.node_base: CV process problem: fn=<built-in function findContours>, kwargs={'image': array([[[ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 72,  72,  72, 255],
        ...,
        [ 70,  70,  70, 255],
        [ 71,  71,  71, 255],
        [ 72,  72,  72, 255]],

       [[ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        ...,
        [ 71,  71,  71, 255],
        [ 70,  70,  70, 255],
        [ 72,  72,  72, 255]],

       [[ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        ...,
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 70,  70,  70, 255]],

       ...,

       [[ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        ...,
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255]],

       [[ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        ...,
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255]],

       [[ 70,  70,  70, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255],
        ...,
        [ 70,  70,  70, 255],
        [ 71,  71,  71, 255],
        [ 71,  71,  71, 255]]], dtype=uint8), 'mode': 3, 'method': 2, 'offset': (0, 0)}, self=<bpy_struct, OCVLfindContoursNode("findContours")>, exception=OpenCV(4.1.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/contours.cpp:197: error: (-210:Unsupported format or combination of formats) [Start]FindContours supports only CV_8UC1 images when mode != CV_RETR_FLOODFILL otherwise supports CV_32SC1 images only in function 'cvStartFindContours_Impl'
feler404 commented 5 years ago

I can reproduce that for current master branch.

Zrzut ekranu 2019-08-10 o 14 46 47

Problems are in findContours, it's working for different settings?

enzyme69 commented 5 years ago
Screen Shot 2019-08-11 at 11 44 31 am

No I tried different setting and not working. Maybe my input is not good to find contour?

enzyme69 commented 5 years ago

Still no output and getting red with simple image... wonder why.

Screen Shot 2019-08-11 at 11 50 11 am
enzyme69 commented 5 years ago

My guess that it might be missing module or something additional?

feler404 commented 5 years ago

I reproduce your problem but not for 'uint8' DType image. So try to use TypeConver node and switch type to 'uint8'.

Zrzut ekranu 2019-08-12 o 11 52 36

If still don't work please send me logs.