001// 002// This file is auto-generated. Please don't modify it! 003// 004package org.opencv.dnn; 005 006import org.opencv.dnn.Net; 007import org.opencv.dnn.TextDetectionModel; 008import org.opencv.dnn.TextDetectionModel_DB; 009 010// C++: class TextDetectionModel_DB 011/** 012 * This class represents high-level API for text detection DL networks compatible with DB model. 013 * 014 * Related publications: CITE: liao2020real 015 * Paper: https://arxiv.org/abs/1911.08947 016 * For more information about the hyper-parameters setting, please refer to https://github.com/MhLiao/DB 017 * 018 * Configurable parameters: 019 * - (float) binaryThreshold - The threshold of the binary map. It is usually set to 0.3. 020 * - (float) polygonThreshold - The threshold of text polygons. It is usually set to 0.5, 0.6, and 0.7. Default is 0.5f 021 * - (double) unclipRatio - The unclip ratio of the detected text region, which determines the output size. It is usually set to 2.0. 022 * - (int) maxCandidates - The max number of the output results. 023 */ 024public class TextDetectionModel_DB extends TextDetectionModel { 025 026 protected TextDetectionModel_DB(long addr) { super(addr); } 027 028 // internal usage only 029 public static TextDetectionModel_DB __fromPtr__(long addr) { return new TextDetectionModel_DB(addr); } 030 031 // 032 // C++: cv::dnn::TextDetectionModel_DB::TextDetectionModel_DB(Net network) 033 // 034 035 /** 036 * Create text detection algorithm from deep learning network. 037 * @param network Net object. 038 */ 039 public TextDetectionModel_DB(Net network) { 040 super(TextDetectionModel_DB_0(network.nativeObj)); 041 } 042 043 044 // 045 // C++: cv::dnn::TextDetectionModel_DB::TextDetectionModel_DB(string model, string config = "") 046 // 047 048 /** 049 * Create text detection model from network represented in one of the supported formats. 050 * An order of {@code model} and {@code config} arguments does not matter. 051 * @param model Binary file contains trained weights. 052 * @param config Text file contains network configuration. 053 */ 054 public TextDetectionModel_DB(String model, String config) { 055 super(TextDetectionModel_DB_1(model, config)); 056 } 057 058 /** 059 * Create text detection model from network represented in one of the supported formats. 060 * An order of {@code model} and {@code config} arguments does not matter. 061 * @param model Binary file contains trained weights. 062 */ 063 public TextDetectionModel_DB(String model) { 064 super(TextDetectionModel_DB_2(model)); 065 } 066 067 068 // 069 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setBinaryThreshold(float binaryThreshold) 070 // 071 072 public TextDetectionModel_DB setBinaryThreshold(float binaryThreshold) { 073 return new TextDetectionModel_DB(setBinaryThreshold_0(nativeObj, binaryThreshold)); 074 } 075 076 077 // 078 // C++: float cv::dnn::TextDetectionModel_DB::getBinaryThreshold() 079 // 080 081 public float getBinaryThreshold() { 082 return getBinaryThreshold_0(nativeObj); 083 } 084 085 086 // 087 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setPolygonThreshold(float polygonThreshold) 088 // 089 090 public TextDetectionModel_DB setPolygonThreshold(float polygonThreshold) { 091 return new TextDetectionModel_DB(setPolygonThreshold_0(nativeObj, polygonThreshold)); 092 } 093 094 095 // 096 // C++: float cv::dnn::TextDetectionModel_DB::getPolygonThreshold() 097 // 098 099 public float getPolygonThreshold() { 100 return getPolygonThreshold_0(nativeObj); 101 } 102 103 104 // 105 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setUnclipRatio(double unclipRatio) 106 // 107 108 public TextDetectionModel_DB setUnclipRatio(double unclipRatio) { 109 return new TextDetectionModel_DB(setUnclipRatio_0(nativeObj, unclipRatio)); 110 } 111 112 113 // 114 // C++: double cv::dnn::TextDetectionModel_DB::getUnclipRatio() 115 // 116 117 public double getUnclipRatio() { 118 return getUnclipRatio_0(nativeObj); 119 } 120 121 122 // 123 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setMaxCandidates(int maxCandidates) 124 // 125 126 public TextDetectionModel_DB setMaxCandidates(int maxCandidates) { 127 return new TextDetectionModel_DB(setMaxCandidates_0(nativeObj, maxCandidates)); 128 } 129 130 131 // 132 // C++: int cv::dnn::TextDetectionModel_DB::getMaxCandidates() 133 // 134 135 public int getMaxCandidates() { 136 return getMaxCandidates_0(nativeObj); 137 } 138 139 140 @Override 141 protected void finalize() throws Throwable { 142 delete(nativeObj); 143 } 144 145 146 147 // C++: cv::dnn::TextDetectionModel_DB::TextDetectionModel_DB(Net network) 148 private static native long TextDetectionModel_DB_0(long network_nativeObj); 149 150 // C++: cv::dnn::TextDetectionModel_DB::TextDetectionModel_DB(string model, string config = "") 151 private static native long TextDetectionModel_DB_1(String model, String config); 152 private static native long TextDetectionModel_DB_2(String model); 153 154 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setBinaryThreshold(float binaryThreshold) 155 private static native long setBinaryThreshold_0(long nativeObj, float binaryThreshold); 156 157 // C++: float cv::dnn::TextDetectionModel_DB::getBinaryThreshold() 158 private static native float getBinaryThreshold_0(long nativeObj); 159 160 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setPolygonThreshold(float polygonThreshold) 161 private static native long setPolygonThreshold_0(long nativeObj, float polygonThreshold); 162 163 // C++: float cv::dnn::TextDetectionModel_DB::getPolygonThreshold() 164 private static native float getPolygonThreshold_0(long nativeObj); 165 166 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setUnclipRatio(double unclipRatio) 167 private static native long setUnclipRatio_0(long nativeObj, double unclipRatio); 168 169 // C++: double cv::dnn::TextDetectionModel_DB::getUnclipRatio() 170 private static native double getUnclipRatio_0(long nativeObj); 171 172 // C++: TextDetectionModel_DB cv::dnn::TextDetectionModel_DB::setMaxCandidates(int maxCandidates) 173 private static native long setMaxCandidates_0(long nativeObj, int maxCandidates); 174 175 // C++: int cv::dnn::TextDetectionModel_DB::getMaxCandidates() 176 private static native int getMaxCandidates_0(long nativeObj); 177 178 // native support for java finalize() 179 private static native void delete(long nativeObj); 180 181}