Ask Your Question

Cornelius's profile - activity

2020-07-24 03:58:25 -0600 marked best answer Find first non-black pixel

I have a very simple input image: it's fully black and has a tiny bright red dot somewehere in it. The colors are "pure", meaning the blacks are (0,0,0), the red dot is at full 255 red intensity.

Now I would like to find the coordinate of the red dot. I thought this would be rather simple, since all I need is the position of the first non-black pixel in my image. That would be good enough for my application.

But I have searched quite a while and could not find a simple and fast solution to do this with OpenCV.

PS: I know that OpenCV has a blob detection, but that seems waaay to powerful (and expensive) for this simple task.

2020-07-24 03:58:25 -0600 received badge  Scholar (source)
2020-07-24 03:58:22 -0600 commented answer Find first non-black pixel

Thank you for the clarification. That is indees rather inintuitive ;-)

2020-07-24 03:47:22 -0600 commented answer Find first non-black pixel

That sounds like a good solution. I'm having some trouble using this function though. This is my code: coords = cv.find

2020-07-24 03:47:00 -0600 commented answer Find first non-black pixel

That sounds like a good solution. I'm having some trouble using this function though. This is my code: coords = cv.find

2020-07-24 03:46:41 -0600 commented answer Find first non-black pixel

That sounds like a good solution. I'm having some trouble using this function though: *coords = cv.findNonZero(red_chan

2020-07-24 03:46:16 -0600 commented answer Find first non-black pixel

That sounds like a good solution. I'm having some trouble using this function though: coords = cv.findNonZero(red_chann

2020-07-24 03:10:38 -0600 asked a question Find first non-black pixel

Find first non-black pixel I have a very simple input image: it's fully black and has a tiny bright red dot somewehere i