View Single Post
  #2   Spotlight this post!  
Unread 08-02-2017, 19:33
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 38
MuskieProgramme is an unknown quantity at this point
Re: Detecting countours

Because you only return true if centerX1 is 247 or 227, not anything in between.

You might go about using the values in between something like this:

Code:
return Math.abs( centerX1 - 237 ) < 10;
What this does is

1) finds the difference between 237 and centerX1
2) gets the absolute value of that
3) compares it to 10. Increasing or decreasing 10 will result in a larger or smaller error margin.
Reply With Quote