720 likes | 809 Views
Machine Vision lecture 1. Thomas Moeslund Computer Vision and Media Technology lab. Aalborg University tbm@cvmt.dk. Pose estimation Pick and place applications Bin-picking. Classification Quality control. THOR. Machine vision applications. HOF. THOR. Conveyor belt.
E N D
Machine Visionlecture 1 Thomas Moeslund Computer Vision and Media Technology lab. Aalborg University tbm@cvmt.dk
Pose estimation Pick and place applications Bin-picking Classification Quality control THOR Machine vision applications HOF THOR Conveyor belt
Machine Vision class • Purpose: • Provide an overview of the different elements in a machine vision system
Machine Vision class • Topics • Acquisition of images: • Light, camera, lens • Representation of digital images: • pixels, colors • Processing of images • filtering, segmentation • Analysis of images: • feature extraction, pattern recognition • Your interests and needs?
Plan for today • Where does an image come from? • Image definitions • Camera types • Image formation • Lens • Creating light for machine vision • ( other applications )
Where does an image come from? Charged coupled device CCD-chip
Where does an image come from? Under exposed • Integration over time • Exposure time/shutter time • DK: lukketid • Maximum charge • Saturation • Blooming Correct exposed Over exposed
Where does an image come from? • Image elements, picture elements, pels, pixels
Origin x f(x,y) y Digital Image Representation • Image is seen as a discrete function f(x,y) as opposed to a continuous function • x and y cannot take on any value!
Origin f(0,0) x x f(x,y) f(2,6) y y Discrete image coordinate system
Digital Image Representation • Pixel representation (bits) • One bit: {0,1} • One byte = eight bits • One pixel: one byte = eight bits = one number: [0,255] • Grey-scale, intensity, black/white: 8 bits = [0,255] • Binary image: 1 bit {0,1}. Black and white: visualized as: 8 bit {0,255} ( colors: Another lecture ) • Video: 25 – 60 images per second. • Framerate: 25Hz – 60Hz • For example: 500 x 500 pixel at 50Hz => 1.25x107 bytes per second!!!!
ROI Digital Image Representation Width • An image f(x,y) is represented as an Array • Width = number of pixels in x-direction • Height = number of pixels in y-direction • Size (width x height, width > height) • ROI = region of interest • To reduce the amount of data Height
Spatial Image Resolution: • Resolution • The size of an area in a scene that is represented by one pixel in the image • Different Resolutions are possible (256x256….16x16) • Lower resolution leads to data reduction!
Gray-level Resolution: Quantization • Different gray-level resolutions: 256, 128, …, 2 • Less gray-levels leads to data reduction. • For 256, 128, 64 gray-levels: Difference hardly visible
Sensor Chip Formats Number of Pixels from 500x500 to 5000x5000 Pixel size from 4m x 4 m to 16 m x 16 m
The lens • A lens focuses a bundle of rays to one point • Parallel rays pass through a focal point at a distance F beyond • the plane of the lens. F is the focal length • Ois the optical center • F and O span the optical axis
Focus and depth-of-field • Depth-of-field (DK: dybteskarphed) • Distance range in which the blur does not exceed a certain value
Depth-of-field Aperture (DK: blænde) • More aperture => better depth-of-field • Downside: less light enters => decrease exposure time => • risk of blur due to motion
Field-of-view • Field-of-view depends on size of chip and focal length • ”Fisheye” lens => small focal length and large field-of-view
Levels of Natural Light [Burke]
Lighting • ”In machine vision lighting is more than 50%” • Use controlled lighting! • Avoid direct/indirect sunlight • Build a housing covering the field-of-view of the camera • Avoid highlights
Illumination Setups Directed illumination Diffuse illumination Rear illumination Light field illumination
Spherical Marker • Viewpoint invariant • High reflectance in illumination direction
Infrared Illumination • Fast segmentation by adaptive threshold • Robust Visually Opaque IR pass filter
Exercises (1/3) • Given a 512 x 512 x 8bit image. How many different images can be made? • Given a 512 x 512 x 8bit image. How is the memory size reduced when you: • Decrease the grayscale resolution repeatedly by 2 • Decrease the x-size and y-size of the image repeatedly by 2 • What do you want to learn in this class?
Exercises (2/3) • Describe the following concepts and provide examples of their usages: • Classification, Quality control, Pose estimation, Bin-picking • What is a CCD-chip and how does it operate? • What is Depth-of-field (DK:dybteskarphed)? • Pros and cons of back-lighting?
Exercises (3/3) • Show that the following is true for a thin lens: • Mick is 2m tall and standing 5m from a camera. The camera’s focal length is 5mm. • At which distance from the lens is Mick in focus? • How tall (in mm) will Mick be on the CCD-chip? • How tall (in pixels) will Mick be on the CCD-chip? • The camera has a 1/2” CCD chip • The camera image has a size of: 480x640 pixels • What is field-of-view of the camera?
Working with images…. • Image manipulation • Simple operations, e.g., scale image • Image processing • Improve the image, e.g., remove noise • Image analysis • Analyze the image, e.g., find the person in the image • Machine vision • Industry, e.g., Quality control, Robot control • Computer vision • Everything: multiple cameras, video-processing, etc.
Image file types • image.jpg, image.tif, image.gif, image.png, image.ppm, …. • Raw: • No data is lost • Header + data (234 235 32 21…) • For example: image.pgm • The file can be viewed • Lossless compression: • No data is lost, but the file cannot be viewed • For example: image.gif • Lossy compression: • Better compression • Some data is lost (optimized from the HVS’ point of view) • The file cannot be viewed • For example: image.jpg
Image file types • Normally you don’t care about the file type • The application will take care of it for you: • For example: rotate • Application • image.x => raw • Rotate the raw image • Rotated raw => rotated_image.x • But to write your own programs from scratch the images need to be in the raw format (without a header).