RoboCup-SSL / ssl-vision

Shared Vision System For The RoboCup Small Size League
GNU General Public License v3.0
88 stars 109 forks source link

Apply a mask to the thresholded image to ignore the surroundings #158

Closed g3force closed 4 years ago

g3force commented 4 years ago

Some things I noticed so far:

But it is functional and works at 70fps on the high-res camera

g3force commented 4 years ago

I've removed the empty widget and instead put a toggle button into the lut widget toolbar. If pressed, the mask can be drawn. I've also renamed 'mask' to 'image mask'. The fps will still drop, if visualizing the mask (blackout the borders). I think it is ok to leave it as is.

With this, this PR is ready to be reviewed and tested.

joydeep-b commented 4 years ago

@g3force Thanks for this PR. It should help avoid the problem of SSL-Vision trying to get blobs from non-field objects and choking on them. I skimmed through the PR, and it seems good, I added a few questions. I have not run this PR, so I recommend asking someone else to try it out before merging, since it affects core parts of ssl-vision, the LUT, etc.

rttwente commented 4 years ago

Tested this with our Basler cameras, and found no issues

g3force commented 4 years ago

I've put the button and a description below the LUT to make it more intuitive image

g3force commented 4 years ago

There is one weird bug: The description label text is turned white when the LUT widget has focus. If some other part of the UI gets focus, the text is turned black again. And if the Edit Mask button is clicked, the text also turned black again.

g3force commented 4 years ago

I've moved the UI to a separate widget again, as I could not fix the bug mentioned above...

g3force commented 4 years ago

I've also optimized the code for applying the mask by using the mask in the threshold loop already instead of looping over the whole image again.

rhololkeolke commented 4 years ago

I just tested the latest version and it all seems to be working for me. Performance is fine (but I'm using relatively low-res cameras).

Regarding the UI, while it takes up more space, I think having it as the separate widget with instructions is more helpful. And the space becomes less of an issue once #164 is merged.