You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
override fun onCreate(savedInstanceState: Bundle?) {
...
createFotoapparat()
...
}
private fun createFotoapparat(){
val cameraView = findViewById<CameraView>(R.id.cameraView)
fotoapparat = Fotoapparat(
context = this,
view = cameraView,
scaleType = ScaleType.CenterCrop,
lensPosition = back(),
logger = loggers(
logcat()
),
cameraErrorCallback = { error ->
println("Recorder errors: $error")
}
)
// now the processor - when I delete this and also the layouts in the view, Camera preview is visible again
val processor = FaceDetectorProcessor.with(this)
.listener({ faces ->
rectanglesView.setRectangles(faces) // (Optional) Show detected faces on the view.
Log.v("Faces",faces.toString()); // is never called!
// ... or do whatever you want with the result
})
.build()
Fotoapparat.with(this)
.into(cameraView)
// the rest of configuration
.frameProcessor(processor)
.build()
}
activity_main.xml:
<io.fotoapparat.facedetector.view.CameraOverlayLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Adjust parameters as you like. But cameraView has to be inside CameraOverlayLayout -->
<io.fotoapparat.view.CameraView
android:id="@+id/cameraView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- This view will display detected faces -->
<io.fotoapparat.facedetector.view.RectanglesView
android:id="@+id/rectanglesView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectanglesColor="@color/colorAccent"
app:rectanglesStrokeWidth="2dp"/>
</io.fotoapparat.facedetector.view.CameraOverlayLayout>
I don't get any errors, but I don't see anything. No faces, no camera preview stream.
...
When I add this line, I get the error (I am not sure if this is needed, when I already io.fotoapparat:fotoapparat:2.7.0) :
ERROR: Failed to resolve: io.fotoapparat.fotoapparat:library:1.0.0
for:
// If you are using Fotoapparat add this one as well
implementation 'io.fotoapparat.fotoapparat:library:1.2.0' // or later version
Any ideas?
The text was updated successfully, but these errors were encountered:
I am using FotoApparat in my App.
When I try to implement the facedetector the Camera View stays black. Nothing to see.
app/build.gradle:
MainActivity.kt:
activity_main.xml:
I don't get any errors, but I don't see anything. No faces, no camera preview stream.
...
When I add this line, I get the error (I am not sure if this is needed, when I already io.fotoapparat:fotoapparat:2.7.0) :
for:
Any ideas?
The text was updated successfully, but these errors were encountered: