Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    with black = False and white = True, something like: np.argmin(np.any(mask, axis=1), axis=0) takes the highest row in the array that contains a white pixel (you might need to flip your array or change the axis based on how you defined your array) Commented May 11, 2021 at 7:28
  • That does not need special functions from OpenCV. Just find the first line that is not completely black. Commented May 11, 2021 at 7:29
  • @FrederikBode i didnt really understand what you meant could you please pass it on as a answer i would happly accept it Commented May 11, 2021 at 7:37