{"action":"created","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/13297","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/13297/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/13297/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/13297/events","html_url":"https://github.com/opencv/opencv/issues/13297","id":384752995,"node_id":"MDU6SXNzdWUzODQ3NTI5OTU=","number":13297,"title":"Error grabcut.cpp: Line 178","user":{"login":"bene0815","id":42209404,"node_id":"MDQ6VXNlcjQyMjA5NDA0","avatar_url":"https://avatars3.githubusercontent.com/u/42209404?v=4","gravatar_id":"","url":"https://api.github.com/users/bene0815","html_url":"https://github.com/bene0815","followers_url":"https://api.github.com/users/bene0815/followers","following_url":"https://api.github.com/users/bene0815/following{/other_user}","gists_url":"https://api.github.com/users/bene0815/gists{/gist_id}","starred_url":"https://api.github.com/users/bene0815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bene0815/subscriptions","organizations_url":"https://api.github.com/users/bene0815/orgs","repos_url":"https://api.github.com/users/bene0815/repos","events_url":"https://api.github.com/users/bene0815/events{/privacy}","received_events_url":"https://api.github.com/users/bene0815/received_events","type":"User","site_admin":false},"labels":[{"id":9731370,"node_id":"MDU6TGFiZWw5NzMxMzcw","url":"https://api.github.com/repos/opencv/opencv/labels/bug","name":"bug","color":"fc2929","default":true},{"id":241023894,"node_id":"MDU6TGFiZWwyNDEwMjM4OTQ=","url":"https://api.github.com/repos/opencv/opencv/labels/category:%20imgproc","name":"category: imgproc","color":"ededed","default":false},{"id":1007433937,"node_id":"MDU6TGFiZWwxMDA3NDMzOTM3","url":"https://api.github.com/repos/opencv/opencv/labels/confirmed","name":"confirmed","color":"ffff80","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/opencv/opencv/milestones/21","html_url":"https://github.com/opencv/opencv/milestone/21","labels_url":"https://api.github.com/repos/opencv/opencv/milestones/21/labels","id":3827377,"node_id":"MDk6TWlsZXN0b25lMzgyNzM3Nw==","number":21,"title":"3.4.5","description":"","creator":{"login":"alalek","id":4981219,"node_id":"MDQ6VXNlcjQ5ODEyMTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4981219?v=4","gravatar_id":"","url":"https://api.github.com/users/alalek","html_url":"https://github.com/alalek","followers_url":"https://api.github.com/users/alalek/followers","following_url":"https://api.github.com/users/alalek/following{/other_user}","gists_url":"https://api.github.com/users/alalek/gists{/gist_id}","starred_url":"https://api.github.com/users/alalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalek/subscriptions","organizations_url":"https://api.github.com/users/alalek/orgs","repos_url":"https://api.github.com/users/alalek/repos","events_url":"https://api.github.com/users/alalek/events{/privacy}","received_events_url":"https://api.github.com/users/alalek/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":28,"state":"open","created_at":"2018-11-16T18:05:56Z","updated_at":"2018-11-28T20:20:24Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-11-27T11:36:40Z","updated_at":"2018-11-28T20:21:42Z","closed_at":null,"author_association":"NONE","body":"Hi, I have a problem with a grabcut error. I have test it in 3.4.3/4 and 4.0. \r\nSometimes the function throw an Error. I don't see the trigger.\r\n\r\nI have add 2 images with the mask to reproduce\r\n[images.tar.gz](https://github.com/opencv/opencv/files/2619607/images.tar.gz)\r\n\r\n###### supplement\r\nI have forgot the most important thing. Is its only if the the mask don't have the cv.GC_BGD \"layer\"\r\nI have test it again with 3.4.1 and 3.4.2, it works correct\r\n\r\n\r\n##### Code\r\n\r\n```\r\nbgdModel = np.zeros((1,65),np.float64)\r\nfgdModel = np.zeros((1,65),np.float64)\r\ncv2.imwrite(\"/TEST/mask.png\", mask)\r\ncv2.imwrite(\"/TEST/org_img.png\", org_img)\r\nmask, bgdModel, fgdModel = cv2.grabCut(org_img,mask,None,bgdModel,fgdModel,3,cv2.GC_INIT_WITH_MASK) # 6\r\n```\r\n\r\n##### ERROR\r\n```\r\nmask, bgdModel, fgdModel = cv2.grabCut(org_img,mask,None,bgdModel,fgdModel,3,cv2.GC_INIT_WITH_MASK) # 6\r\ncv2.error: OpenCV(4.0.0) /opencv-4.0.0/modules/imgproc/src/grabcut.cpp:178: error: (-215:Assertion failed) totCount > 0 in function \\'endLearning\\'\r\n```\r\n\r\n\r\n\r\n##### System information (version)\r\n\r\n- OpenCV => 3.4.3, 3.4.4, 4.0.0\r\n- Operating System / Platform => Docker (FROM python:3.6)\r\n- Compiler => make build with python3\r\n```\r\nFROM python:3.6\r\n\r\nENV OPENCV=4.0.0\r\nENV CPU_BASELINE=AVX2\r\nENV PCOUNT=40\r\n\r\nRUN pip install --upgrade pip numpy requests Pillow logaugment\r\nRUN buildDeps=' \\\r\n\t\tbuild-essential \\\r\n\t\tcmake \\\r\n        wget \\\r\n        unzip \\\r\n        yasm \\\r\n        git \\\r\n\t' \\\r\n    && apt-get update \\\r\n    && apt-get upgrade -y \\\r\n    && apt-get install -y \\\r\n            $buildDeps \\\r\n            g++ \\\r\n            pkg-config \\\r\n            libswscale-dev \\\r\n            libtbb2 \\\r\n            libtbb-dev \\\r\n            libjpeg-dev \\\r\n            libpng-dev \\\r\n            libtiff-dev \\\r\n            libavformat-dev \\\r\n            libpq-dev \\\r\n            libcairo2-dev \\\r\n            libpango1.0-dev \\\r\n            libgif-dev \\\r\n    && wget https://github.com/opencv/opencv/archive/$OPENCV.zip \\\r\n    && unzip ${OPENCV}.zip\r\n    RUN mkdir /opencv-${OPENCV}/cmake_binary \\\r\n    && cd /opencv-${OPENCV}/cmake_binary \\\r\n    && cmake -DBUILD_TIFF=ON \\\r\n      -DBUILD_opencv_java=OFF \\\r\n      -DCPU_BASELINE=${CPU_BASELINE} \\\r\n      -DBUILD_TESTS=OFF \\\r\n      -DBUILD_PERF_TESTS=OFF \\\r\n      -DCMAKE_BUILD_TYPE=RELEASE \\\r\n      -DCMAKE_INSTALL_PREFIX=$(python3.6 -c \"import sys; print(sys.prefix)\") \\\r\n      -DPYTHON_EXECUTABLE=$(which python3.6) \\\r\n      -DPYTHON_INCLUDE_DIR=$(python3.6 -c \"from distutils.sysconfig import get_python_inc; print(get_python_inc())\") \\\r\n      -DPYTHON_PACKAGES_PATH=$(python3.6 -c \"from distutils.sysconfig import get_python_lib; print(get_python_lib())\") .. \\\r\n    && make -j$PCOUNT \\\r\n    && make install \\\r\n    && rm /${OPENCV}.zip \\\r\n    && rm -r /opencv-${OPENCV} \\\r\n    && cd $(python3.6 -c \"import sys; print(sys.prefix)\")/python \\\r\n    && pip install -e .\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/opencv/opencv/issues/comments/442591188","html_url":"https://github.com/opencv/opencv/issues/13297#issuecomment-442591188","issue_url":"https://api.github.com/repos/opencv/opencv/issues/13297","id":442591188,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjU5MTE4OA==","user":{"login":"alalek","id":4981219,"node_id":"MDQ6VXNlcjQ5ODEyMTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4981219?v=4","gravatar_id":"","url":"https://api.github.com/users/alalek","html_url":"https://github.com/alalek","followers_url":"https://api.github.com/users/alalek/followers","following_url":"https://api.github.com/users/alalek/following{/other_user}","gists_url":"https://api.github.com/users/alalek/gists{/gist_id}","starred_url":"https://api.github.com/users/alalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalek/subscriptions","organizations_url":"https://api.github.com/users/alalek/orgs","repos_url":"https://api.github.com/users/alalek/repos","events_url":"https://api.github.com/users/alalek/events{/privacy}","received_events_url":"https://api.github.com/users/alalek/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T20:21:42Z","updated_at":"2018-11-28T20:21:42Z","author_association":"CONTRIBUTOR","body":"@bene0815 Could you try #13323 on your other data?"}}
{"actor":{"display_login":"alalek"}}