Ocean
Loading...
Searching...
No Matches
StereoQrCorrespondence.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
11
12#include <cstdint>
13#include <vector>
14
15namespace Ocean
16{
17namespace CV
18{
19namespace Detector
20{
21namespace QRCodes
22{
23
24/** Selects stereo observations without sharing a finder pattern in either image. */
25class OCEAN_CV_DETECTOR_QRCODES_EXPORT StereoQrCorrespondence
26{
27 public:
28
29 struct Candidate
30 {
31 uint16_t findersA = 0;
32 uint16_t findersB = 0;
33 double cost = 0.0;
34 };
35
36 /**
37 * Maximizes the number of disjoint candidates, then minimizes their total cost.
38 * @param candidates Candidates with three finder bits per image and finite nonnegative costs
39 * @param selected Indices of selected candidates in ascending order, empty on failure
40 * @param maxSearchNodes Maximum search nodes; an exhausted search reports failure, not a partial assignment
41 * @param maxCandidateVisits Maximum candidate validation, bound and filtering visits
42 * @return True when the optimal assignment was established within both search budgets; false on invalid input, aggregate-cost overflow or budget exhaustion
43 */
44 static bool select(const std::vector<Candidate>& candidates, std::vector<size_t>& selected, const size_t maxSearchNodes = 16384, const size_t maxCandidateVisits = 262144);
45};
46
47} // namespace QRCodes
48} // namespace Detector
49} // namespace CV
50} // namespace Ocean
Selects stereo observations without sharing a finder pattern in either image.
Definition StereoQrCorrespondence.h:26
static bool select(const std::vector< Candidate > &candidates, std::vector< size_t > &selected, const size_t maxSearchNodes=16384, const size_t maxCandidateVisits=262144)
Maximizes the number of disjoint candidates, then minimizes their total cost.
Definition AlignmentPatternDetector.h:30
Namespace of the CV Detector library.
Definition Barcode.h:19
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15
double cost
Definition StereoQrCorrespondence.h:33
uint16_t findersA
Definition StereoQrCorrespondence.h:31
uint16_t findersB
Definition StereoQrCorrespondence.h:32