mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Try skip Java test if charset is not supported
This commit is contained in:
parent
901d5b6682
commit
d4f94bfb1b
@ -11,4 +11,4 @@
|
|||||||
|
|
||||||
void Copy_vector_NativeByteArray_to_List(JNIEnv* env, std::vector<std::string>& vs, jobject list);
|
void Copy_vector_NativeByteArray_to_List(JNIEnv* env, std::vector<std::string>& vs, jobject list);
|
||||||
|
|
||||||
#endif /* DNN_CONVERTERS_HPP */
|
#endif /* OBJDETECT_CONVERTERS_HPP */
|
||||||
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
public class QRCodeDetectorTest extends OpenCVTestCase {
|
public class QRCodeDetectorTest extends OpenCVTestCase {
|
||||||
|
|
||||||
@ -57,6 +58,9 @@ public class QRCodeDetectorTest extends OpenCVTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKanji() throws UnsupportedEncodingException {
|
public void testKanji() throws UnsupportedEncodingException {
|
||||||
|
if (!Charset.isSupported("Shift_JIS"))
|
||||||
|
throw new TestSkipException();
|
||||||
|
|
||||||
String inp = new String("\u3053\u3093\u306B\u3061\u306F\u4E16\u754C");
|
String inp = new String("\u3053\u3093\u306B\u3061\u306F\u4E16\u754C");
|
||||||
|
|
||||||
QRCodeEncoder_Params params = new QRCodeEncoder_Params();
|
QRCodeEncoder_Params params = new QRCodeEncoder_Params();
|
||||||
|
@ -4124,22 +4124,22 @@ bool ImplContour::decodeMulti(
|
|||||||
straight_qrcode.assign(tmp_straight_qrcodes);
|
straight_qrcode.assign(tmp_straight_qrcodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
decoded_info.clear();
|
decoded_info.resize(info.size());
|
||||||
encodings.clear();
|
encodings.resize(info.size());
|
||||||
for (size_t i = 0; i < info.size(); i++)
|
for (size_t i = 0; i < info.size(); i++)
|
||||||
{
|
{
|
||||||
auto& decoder = qrdec[i];
|
auto& decoder = qrdec[i];
|
||||||
encodings.push_back(decoder.eci);
|
encodings[i] = decoder.eci;
|
||||||
if (!decoder.isStructured())
|
if (!decoder.isStructured())
|
||||||
{
|
{
|
||||||
decoded_info.push_back(info[i]);
|
decoded_info[i] = info[i];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store final message corresponding to 0-th code in a sequence.
|
// Store final message corresponding to 0-th code in a sequence.
|
||||||
if (decoder.structure_info.sequence_num != 0)
|
if (decoder.structure_info.sequence_num != 0)
|
||||||
{
|
{
|
||||||
decoded_info.push_back("");
|
decoded_info[i] = "";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4160,7 +4160,7 @@ bool ImplContour::decodeMulti(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decoded_info.push_back(decoded);
|
decoded_info[i] = decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
alignmentMarkers.resize(src_points.size());
|
alignmentMarkers.resize(src_points.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user