Hi! I’m currently working on a project right now that is able to detect red markers from the sky.
My color masks are working great.
However, when I tried testing the algorithm by taking pictures of red markers from the sky, I ran across the problem of having against the Light Photos.
My red markers go dark and the pixels don’t become red anymore. See the photo.
you could control your camera’s exposure. the marker will look better when the sky is overexposed.
and yes, we need to see code. there’s no reason that picture shouldn’t work. marker is red and saturated and not too dark to make those values noisy. I tried that just now and it works just fine.
actually, np.where is the code I used to convert the image to binary, 255 for the detected red and 0 for the undetected. I’ve been doing OpenCV and I’m still not an expert.
So based on what you recommend, np.nonzero could probably lessen my runtime error.
if you use np.where(mask_array, consequence_values, alternative_values) (three arguments), and you need the effect it produces, then it’s the best tool for the task.
if you’re just overwriting parts of an array using a mask, you can just do