question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Demo] Wrong set of seedpoint for cv2.floodFill

See original GitHub issue

Hi there,

Thanks for this implementation! I ran into a small problem running the demo: the cv2.floodFill was throwing errors saying the seedpoint had wrong values. Investigating a bit, I wonder if this section below https://github.com/jfzhang95/DeepGrabCut-PyTorch/blob/master/demo.py#L97-L100 should not be commented.

Since left, right, up, down are used to put the seedpoint, if you leave this section uncommented (and that your monitor has more than twice the amount of pixels than the displayed image), opencv throws the mentioned error:

cv2.error: OpenCV(3.4.5) /io/opencv/modules/imgproc/src/floodfill.cpp:509: error: (-211:One of arguments' values is out of range) Seed point is outside of image in function 'floodFill'

Commenting the section fixes the error as the seedpoint changes from coordinates of 1000+ pixels down back to image dimensions: dgc_fix

I’m unsure about how others managed to run the demo without commenting it though.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pkjplayercommented, Jun 11, 2019

Hello, I met the same problem as you, how do you solve it

0reactions
frgfmcommented, Jul 2, 2019

Hi @pkjplayer I tried, and pressing space works perfectly! The suggestion I made earlier gives the same result without pressing the key. Good catch anyway, I’ll close the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can anyone explain why is my floodfill function not working in ...
I set the lodiff and updiff value to 20 and flags = 4 (for 4 connected pixel floodfill ) . For mask parameter...
Read more >
Flood-filling in an image
Flood-filling in an image. An example using the Flood-Fill technique. In this sample you will learn how to use the following OpenCV functions:...
Read more >
samples/cpp/ffilldemo.cpp - OpenCV
samples/cpp/ffilldemo.cpp. An example using the FloodFill technique ... bool useMask = false;. int newMaskVal = 255; ... Point seed = Point(x,y);.
Read more >
samples/cpp/ffilldemo.cpp - OpenCV - ccoderun.ca
samples/cpp/ffilldemo.cpp. An example using the FloodFill technique. #include "opencv2/imgproc.hpp". #include "opencv2/imgcodecs.hpp".
Read more >
Bitmap/Flood fill - Rosetta Code
Implement a flood fill. A flood fill is a way of filling an area using color banks to define the contained area or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found