ocr fix
This commit is contained in:
Generated
+3
@@ -1,5 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GitSharedSettings">
|
||||||
|
<option name="synchronizeBranchProtectionRules" value="false" />
|
||||||
|
</component>
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ public class Commands
|
|||||||
|
|
||||||
public static byte TFT_PAGE_DOWN = (byte) 0xA8;
|
public static byte TFT_PAGE_DOWN = (byte) 0xA8;
|
||||||
|
|
||||||
public static byte ORC_TEXT_SUCCESS = (byte) 0xA9;
|
public static byte OCR_TEXT_SUCCESS = (byte) 0xA9;
|
||||||
public static byte ORC_TEXT_FAILED = (byte) 0xB9;
|
public static byte OCR_TEXT_FAILED = (byte) 0xB9;
|
||||||
public static byte ORC_TEXT_LENGTH = (byte) 0xC9;
|
public static byte OCR_TEXT_LENGTH = (byte) 0xC9;
|
||||||
public static byte ORC_TEXT_DATA = (byte) 0xD9;
|
public static byte OCR_TEXT_DATA = (byte) 0xD9;
|
||||||
public static byte ORC_TEXT_FINISH = (byte) 0xE9;
|
public static byte OCR_TEXT_FINISH = (byte) 0xE9;
|
||||||
|
|
||||||
public static final byte RECEIVE_FULL_AUTO = (byte) 0xA0;
|
public static final byte RECEIVE_FULL_AUTO = (byte) 0xA0;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.bkrcl.control_car_video.camerautil.CameraCommandUtil;
|
import com.bkrcl.control_car_video.camerautil.CameraCommandUtil;
|
||||||
import com.bkrcl.control_car_video.camerautil.SearchCameraUtil;
|
import com.bkrcl.control_car_video.camerautil.SearchCameraUtil;
|
||||||
import com.uns.maincar.R;
|
import com.uns.maincar.R;
|
||||||
import com.uns.maincar.communication.Client;
|
|
||||||
import com.uns.maincar.communication.CommandDecoder;
|
import com.uns.maincar.communication.CommandDecoder;
|
||||||
import com.uns.maincar.communication.CommandEncoder;
|
import com.uns.maincar.communication.CommandEncoder;
|
||||||
import com.uns.maincar.communication.DataTransferCore;
|
import com.uns.maincar.communication.DataTransferCore;
|
||||||
@@ -42,12 +41,12 @@ import com.uns.maincar.constants.GlobalSignType;
|
|||||||
import com.uns.maincar.cpp_interface.CarLicense;
|
import com.uns.maincar.cpp_interface.CarLicense;
|
||||||
import com.uns.maincar.cpp_interface.EnvTest;
|
import com.uns.maincar.cpp_interface.EnvTest;
|
||||||
import com.uns.maincar.cpp_interface.MainCarAES;
|
import com.uns.maincar.cpp_interface.MainCarAES;
|
||||||
|
import com.uns.maincar.cpp_interface.OCR;
|
||||||
import com.uns.maincar.cpp_interface.QRDecoder;
|
import com.uns.maincar.cpp_interface.QRDecoder;
|
||||||
import com.uns.maincar.cpp_interface.ShapeColor;
|
import com.uns.maincar.cpp_interface.ShapeColor;
|
||||||
import com.uns.maincar.cpp_interface.TrafficLight;
|
import com.uns.maincar.cpp_interface.TrafficLight;
|
||||||
import com.uns.maincar.cpp_interface.TrafficSign;
|
import com.uns.maincar.cpp_interface.TrafficSign;
|
||||||
import com.uns.maincar.tools.ImageReleaser;
|
import com.uns.maincar.tools.ImageReleaser;
|
||||||
import com.uns.maincar.cpp_interface.OCR;
|
|
||||||
import com.uns.maincar.tools.OCRDataReleaser;
|
import com.uns.maincar.tools.OCRDataReleaser;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -311,7 +310,16 @@ public class MainActivity extends AppCompatActivity
|
|||||||
// String str = OCR.DecodeImage(currImage);
|
// String str = OCR.DecodeImage(currImage);
|
||||||
String str = OCR.SelfTest(this);
|
String str = OCR.SelfTest(this);
|
||||||
byte[] bstr = str.getBytes(StandardCharsets.UTF_8);
|
byte[] bstr = str.getBytes(StandardCharsets.UTF_8);
|
||||||
|
CommandEncoder encoder = new CommandEncoder();
|
||||||
|
dtc_client.Send(encoder.GenerateCommand(Commands.OCR_TEXT_LENGTH, (byte) bstr.length, (byte) 0x00, (byte) bstr.length));
|
||||||
|
for (int i = 0; i < bstr.length; i += 2)
|
||||||
|
{
|
||||||
|
Sleep(500);
|
||||||
|
byte data_2 = ((i + 1) >= bstr.length ? 0x00 : bstr[i + 1]);
|
||||||
|
byte checksum = (byte) ((bstr[i] + data_2) % 0xFF);
|
||||||
|
byte main = ((i + 1) < bstr.length ? Commands.OCR_TEXT_DATA : Commands.OCR_TEXT_FINISH);
|
||||||
|
dtc_client.Send(encoder.GenerateCommand(main, bstr[i], data_2, checksum));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String ByteArray2String(byte[] arr)
|
private String ByteArray2String(byte[] arr)
|
||||||
|
|||||||
+2
@@ -124,3 +124,5 @@ generate_cxx_metadata
|
|||||||
create-invalidation-state 11ms
|
create-invalidation-state 11ms
|
||||||
generate_cxx_metadata completed in 15ms
|
generate_cxx_metadata completed in 15ms
|
||||||
|
|
||||||
|
# C/C++ build system timings
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -11,7 +11,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": -1788125960
|
"memoizedHashCode": -1639770073
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 144563755
|
"memoizedHashCode": 292919642
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -39,6 +39,6 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 943363118
|
"memoizedHashCode": 1091719005
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
+2
@@ -65,3 +65,5 @@ generate_cxx_metadata
|
|||||||
create-invalidation-state 11ms
|
create-invalidation-state 11ms
|
||||||
generate_cxx_metadata completed in 19ms
|
generate_cxx_metadata completed in 19ms
|
||||||
|
|
||||||
|
# C/C++ build system timings
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -11,7 +11,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": -1799921156
|
"memoizedHashCode": -1651565269
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 2143131576
|
"memoizedHashCode": -2003479833
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -39,6 +39,6 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 931567922
|
"memoizedHashCode": 1079923809
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -650,3 +650,16 @@ create_cxx_tasks
|
|||||||
create-initial-cxx-model completed in 91ms
|
create-initial-cxx-model completed in 91ms
|
||||||
create_cxx_tasks completed in 92ms
|
create_cxx_tasks completed in 92ms
|
||||||
|
|
||||||
|
# C/C++ build system timings
|
||||||
|
create_cxx_tasks
|
||||||
|
create-initial-cxx-model
|
||||||
|
create-module-model
|
||||||
|
create-cmake-model 31ms
|
||||||
|
create-module-model completed in 35ms
|
||||||
|
create-module-model
|
||||||
|
create-cmake-model 33ms
|
||||||
|
create-module-model completed in 35ms
|
||||||
|
[gap of 10ms]
|
||||||
|
create-initial-cxx-model completed in 88ms
|
||||||
|
create_cxx_tasks completed in 89ms
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": -1214542005
|
"memoizedHashCode": -1066186118
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": -422353902
|
"memoizedHashCode": -273998015
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 282107291
|
"memoizedHashCode": 430463178
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 2144921361
|
"memoizedHashCode": -2001690048
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 1252231779
|
"memoizedHashCode": 1400587666
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level_": 0,
|
"level_": 0,
|
||||||
@@ -81,6 +81,6 @@
|
|||||||
"fieldsDescending": {}
|
"fieldsDescending": {}
|
||||||
},
|
},
|
||||||
"memoizedSize": -1,
|
"memoizedSize": -1,
|
||||||
"memoizedHashCode": 1588211998
|
"memoizedHashCode": 1736567885
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user