![]() |
Method From ColorImage
So the code for the threshold method is:
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: |
Re: Method From ColorImage
1. Yeah, that doesn't make a lot of sense. Maybe free() doesn't always do what we think it does? (not likely)
2. Reflection! Code:
Constructor<BinaryImage> ct = BinaryImage.class.getDeclaredConstructor(); |
Re: Method From ColorImage
1. It's a bug, introduced in https://github.com/wpilibsuite/allwp...70d994ed36ff86 ... originally the res.free() was only called if an exception was raised.
2. By calling ColorImage.threshold(), clearly :) Please feel free to create issues on github for these. |
Re: Method From ColorImage
Quote:
|
Re: Method From ColorImage
Quote:
Code:
class A {} |
Re: Method From ColorImage
Quote:
As for an actual answer, you're not supposed to initialize a BinaryImage. You get them from methods like this one. |
Re: Method From ColorImage
Quote:
Quote:
Quote:
|
Re: Method From ColorImage
Quote:
Quote:
|
Re: Method From ColorImage
Okay so from reading what above ^. I'm assuming the best way to create work with ColorImage.threshold() and initializing a BinaryImage is to compile WPI?
|
Re: Method From ColorImage
Quote:
|
| All times are GMT -5. The time now is 09:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi