Skip to content
Snippets Groups Projects
Commit e50692e8 authored by sorgre's avatar sorgre
Browse files

Changed to package without main.

parent a6fa9f14
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,3 @@ imagelab = {path = "../imagelab", develop = true}
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "setuptools"]
[tool.poetry.scripts]
photometric_stereo = "photometric_stereo:"
from . import calibrate
from imagelab import io, visionhardware
cameras = visionhardware.getCameras()
if len(cameras) < 1:
exit(1)
im = cameras[0].capture_single_frame()
io.imwrite("test.png", im)
from imagelab import imageanalysis, utilities
import numpy as np
def detect_spheres(*images):
boxes = []
for image in images:
gray = utilities.grayscale(image)
nonblack = np.zeros_like(gray.shape[-3:], dtype=bool)
for idx in np.nditer(gray.shape[:-3]):
nonblack |= gray[idx] > 10
boxes += [imageanalysis.detect_ellipse(255 * nonblack.astype('u1'))]
if len(boxes) == 1:
boxes = boxes[0]
return boxes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment