Skip to content

Commit d4c7c05

Browse files
committed
Fixing bug in average region flow, previously was dividing the total flow by the area of the entire cv object rather than the area of the region. Now uses the width and height passed into the function.
1 parent 0fa983e commit d4c7c05

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gab/opencv/Flow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public PVector getTotalFlowInRegion(int x, int y, int w, int h) {
5959

6060
public PVector getAverageFlowInRegion(int x, int y, int w, int h) {
6161
PVector total = getTotalFlowInRegion(x, y, w, h);
62-
return new PVector(total.x/(flow.width() * flow.height()), total.y/(flow.width()*flow.height()));
62+
return new PVector(total.x/(w*h), total.y/(w*h));
6363
}
6464

6565
public PVector getTotalFlow() {

0 commit comments

Comments
 (0)