Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing null check on ColourBlobLocatorProcessor.Builder imageRegion #1076

Open
bubner opened this issue Sep 21, 2024 · 1 comment
Open

Missing null check on ColourBlobLocatorProcessor.Builder imageRegion #1076

bubner opened this issue Sep 21, 2024 · 1 comment

Comments

@bubner
Copy link

bubner commented Sep 21, 2024

Hi, just reporting a small visual-level bug based on the builder of ColorBlobLocatorProcessor.

The region of interest parameter is not checked for being null when .build() is called, so instead of throwing a helpful message like You must set a region of interest! it throws:

java.lang.NullPointerException: Attempt to invoke virtual method 'org.opencv.core.Rect org.firstinspires.ftc.vision.opencv.ImageRegion.asOpenCvRect(int, int)' on a null object reference
   at org.firstinspires.ftc.vision.opencv.ColorBlobLocatorProcessorImpl.init(ColorBlobLocatorProcessorImpl.java:130)

The colour range and contour mode parameters are already checked when the processor is built to supply more helpful exception messages, so it would be helpful to more novice programmers to receive a more helpful exception if they forget to call setRoi().

@Windwoes
Copy link
Member

Thanks for pointing this out, we'll fix it in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants