|
|
|
|
|
|
|
|
ImageView inputImageView; |
|
|
ImageView inputImageView; |
|
|
ImageView outputImageView; |
|
|
ImageView outputImageView; |
|
|
ToggleButton toggleButton; |
|
|
ToggleButton toggleButton; |
|
|
int num=0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int num; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
super.onCreate(savedInstanceState); |
|
|
super.onCreate(savedInstanceState); |
|
|
setContentView(R.layout.activity_main); |
|
|
setContentView(R.layout.activity_main); |
|
|
|
|
|
setTitle("Super Ueberwachung"); |
|
|
|
|
|
|
|
|
inputImageView = findViewById(R.id.inputImageView); |
|
|
inputImageView = findViewById(R.id.inputImageView); |
|
|
outputImageView = findViewById(R.id.outputImageView); |
|
|
outputImageView = findViewById(R.id.outputImageView); |
|
|
|
|
|
|
|
|
public void onServiceConnected(ComponentName name, IBinder service) { |
|
|
public void onServiceConnected(ComponentName name, IBinder service) { |
|
|
DetectorService.ServiceBinder binder = (DetectorService.ServiceBinder) service; |
|
|
DetectorService.ServiceBinder binder = (DetectorService.ServiceBinder) service; |
|
|
detectorService = binder.getBoundService(); |
|
|
detectorService = binder.getBoundService(); |
|
|
detectorService.videoDetector.debugProcessing(null, outputImageView); //inputImageView |
|
|
|
|
|
|
|
|
detectorService.videoDetector.debugProcessing(inputImageView, outputImageView); //inputImageView |
|
|
|
|
|
|
|
|
detectorService.setOnDetectionListener(new DetectorService.OnDetectionListener() { |
|
|
detectorService.setOnDetectionListener(new DetectorService.OnDetectionListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onDetection(@NonNull StringBuffer stringBuffer) { |
|
|
public void onDetection(@NonNull StringBuffer stringBuffer) { |
|
|
Log.d("onDetection", stringBuffer.toString()); //Für oli hier Textview einbauen |
|
|
Log.d("onDetection", stringBuffer.toString()); //Für oli hier Textview einbauen |
|
|
num++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
num = stringBuffer.toString().split("\n").length; |
|
|
|
|
|
//Log.d("num", String.valueOf(num)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |