怎样提高拍照的清晰度
-
如题,选择用模型匹配进行物体识别,发现分辨率不高,拍照模糊,怎样能提高呢
-
@laoguren1122 程序如图
import time, sensor, image, math
from image import SEARCH_EX, SEARCH_DSReset sensor
sensor.reset()
Set sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)Max resolution for template matching with SEARCH_EX is QQVGA
sensor.set_framesize(sensor.QQVGA)
You can set windowing to reduce the search image.
#sensor.set_windowing(((640-80)//2, (480-60)//2, 80, 60))
sensor.set_pixformat(sensor.GRAYSCALE)Load template.
Template should be a small (eg. 32x32 pixels) grayscale image.
template = image.Image("/ball3.pgm")
low_threshold = (0, 50)
high_threshold = (195, 255)clock = time.clock()
Run template matching
while (True):
clock.tick()
img = sensor.snapshot().lens_corr(1.8)for x in range(4):
r = img.find_template(template, 0.70) if r: img.draw_rectangle(r,color=0)
img.find_edges(image.EDGE_CANNY, threshold=(50, 80))
for c in img.find_circles(threshold = 2500, x_margin = 20, y_margin = 20, r_margin = 20):
img.draw_circle(c.x(), c.y(), c.r(), color = (0, 0, 0))
print(c)
print(clock.fps())
-
来自星瞳实验室APP: [常见问题]Memory Error: FB Alloc collision!内存不够 https://forum.singtown.com/topic/558