Dies ist der Code, den ich habe und mit diesem Code helle Flecken sind perfekt erkannt, wie in Bild gezeigt.Aber das Problem ist, obwohl der Ort ist nicht wird es falsche Stelle im Bild erkennen kann mir helfen, wie Werde das los???Wie vermeide ich die Erkennung falscher Lichtpunkte?
# import the necessary packages
import numpy as np
import argparse
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", help = "Desktop")
ap.add_argument("-r", "--radius", type = int,
\t help = "radius of Gaussian blur; must be odd")
args = vars(ap.parse_args())
# load the image and convert it to grayscale
image1 = cv2.imread("h.png")
orig = image1.copy()
gray = cv2.cvtColor(image1, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (args["radius"], args["radius"]), 0)
(minVal, maxVal, minLoc, maxLoc) = cv2.minMaxLoc(gray)
image1 = orig.copy()
cv2.circle(image1, maxLoc, args["radius"], (255, 0, 0), 2)
# display the results of our newly improved method
cv2.imwrite("myImage.png", image1)
[1]: https://i.stack.imgur.com/6CDYP.png
Sie so viel Zdar für Ihren wertvollen Vorschlag danken werde ich es versuchen, und lassen Sie wissen –
obwohl ich benutzte Schwelle falsche Flecken erkannt werden @ ZdaR..what Kann ich tun?? –
können Sie Ihre E-Mail-ID geben, ich werde Ihnen im Detail sagen, meine ist '[email protected]' –