View Single Post
  #1   Spotlight this post!  
Unread 22-06-2016, 17:20
Ouroboroz Ouroboroz is offline
Registered User
AKA: Kevin
FRC #2554 (The Warhawks)
Team Role: Programmer
 
Join Date: Apr 2016
Rookie Year: 2014
Location: Edison NJ
Posts: 8
Ouroboroz is an unknown quantity at this point
Method From ColorImage

So the code for the threshold method is:

private BinaryImage threshold(NIVision.ColorMode colorMode, int low1, int high1, int low2,
int high2, int low3, int high3) throws NIVisionException {
BinaryImage res = new BinaryImage();
NIVision.Range range1 = new NIVision.Range(low1, high1);
NIVision.Range range2 = new NIVision.Range(low2, high2);
NIVision.Range range3 = new NIVision.Range(low3, high3);
NIVision.imaqColorThreshold(res.image, image, 1, colorMode, range1, range2, range3);
res.free();
range1.free();
range2.free();
range3.free();
return res;
}
I'm confused on the part where res is freed and the returned afterwards. If I read correctly, free() releases the memory for the image. So would return still give back the image.

PS How do I initialize a Binary Image? The constructor is not public. D:
Reply With Quote