Skip to content
This repository was archived by the owner on Dec 31, 2022. It is now read-only.

Commit 2976dc3

Browse files
Fixed Vuforia Trackable Debugging causing a crash on stop
1 parent 9b16047 commit 2976dc3

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

DogeCV/src/main/java/com/disnodeteam/dogecv/Dogeforia.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,21 @@ public void processFrame(Frame frame){
120120
outMat = detector.processFrame(inputMat, null);
121121

122122
if(showDebug){
123-
VuforiaTrackablesImpl trackables = loadedTrackableSets.get(0);
124-
int count = 0;
125-
for(VuforiaTrackable trackable : trackables){
126-
if(trackable == null || ((VuforiaTrackableDefaultListener)trackable.getListener()) == null){
127-
continue;
128-
}
129-
if(((VuforiaTrackableDefaultListener)trackable.getListener()).isVisible()){
130-
Imgproc.putText(outMat,"Vuforia: " + trackable.getName(), new Point(10,50 * count + 50),0,2,new Scalar(0,255,0),3);
131-
count++;
132-
}
133-
123+
if(loadedTrackableSets !=null && loadedTrackableSets.size() > 0) {
124+
VuforiaTrackablesImpl trackables = loadedTrackableSets.get(0);
125+
int count = 0;
126+
for(VuforiaTrackable trackable : trackables){
127+
if(trackable == null || ((VuforiaTrackableDefaultListener)trackable.getListener()) == null){
128+
continue;
129+
}
130+
if(((VuforiaTrackableDefaultListener)trackable.getListener()).isVisible()){
131+
Imgproc.putText(outMat,"Vuforia: " + trackable.getName(), new Point(10,50 * count + 50),0,2,new Scalar(0,255,0),3);
132+
count++;
133+
}
134+
135+
}
134136
}
137+
135138
}
136139

137140

@@ -182,7 +185,7 @@ public void render() {
182185
e.printStackTrace();
183186
}
184187
}else{
185-
Log.w("DogeCV", "Frame is empty wtf: " + getFrameQueueCapacity());
188+
//Log.w("DogeCV", "Frame is empty: " + getFrameQueueCapacity());
186189
}
187190

188191
/*

0 commit comments

Comments
 (0)