Skip to content

Commit c80b5f5

Browse files
committed
opencv-mark: remove duplicate OpticalFlowPyrLK benchmark registration
registered two vision benchmarks named "OpticalFlowPyrLK": - the intended parity case using DEFAULT_OPTFLOW_POINTS (1000) points, - a leftover case using a hard-coded 100 points. Both were emitted under the same name, so the Vision Score geometric mean double-counted this kernel and downstream CSV/JSON consumers saw two rows per resolution where every other kernel had one. Remove the 100-point variant to restore a single OpticalFlowPyrLK measurement per resolution and eliminate the weight bias in aggregate scores. Fixes #22.
1 parent 029077a commit c80b5f5

2 files changed

Lines changed: 14 additions & 48 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66

77
## [Unreleased]
88

9+
### Fixed — opencv-mark duplicate `OpticalFlowPyrLK` benchmark name
10+
11+
`opencv-mark/src/benchmarks/cv_feature.cpp` registered two vision
12+
benchmarks with `bc.name = "OpticalFlowPyrLK"`: one using
13+
`DEFAULT_OPTFLOW_POINTS` (1000) and one using a hard-coded 100 points.
14+
Both were emitted under the same name, which caused the Vision Score
15+
geometric mean to double-count this kernel and produced two CSV/JSON
16+
rows per resolution where every other kernel produced one.
17+
18+
Removed the 100-point variant so that only the `DEFAULT_OPTFLOW_POINTS`
19+
configuration participates in `--vision-parity`. This restores a
20+
single `OpticalFlowPyrLK` row per resolution and removes the weight
21+
bias from aggregate scores.
22+
923
### Fixed — Khronos sample compatibility (verify_fns + CI split-and-merge)
1024

1125
Three Khronos OpenVX-sample-impl issues surfaced once rustVX was

opencv-mark/src/benchmarks/cv_feature.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -228,54 +228,6 @@ std::vector<OpenCVBenchmarkCase> registerCvFeatureBenchmarks() {
228228
cases.push_back(bc);
229229
}
230230

231-
// OpticalFlowPyrLK — U8 image pair with 100 tracked points.
232-
{
233-
OpenCVBenchmarkCase bc;
234-
bc.name = "OpticalFlowPyrLK";
235-
bc.category = "feature";
236-
bc.feature_set = "vision";
237-
bc.setup_fn = [](uint32_t w, uint32_t h, OpenCVTestData& gen, CaseBuffers& bufs) -> bool {
238-
bufs.input = gen.makeU8(w, h);
239-
bufs.input_extra = gen.makeU8(w, h);
240-
bufs.points_prev.clear();
241-
bufs.points_prev.reserve(100);
242-
for (int i = 0; i < 100; ++i) {
243-
bufs.points_prev.emplace_back(static_cast<float>((i % 10) * (w / 10)),
244-
static_cast<float>((i / 10) * (h / 10)));
245-
}
246-
bufs.points_next.resize(bufs.points_prev.size());
247-
bufs.status.resize(bufs.points_prev.size());
248-
bufs.error.resize(bufs.points_prev.size());
249-
return true;
250-
};
251-
bc.run_fn = [](CaseBuffers& bufs) {
252-
cv::calcOpticalFlowPyrLK(
253-
bufs.input, bufs.input_extra, bufs.points_prev, bufs.points_next,
254-
bufs.status, bufs.error,
255-
cv::Size(DEFAULT_OPTFLOW_WINSIZE, DEFAULT_OPTFLOW_WINSIZE),
256-
DEFAULT_PYRAMID_LEVELS - 1,
257-
cv::TermCriteria(cv::TermCriteria::COUNT | cv::TermCriteria::EPS, 5, 0.01));
258-
};
259-
bc.verify_fn = []() -> bool {
260-
cv::Mat img1(64, 64, CV_8UC1, cv::Scalar(100));
261-
cv::Mat img2(64, 64, CV_8UC1, cv::Scalar(100));
262-
std::vector<cv::Point2f> prev;
263-
for (int i = 0; i < 4; ++i) {
264-
prev.emplace_back(static_cast<float>(16 + (i % 2) * 32),
265-
static_cast<float>(16 + (i / 2) * 32));
266-
}
267-
std::vector<cv::Point2f> next;
268-
std::vector<unsigned char> status;
269-
std::vector<float> error;
270-
cv::calcOpticalFlowPyrLK(
271-
img1, img2, prev, next, status, error,
272-
cv::Size(5, 5), 1,
273-
cv::TermCriteria(cv::TermCriteria::COUNT | cv::TermCriteria::EPS, 5, 0.01));
274-
return status.size() == prev.size();
275-
};
276-
cases.push_back(bc);
277-
}
278-
279231
return cases;
280232
}
281233

0 commit comments

Comments
 (0)