use of org.opencv.core.CvException in project Frankenstein by olir.
the class ProcessingSceneController method initProcessing.
public void initProcessing(ConfigurationSceneController cController, Configuration configuration) {
markPosition = -1;
taskPosition = -1;
selectedFilter = null;
filterListData.clear();
this.taskMessage = "";
this.taskErrorMessage = null;
processor = new MovieProcessor(configuration);
try {
processor.init(ProcessingSceneController.this);
Platform.runLater(() -> {
drawEditCanvas();
startButton.setDisable(false);
btnMark.setDisable(false);
btnOneFrame.setDisable(true);
btnClear.setDisable(true);
// btnCopy.setDisable(true);
// btnPaste.setDisable(true);
btnListAdd.setDisable(true);
btnListFilter.setDisable(true);
btnListDelete.setDisable(true);
currentTime.setDisable(false);
currentFrameIndex.setDisable(false);
});
} catch (CvException e) {
taskError(e.toString());
}
}
use of org.opencv.core.CvException in project Relic_Main by TeamOverdrive.
the class Utils method exportResource.
public static String exportResource(Context context, int resourceId, String dirname) {
String fullname = context.getResources().getString(resourceId);
String resName = fullname.substring(fullname.lastIndexOf("/") + 1);
try {
InputStream is = context.getResources().openRawResource(resourceId);
File resDir = context.getDir(dirname, Context.MODE_PRIVATE);
File resFile = new File(resDir, resName);
FileOutputStream os = new FileOutputStream(resFile);
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
is.close();
os.close();
return resFile.getAbsolutePath();
} catch (IOException e) {
e.printStackTrace();
throw new CvException("Failed to export resource " + resName + ". Exception thrown: " + e);
}
}
Aggregations