michaelleewebb
Member
trying to change video0,video1, backsub0,backsub1 into arrays. appears to me that OCVBackgroundSubtractorMOG2 can't be converted to an array. can someone read the error message i get when i run the program in debug mode. confirm i'm right, maybe explain a work around. maybe my sytax is wrong ?
in case i'm not clear, i have:
Dim Video0 As OCVVideo
Dim Video1 As OCVVideo
Dim BackSub0 As OCVBackgroundSubtractorMOG2 = Video0.createBackgroundSubtractorMOG2(10,98,False)
Dim BackSub1 As OCVBackgroundSubtractorMOG2 = Video1.createBackgroundSubtractorMOG2(10,98,False)
i wish to have:
dim Videos(2) as OCVVideo
dim BackSubs(2) As OCVBackgroundSubtractorMOG2
error is this line:
Dim BackSubs(WireCounter) As OCVBackgroundSubtractorMOG2 = Videos(WireCounter).createBackgroundSubtractorMOG2(10,98,False)
this is error message:
Compiling generated Java code. Error
B4J line: 183
Dim BackSubs(WireCounter) As OCVBackgroundSubtra
src\b4j\example\main.java:289: error: incompatible types: BackgroundSubtractorMOG2 cannot be converted to BackgroundSubtractorMOG2[]
_backsubs = (com.b4jcv.video.BackgroundSubtractorMOG2[])(_videos[_wirecounter].createBackgroundSubtractorMOG2((int) (10),98,anywheresoftware.b4a.keywords.Common.False));
^
1 error
in case i'm not clear, i have:
Dim Video0 As OCVVideo
Dim Video1 As OCVVideo
Dim BackSub0 As OCVBackgroundSubtractorMOG2 = Video0.createBackgroundSubtractorMOG2(10,98,False)
Dim BackSub1 As OCVBackgroundSubtractorMOG2 = Video1.createBackgroundSubtractorMOG2(10,98,False)
i wish to have:
dim Videos(2) as OCVVideo
dim BackSubs(2) As OCVBackgroundSubtractorMOG2
arrays:
Dim Video0 As OCVVideo
Dim Video1 As OCVVideo
Dim BackSub0 As OCVBackgroundSubtractorMOG2 = Video0.createBackgroundSubtractorMOG2(10,98,False)
Dim BackSub1 As OCVBackgroundSubtractorMOG2 = Video1.createBackgroundSubtractorMOG2(10,98,False)
Dim NumOfTripWires As Int = 3
Dim Videos(NumOfTripWires) As OCVVideo
Dim WireCounter As Int = 0
Do Until WireCounter = NumOfTripWires
Dim BackSubs(WireCounter) As OCVBackgroundSubtractorMOG2 = Videos(WireCounter).createBackgroundSubtractorMOG2(10,98,False)
WireCounter = WireCounter + 1
Loop
error is this line:
Dim BackSubs(WireCounter) As OCVBackgroundSubtractorMOG2 = Videos(WireCounter).createBackgroundSubtractorMOG2(10,98,False)
this is error message:
Compiling generated Java code. Error
B4J line: 183
Dim BackSubs(WireCounter) As OCVBackgroundSubtra
src\b4j\example\main.java:289: error: incompatible types: BackgroundSubtractorMOG2 cannot be converted to BackgroundSubtractorMOG2[]
_backsubs = (com.b4jcv.video.BackgroundSubtractorMOG2[])(_videos[_wirecounter].createBackgroundSubtractorMOG2((int) (10),98,anywheresoftware.b4a.keywords.Common.False));
^
1 error
Last edited: