Color Tracking.

Slides:



Advertisements
Similar presentations
1 ECE 495 – Integrated System Design I Introduction to Image Processing ECE 495, Spring 2013.
Advertisements

Video Object Tracking and Replacement for Post TV Production LYU0303 Final Year Project Spring 2004.
Analysis of Tactile Map Reading Visual Team Peter Maricle, Raihan Masud, Kristy Thomas, Kyle Vessey and Fan Wang.
Simple Face Detection system Ali Arab Sharif university of tech. Fall 2012.
Image Processing IB Paper 8 – Part A Ognjen Arandjelović Ognjen Arandjelović
AlgirdasBeinaravičius Gediminas Mazrimas Salman Mosslem.
Color Image Processing
Autonomous Vehicle Pursuit of Target Through Optical Recognition Vision & Image Science Laboratory, Department of Electrical Engineering,Technion Daniel.
Aalborg University Copenhagen
Video Object Tracking and Replacement for Post TV Production LYU0303 Final Year Project Spring 2004.
1 Color Segmentation: Color Spaces and Illumination Mohan Sridharan University of Birmingham
Presented by: Doron Brot, Maimon Vanunu, Elia Tzirulnick Supervised by: Johanan Erez, Ina Krinsky, Dror Ouzana Vision & Image Science Laboratory, Department.
Color: Readings: Ch 6: color spaces color histograms color segmentation.
T.Sharon 1 Internet Resources Discovery (IRD) Introduction to MMIR.
1 5. Video Object Tracking and Processing To achieve augmented reality, computer generated graphics should be shown together with the live video In addition,
Smart Traveller with Visual Translator. What is Smart Traveller? Mobile Device which is convenience for a traveller to carry Mobile Device which is convenience.
A Novel 2D To 3D Image Technique Based On Object- Oriented Conversion.
Conference Room Laser Pointer System Preliminary Design Report Anna Goncharova Brent Hoover Alex Mendes.
L.
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
Machine Vision for Robots
Knowledge Systems Lab JN 9/10/2002 Computer Vision: Gesture Recognition from Images Joshua R. New Knowledge Systems Laboratory Jacksonville State University.
Image and Video Processing in MATLAB Partly based on slides by Dmitri Roduy.
Machine Vision Products that IMPACT your Bottom Line! Introducing KickStart!
L. Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV.
September 5, 2013Computer Vision Lecture 2: Digital Images 1 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis.
Algirdas Beinaravičius Gediminas Mazrimas Salman Mosslem.
Presented By: ROLL No IMTIAZ HUSSAIN048 M.EHSAN ULLAH012 MUHAMMAD IDREES027 HAFIZ ABU BAKKAR096(06)
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014.
Vision Geza Kovacs Maslab Colorspaces RGB: red, green, and blue components HSV: hue, saturation, and value Your color-detection code will be more.
Tutorial # 9 – Q#6.16 from textbook Nov. 21,
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 24, 2009.
Introduction to Computer Graphics
` Tracking the Eyes using a Webcam Presented by: Kwesi Ackon Kwesi Ackon Supervisor: Mr. J. Connan.
Autonomous Robots Vision © Manfred Huber 2014.
Zack Nemes By: Clemence Larroche. To track and follow a car as it travels along a path.
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
Intelligent Robotics Today: Vision & Time & Space Complexity.
SUREILLANCE IN THE DEPARTMENT THROUGH IMAGE PROCESSING F.Y.P. PRESENTATION BY AHMAD IJAZ & UFUK INCE SUPERVISOR: ASSOC. PROF. ERHAN INCE.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
EE368: Digital Image Processing Bernd Girod Leahy, p.1/15 Face Detection on Similar Color Images Scott Leahy EE368, Stanford University May 30, 2003.
Morphological Image Processing
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
EE368 Final Project Spring 2003
Cancer Metastases Classification in Histological Whole Slide Images
Color Image Processing
Color Image Processing
Tracking the eyes using a webcam
CSE 554 Lecture 1: Binary Pictures
Processing the image with Python
Digital Image Processing Homework 3
Color Image Processing
Colour Theory Fundamentals
Color: Readings: Ch 6: color spaces color histograms
Histogram—Representation of Color Feature in Image Processing Yang, Li
A. Vadivel, M. Mohan, Shamik Sural and A. K. Majumdar
Computer Vision Lecture 4: Color
הפקולטה להנדסת חשמל - המעבדה לבקרה ורובוטיקה גילוי תנועה ועקיבה אחר מספר מטרות מתמרנות הטכניון - מכון טכנולוגי לישראל TECHNION.
Content-Based Image Retrieval
Content-Based Image Retrieval
Color Image Processing
Capturing Light… in man and machine
Color Visualization in Matlab
Color Image Processing
CSSE463: Image Recognition Day 2
Introduction Computer vision is the analysis of digital images
CSSE463: Image Recognition Day 2
Image segmentation Grey scale image Binary image
Presentation transcript:

Color Tracking

A Quick Overview Color Representations Choosing a Color to Track How to Find the Target

RGB vs HSV RGB is very sensitive to brightness HSV (Hue, Saturation, Value) is less sensitive Color Space Visualizer: http://colorizer.org/

HSV Color Space Hue: expressed as a number from 0 to 179 Saturation: How "pure" the color is. The closer to 0, the more grey the color looks. Range 0-255 Value: (or Brightness) works in conjunction with saturation and describes the brightness or intensity of the color from 0 to 255. Color conversion: cv2.cvtColor(input_image, flag) Where flag determines the type of conversion. For BGR→Gray, flag is cv2.COLOR_BGR2GRAY For BGR→HSV, flag is cv2.COLOR_BGR2HSV Note: For HSV, Hue range is [0,179], Saturation range is [0,255] and Value range is [0,255]. You will have to experiment to find the right settings for your lab.

Convert to HSV, Find HSV values import cv2 import numpy as np cap = cv2.VideoCapture(0) while (1): # Take each frame _, frame = cap.read() # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) -------------------------------------------------------------------------------------------- #print out the HSV values for color green green = np.uint8([[[0,255,0 ]]]) hsv_green = cv2.cvtColor(green,cv2.COLOR_BGR2HSV) print hsv_green [[[ 60 255 255]]]

Choosing a Color Use a patch of pixels to determine target HS values rather than a single pixel.

# Program to use mouse to designate a rectangular # region on image import cv2 import numpy as np def mouseHandler(event,x,y,flags,param): global im_temp, pts_src if event == cv2.EVENT_LBUTTONDOWN: cv2.circle(im_temp,(x,y),3,(0,255,255),5,cv2.LINE_AA) cv2.imshow("image", im_temp) if len(pts_src) < 4: pts_src = np.append(pts_src,[(x,y)],axis=0) # Open webcam cap = cv2.VideoCapture(0) # Capture a frame ret, frame = cap.read() # Create a named window cv2.namedWindow("image",1) im_temp=frame pts_src= np.empty((0,2),dtype=np.int32) cv2.setMouseCallback("image",mouseHandler) cv2.imshow("image",im_temp) cv2.waitKey(0) cv2.destroyAllWindows print pts_src

Use Morphology to “clean up” image erode: The value of the output pixel is the minimum value of all the pixels in the input pixel's neighborhood dilate: The value of the output pixel is the maximum value of all the pixels in the input pixel's neighborhood Tutorial: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html

Connected-Component Labeling (a.k.a. Blob Extraction)

Finding the Target-Pseudocode def get_target(hsv_image): #get pixels within threshold of target patch masked_image = mask_image(hsv_image, h_thresh, s_thresh, v_thresh) #morphologically erode and dilate the image eroded_image = erosion_filter(masked_image) cleaned_image = dilate_filter(erodeed_image) #find the largest connected component (largest blob) big_blob = get_largest_blob(cleaned_image) # Compute centroid and area of big_blob to move the robot forward, back, left,, right centroid = get_centroid(big_blob) area = get_area(big_blob) return centroid, area

Center the Target Demo Video Demo2 Video Move Forward/Backward based on Target Area (i.e. distance to Target) Turn left/right to center the Target's Centroid. Amount to rotate a function of distance to target Demo Video Demo2 Video