All the functions you're asking about are in the WPIJavaCV project, which should be in the SmartDashboard repository (I see you found it in another thread). getAnd() applies a logical AND to each pixel in 2 binary images:
Code:
on AND on = on
on AND off = off
off AND on = off
off AND off = off
getOr() does the same thing but with an OR operation:
Code:
on OR on = on
on OR off = on
off OR on = on
off OR off = off
So to do a threshold of red between [100,150] and green outside [75,100], you'd do:
Code:
WPIBinaryImage red = image.getRedChannel(),
green = image.getGreenChannel();
WPIBinaryImage redThresh = red.getThreshold(100).getAnd(red.getThresholdInverted(150)),
greenThres = green.getThresholdInverted(75).getOr(green.getThreshold(100));
WPIBinaryImage threshold = red.getAnd(green);