This repo contains a script that allows us to find range of colors in images using openCV, and then convert them into geo vectors.

Overview

Vectorizing color range

This repo contains a script that allows us to find range of colors in images using openCV, and then convert them into geo vectors.

Install

git clone https://github.com/developmentseed/color_range_filter.git
cd color_range_filter/
docker-compose build

How to use it?

In order to use this script we need to find first the HSV , kernek and area values.

Execute the HSV color picker with the follow script

    python src/hsv_color_picker.py --image_file=data/141013-193791-19-st.png

Require: The images that we pass to the script should be named as {x}-{y}-{z}.png for tiles and {x}-{y}-{z}-st.png for super-tiles

Once the script is running, it will appear two windows, one of the image and the other for some other adjustments.

image

Where:

  • Area: To adjust the area of the color classification.

  • Eval color Range: This is for adjusting the range of color to take the HSV values.

  • Kernel: Describes how the pixels involved in the computation are combined in order to obtain the desired result.

  • Crop image range: In some cases we may need only the area to work on, the maximum - 20 value means take all the image to get the color classification.

  • In the image Window, click the area where you want to select: eg. 👇 , Finding grass:

image

  • Once you have the desire selection , press key e and it will export a geojson file at same path of the image, and then it can be loaded in Qgis or JOSM.

image

Runing the scrpit for large areas

For running in large area it is necessary to HSV, kernel and area values, it can be obtained from the console log in the previous step. E.g. The below values are for finding trees in urban areas.

    --hsv_lower=31,25,9 \
    --hsv_upper=131,125,189 \
    --area=2000,50000 \
    --kernel=2 \
  • Use the following values in the script 👇
docker run --rm -v ${PWD}:/mnt developmentseed/vector_color:v1 python src/range.py \
    --geojson_tiles_file=data/tiles.geojson \
    --output_folder=data/tiles/ \
    --url_map_service="https://tile.openstreetmap.org/{z}/{x}/{y}.png" \
    --hsv_lower=20,3,15 \
    --hsv_upper=75,145,191 \
    --area=2000,10000 \
    --kernel=2 \
    --tags=class=tree \
    --geojson_output=data/tree.geojson

Output 👇

2021-10-06 21 17 42_fixed

You might also like...
SceneCollisionNet This repo contains the code for "Object Rearrangement Using Learned Implicit Collision Functions", an ICRA 2021 paper. For more info

SceneCollisionNet This repo contains the code for "Object Rearrangement Using Learned Implicit Collision Functions", an ICRA 2021 paper. For more info

~1000 book pages + OpenCV + python = page regions identified as paragraphs, lines, images, captions, etc.
~1000 book pages + OpenCV + python = page regions identified as paragraphs, lines, images, captions, etc.

cosc428-structor I had an open-ended Computer Vision assignment to complete, and an out-of-copyright book that I wanted to turn into an ebook. Convent

Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.

hocr-tools About About the code Installation System-wide with pip System-wide from source virtualenv Available Programs hocr-check -- check the hOCR f

Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.

hocr-tools About About the code Installation System-wide with pip System-wide from source virtualenv Available Programs hocr-check -- check the hOCR f

Slice a single image into multiple pieces and create a dataset from them
Slice a single image into multiple pieces and create a dataset from them

OpenCV Image to Dataset Converter Slice a single image of Persian digits into mu

Select range and every time the screen changes, OCR is activated.

ASOCR(Auto Screen OCR) Select range and every time you press Space key, OCR is activated. 範囲を選ぶと、あなたがスペースキーを押すたびに、画面が変わる度にOCRが起動します。 usage1: simple OC

A python script based on opencv and paddleocr, which can automatically pick up tasks, make cookies, and receive rewards in the  Destiny 2 Dawning Oven
A python script based on opencv and paddleocr, which can automatically pick up tasks, make cookies, and receive rewards in the Destiny 2 Dawning Oven

A python script based on opencv and paddleocr, which can automatically pick up tasks, make cookies, and receive rewards in the Destiny 2 Dawning Oven

 MeshToGeotiff - A fast Python algorithm to convert a 3D mesh into a GeoTIFF
MeshToGeotiff - A fast Python algorithm to convert a 3D mesh into a GeoTIFF

MeshToGeotiff - A fast Python algorithm to convert a 3D mesh into a GeoTIFF Python class for converting (very fast) 3D Meshes/Surfaces to Raster DEMs

Automatically remove the mosaics in images and videos, or add mosaics to them.
Automatically remove the mosaics in images and videos, or add mosaics to them.

Automatically remove the mosaics in images and videos, or add mosaics to them.

Owner
Development Seed
Development Seed
Using Opencv ,based on Augmental Reality(AR) and will show the feature matching of image and then by finding its matching

Using Opencv ,this project is based on Augmental Reality(AR) and will show the feature matching of image and then by finding its matching ,it will just mask that image . This project ,if used in cctv then it will detect black listed people if mentioned properly with their images.

null 1 Feb 13, 2022
A Python script to capture images from multiple webcams at once and save them into your local machine

Capturing multiple images at once from Webcam Using OpenCV Capture multiple image by accessing the webcam of your system and save it to your machine.

Fazal ur Rehman 2 Apr 16, 2022
Opencv-image-filters - A camera to capture videos in real time by placing filters using Python with the help of the Tkinter and OpenCV libraries

Opencv-image-filters - A camera to capture videos in real time by placing filters using Python with the help of the Tkinter and OpenCV libraries

Sergio Díaz Fernández 1 Jan 13, 2022
This pyhton script converts a pdf to Image then using tesseract as OCR engine converts Image to Text

Script_Convertir_PDF_IMG_TXT Este script de pyhton convierte un pdf en Imagen luego utilizando tesseract como motor OCR convierte la Imagen a Texto. p

alebogado 1 Jan 27, 2022
This repository contains codes on how to handle mouse event using OpenCV

Handling-Mouse-Click-Events-Using-OpenCV This repository contains codes on how t

Happy  N. Monday 3 Feb 15, 2022
Turn images of tables into CSV data. Detect tables from images and run OCR on the cells.

Table of Contents Overview Requirements Demo Modules Overview This python package contains modules to help with finding and extracting tabular data fr

Eric Ihli 311 Dec 24, 2022
Program created with opencv that allows you to automatically count your repetitions on several fitness exercises.

Virtual partner of gym Description Program created with opencv that allows you to automatically count your repetitions on several fitness exercises li

null 1 Jan 4, 2022
Text Detection from images using OpenCV

EAST Detector for Text Detection OpenCV’s EAST(Efficient and Accurate Scene Text Detection ) text detector is a deep learning model, based on a novel

Abhishek Singh 88 Oct 20, 2022
A simple Security Camera created using Opencv in Python where images gets saved in realtime in your Dropbox account at every 5 seconds

Security Camera using Opencv & Dropbox This is a simple Security Camera created using Opencv in Python where images gets saved in realtime in your Dro

Arpit Rath 1 Jan 31, 2022
Basic functions manipulating images using the OpenCV library

OpenCV Basic functions manipulating images using the OpenCV library. Reading Ima

Shatha Siala 3 Feb 17, 2022