Imitation of Visual Illusions Via Opencv and Cnn

Imitation of Visual Illusions Via Opencv and Cnn

January 16, 2009 14:39 02257 International Journal of Bifurcation and Chaos, Vol. 18, No. 12 (2008) 3551–3609 c World Scientific Publishing Company IMITATION OF VISUAL ILLUSIONS VIA OPENCV AND CNN MAKOTO ITOH Department of Information and Communication Engineering, Fukuoka Institute of Technology, Fukuoka 811-0295, Japan LEON O. CHUA Department of Electrical Engineering and Computer Sciences, University of California, Berkeley, Berkeley, CA 94720, USA Received February 26, 2008; Revised April 20, 2008 Visual illusion is the fallacious perception of reality or some actually existing object. In this paper, we imitate the mechanism of Ehrenstein illusion, neon color spreading illusion, water- color illusion, Kanizsa illusion, shifted edges illusion, and hybrid image illusion using the Open Source Computer Vision Library (OpenCV). We also imitate these illusions using Cellular Neu- ral Networks (CNNs). These imitations suggest that some illusions are processed by high-level brain functions. We next apply the morphological gradient operation to anomalous motion illu- sions. The processed images are classified into two kinds of images, which correspond to the central drift illusion and the peripheral drift illusion, respectively. It demonstrates that the con- trast of the colors plays an important role in the anomalous motion illusion. We also imitate the anomalous motion illusions using both OpenCV and CNN. These imitations suggest that some visual illusions may be processed by the illusory movement of animations. Keywords: Visual illusion; OpenCV; CNN; programming function; template; equilibrium state; nonlinear operator; Hough transform; morphological gradient; thresholding; edge detection; watershed segmentation; optical flow; animation; Ehrenstein illusion; neon color spreading illu- sion; watercolor illusion; Kanizsa illusion; Fraser illusion; shifted edges illusion; hybrid image illusion; central drift illusion; peripheral drift illusion. 1. Introduction into seeing. The study of illusory colors demon- Human visual systems see something that is not strates that color processing in the brain occurs present, or incorrectly see what is present. The hand in hand with processing of other properties; information gathered by the eye is processed by such as, shape and boundary. Recently, great atten- the brain to give a percept that does not tally tion has been drawn to anomalous motion illusion with a physical measurement of the stimulus [Kitaoka, 2007], which is characterized by illusory source. Visual illusion1 is defined as the falla- motion in a stationary image. In some anoma- cious perception of reality or some actually exist- lous motion illusions, color enhances the illusion, ing object. Illusory colors [Werner et al., 2007] namely, it gives a much stronger illusion. Research are defined as the colors that the brain is tricked on visual illusion can provide fundamental insights 1 For more details of visual illusions, see “optical illusion,” Wikipedia: The Free Encyclopedia. 3551 January 16, 2009 14:39 02257 3552 M. Itoh & L. O. Chua into the general brain mechanisms of perception and watercolor illusion, Kanizsa illusion, shifted edges cognition. illusion [Kitaoka, 2007], and hybrid image illusion Cellular Neural Network (CNN) [Chua, 1998; [Oliva et al., 2006] using OpenCV programming Chua & Roska, 2002] is a dynamic nonlinear system functions. We also imitate them by using CNN tem- defined by coupling only identical simple dynamical plates with the help of OpenCV, thereby allowing systems, called cells, located within a prescribed us to simulate many visual illusions by equilibrium sphere of influence, such as nearest neighbors. states of CNNs. Our imitations via OpenCV and Because of its simplicity, and ease for chip (hard- CNN suggest that some color illusions are processed ware) implementation, CNN has found numerous by high-level brain functions. We next apply mor- applications in Image and Video Signal Processing, phological gradient operation to anomalous motion Robotic and Biological Visions, and Higher Brain illusions. The processed output images are classi- Functions.Itisawell-knownfactthatformany fied into two kinds of images. One is a pale or brainlike computations, the CNN universal chip a single colored image and the other is a bright [Chua, 1998; Chua & Roska, 2002] is far superior colored image. They seem to emulate the type of to any equivalent DSP implementation by at least illusion which occurs in the central vision (central three orders of magnitude in either speed, power drift illusion [Kitaoka, 2007]), and in the peripheral or area. The CNN has the ability to mimic high vision (peripheral drift illusion [Kitaoka, 2007]), level brain functions. Many well-known visual illu- respectively. This suggests that color contrast plays sions have been simulated by CNN image process- an important role in anomalous motion illusion. ing [Chua, 1998; Chua & Roska, 2002; Itoh & Chua, Finally, we imitate anomalous motion illusions, and 2007]. glare effect illusion, by using the OpenCV’s optical Open Source Computer Vision Library flow and the shift motion CNN templates. These (OpenCV)2 is a library of programming functions imitations suggest that some visual illusions may be originally developed by Intel and optimized for their processed by the illusory movement of animations. processors. This library is mainly aimed at real-time image processing (computer vision), and includes a 2. OpenCV Functions collection of algorithms and sample code for various OpenCV is a collection of programming functions computer vision problems. OpenCV’s application that implement some popular image processing and areas include Human-Computer Interaction; Object computer vision algorithms developed by Intel and Identification, Segmentation and Recognition; Face optimized for their processors. We introduce the Recognition; Gesture Recognition; Motion Tracking, basic definition of Hough Transform, morpholog- Ego Motion, Motion Understanding; Structure from ical gradient, thresholding, Canny edge detector, Motion; and Mobile Robotics. The OpenCV is not and optical flow,intheOpenCV reference manual. designed as a neural network, but it has the Machine These functions are basically nonlinear operators, Learning Library, which includes feedforward arti- and they are used to imitate visual illusions. ficial neural networks, more particularly, multilayer perceptrons. 2.1. The difference between OpenCV and CNNs is Hough transform described as follows: The image processing of CNNs Hough Transform3 is a popular method for extract- is dynamic, however, that of the OpenCV is static, ing geometric primitives from raster images.4 The since the CNN is defined by a system of differen- simplest version of the algorithm just detects lines, tial equations, and the OpenCV is usually defined but it is easily generalized to find more complex by nonlinear or linear functions. If we integrate features. To illustrate the idea, let us start with OpenCV into CNN image processing, we can use a straight line (Fig. 1). In the image space, the both dynamic and static properties. straight line can be described as y = mx + n and is In this paper, we imitate the mechanism of plotted for each pair of values (x, y). However, the Ehrenstein illusion, neon color spreading illusion, characteristics of that straight line is not x or y, 2 Open Source Computer Vision Library: http://www.intel.com/technology/computing/opencv/ 3 For more information, see “Hough transform,” in the OpenCV Reference Manual or Wikipedia. 4 A raster image, also called a bitmap, is a way to represent digital images. The raster image takes a wide variety of formats, including the familiar gif, jpg, and bmp. January 16, 2009 14:39 02257 Imitation of Visual Illusions via OpenCV and CNN 3553 Fig. 1. Hough transform. The points a, b and c are transformed into the blue, green and red lines on the (r, θ)-plane, respectively. The black point where the lines intersect gives a distance and angle. but its slope m and intercept n. Based on that fact, location (in the Hough space) where they cross cor- the straight line y = mx + n can be represented as responds to lines (in the original image space) that apoint(n, m) in the parameter space (n versus m pass through both points. More generally, a set of graph.) points that form a straight line will produce sinu- Using slope-intercept parameters could make soids which cross at the parameters for that line. application complicated since both parameters are Thus, the problem of detecting colinear points can unbounded: As lines get more and more vertical, be converted to the problem of finding concurrent the magnitudes of m and n grow toward infinity. curves (Fig. 1). For computational purposes, it is better to param- Consider next the integration kernel eterize the lines in the Hough transform with two · · − other parameters, commonly called r and θ.The h(x, y, r, θ)=I(x, y)δ[x cos θ + y sin θ r], (4) parameter r represents the distance between the where I is the image magnitude in pattern space line and the origin, while θ is the angle of the vec- and δ is the Dirac delta function that is normally tor from the origin to this closest point. Using this integrated into a sinusoidal string of accumulator parameterization, the equation of the line can be bins. Typically, I is binary valued taking on unit written as: value at points on image lines. An accumulator bin cos θ r thus receives a unit count where singularities appear y = − x + , (1) sin θ sin θ in h. The Hough transformation is nonlinear,since the integration kernel (4) can be written as which can be recast into 2 2 1 r = x · cos θ + y · sin θ. (2) h(x, y, r, θ)=I(x, y)δ (x + y ) 2 −1 y It is therefore possible to associate to each line of ×cos θ − tan − r , (5) an image, a couple of real numbers (r, θ)whichare x unique if θ ∈ [0,π]andr ∈ R,orifθ ∈ [0, 2π]and which shows the nonlinear affect of (x, y)on(r, θ). r>0. The (r, θ)-plane is sometimes referred to as Practically, the Hough transform algorithm Hough space.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    60 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us