001/*
002 * Copyright (C) Photon Vision.
003 *
004 * This program is free software: you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License as published by
006 * the Free Software Foundation, either version 3 of the License, or
007 * (at your option) any later version.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
016 */
017
018package org.photonvision.vision.pipeline;
019
020import org.opencv.objdetect.Objdetect;
021
022public class UICalibrationData {
023    public int videoModeIndex;
024    public int count;
025    public int minCount;
026    public boolean hasEnough;
027    public double squareSizeIn;
028    public int patternWidth;
029    public int patternHeight;
030    public BoardType boardType;
031    public double markerSizeIn;
032    public boolean useOldPattern;
033    public TagFamily tagFamily;
034
035    public UICalibrationData() {}
036
037    public UICalibrationData(
038            int count,
039            int videoModeIndex,
040            int minCount,
041            boolean hasEnough,
042            double squareSizeIn,
043            double markerSizeIn,
044            int patternWidth,
045            int patternHeight,
046            BoardType boardType,
047            boolean useOldPattern,
048            TagFamily tagFamily) {
049        this.count = count;
050        this.minCount = minCount;
051        this.videoModeIndex = videoModeIndex;
052        this.hasEnough = hasEnough;
053        this.squareSizeIn = squareSizeIn;
054        this.markerSizeIn = markerSizeIn;
055        this.patternWidth = patternWidth;
056        this.patternHeight = patternHeight;
057        this.boardType = boardType;
058        this.useOldPattern = useOldPattern;
059        this.tagFamily = tagFamily;
060    }
061
062    public enum BoardType {
063        CHESSBOARD,
064        CHARUCOBOARD,
065    }
066
067    public enum TagFamily {
068        Dict_4X4_1000(Objdetect.DICT_4X4_1000),
069        Dict_5X5_1000(Objdetect.DICT_5X5_1000),
070        Dict_6X6_1000(Objdetect.DICT_6X6_1000),
071        Dict_7X7_1000(Objdetect.DICT_7X7_1000);
072
073        private int value;
074
075        // getter method
076        public int getValue() {
077            return this.value;
078        }
079
080        // enum constructor - cannot be public or protected
081        private TagFamily(int value) {
082            this.value = value;
083        }
084    }
085
086    @Override
087    public String toString() {
088        return "UICalibrationData{"
089                + "videoModeIndex="
090                + videoModeIndex
091                + ", count="
092                + count
093                + ", minCount="
094                + minCount
095                + ", hasEnough="
096                + hasEnough
097                + ", squareSizeIn="
098                + squareSizeIn
099                + ", markerSizeIn="
100                + markerSizeIn
101                + ", patternWidth="
102                + patternWidth
103                + ", patternHeight="
104                + patternHeight
105                + ", boardType="
106                + boardType
107                + ", tagFamily="
108                + tagFamily
109                + ", useOldPattern="
110                + useOldPattern
111                + '}';
112    }
113}