Color detection in images to capture presense of known objects.

Overview

Swatch icon

GitHub Release Build Status License

swatch

Color detection in images to capture presence of known objects.

Why?

There is great object and face detection software out there, but sometimes AI detection is overkill or not suitable different types of objects. Swatch was created to create an easy to use API to detect the presence of objects of known color in expected places.

In this example you can see a cropped section of the street with a trash can. Then, using expected color bounds, the parts of the image that don't match the expected color are masked away. If a significant enough amount of pixels are left that match the color then it can be considered a true positive.

street street-bounding street-mask

Features

Web UI

Color Playground

Swatch Color Playground

Configuration

A config.yaml file must be created and mapped to /config

Check out GitHub Docs for example and more instructions on creating the config file.

Adding Objects

Check out the Color Setup Docs for how to setup objects and fine the color values to use.

API References

Check out GitHub Docs for the API reference.

Contributing

Contributions are very much welcome!

For instructions on how to get started, see the contributing section

Donations

If you would like to make a donation to support development, please use GitHub Sponsors.

Comments
  • [Support]: Need help with tuning the color values

    [Support]: Need help with tuning the color values

    Describe the problem you are having

    I used a python script to crop the images from my camera with the same coordinates provided in the config file for Swatch. I then uploaded the cropped images to Swatch to get the color values. Below are the results of this test as well as the result of running detect on the original uncropped pictures.

    midday:
    {
        "message": "The dominant color is (151, 36, 46) with a mixed palette as [(156, 39, 49), (183, 168, 169), (203, 139, 150), (85, 6, 13)]",
        "success": true
    }
    
    {
        "door": {
            "stop_sign": {
                "area": 81,
                "result": false
            }
        }
    }
    

    cropped_midday

    night_lights_on:
    {
        "message": "The dominant color is (64, 22, 26) with a mixed palette as [(62, 14, 18), (79, 74, 74), (130, 84, 90), (84, 60, 68)]",
        "success": true
    }
    
    {
        "door": {
            "stop_sign": {
                "area": 99,
                "result": false
            }
        }
    }
    

    cropped_night_lights_on_garage

    night_spotlight:
    {
        "message": "The dominant color is (121, 64, 79) with a mixed palette as [(119, 62, 77), (203, 137, 152), (165, 119, 150), (163, 120, 127)]",
        "success": true
    }
    
    {
        "door": {
            "stop_sign": {
                "area": 846,
                "result": false
            }
        }
    }
    

    cropped_spotllight_garage

    night_door_open:
    {
        "message": "The dominant color is (19, 20, 19) with a mixed palette as [(11, 12, 12), (19, 20, 19), (4, 4, 4), (28, 26, 27)]",
        "success": true
    }
    
    {
        "door": {
            "stop_sign": {
                "area": 111,
                "result": false
            }
        }
    }
    

    cropped_night_door_open_garage

    I am not sure what lower and upper color values or min/max pixel thresholds I should use so that the first 3 situations are detected and the last one isn't. Any combination I use either one is incorrectly missed or incorrectly detected. For some reason, even when I had the lower RGB values larger than the values of the 4th situations, Swatch marked it as true.

    Version

    1.0.0

    Swatch config file

    # REQUIRED: Define a list of objects that are expected to be seen. These can be specific
    # to one camera or common between many / all cameras
    objects:
      # REQUIRED: Name of the object
      stop_sign:
        # REQUIRED: the lower R, G, B values that are considered a potential match for the object.
        color_lower: 64, 22, 26
        # REQUIRED: the upper R, G, B values that are considered a potential match for the object.
        color_upper: 151, 36, 46
        # OPTIONAL: the min number of pixels with R, G, B values within the bounds to be
        # considered a true positive. This is recommended to be set as a super small amount
        # could be a false positive. (Default: shown below)
        min_area: 1000
        # OPTIONAL: the max number of pixels with R, G, B values within the bounds to be
        # considered a true positive (Default: shown below).
        max_area: 100000
    
    # REQUIRED: Define list of cameras that will be used for color detection.
    cameras:
      # REQUIRED: Name of the camera
      garage_cam:
        # REQUIRED: Zones are cropped areas where the object can be expected to be. 
        # This makes searching / matches for efficient and more predictable than searching
        # the entire image.
        zones:
          # REQUIRED: Name of the zone.
          door:
            # REQUIRED: Coordinates to crop the zone by. 
            coordinates: 645, 712, 1368, 1434
            # REQUIRED: List of objects that may be in this zone. These correspond to
            # the objects list defined previously and are matched by name.
            objects:
              - stop_sign
    

    Relevant log output

    N/A
    

    Any other information that may be helpful

    No response

    opened by backslashV 18
  • [Support]:  Trouble Getting Into WebUI - 502 Bad Gateway error

    [Support]: Trouble Getting Into WebUI - 502 Bad Gateway error

    Describe the problem you are having

    Can't access WebUI - 502 bad gateway error

    Repository has been added, and add-on installed. I have also installed the HACS integration. I tried to setup the normal integration (which is now showing up) but wasn't sure if I'm pointing to the right URL as I'm getting an error back on that.

    Bigger issue seems to be with getting into the WebUI

    Version

    3.0.2

    Swatch config file

    # REQUIRED: Define a list of objects that are expected to be seen. These can be specific
    # to one camera or common between many / all cameras
    objects:
      # REQUIRED: Name of the object
      trash_can:
        # REQUIRED: the list of color variants that this object can be detected as. Useful for
        # different lighting conditions
        color_variants:
          # REQUIRED: the name of the color variant
          default:
            # REQUIRED: the lower R, G, B values that are considered a potential match for the
            # color variant of the object.
            color_lower: 70, 70, 0
            # REQUIRED: the upper R, G, B values that are considered a potential match for the
            # color variant of the object.
            color_upper: 110, 100, 50
            # OPTIONAL: the time range for when this color variant is allowed
            # NOTE: make sure that /etc/localtime is passed to the container so it has valid time
            time_range:
              # OPTIONAL: Color variant is valid if current time is > this 24H time (Default: shown below).
              after: "00:00"
              # OPTIONAL: Color variant is valid if current time is < this 24H time (Default: shown below).
              before: "24:00"
        # OPTIONAL: the min number of pixels with R, G, B values within the bounds to be
        # considered a true positive. This is recommended to be set as a super small amount
        # could be a false positive. (Default: shown below)
        min_area: 1000
        # OPTIONAL: the max number of pixels with R, G, B values within the bounds to be
        # considered a true positive (Default: shown below).
        max_area: 100000
        
    # REQUIRED: Define list of cameras that will be used for color detection.
    cameras:
      # REQUIRED: Name of the camera
      GR:
        # OPTIONAL: Frequency in seconds to run detection on the camera.
        # a value of 0 disables auto detection (Default: shown below).
        auto_detect: 0
        # OPTIONAL: Configure the url and retention of snapshots. (Default: Shown Below)
        snapshot_config:
            # OPTIONAL: but highly recommended, setting the default url for a snapshot to be
            # processed by this camera. This is required for auto detection (Default: none).
            url: "http://ip.ad.dr.ess/jpg"
            # OPTIONAL: Whether or not to draw bounding boxes for confirmed objects in the snapshots (Default: shown below).
            bounding_box: true
            # OPTIONAL: Whether or not to save a clean png of the snapshot along with the annotated jpg (Default: shown below).
            clean_snapshot: true
            # OPTIONAL: Whether or not to save the snapshots of confirmed detections (Default: shown below).
            save_detections: true
            # OPTIONAL: Whether or not to save the snapshots of missed detections (Default: shown below).
            save_misses: false
            # OPTIONAL: Variations of snapshots to keep. Options are all, mask, crop (Default: shown below).
            mode: "all"
            # OPTIONAL: Number of days of snapshots to keep (Default: shown below).
            retain_days: 7
        # REQUIRED: Zones are cropped areas where the object can be expected to be.
        # This makes searching / matches for efficient and more predictable than searching
        # the entire image.
        zones:
          # REQUIRED: Name of the zone.
          street:
            # REQUIRED: Coordinates to crop the zone by.
            # NOTE: The order of the coordinates are: x, y, x+w, y+h starting in the top left corner as 0, 0.
            coordinates: 225, 540, 350, 620
            # REQUIRED: List of objects that may be in this zone. These correspond to
            # the objects list defined previously and are matched by name.
            objects:
              - trash_can
    

    Relevant log output

    [2022-06-08 14:13:47,455]: INFO - Starting SwatchApp
    [2022-06-08 14:13:47,464]: INFO - Importing SwatchApp Config
    [2022-06-08 14:13:47,464]: INFO - Verified SwatchApp Config
    Starting migrations
    [2022-06-08 14:13:47,480]: INFO - Starting migrations
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3113, in connect
        self._state.set_connection(self._connect())
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3453, in _connect
        conn = sqlite3.connect(self.database, timeout=self._timeout,
    sqlite3.OperationalError: unable to open database file
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3175, in execute_sql
        cursor = self.cursor(commit)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3159, in cursor
        self.connect()
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3112, in connect
        with __exception_wrapper__:
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 2950, in __exit__
        reraise(new_type, new_type(exc_value, *exc_args), traceback)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 191, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3113, in connect
        self._state.set_connection(self._connect())
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3453, in _connect
        conn = sqlite3.connect(self.database, timeout=self._timeout,
    peewee.OperationalError: unable to open database file
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/opt/swatch/swatch/__main__.py", line 14, in <module>
        swatch_app = SwatchApp()
      File "/opt/swatch/swatch/app.py", line 44, in __init__
        self.__init_db__()
      File "/opt/swatch/swatch/app.py", line 74, in __init_db__
        router.run()
      File "/usr/local/lib/python3.10/site-packages/peewee_migrate/router.py", line 201, in run
        diff = self.diff
      File "/usr/local/lib/python3.10/site-packages/peewee_migrate/router.py", line 75, in diff
        done = set(self.done)
      File "/usr/local/lib/python3.10/site-packages/peewee_migrate/router.py", line 70, in done
        return [mm.name for mm in self.model.select().order_by(self.model.id)]
      File "/usr/local/lib/python3.10/functools.py", line 981, in __get__
        val = self.func(instance)
      File "/usr/local/lib/python3.10/site-packages/peewee_migrate/router.py", line 59, in model
        MigrateHistory.create_table(True)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 6758, in create_table
        cls._schema.create_all(safe, **options)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 5861, in create_all
        self.create_table(safe, **table_options)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 5716, in create_table
        self.database.execute(self._create_table(safe=safe, **options))
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3190, in execute
        return self.execute_sql(sql, params, commit=commit)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3174, in execute_sql
        with __exception_wrapper__:
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 2950, in __exit__
        reraise(new_type, new_type(exc_value, *exc_args), traceback)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 191, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3175, in execute_sql
        cursor = self.cursor(commit)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3159, in cursor
        self.connect()
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3112, in connect
        with __exception_wrapper__:
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 2950, in __exit__
        reraise(new_type, new_type(exc_value, *exc_args), traceback)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 191, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3113, in connect
        self._state.set_connection(self._connect())
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3453, in _connect
        conn = sqlite3.connect(self.database, timeout=self._timeout,
    peewee.OperationalError: unable to open database file
    

    Any other information that may be helpful

    No response

    support config 
    opened by ssryan9 15
  • [Support]: Possible Config Issues/ No Detections Firing

    [Support]: Possible Config Issues/ No Detections Firing

    Describe the problem you are having

    I've setup a zone that crops my image down to this: Screen Shot 2022-06-08 at 10 32 21 PM

    In the config file you'll see the color variant I've setup (color_lower: 0, 0, 150, color_upper: 255, 130, 255)

    I've not seen any detections triggered. Do I have the color variant range setup correctly? I've triggered new snapshots that contain the same amount of color as the image above.

    Logs were sparse

    Version

    3.0.3

    Swatch config file

    objects:
      water_meter:
        color_variants:
          default:
            color_lower: 0, 0, 150
            color_upper: 255, 130, 255
        
    cameras:
      BB_Camera:
        snapshot_config:
            url: "http://HA/lastimage.jpeg"
        zones:
          full_view:
            coordinates: 225, 25, 360, 360
            objects:
              - water_meter
          water_needed:
            coordinates: 300, 300, 365, 360
            objects:
              - water_meter
    

    Relevant log output

    [2022-06-08 22:32:03,141]: INFO - Starting SwatchApp
    [2022-06-08 22:32:03,150]: INFO - Importing SwatchApp Config
    [2022-06-08 22:32:03,150]: INFO - Verified SwatchApp Config
    Starting migrations
    [2022-06-08 22:32:03,154]: INFO - Starting migrations
    There is nothing to migrate
    [2022-06-08 22:32:03,164]: INFO - There is nothing to migrate
    [2022-06-08 22:32:03,166]: INFO - Starting snapshot cleanup
    [2022-06-08 22:32:03,166]: INFO - Starting Detection Cleanup
    

    Any other information that may be helpful

    Thanks in advance - really excited about getting this across the finish line

    support config 
    opened by ssryan9 12
  • [Support]: Database error after updating to 2.2.0 as running a home assistant addon

    [Support]: Database error after updating to 2.2.0 as running a home assistant addon

    Describe the problem you are having

    Hi! Trying to test this, but just updated and now it wont start. Gives error related to database? I'm running inside home assistant and as a ad don. Wonder if it is related to that?

    Version

    2.2.0

    Swatch config file

    # REQUIRED: Define list of cameras that will be used for color detection.
    cameras:
      # REQUIRED: Name of the camera
      autokatos:
        # OPTIONAL: Frequency in seconds to run detection on the camera.
        # a value of 0 disables auto detection (Default: shown below).
        auto_detect: 10
        # OPTIONAL: Configure the url and retention of snapshots. (Default: Shown Below)
        snapshot_config:
            # OPTIONAL: but highly recommended, setting the default url for a snapshot to be
            # processed by this camera. This is required for auto detection (Default: none).
            url: "http://xxxx/cgi-bin/api.cgi?cmd=Snap&channel=6&rs=qwerty&user=xxxxx&password=xxxx"
            # OPTIONAL: Whether or not to save the snapshots of confirmed detections (Default: shown below).
            save_detections: true
            # OPTIONAL: Whether or not to save the snapshots of missed detections (Default: shown below).
            save_misses: true
            # OPTIONAL: Variations of snapshots to keep. Options are all, mask, crop (Default: shown below).
            mode: "all"
            # OPTIONAL: Number of days of snapshots to keep (Default: shown below).
            retain_days: 7
        # REQUIRED: Zones are cropped areas where the object can be expected to be.
        # This makes searching / matches for efficient and more predictable than searching
        # the entire image.
        zones:
          # REQUIRED: Name of the zone.
          vasenpuoli:
            # REQUIRED: Coordinates to crop the zone by.
            # NOTE: The order of the coordinates are: y, y+h, x, x+w starting in the top left corner as 0, 0.
            coordinates: 0,500,0,500
            # REQUIRED: List of objects that may be in this zone. These correspond to
            # the objects list defined previously and are matched by name.
            objects:
              - fiat
    # REQUIRED: Define a list of objects that are expected to be seen. These can be specific
    # to one camera or common between many / all cameras
    objects:
      # REQUIRED: Name of the object
      fiat:
        # REQUIRED: the list of color variants that this object can be detected as. Useful for
        # different lighting conditions
        color_variants:
          name_of_variant:
            color_lower: 6, 21, 79
            color_upper: 255, 132, 252
            # OPTIONAL: the time range for when this color variant is allowed
            # NOTE: make sure that /etc/localtime is passed to the container so it has valid time
            #time_range:
              # OPTIONAL: Color variant is valid if current time is > this 24H time (Default: shown below).
              #after: "00:00"
              # OPTIONAL: Color variant is valid if current time is < this 24H time (Default: shown below).
              #before: "24:00"
        # OPTIONAL: the min number of pixels with R, G, B values within the bounds to be
        # considered a true positive. This is recommended to be set as a super small amount
        # could be a false positive. (Default: shown below)
        #min_area: 1000
        # OPTIONAL: the max number of pixels with R, G, B values within the bounds to be
        # considered a true positive (Default: shown below).
        #max_area: 100000
    

    Relevant log output

    Starting SwatchApp
    Importing SwatchApp Config
    Verified SwatchApp Config
    Starting migrations
    There is nothing to migrate
    Exception in thread Thread-1 (run):
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3113, in connect
        self._state.set_connection(self._connect())
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3453, in _connect
        conn = sqlite3.connect(self.database, timeout=self._timeout,
    sqlite3.OperationalError: unable to open database file
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
        self.run()
      File "/usr/local/lib/python3.10/threading.py", line 946, in run
        self._target(*self._args, **self._kwargs)
      File "/usr/local/lib/python3.10/site-packages/playhouse/sqliteq.py", line 266, in run
        writer.run()
      File "/usr/local/lib/python3.10/site-packages/playhouse/sqliteq.py", line 128, in run
        conn = self.database.connection()
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3153, in connection
        self.connect()
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3112, in connect
        with __exception_wrapper__:
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 2950, in __exit__
        reraise(new_type, new_type(exc_value, *exc_args), traceback)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 191, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3113, in connect
        self._state.set_connection(self._connect())
      File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3453, in _connect
        conn = sqlite3.connect(self.database, timeout=self._timeout,
    peewee.OperationalError: unable to open database file
    Starting Auto Detection for autokatos
    Starting snapshot cleanup
    Starting Detection Cleanup
    

    Any other information that may be helpful

    No response

    support 
    opened by kinnujan 12
  • Can't install

    Can't install

    Describe the problem you are having

    I get the following error when I try to install Swatch. I initially tried to upgrade to 3.1, when that didn't work I tried to uninstall and reinstall swatch.

    Failed to install add-on
    Can't install crzynik/swatch:3.1.0: 404 Client Error for http+docker://localhost/v1.41/images/create?tag=3.1.0&fromImage=crzynik%2Fswatch&platform=linux%2Famd64: Not Found ("manifest for crzynik/swatch:3.1.0 not found: manifest unknown: manifest unknown")
    

    Updating home assistant doesn't help, restarting ha doesn't help. Restarting the machine doesn't help

    I'd love to know what's going on.

    Screenshot_20220708-203308_Home Assistant

    Version

    3.1

    Swatch config file

    objects:
      # REQUIRED: Name of the object
      tube_light:
        # REQUIRED: the list of color variants that this object can be detected as. Useful for
        # different lighting conditions
        color_variants:
          # REQUIRED: the name of the color variant
          default:
            # REQUIRED: the lower R, G, B values that are considered a potential match for the
            # color variant of the object.
            color_lower: 70, 70, 0
            # REQUIRED: the upper R, G, B values that are considered a potential match for the
            # color variant of the object.
            color_upper: 110, 100, 50
            # OPTIONAL: the time range for when this color variant is allowed
            # NOTE: make sure that /etc/localtime is passed to the container so it has valid time
            time_range:
              # OPTIONAL: Color variant is valid if current time is > this 24H time (Default: shown below).
              after: "00:00"
              # OPTIONAL: Color variant is valid if current time is < this 24H time (Default: shown below).
              before: "24:00"
        # OPTIONAL: the min area of the bounding box around groups of matching R, G, B pixels
        # considered a true positive. This is not recommended to be set as a super small amount
        # could be a false positive. (Default: shown below)
        min_area: 2
        # OPTIONAL: the max area of the bounding box around groups of pixels with R, G, B
        # values within the bounds to be considered a true positive (Default: shown below).
        max_area: 100000
        # OPTIONAL: the min ratio of width/height of bounding box for valid object detection (default: shown below).
        min_ratio: 0
         # OPTIONAL: the max ratio of width/height of bounding box for valid object detection (default: shown below).
        max_ratio: 24000000
        
    cameras:
      # REQUIRED: Name of the camera
      greatroom_cam:
        # OPTIONAL: Frequency in seconds to run detection on the camera.
        # a value of 0 disables auto detection (Default: shown below).
        auto_detect: 30
        # OPTIONAL: Configure the url and retention of snapshots. (Default: Shown Below)
        snapshot_config:
            # OPTIONAL: but highly recommended, setting the default url for a snapshot to be
            # processed by this camera. This is required for auto detection (Default: none).
            url: "http://192.168.0.5:5000/snapshot/dog-cam.jpg"
            # OPTIONAL: Whether or not to draw bounding boxes for confirmed objects in the snapshots (Default: shown below).
            bounding_box: true
            # OPTIONAL: Whether or not to save a clean png of the snapshot along with the annotated jpg (Default: shown below).
            clean_snapshot: true
            # OPTIONAL: Whether or not to save the snapshots of confirmed detections (Default: shown below).
            save_detections: true
            # OPTIONAL: Whether or not to save the snapshots of missed detections (Default: shown below).
            save_misses: false
            # OPTIONAL: Variations of snapshots to keep. Options are all, mask, crop (Default: shown below).
            mode: "all"
            # OPTIONAL: Number of days of snapshots to keep (Default: shown below).
            retain_days: 7
        # REQUIRED: Zones are cropped areas where the object can be expected to be.
        # This makes searching / matches for efficient and more predictable than searching
        # the entire image.
        zones:
          # REQUIRED: Name of the zone.
          livingroom:
            # REQUIRED: Coordinates to crop the zone by.
            # NOTE: The order of the coordinates are: x, y, x+w, y+h starting in the top left corner as 0, 0.
            coordinates: 1000, 0, 1200, 125
            # REQUIRED: List of objects that may be in this zone. These correspond to
            # the objects list defined previously and are matched by name.
            objects:
              - tube_light
    

    Relevant log output

    N/A
    

    Any other information that may be helpful

    No response

    support 
    opened by rcdemuth 11
  • Release 3.0.2 (#44)

    Release 3.0.2 (#44)

    • Do not include file name in creating db path

    • Add db tests

    • Use consts for env vars

    • Formatting

    • Only check if the path exists

    • Improve test

    • Format tests

    Fix for #43

    opened by NickM-27 0
  • Release 3.0.0 (#40)

    Release 3.0.0 (#40)

    • Set version for next release

    • Contours (#37)

    • Use contours to calculate bounding boxes

    • Fix bug

    • Add option to draw bounding boxes which is enabled by default

    • Add option to docs

    • Formatting

    • Only cleanup processes if started

    • Catch failure correctly

    • Supply correct image for object detection

    • Update version

    • Config options (#38)

    • Save bounding box on detection snapshot if enabled

    • Add option to save clean png as well.

    • Update config options

    • Formatting

    • Don't crash on bad end time

    • Update example images to show the new bounding boxes

    • Release cleanup (#39)

    • Cleanup logging templates

    • Use specific logger with name

    • Catch connection errors when saving snapshots

    • Fix file names and logging

    • Use better exceptions

    • Improve logging

    • Move color utils to own module

    • Use same mask image

    • Fix test image

    • Formatting

    • Cleanup errors and fix bugs

    • Disable animation between items

    opened by NickM-27 0
  • Image normalization to account for lighting conditions, by using a color reference zone

    Image normalization to account for lighting conditions, by using a color reference zone

    Is your feature request related to a problem? Please describe. No

    Describe the solution you'd like Would love the ability to set a color reference zone. For example, the side of the house, or the white trim around a window. Essentially, a region that should be used to modify the values to account for lighting conditions. When the reference zone is created, the colors in the zone would be averaged, stored permanently and used as a reference to determine lighting conditions for the image in future detections. Suggest a minimum of 25 pixels for this area. They could even just be individual pixels from parts of the image that won't be used for object detection.

    For example, if your reference zone averages to rgb(117, 128, 131) when created, it would be checked again before object detection is processed. If it now averages to rgb(129, 127, 122), each channel in the object detection zone would be multiplied by some constant to normalize the colors - in this case the constants would be rgb(0.907,1.008,1.074).

    Another thing to note is that colors should be normalized when saving the color variant for an object.

    Describe alternatives you've considered Maybe implementing this myself? But I'd need at least the ability to template the colors of variants and am not sure if that's possible without having to constantly reload the configuration.

    Additional context I literally haven't even implemented this integration yet 😃, so take this with a grain of salt. Just something I considered while reading the docs.

    pinned 
    opened by higbyk 1
Releases(3.1.0)
  • 3.1.0(Jun 14, 2022)

    3.1.0

    Min/Max Ratio Filter For Objects

    Set a filter based on the ratio of width/height to further filter out false positives (allow less strict color values)

    Full Changelog: https://github.com/NickM-27/swatch/compare/3.0.2...3.1.0

    Source code(tar.gz)
    Source code(zip)
  • 3.0.2(Jun 9, 2022)

    What's Changed

    • Release 3.0.2 (#44) by @NickM-27 in https://github.com/NickM-27/swatch/pull/45
    • Dev by @NickM-27 in https://github.com/NickM-27/swatch/pull/48

    Full Changelog: https://github.com/NickM-27/swatch/compare/3.0.1...3.0.2

    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Jun 1, 2022)

    Object Detection

    In 3.0.0 object detection has been re-written so instead of detecting objects based on total pixels within the color range, bounding boxes will be drawn on clusters of matching pixels and the area of the box will be tested.

    Snapshots

    Snapshots will now (by default) include the bounding boxes of the objects that have been detected. This can be disabled in the config if desired.

    Specific snapshots for events will also be included along with a clean png snapshot as well.

    3.0.1

    Fix bug where end time for detection would reset on restart

    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-beta1(May 29, 2022)

    3.0.0

    Object Detection

    In 3.0.0 object detection has been re-written so instead of detecting objects based on total pixels within the color range, bounding boxes will be drawn on clusters of matching pixels and the area of the box will be tested.

    Snapshots

    Snapshots will now (by default) include the bounding boxes of the objects that have been detected. This can be disabled in the config if desired.

    Specific snapshots for events will also be included along with a clean png snapshot as well.

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.3.0...3.0.0-beta1

    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(May 28, 2022)

    What's Changed

    • Optimize web UI by @NickM-27 in https://github.com/NickM-27/swatch/pull/36
    • Create db path if it does not currently exist

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.2.3...2.3.0

    Source code(tar.gz)
    Source code(zip)
  • 2.2.3(May 27, 2022)

    What's Changed

    • Logging instead of print statements by @NickM-27 in https://github.com/NickM-27/swatch/pull/35
    • Fix issues with db initialization

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.2.1...2.2.3

    Source code(tar.gz)
    Source code(zip)
  • 2.2.1(May 26, 2022)

    What's Changed

    • Add MEDIA_DIR env variable so hass addon can keep files in swatch specific folder @NickM-27 in https://github.com/NickM-27/swatch/pull/34

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.2.0...2.2.1

    Source code(tar.gz)
    Source code(zip)
  • 2.2.0-2(May 23, 2022)

    New Feature

    Swatch now keeps track of objects as they are detected inside a database. This will make it easier to have an "event log" of that object.

    Breaking

    A new /database/ path must be mapped to docker

    What's Changed

    • Bug fix by @NickM-27 in https://github.com/NickM-27/swatch/pull/27
    • Optimizations cleanup by @NickM-27 in https://github.com/NickM-27/swatch/pull/28
    • Db by @NickM-27 in https://github.com/NickM-27/swatch/pull/24
    • Db fixes by @NickM-27 in https://github.com/NickM-27/swatch/pull/31
    • Detections UI by @NickM-27 in https://github.com/NickM-27/swatch/pull/32

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.2.0...2.2.0-2

    Source code(tar.gz)
    Source code(zip)
  • 2.1.1(May 21, 2022)

    What's Changed

    • Config names by @NickM-27 in https://github.com/NickM-27/swatch/pull/26

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.1.0...2.1.1

    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(May 19, 2022)

    What's Changed

    • Url fixes by @NickM-27 in https://github.com/NickM-27/swatch/pull/22
    • UI optimizations by @NickM-27 in https://github.com/NickM-27/swatch/pull/23
    • Time limits for color variants by @NickM-27 in https://github.com/NickM-27/swatch/pull/25

    Full Changelog: https://github.com/NickM-27/swatch/compare/2.0.0...2.1.0

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(May 17, 2022)

    What's Changed

    Rewrote Frontend In Flutter:

    • Ability to view cameras and zones in dashboard • Ability to use camera_url to run color tests on an object and adjust values in real time.

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.5.0...2.0.0

    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(May 16, 2022)

    What's Changed

    New Web frontend

    • Add kotlin frontend by @NickM-27 in https://github.com/NickM-27/swatch/pull/20

    http://host:4500 will now display a hello world frontend and http://host:4500/api will continue to work as an API

    This is a huge step forward in getting closer to offering a frontend UI that allows easier management of color value and all kinds of other features in the future.

    Docs

    • Color setup docs by @NickM-27 in https://github.com/NickM-27/swatch/pull/18

    Fixes

    • Fix crashes when getting unexpected image data by @NickM-27 in https://github.com/NickM-27/swatch/pull/19

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.4.1...1.5.0

    Source code(tar.gz)
    Source code(zip)
  • 1.4.1(May 13, 2022)

    What's Changed

    BREAKING

    • BREAKING: Automatically cleanup snapshots by @NickM-27 in https://github.com/NickM-27/swatch/pull/17

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.3.0...1.4.1

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(May 13, 2022)

    What's Changed

    BREAKING

    • BREAKING: Automatically cleanup snapshots by @NickM-27 in https://github.com/NickM-27/swatch/pull/17

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.3.0...1.4.0

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(May 13, 2022)

    What's Changed

    • Ability to have cameras auto detect by @NickM-27 in https://github.com/NickM-27/swatch/pull/16
    • Add mypy to build checks by @NickM-27 in https://github.com/NickM-27/swatch/pull/14
    • Add enhancement label to feature request by @NickM-27 in https://github.com/NickM-27/swatch/pull/15

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.2.1...1.3.0

    Source code(tar.gz)
    Source code(zip)
  • 1.2.1(May 10, 2022)

    What's Changed

    • Add direct config support for multiple color variants by @NickM-27 in https://github.com/NickM-27/swatch/pull/12
    • Optimize color variants by @NickM-27 in https://github.com/NickM-27/swatch/pull/13

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.2.0...1.2.1

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(May 10, 2022)

    What's Changed

    • Add direct config support for multiple color variants by @NickM-27 in https://github.com/NickM-27/swatch/pull/12

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.1.0...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(May 10, 2022)

    What's Changed

    • Results are stored so they can be accessed by service independently by @NickM-27 in https://github.com/NickM-27/swatch/pull/10

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.0.2...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Apr 21, 2022)

    What's Changed

    • Image processor by @NickM-27 in https://github.com/NickM-27/swatch/pull/9

    Full Changelog: https://github.com/NickM-27/swatch/compare/1.0.1...1.0.2

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Apr 8, 2022)

Owner
Nicolas Mowen
Senior Android Developer @ ADT - I am a passionate App Developer who loves contributing, smart home automation, learning new things, and problem solving!
Nicolas Mowen
Face Mask Detection with Tensorflow(Flutter)Face Mask Detection with Tensorflow(Flutter)

Face Mask Detection with Tensorflow(Flutter) Face Mask Detection With TFlite Info An app made with flutter and tensor flow lite for face mask detectio

Mohsen Mirdar 1 May 23, 2022
Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and live camera.

Face Mask Detector App Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and li

Yousef Shaban 3 Aug 15, 2022
Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance reports for you.

ozzie.flutter Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance r

Jorge Coca 40 Nov 3, 2022
SeizeYourSpace - An App to capture details about folks interested in joining Publicis Sapient. Especially useful at events!

photo_job A simple app to take in candidate applications at a Conference Booth. This simplifies the work for a recruiter and eliminates the paper work

Pavan Podila 4 Jul 11, 2022
Mobile secure keyboard to prevent KeyLogger attack and screen capture.

Mobile secure keyboard to prevent KeyLogger attack and screen capture. Screenshots Alphanumeric Numeric Getting started To use this plugin, add flutte

null 20 Dec 22, 2022
Safe is an open source mobile platorm to discretely capture incidents with ease, powered by an SMCE written in native Swift and Kotlin.

Safe A powerful tool for personal and community safety. joinsafe.me » Available for iOS & Android ~ Links will be added once a release is available. ~

Safe 10 Oct 26, 2022
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022
ThemeX is an easy theme manipulation. Only inform primary color and the ThemeX generate all color combination palette for you

ThemeX is an easy theme manipulation basied on Material Design. Only inform primary color and the ThemeX generate all color combination palette for yo

Michael S. Lopes 2 Jan 31, 2022
Color picker for Flutter, based on the Google Docs color picker.

Material ColorPicker Color picker for Flutter, based on the Google Docs color picker. Getting Started You can embed into your material app or use it o

Razvan Lung 103 Oct 30, 2022
A Fluter tabview that text color can change with animation and bg color change with animation

float_tab A Fluter tabview that text color can change with animation and bg color change with animation Getting Started This project is a starting poi

ventureli 1 Dec 8, 2021
Material color picker, you can customize colors. Selection in two step, first main color and after shades.

Flutter Material Color Picker Material Color picker is a Flutter widget, that can be customizable. By default, it's Material Colors, but you can defin

Jean-Charles Moussé 70 Nov 25, 2022
A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

flutter_statusbarcolor A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically. Getting Starte

Zero 201 Nov 10, 2022
Color matching game - A Crossplatform Color Matching Game made with Flutter

color_matching_game A Color Matching Game built with Flutter. It is a simple app made without adding a plug-in. Play by specifying the red, green and

Yusuke Ishimi 6 Nov 21, 2022
A colorful TabBar Flutter library with color animating indicator where each tab has a color. (inspired by SmartNews app)

Flutter Colorful TabBar A colorful TabBar for Flutter where each tab has a color (inspired by SmartNews app). Getting Started Add this to your package

null 8 Jun 17, 2022
null 0 Feb 2, 2022
meg4cyberc4t 11 Oct 24, 2022
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

image_editor The version of readme pub and github may be inconsistent, please refer to github. Use native(objc,kotlin) code to handle image data, it i

FlutterCandies 317 Jan 3, 2023
In this repo you will see how to pick images from the image library and also, see how to store the selected images on Firebase.

flutterimageapp Flutter Tutorial - Upload Images using Firebase Storage. Flutter Tutorial - Upload Images using Firebase Storage Video series can be w

Whatsupcoders 60 Nov 4, 2022
camilo velandia 69 Dec 30, 2022