我尝试将JavaCV与Kotlin一起使用,但是该代码有问题
import org.bytedeco.javacv.OpenCVFrameGrabber
import org.bytedeco.javacv.CanvasFrame
import org.bytedeco.javacv.Frame
class Vision {
var grabber: OpenCVFrameGrabber = OpenCVFrameGrabber(0)
grabber.start()
var frame: Frame = grabber.grab()
var canvasFrame: CanvasFrame = CanvasFrame("Test Title")
canvasFrame.setCanvasSize( frame.imageWidth, frame.imageHeight )
while (canvasFrame.isVisible() && (frame = grabber.grab()) != null) = this.canvasFrame.showImage(frame)
}
带有 canvasFrame的 grabber.start()字符串。显示错误“期望成员声明”
你能帮我吗?