RotatedRect default constructor Java API (Bug #1297)
Description
the RotatedRect default constructor in the Java API needs to initialize a Point and Size object. Otherise, any other function that uses the set method, like camshift for example, will not work.
this is all you have to do to fix it.
public RotatedRect() {
this.angle=0;
center = new Point();
size = new Size();
}
additionally, the set function needs to be fixed to this:
public void set(double[] vals) {
if(vals!=null) {
center.x = vals.length>0 ? (int)valsr0 : 0;
center.y = vals.length>1 ? (int)valsr1 : 0;
size.width = vals.length>2 ? (int)valsr2 : 0;
size.height = vals.length>3 ? (int)valsr3 : 0;
angle = vals.length>4 ? (int)valsr4 : 0;
} else {
center.x = 0;
center.y = 0;
size.width = 0;
size.height = 0;
angle = 0;
}
}
if you look at the source, center.y was not being called. instead it was two center.x probably just a copy paste thing.
i don't know how to change it myself, since i'm kindof new.
Associated revisions
Merge pull request #1297 from SpecLad:merge-2.4
History
Updated by Andrey Kamaev over 13 years ago
Thanks for reporting.
RotatedRect is already fixed in r6155 r6306
- Status changed from Open to Done
- (deleted custom field) set to obsolete
Updated by aaron albin over 13 years ago
Oh ok cool. I was using the prebuilt package that was recommended to download and set up. Will there be a new prebuilt one coming out?
Updated by Andrey Kamaev over 13 years ago
Yes, and it is about to coming out.
Updated by Kirill Kornyakov almost 13 years ago
- Target version set to 2.3