They look the same to me (the only difference is I have the PCV panel declared in the "main" Layout file) but I'm including copies of each:
Kiosk uses two timers, a Starter service, MediaPlayer???
Kiosk app:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ocl As OCVOpenCVLoader 'ignore Needs to be here before declaring Mat objects
Dim mOpenCvCameraView As OCVJavaCameraView
Dim PREVIEW_WIDTH As Int = 640 'Set it to a resolution that your camera supports. 640x480 is more than enough to detect color blobs in most cases.
Dim PREVIEW_HEIGHT As Int = 480
'OCV
Dim mUtils As OCVUtils
Dim mImgProc As OCVImgproc
Dim mCore As OCVCore
'Substractor
Dim mVideo As OCVVideo
Dim mOCVBackgroundSubtractor As OCVBackgroundSubtractorMOG2 = mVideo.createBackgroundSubtractorMOG2(80,50,False)
Dim fgMaskMOG2,fgMaskMOG3 As OCVMat
...
----------------------------------------------------------------------------
Your Demo (with my changes):
Sub Globals
Dim ocl As OCVOpenCVLoader 'ignore Needs to be here before declaring Mat objects
Private PCV As Panel
Dim mOpenCvCameraView As OCVJavaCameraView
Dim PREVIEW_WIDTH As Int = 640 'Set it to a resolution that your camera supports. 640x480 is more than enough to detect color blobs in most cases.
Dim PREVIEW_HEIGHT As Int = 480
'OCV
'Dim mUtils As OCVUtils
Dim mImgProc As OCVImgproc
Dim mCore As OCVCore
'Substractor
Dim mVideo As OCVVideo
Dim mOCVBackgroundSubtractor As OCVBackgroundSubtractorMOG2 = mVideo.createBackgroundSubtractorMOG2(80,50,False)
Dim fgMaskMOG2,fgMaskMOG3 As OCVMat
'Dim tmp As OCVMat
...
===============================================================================
Kiosk:
Sub Activity_Create(FirstTime As Boolean)
LoadPanel(vm,"main")
mOpenCvCameraView.Initialize("frameprocessor",PCV,mOpenCvCameraView.CAMERA_ID_FRONT)'.CAMERA_ID_BACK) .CAMERA_ID_ANY)
mOpenCvCameraView.setMaxFrameSize(PREVIEW_WIDTH,PREVIEW_HEIGHT)
PCV.Visible = False
...
End Sub
----------------------------------------------------------------------------
Demo:
TMR.Initialize("TMR",5000) ' Change this after testing to more than 5 seconds
PCV.Initialize("") ' The panel where the camera surfaceview will be placed
Activity.AddView(PCV,0,0,100%X,100%Y)
PCV.Visible = False
mOpenCvCameraView.Initialize("frameprocessor",PCV,mOpenCvCameraView.CAMERA_ID_FRONT)'.CAMERA_ID_BACK)
mOpenCvCameraView.setMaxFrameSize(PREVIEW_WIDTH,PREVIEW_HEIGHT)
End Sub
===============================================================================
Kiosk:
Sub Activity_Pause (UserClosed As Boolean)
mOpenCvCameraView.disconnectCamera
Minute.Enabled = False
End Sub
----------------------------------------------------------------------------
Demo:
Sub Activity_Pause (UserClosed As Boolean)
mOpenCvCameraView.disconnectCamera
Log("disconnectCamera")
End Sub
===============================================================================