Skip to content

Commit

Permalink
Dummy ImageStreamer on papervision pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
serivesmejia committed Nov 4, 2024
1 parent 6e19f14 commit 8398d35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.github.serivesmejia.eocvsim.gui.DialogFactory
import com.github.serivesmejia.eocvsim.input.SourceType
import com.github.serivesmejia.eocvsim.pipeline.PipelineSource
import com.github.serivesmejia.eocvsim.util.loggerForThis
import io.github.deltacv.eocvsim.pipeline.StreamableOpenCvPipelineInstantiator
import io.github.deltacv.eocvsim.plugin.EOCVSimPlugin
import io.github.deltacv.eocvsim.plugin.loader.PluginSource
import io.github.deltacv.papervision.engine.client.message.*
Expand Down Expand Up @@ -403,6 +404,11 @@ class PaperVisionEOCVSimPlugin : EOCVSimPlugin() {
)

eocvSim.pipelineManager.onUpdate.doOnce {
eocvSim.pipelineManager.addInstantiator(
PaperVisionDefaultPipeline::class.java,
StreamableOpenCvPipelineInstantiator(EOCVSimEngineImageStreamer(Size(320.0, 240.0)))
)

eocvSim.pipelineManager.changePipeline(
eocvSim.pipelineManager.getIndexOf(
PaperVisionDefaultPipeline::class.java,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package io.github.deltacv.papervision.plugin.eocvsim

import com.github.serivesmejia.eocvsim.util.loggerForThis
import com.qualcomm.robotcore.eventloop.opmode.Disabled
import io.github.deltacv.eocvsim.pipeline.StreamableOpenCvPipeline
import org.firstinspires.ftc.robotcore.external.Telemetry
import org.opencv.core.Mat
import org.opencv.core.MatOfByte
Expand All @@ -32,7 +33,7 @@ import org.openftc.easyopencv.OpenCvPipeline
@Disabled
class PaperVisionDefaultPipeline(
val telemetry: Telemetry
) : OpenCvPipeline() {
) : StreamableOpenCvPipeline() {

val logger by loggerForThis()

Expand Down Expand Up @@ -71,6 +72,9 @@ class PaperVisionDefaultPipeline(
override fun processFrame(input: Mat): Mat {
telemetry.addLine("Making computer vision accessible to everyone")
telemetry.update()

streamFrame(0, input, null)

return drawMat
}

Expand Down

0 comments on commit 8398d35

Please sign in to comment.