OpenCV Android Track激光点

我正试图在Android设备上使用OpenCV跟踪激光点。 我想用这个激光点画在canvas上,canvas放在我的摄像头视图上。

我已经将我的camerapreview转换为HSV色彩空间并使用阈值滤波(仅在H和V通道上)来分离我的激光点。 这非常有效。

public Mat onCameraFrame(CvCameraViewFrame cvf) { // Grab the video frame cvf.rgba().copyTo(originalFrame); cvf.rgba().copyTo(frame); // Convert it to HSV Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGB2HSV); // Split the frame into individual components (separate images for H, S, // and V) mChannels.clear(); Core.split(frame, mChannels); // Split channels: 0-H, 1-S, 2-V frameH = mChannels.get(0); // frameS = mChannels.get(1); frameV = mChannels.get(2); // Apply a threshold to each component Imgproc.threshold(frameH, frameH, 155, 160, Imgproc.THRESH_BINARY); // Imgproc.threshold(frameS, frameS, 0, 100, Imgproc.THRESH_BINARY); Imgproc.threshold(frameV, frameV, 250, 256, Imgproc.THRESH_BINARY); // Perform an AND operation Core.bitwise_and(frameH, frameV, frame); // Display the result. frameH.release(); // frameS.release(); frameV.release(); frame.release(); return originalFrame; } 

现在我正试图获得我的laserdot中心的坐标。 我尝试在我的框架上使用findContours函数但这导致多个点。

我希望有人可以指出我正确的方向,为下一步使用filter提供一些提示。

以下是显示已处理帧的屏幕截图。 处理过的帧

最后使用上面karlphilip提到的边界框技术。