For years I've been using the following code to detect a star's center:
Code: Select all
from SharpCap.ImageProcessing import OpenCVStarDetector
from System.Drawing import Bitmap
gaussianBlur = 0.8
path = "C:\Users\Brian\Desktop\pec-learn\capture.png"
ocvsd = OpenCVStarDetector(2, 20, 10, gaussian_blur)
SharpCap.SelectedCamera.CaptureSingleFrameTo(path)
bm = Bitmap(path)
stars = ocvsd.Detect(bm)
star = stars[0]
xcenter = star.BoundingBox.X + 0.5 * star.BoundingBox.Width
ycenter = star.BoundingBox.Y + 0.5 * star.BoundingBox.Height
Is there another API that supports this?
Thanks,
Brian