Closed g3force closed 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.
@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.
Tested this with our Basler cameras, and found no issues
I've put the button and a description below the LUT to make it more intuitive
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.
I've moved the UI to a separate widget again, as I could not fix the bug mentioned above...
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.
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.
Some things I noticed so far:
But it is functional and works at 70fps on the high-res camera