Skip to main content

2D acquisition canvas

Project description

tiny_2d_engine

t2de

A Tk.Canevas widget augmented to allow 2D acquisitions:

  1. load an image
  2. Add a calibration for the image to set up your own world coordinates
  3. Add Points or Lines on the image
  4. Save your project. You will find the word coordinates of all your objects in the projects, ready for an other usage.

It can be used as a standaone application with:

> tiny_2d_engine gui

Or as a Tkinter widget like here:

from tkinter import ttk
from tiny_2d_engine.main import Acquisition2D

def add_viewer_2d(otroot):
    """Injection of a viewer 2D to opentea"""
    title = "2D dialog"
    view2d_fr = ttk.Frame(otroot.notebook, name=title)
    otroot.notebook.add(view2d_fr, text=title)
    viewer = Viewer2D(
        view2d_fr,
        otroot,
    )
    return viewer


class Viewer2D(Acquisition2D):
    def __init__(self, master, otroot):
        super().__init__(master, standalone=True)
        self.pack( side="top")
        self.otroot = otroot

    def get(self):
        print("get data")
        return self.acq_canvas.as_dict()

    def set(self, data: dict):
        print("set data")
        self.acq_canvas.load_dict(data)

Disclaimer

This package is very young and uncomplete.

Known issues are:

  • A spurious contextual menu pops up sometimes
  • Changing image can fail
  • Moving the calibration around is quickly perturbating the acquisitions (You are not supposed to do that!)

But it works somehow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiny_2d_engine-0.0.0.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

tiny_2d_engine-0.0.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file tiny_2d_engine-0.0.0.tar.gz.

File metadata

  • Download URL: tiny_2d_engine-0.0.0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.14

File hashes

Hashes for tiny_2d_engine-0.0.0.tar.gz
Algorithm Hash digest
SHA256 893cb61b7f1d366b79565ac3b51f7633a602a4431f43b72f80d2562afa6b4f9d
MD5 f43186de421b777a5ba99079bd4269eb
BLAKE2b-256 a3c5b4bd95e3f2550a7723057ee924dbe9bb489fc8351f211ed413a2e2dbbd43

See more details on using hashes here.

File details

Details for the file tiny_2d_engine-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tiny_2d_engine-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 420681800c27027c2b5b3aae5c0a8da3611a5e3c3303840b6acdb91f97adfa61
MD5 b20721b5c52364523f7a25fe380e166f
BLAKE2b-256 ece50f71a4f18f2d1506850b4482468ae056cf0d21ee42f6d90f6914760c5dcf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page