Soru opencv

  • Konuyu başlatan Konuyu başlatan boom166
  • Başlangıç tarihi Başlangıç tarihi

Vartgalma

Öğrenci
Katılım
9 Ocak 2023
Mesajlar
4
Reaksiyon puanı
0
Puanları
1
Yaş
22
#para saydırma
import cv2
import numpy as np


image = cv2.imread('images/1404418.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow('gray', gray)
cv2.waitKey(0)
ret,thresh = cv2.threshold(gray,160,255,cv2.THRESH_BINARY)
cv2.imshow('thresh', thresh)
cv2.waitKey(0)
blur = cv2.medianBlur(thresh, 21)
cv2.imshow('blur', blur)
cv2.waitKey(0)


circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 90,minRadius=50,maxRadius=105)
#circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 2, 50,minRadius=30,maxRadius=70)

#circles = np.uint8(np.around(circles))

for i in circles[0,:]:
# draw the outer circle
cv2.circle(image,(int(i[0]), int(i[1])), int(i[2]), (0, 0, 255), 2)

# draw the center of the circle
cv2.circle(image, (int(i[0]), int(i[1])), 2, (0, 255, 0), -1)

cv2.imshow('detected circles', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
 

cumbullop

Öğrenci
Katılım
9 Ocak 2023
Mesajlar
3
Reaksiyon puanı
0
Puanları
1
Yaş
23
Python:
#para saydırma
import cv2
import numpy as np


image = cv2.imread('images/1404418.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow('gray', gray)
cv2.waitKey(0)
ret,thresh = cv2.threshold(gray,160,255,cv2.THRESH_BINARY)
cv2.imshow('thresh', thresh)
cv2.waitKey(0)
blur = cv2.medianBlur(thresh, 21)
cv2.imshow('blur', blur)
cv2.waitKey(0)


circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 90,minRadius=50,maxRadius=105)
#circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 2, 50,minRadius=30,maxRadius=70)

#circles = np.uint8(np.around(circles))

for i in circles[0,:]:
# draw the outer circle
cv2.circle(image,(int(i[0]), int(i[1])), int(i[2]), (0, 0, 255), 2)

# draw the center of the circle
cv2.circle(image, (int(i[0]), int(i[1])), 2, (0, 255, 0), -1)

cv2.imshow('detected circles', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
 

mademmor

Öğrenci
Katılım
9 Ocak 2023
Mesajlar
2
Reaksiyon puanı
0
Puanları
1
Yaş
22
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Vartgalma

Öğrenci
Katılım
9 Ocak 2023
Mesajlar
4
Reaksiyon puanı
0
Puanları
1
Yaş
22
Kod:
#para saydırma
import cv2
import numpy as np


image = cv2.imread('images/1404418.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow('gray', gray)
cv2.waitKey(0)
ret,thresh = cv2.threshold(gray,160,255,cv2.THRESH_BINARY)
cv2.imshow('thresh', thresh)
cv2.waitKey(0)
blur = cv2.medianBlur(thresh, 21)
cv2.imshow('blur', blur)
cv2.waitKey(0)


circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 90,minRadius=50,maxRadius=105)
#circles = cv2.HoughCircles(gray, cv.CV_HOUGH_GRADIENT, 2, 50,minRadius=30,maxRadius=70)

#circles = np.uint8(np.around(circles))

for i in circles[0,:]:
    # draw the outer circle
    cv2.circle(image,(int(i[0]), int(i[1])), int(i[2]), (0, 0, 255), 2)
    
    # draw the center of the circle
    cv2.circle(image, (int(i[0]), int(i[1])), 2, (0, 255, 0), -1)

cv2.imshow('detected circles', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
 
Üst