-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathtaxonomy.qmd
More file actions
1443 lines (1181 loc) · 71.5 KB
/
Copy pathtaxonomy.qmd
File metadata and controls
1443 lines (1181 loc) · 71.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# The Challenge of Vision {#sec-challenge_of_vision}
## Introduction
Let's start with a simple observation: every day, when you wake up, you
open your eyes and see. You see without any effort; you do not get tired
after a few hours from seeing too much. The same happens with all the
other senses. With them you perceive the world around you: you hear the
birds or the car noises, you smell the breakfast and feel the touch of
the sheets, and that keeps going on and on until the end of the day. But
the most surprising fact is that your brain is continuously solving very
complex tasks still unmatched by any artificial system.
The apparent simplicity of perceiving the world around us produces the
false intuition that it will be easy to build a machine capable of
seeing as humans do. Let's ignore the senses of hearing, touch, taste,
and smell, and let's focus on the visual sense. Human vision is capable
of extracting information about the world around us using only the light
that reflects off surfaces in the direction of our eyes. The light that
reaches our eyes does not tell us what object we are looking at. It only
give us information about the amount of light reaching our eye from each
direction in space. Our brains have to translate the information
collected by millions of photoreceptors in our retinas into an
interpretation of the world in front of us. What we see is different
than the light that reaches our eyes, as visual illusions prove to us.
:::{.column-margin}
This book will focus on the visual sense.
Nonetheless, the techniques introduced aren't exclusive to images and
possess the versatility to be adapted for the processing of various
other signal types.
:::
Computer vision studies how to reproduce in a computer the ability to
see. Since its origins, the study of vision has been an
interdisciplinary study involving many disciplines (physics, psychology,
biology, neuroscience, arts, and computer science).
The goal of a vision scientist is twofold: to understand how perception
works and to build systems that can interpret the world around them
using images (or image sequences) as input. In this chapter, we want to
provide a broad perspective on **vision science** and the multiple
disciplines that contribute to it.
## Vision
David Marr @Marr82 defines vision as "to know what is where by looking,"
and adds "vision is the process of discovering from images what is
present in the world, and where it is."
It is difficult to say exactly what makes understanding the mechanisms
of vision hard as we do not have a full solution yet @Cavanagh96. In
this section we will mention two aspects that make vision hard: the
structure of the input and the structure of the desired output.
What is the goal of vision? Our eyes are sensors, and for an agent that
navigates and solves tasks in the world, the role of the sensor is to
provide relevant information for solving the task. In the case of
computer vision, we mostly study visual perception from a disembodied
perspective. There is no agent and there is no task. This perspective
makes the study of vision difficult.
### The Input: The Structure of Ambient Light
From a light source, a dense array of light rays emerges in all
directions. Before these light rays reach the eye, the light interacts
with the objects in the world. Let's consider a single ray emerging from
the light source (we will use here a simple geometric interpretation of
the structure of light). If the light ray is not directed toward the
eye, this ray will strike some surface in the world and, as result, a
new set of rays will be emitted in many directions. This process will
continue producing more and more interactions and filling the space. In
the middle of the space the observer will sense only a subset of the
light rays that will strike the eye. As a result of this complex pattern
of interactions even a single ray will form a complex image in the eye
of the observer.
@fig-lightRay shows some pictures taken when illuminating a complex
scene with a laser pointer that illuminate the scene with a narrow beam
of light (this is the best approximation to the image produced by a
single light ray that we could do at home).
{#fig-lightRay}
The resulting images show the complexity of the interactions between the
different surfaces. The sum of the contribution of all the light rays
emitted by the light source will give rise to a natural looking picture.
On each image, the approximate direction of the light beam produced by
pointer is indicated by the red arrow in @fig-lightRay (b-c).
Despite the complexity of the structure of the ambient light (a term
coined by James J. Gibson @Gibson1966) with multiple reflections,
shadows, and specular surfaces (which provide incorrect disparity
information to our two eyes), our visual system has no problem in
interacting with this scene, even if it is among the first things that
we see just after waking up.
The pattern of light filling the space can be described by the function:
$$P (\theta, \Phi, \lambda, t, X, Y, Z)$$ where $P$ is the light
intensity of a ray passing by the world location $(X,Y,Z)$ in the
direction given by the angle $(\theta, \Phi)$, and with wavelength
$\lambda$ at an instant in time $t$. This function,
called the **plenoptic function** Edward H. Adelson and James R. Bergen
@Adelson91, contains all the information needed to describe the complete
pattern of light rays that fills the space.
:::{.column-margin}
We will study color in chapter [Color](color.html)
:::
:::{.column-margin}
**Plenoptic function**: Edward H. Adelson was going
to call it the *holoscopic function*, but a well-known holographer told
him that he would punch him in the nose if he called it that.
:::
The plenoptic function does not include information about the observer.
The observer does not have access to the entire plenoptic function, only
to a small slice of it. In @sec-imaging we will describe how different mechanisms can
produce images by sampling the ambient light in different ways.
For a given observer, most of the light rays are occluded. Without
occlusion, vision would be a lot simpler. Occlusion is the best example
of how hard vision can get. Many times, properly interpreting an image
will require understanding what part is occluded (e.g., we know that a
person is not floating just because the legs are occluded behind a
table). Unfortunately, occlusions are common. In fact, there are more
occluded surfaces than visible surfaces for any given observer.
Although recovering the entire plenoptic function would have many
applications, fortunately, the goal of vision is not to recover this
function.
### The Output: Measuring Light Versus Measuring Scene Properties
Vision is not a deterministic process that analyzes the input images
independently of our internal state. Even when two people look at the
same thing they will have different **visual awareness**. Our visual
experience is greatly influenced by what we know, what we are doing, and
what we expect to see.
If the goal of vision were simply to measure the light intensity coming
from a particular direction of space (like a photometer) then things
would be easy. However, the goal of vision is to provide an
interpretation of the world in terms of "meaningful" surfaces, objects,
materials, etc., in order to extract all the different elements that
compose the scene (anything that will be relevant to the observer). This
problem is hard because most of the information is lost and the visual
system needs to make a number of assumptions about the structure of the
visual world in order to be able to recover the desired information from
a small sample of the plenoptic function. It is also hard because our
understanding about what is relevant for the observer is incomplete.
The goal of vision is not to measure light intensities, but to extract
scene properties relevant for the observer. @fig-measuringScene shows
different images that illustrate that the human visual system is trying
to recover the scenes that are the cause of those images.
{#fig-measuringScene
width="100%"}
In @fig-measuringScene (a), we see a red square occluding a smaller blue square. But why do we
see a blue square and not an L-shaped figure like the green shape on the
top? If we assume that squares are typical in the world and that
occlusions are common, then perceiving an occluded blue square is the
most natural interpretation of the scene. Even though the green figure
shows us that L-shaped figures are possible, we interpret the blue
L-shaped figure as an occluded square. The next image, @fig-measuringScene (b), shows the
"turning tables illusion" by Roger Shepard @Shepard90. In this illusion,
both table tops have the same shape and size but one is rotated with
respect to the other. The visual system insists in interpreting these
objects as 3D objects giving the impression that the left table is
longer than the table of the right. And this perception can not be shut
down even if we know exactly how this image has been generated. The
third example, @fig-measuringScene (c), shows the "checkershadow illusion" by Adelson
@adelson1995checkershadow. In this figure, the squares marked with A and
B have the exact same intensity values. But the visual system is trying
to measure the surface reflectance of the squares, removing the effect
of the shadow to infer the true gray value of each square. As a result,
the square in the shadow is perceived as being lighter than the square
outside the shadow region, even though both have the same gray levels.
:::{.column-margin}
When looking at a two-dimensional (2D) picture, we automatically interpret it as a 3D scene if the right cues are present.
:::
The goal of vision is to provide the observer with information relevant
to understanding the outside world and to enable them to solve other
tasks such as navigating the world, interacting with other agents, and
finding food. Tasks within computer vision include the following:
detecting changes in the environment; motion estimation; object
recognition and localization; recognizing materials; reading text and
visual symbols; building 3D models from images; finding free space to
move; finding other people; deciding if food is in good state; and
understanding the behavior of animals. Not all of those tasks are at the
same level. Some seem to require a lot of external knowledge while
others seem solvable from the images alone.
## Theories of Vision
In this section we want to describe, with a few strokes, some of the
theories of vision that have contributed to and shaped modern
approaches. Think of this section as a travel brochure that will show
you a few snapshots of a trip, but that's not intended to be a
replacement for traveling yourself. You should read the books and papers
that we will mention in this section, as they are the foundations on
which this fascinating field has been built.
### The Origins of the Science of Perception
How do we know what is in the world by looking at it? Understanding how
an image of the world is getting into our minds has a long history that
required contributions from many scientific disciplines (art,
philosophy, physics, optics, biology, psychology, neuroscience, etc.).
Ancient humans probably knew that their image of the world originated in
the eyes. It just takes closing your eyes or putting one hand in front
of one eye to see the corresponding image disappear. In fact,
chimpanzees and orangutans might also know that the eyes are the source
of visual stimuli as they seem to do **eye-gaze following** to
understand what their companions are paying attention to. Humans learned
to create astonishing images in caves with a degree of realism that
indicates an understanding of colors, forms, shadows, and motion. They
did not think that in order to create an image of a bison on the wall of
the cave the only option was to attach a dead bison to the wall. They
knew that a dynamic scene could be represented by static painting.
Paintings are a potent visual illusion that show that the image of the
object does not need the object itself.
:::{.column-margin}
If you have never read the works of the Greek
philosophers, please do. You will be astounded by how much they knew
about math and physics even though they lacked devices to confirm many
of their hypothesis.
:::
How is information about the world being picked
up by our eyes? The Greeks had two competing theories: intromission
theories and extramission (or emission) theories.
Early **intromission** theories (425 BC) believed that objects emitted
copies of themselves (eidola or simulacra) that entered the eyes. This
theory was defended by philosophers such as Demokritos, Epicurus, and
Lucretius. However, it was unclear how objects could be sending copies
when there were multiple observers, and how the copies did not interfere
with each other. It was also unclear how copies of large objects could
fit into the eye.
**Extramission** theory, started with Empedocles @kalderon2015form and
was later followed by Plato and Euclid among others. Empedocles (approx.
494--434 BC) provided one the first theories of vision in his poem "On
Nature", and introduced many other influential ideas such that all
things are composed or four elements: fire, earth, air, and water. He
said that the eye contained the four elements and that the fire was
responsible of creating **rays** that emanated from the eyes, like
fingers that sensed the world. The extramission theory explained why
sometimes eyes shined at night, in particular cat's eyes, which were
assumed to contain so much fire that even humans could see it
occasionally. Of course, now we know that the when cats' eyes appear to
shine, they are reflecting light from other sources, but without a
theory of light and reflection it made sense to believe that one was
observing rays emitted by the eyes.
::: {.column-margin}

:::
Plato's theory of vision (427--347 BC) was very influential. Plato's
theory contained both intromission and extramission elements. The
following is a fragment of Plato's dialog @Plato360bc, which provides a
description of how the flow produced by the internal fire in the eyes
interacts with the external fire to produce sight:
> And of the organs they first contrived the eyes to give light, and the
> principle according to which they were inserted was as follows: So
> much of fire as would not burn, but gave a gentle light, they formed
> into a substance akin to the light of every-day life; and the pure
> fire which is within us and related thereto they made to flow through
> the eyes in a stream smooth and dense, compressing the whole eye, and
> especially the centre part, so that it kept out everything of a
> coarser nature, and allowed to pass only this pure element. When the
> light of day surrounds the stream of vision, then like falls upon
> like, and they coalesce, and one body is formed by natural affinity in
> the line of vision, wherever the light that falls from within meets
> with an external object. And the whole stream of vision, being
> similarly affected in virtue of similarity, diffuses the motions of
> what it touches or what touches it over the whole body, until they
> reach the soul, causing that perception which we call sight. But when
> night comes on and the external and kindred fire departs, then the
> stream of vision is cut off; for going forth to an unlike element it
> is changed and extinguished, being no longer of one nature with the
> surrounding atmosphere which is now deprived of fire: and so the eye
> no longer sees, and we feel disposed to sleep.
Plato considered the sense of vision as being worse than touch because
vision could only sense the part that was facing the observer.
Therefore, according to Plato, one could not trust the sense of vision.
However, Aristotle (384--322 BC), Plato's student, was critical of the
extramission theory and pointed out that the stars were too far away for
rays from the eyes to reach them (an argument also used by Euclid).
Aristotle went further and suggested that only some objects are light
sources (e.g., fire) and the other objects reflect the rays that hit the
eyes @Aristotle350bc. He also criticized the belief that the eye had
fire inside. Instead, Aristotle defended the idea that the element of
perception had to be water as vision needed a transparent element.
Euclid (325 BC), a Greek mathematician, provided the first mathematical
theory of vision, giving a mathematical description of how the emitted
rays by the eye traveled on **straight lines** and formed a cone that
reached the scene.
::: {.column-margin}

:::
He listed the following seven axioms of light, extracted from
@Burton1945:
> 1. Let it be assumed that lines draw directly from the eye pass
> through a space of great extent;
>
> 2. and that the form of the space included within our vision is a
> cone, with its apex in the eye and its base at the limits of our
> vision;
>
> 3. and that those things upon which vision falls are seen, and that
> those things upon which vision does not fall are not seen;
>
> 4. and that those things seen within a larger angle appear larger,
> and that those seen within a smaller angle appear smaller, and
> those seen within equal angles appear to be of the same size;
>
> 5. and that things seen within the higher visual range appear higher,
> while those within the lower range appear lower;
>
> 6. and, similarly, that those seen within the visual range on the
> right appear on the right, while those within that on the left
> appear on the left;
>
> 7. but that things seen within several angles appear to be more
> clear.
Starting from those axioms, in his paper "Optics" @Burton1945, Euclid
describes many different ways to use geometric reasoning to measure the
size of objects in the world using the properties of light and vision.
One example of the application of his theory is shown in @fig-euclid. The
description of the figure in the original text reads as follows: "To
know how great is a given elevation (AB) when the sun is shining. Let
the eye be D, and let GA be a ray of the sun falling upon the end of
line AB, and let it be prolonged as far as the eye D. And let DB be the
shadow of AB. And let there be a second line, EZ, meeting the ray, but
not at all illuminated by it below the end of line at Z. So, into the
triangle ABD has been fitted a second triangle, EZD. Thus, as DE is to
ZE, so is DB to AB. But the ratio of ED to ZE is known. Moreover, DB is
known; so, AB is also known" @Burton1945.
{#fig-euclid width="60%"}
:::{.column-margin}
Euclid's work set the basis of **perspective**, and
his discoveries influenced thinkers and artists in the following
centuries.
:::
Many other Greek philosophers and mathematicians contributed to a deeper
understanding of light. Hero of Alexandria (10-70), in the work
**Catoptrica**, postulated that light propagated in straight lines and
also described an early version of the **law of reflection**: light will
follow the shortest path between two points, which means that the angle
of incidence is the same as the angle of departure. Ptolemy described
how light changed direction (i.e., **refraction**) when changing medium
(e.g., from air to water). Few other discoveries about vision between
the first and tenth centuries survive.
:::{.column-margin}
Credit
assignment is unclear. For instance, early versions of the law of
reflection are credited to Heron, Ptolemy, Archimedes, Plato, and was
potentially known to others before @10.2307/225870.
:::
In the late tenth century Hasan Ibn al-Haytham's work transformed the
initial Greek theories into a true scientific discipline, inspiring many
of the works that followed, even through Johannes Kepler. Ibn al-Haytham
(965--1040 AD), known as Alhacen in the Latin world, published the
@2001alhacen between the years 1028 and 1038. This book is considered by
many the beginning of the scientific method. In his Book of Optics, Ibn
al-Haytham describes how light rays bounce of objects in all directions
and that the rays only become visible when they reach the eye
perpendicularly. He described the pinhole camera and invented the
**camera obscura**.
{#fig-Alhacen
width="60%"}
Ibn al-Haytham rejected the extramission theory. He argued that sight
could be explained by the light rays emitted by objects and that it was
not necessary to assume that the eye emitted rays. Ibn al-Haytham's work
built upon the work of Ptolemy, Euclid, Galen, and Aristotle, although
little is known about the exact sources of inspiration as manuscripts at
that time did not include citations to previous work and it was rare
when other scientists were cited by name. Ptolemy believed that distance
between the eye and an object could be measured by feeling the length of
a ray of light (thus requiring a single eye), while Ibn al-Haytham
showed experimentally that both eyes were needed to perceive depth
@2001alhacen.
Kepler (1604 AD), building on Alhacen's work, provided the first
complete description of how images are formed in the retina in
@Martens2001-MAROPT-2. Kepler understood **lenses** and how the eye
projected a reverse picture into the retina. Kepler understood the role
of the crystalline lens as the focusing element of images in the eye, in
contrast with previous theories that believed that the crystalline lens
was the sensitive element selecting only the perpendicular rays that
reached the eye.
### Helmholtz: Perception as Inference
Hermann von Helmholtz (1821--1894) was a German scientist and
philosopher. While he wanted to study physics, he trained as a physician
at the urging of his father @Shapin2019, then went on to make important
contributions in philosophy, physics, audition, color theory, and visual
perception.
With Thomas Young, he codeveloped the theory of **trichromacy**, that
the eye has three classes of receptors, each sensitive to different
wavelengths of light.
:::{.column-margin}
{width=120}
:::
He measured the speed of transmission of nerves (24.6--38.4 m/s
@wikiHelmholtz2021, previously thought to be unmeasurably fast
@Shapin2019). He also developed the ophthalmascope, shown in @fig-helmholtz, an
instrument to observe the retina of the human eye. The key of the
ophthalmascope was to see the need for colinear viewing and illumination
directions. @fig-helmholtz shows a schematic illustration of
Helmholtz's opthalmoscope, viewed from above. The glass plates along the
diagonal, labeled $a$ in the figure, allow for viewing the eye under
study by the opthalmologist while reflecting illumination from a light
source into the eye. @fig-helmholtz shows a drawing by Helmholtz of an
image from the ophthalmoscope, showing blood vessels (in background) and
branches of the retinal artery and vein over the optic nerve (center).
{#fig-helmholtz}
Helmholtz was also an important theorist in visual perception. He wrote @Helmholtz62,
> The general rule determining the ideas of vision that are formed
> whenever an impression is made on the eye, is that *such objects are
> always imagined as being present in the field of vision as would have
> to be there in order to produce the same impression on the nervous
> mechanism, the eyes being used under ordinary normal conditions*.
Thus, the mind makes perceptions out of sensations @Shapin2019, finding
representations of the object most likely to explain the sensory input
@Wandell95. This viewpoint relates to **Bayesian methods** for computer
vision inference.
In his introduction, "Concerning the Perceptions in General," he
continued @Helmholtz62:
> Still, it may be permissible to speak of the psychic acts of ordinary
> perception as *unconscious conclusions*, thereby making a distinction
> of some sort between them and the common so-called conscious
> conclusions.
He added that when an astronomer computes the position of stars in
space, based on observations, this is a conscious conclusion. When you
press on the eye and see light, that is an unconscious conclusion about
what is in the world, given the responses of your eye. This unconscious
inference is the topic of computer vision.
Helmholtz emphasized the active role of the viewer in perception
@Helmholtz62,
> If the objects had simply been passed in review before our eyes by
> some foreign force without our being able to do anything about them,
> probably we should never have found our way about amid such an optical
> phantasmagoria \... But when we notice that we can get various images
> of a table in front of us simply by changing our position; and that we
> can sometimes have one view and sometimes another, just as we like at
> any time \... Thus by our movements we find out that it is the
> stationary form of the table in space which is the cause of the
> changing image in our eyes.
This foreshadows some unsupervised learning methods common in computer
vision today.
### Gestalt Psychology and Perceptual Organization
Gestalt psychology started around 1912, with the publication of
"Experimental Studies of the Perception of Movement" by Max Wertheimer
@wertheimer1912experimentelle. In this paper Wertheimer introduced the
**phi phenomenon**, a visual illusion that consists in presenting two
images with a vertical bar at different locations in rapid succession
giving the impression that there is continuous motion between them
@steinman2000phi.
:::{.column-margin}
Frame 1

Frame 2

:::
Wertheimer, together with Kurt Koffka and Wolfgang Köhler,
postulated that perceived motion was a new phenomenon that is not
present in the individual stimuli (the two flashing frames) and that
what we perceive is the whole event as a single unit (continuous
motion). Gestalt psychology extended this interpretation to explain many
other visual phenomena and emerged as a reaction of the existing trend
that said that for psychology to be a science it had to decompose
stimuli into its constituent elements. Gestalt theory argued that
perception is about wholes more than it is about parts.
Wertheimer introduced the problem of **perceptual organization**.
Perceptual organization studies how our visual system organizes
individual visual features (i.e., colors, lines, \...) into coherent
objects and wholes. Wertheimer proposed a set of rules used by the
visual system to organize elements on a simple display. He showed sets
of dots and lines disposed in different arrangements, as shown in @fig-gestalt, to
find out when those elements were grouped together into larger elements.
{#fig-gestalt width="100%"}
Gestalt psychologists called **grouping laws** the visual cues they
uncovered. However, they are not strictly laws and not all grouping cues
are equally strong. Some of the most important laws are as follows:
- Law of **proximity**: Items that are nearby are more likely to group
together. From @fig-gestalt, we can see that groupings a-b, c-d, e-f, and g-h
are stronger than b-c, d-e, and f-g. With some effort one can group
the items according to the second arrangement, but it is hard to
sustain that grouping perceptually. The law of proximity is affected
by the similarity of the items.
- Law of **similarity**: Elements that have similar features (color,
size, orientation) also group together, even when they are all
equally distant.
- Law of **closure**: We are very familiar with the fact that when a
line forms a closed figure, we do not simply see a line, we see a
shape. The example shown in @fig-gestalt shows how closure wins over proximity.
The vertical lines are closer for the grouping a-b. However, we
group them as b-c, d-e, and f-g.
- Law of **good continuation**: Edges are likely to be smooth. Lines
that follow each other pointing in the same direction are likely to
be grouped together. For instance, an X-shape is perceived as two
lines that cross each other instead of perceiving it as a V-shape on
top of an inverted V.
- Laws of **parallelism**, and **symmetry**: There are many other
grouping cues with different strengths that induce clustering
between visual elements.
- **Common fate**: Motion is a very important grouping cue. When two
elements have a common motion (accelerations, direction, rate of
change) they tend to group together.
- **Past experience**: Items grouped in the past are more likely to be
perceived as a group in the future.
:::{.column-margin}
Law of good continuation. The following shape:

has two possible groupings:

The law of good continuation says that the one on the left is
the one an observer perceives (although we just see an X and not two lines crossing each other...)
:::
In complex displays, one will expect that multiple of these grouping
cues will be present. Gestalt theory not did quantitatively address how
grouping cues will balance each other when they were in conflict.
Stephen Palmer @Palmer94 measured the strength of these grouping cues
and introduced new ones.
Gestalists also studied the problem of **lightness perception**.
:::{.column-margin}
**Lightness** is a perceptual quantity that is
influenced by both the perceived reflectance and the perceived
illumination of a surface @Adelson99.
:::
For a wonderful book on
lightness perception, we refer the reader to @gilchrist2006, and the
work of Edward Adelson @Adelson99. Adelson defines lightness as "the
visual system's attempt to extract reflectance based on the luminances
in the scene."
Gestalt psychologists said that the perception of lightness on an image
patch is a function of the context. One has to take into account the
grouping laws (perceptual organization) in order to explain the
perceived lightness on a display. Koffka @Koffka1935 introduced the
**Koffka ring**, a beautiful illusion to illustrate the power of
perceptual grouping to explain lightness perception (@fig-koffka_ring).
:::{.column-margin}
Kurt Koffka, born in Berlin in 1886, published his \booktitle{Principles of Gestalt Psychology} in 1935, after moving to the USA in 1924.
:::
{#fig-koffka_ring
width="100%"}
In each display, the two sides of the ring have the same gray level.
Depending on the spatial configuration of the two sides, their
lightnesses appear very different. In @fig-koffka_ring (a) the ring appears as solid gray. In @fig-koffka_ring (b)
splitting the figure into two halves by an interleaving white space
makes the two sides of the ring look different. @fig-koffka_ring (c) shows
a variant of the Koffka ring proposed by Adelson @Adelson99 where the
grouping cues create a stronger effect. One can conclude from this
experiment that lightness perception is not a local process and that it
involves considering the context and the principles of grouping.
Another striking proof of the importance of perceptual organization is
the visual phenomenon of **amodal completion**. As discussed in the
introduction, in @fig-measuringScene (a) we see a red square on top of a blue square. Even
though the blue square is occluded by the red square, we see it as a
square. The green geometric figure is identical to the blue one but the
gap breaks the illusion of occlusion and we do not perceive it as a
square anymore. This phenomenon of perceiving a whole object when only a
part is visible is called **amodal completion**. The word *amodal* means
that we have perception without using any direct perceptual modality.
Amodal completion is something we do all the time when we explore a
scene. Most of the objects that we see are partially occluded and we use
amodal completion to extend the object behind the occlusion.
**Modal completion** is a related visual phenomenon that happens when we
see an induced object appear in front of others. @fig-kanizsa shows
several examples of modal and amodal completion. A beautiful visual
illusion that illustrates modal completion is the **Kanizsa triangle**,
shown in @fig-kanizsa (d). In this case, we see a triangle that is not really there.
{#fig-kanizsa
width="100%"}
The Kanizsa triangle shows both amodal and modal completion. The circles
are seen by amodal completion and the triangle appears as modal
completion. Modal completion produces **illusory contours** to appear in
the image. Some observers report that the triangle on top is brighter
than the surrounding background and that illusory contours appear at the
triangle sides.
:::{.column-margin}
Gaetano Kanizsa @kanizsa79 studied how perceptual
organization could be used to see what is not there.
:::
Perceptual organization remains an intriguing and rich area of research
with many visual mechanisms still poorly understood. The list of
principles of perceptual organization discovered by the gestalt theory
have impacted a lot of modern research in computer vision, in particular
in the domain of **image segmentation** @Malik90.
### Gibson's Ecological Approach to Visual Perception
While previous theories of perception considered that the simplest
scenario to study vision was assuming a static camera taking a snapshot
in a controlled lab setting, James J. Gibson postulated that, to
understand vision, one should take an **ecological approach to visual
perception** @Gibson1979. The study of the eye should be done in the
context of the body that supports it and the world it lives in.
Experimental science based in simple visual stimuli allowed for
measuring quantities, reporting results, and reproducing findings, but
the simple stimuli were very limiting. Dealing with real-world stimuli
is messy, and no one had good theories on how to use them
experimentally. Gibson argued that, to understand perception, the
experimental lab should be like real life. Many of the displays used by
gestalt psychologists were too simple and unlikely to occur in the real
world. They provide useful knowledge, but fall short of unraveling the
true nature of the visual system.
The environment should be studied by means of ecological properties, and
not by using physical laws. That is, by understanding what quantities
and processes of the environment are relevant for the observer. An
ecological description of the environment describes it in terms of
medium (air or water), substances (rocks, metal, wood, etc.), and
surfaces (which separate medium from substances), together with the
notions of change and persistence. Gibson considers those concepts more
relevant to the study of perception than the notions of space, matter,
and time, which have their origin in classical physics but have little
relevance for the observer. The dominant role of the observer in
Gibson's theory is illustrated in how the environment is understood:
water is substance for terrestrial animals, and it is the medium for
aquatic animals. The **ground plane** is the most important surface for
terrestrial animals, it is the center of their perception and behavior.
The ground provides the support for action and a reference for
perception. Other notions of ecological importance are the concepts of
*layout*, *place*, and *enclosure*.
:::{.column-margin}
Drawing by Gibson
showing how few lines induce a strong 3D percept of a ground plane.\
{width="30%"}
:::
Gibson also made a distinction between the light studied by optical
physics and the one that is relevant for perception, which he called
**ecological optics**. According to Gibson, physicists are interested in
studying light in simplified settings such as the light emitted by point
sources that send rays into an infinite space, or that interact with
surfaces or lenses once. Ecological optics instead studies the light
that converges into the observer, which is the result of countless
interactions with all the surfaces in a messy environment. The **ambient
optic array** is the set of light rays that converge into a point of
observation. And this point of observation can be occupied by an
observer who will move around the world. This moving ambient optic array
will contain information about the environment and also about the
observer themself @fig-gibson_bird.
{#fig-gibson_bird
width="70%"}
Another key concept in Gibson's theory is the notion of **affordance**
introduced by Gibson in 1966 @Gibson1966. A *path* affords locomotion
from one point to another, an *obstacle* affords collision, and a
*stairway* affords both descent and ascent. An *object* is a substance
enclosed by a surface. The affordance of an object is generally a direct
consequence of its properties: a hollow object can contain substances, a
detached object affords carrying, an object with a sharp edge affords
cutting, and so on. Animate objects are controlled by internal forces,
and they afford social interaction.
Gibson's theory of visual perception postulates that the ambient optic
array is very rich and contains all the information needed to perceive
the environment. **Direct perception** is the process of **information
pickup** directly from the ambient array. This is in contrast with other
theories of visual perception that assume that the input stimuli is very impoverished and that perception is
**indirect** as it has to be complemented by additional processes. The
indirect theory of perception is the most common one. However, the
important message to learn here is that, when building a perceptual
system, the richer the input is, one might hope that the solution to the
perception problem will be simpler.
:::{.column-margin}
Gibson did not like the term **stimuli** because it
implied that the environment stimulates the observer. For Gibson, it is
important to stress that the observer is only picking up
information.
:::
### The Neural Mechanisms of Visual Perception
Neuroscience has greatly contributed to our understanding of how vision
works and has inspired a large number of computer vision approaches:
red-green-blue (RGB) encoding of images, filter based image
representations, neural networks, and attention modulation. Studies on
the neural mechanisms of visual perception had a lasting impact. In this
section will only review some of the many discoveries made over many
centuries trying to explain how the brain works. One premise in the
computational neuroscience community is that one can understand how
vision works by reverse engineering how the brain solves the task.
For a long time it was known that the brain was the center of reason,
but the mechanisms and anatomy of the brain were not well understood. In
fact, researchers believed that the brain was not composed of
individualized cells as the rest of the body. It was in 1890 that
Santiago Ramón y Cajal, using Golgi's stain, isolated individual
neurons and proved that the brain is composed by **networks of
interconnected cells** as shown in his work on the anatomy of the retina
@cajal1893retine. This was the first time that networks were observed.
Ramón y Cajal then mapped most of the brain and his drawings are still a
reference. Both Santiago Ramón y Cajal and Camillo Golgi received the
Nobel prize in 1906 @Glickstein2006.
:::{.column-margin}
Santiago
Ramón y Cajal was born in 1852 in Navarra, Spain.
:::
{#fig-cajal width="100%"}
The drawing of the retina (@fig-cajal) shows the first layers of neurons that
process the visual input. The retina is an amazing piece of the brain
that transforms light into impulses. Light is first transformed into
electric signal by the photoreceptors (rods and cones) and is then
processed by a few layers formed by several types of neurons (amacrine,
bipolar, and ganglion cells). Finally, ganglion cells transmit the
output of the retina through the optic nerve to the rest of the brain.
The studies of Ramón y Cajal revealed the circuitry of many parts of the
brain but told us little about their functional behavior or how the
circuits were processing information.
The **retina** was one of the first visual structures that was studied
from a functional perspective. Haldan Keffer Hartline @Hartline1938, in
1938, using an innovative method to record the response of single optic
nerve fibers (which corresponds to the axons of ganglion cells), studied
retinal ganglion cells and popularized the concept of **receptive
field**, previously introduced by Charles Scott Sherrington
@Sherrington1906 in 1906 when studying the tactile domain.
:::{.column-margin}
A review of how the concept of **receptive field**
evolved can be found in @Spillmann2014ReceptiveFO.
:::
The receptive field of a neuron corresponds to the region of the input
stimulus space (the retina in the case of a visual neuron) that has to
be stimulated in order to produce a response in the neuron. Most neurons
in the visual processing stream are activated only when light shines on
a precise portion of the retina.
:::{.column-margin}
Only stimulation within the **receptive field** (RF)
of a neuron produces a response.\
{width="40%""}
:::
Steven Kuffler (1953) studied the organization of the retina and showed
that ganglion cells have concentric receptive fields with a circular
**center-surround organization** @Kuffler1953. He did this by shining a
small spot of light on different parts of the retina and recording the
response of a ganglion cell as he changed the location of the spot of
light. First Hartline, and then Kuffler, showed that there were two
types of ganglion cells; a first group of cells, called **on-center**,
would get activated when the spot of light was inside a small region in
the middle of the receptive field and would get deactivated (firing
bellow their average rate) when the spot light was projected inside a
ring around the center. A second group had the opposite behavior, called
**off-center**. These results are fascinating because they reveal that
the retina seems to be performing some sort of contrast enhancing
operation (as we will discuss in other chapters) and their work
motivated a large number of studies in **computational neuroscience**
and **neuromorphic engineering** @Mead89 that tried to reproduce the
operations made in the retina. Haldan Keffer Hartline received the Nobel
Prize in 1967 for his discoveries on how the eye processes visual
information.
The axons of ganglion cells from both eyes projects to another structure
called the **lateral geniculate nucleus** (LGN). The LGN is composed of
six layers of neurons and its output goes to the visual cortex and other
visual areas. This structure receives inputs from both eyes but the
signals are not mixed and the neurons in this area remain monocular. LGN
neurons have concentric (center-surround) receptive fields. The role of
the LGN is not completely understood but it may be involved in temporal
decorrelation, attention modulation and saccadic suppression.
Interestingly, only 5 percent of the input connections come from the
retina while 95 percent of the LGN inputs are **feedback connections**
from the primary visual cortex and other areas.
Concentric receptive fields are very common in the early layers of
visual processing, but things become more interesting when studying
cells in the **visual cortex**. One challenge was that the techniques
used to record the responses of cells in the optic nerve could not be
applied to record the activity of cells in the cortex.
@fig-receptivefields shows some of the receptive fields found in the
LGN. When a cell with an **ON-center Receptive Field (RF)** is
illuminated with a small spot of light projected on the inner part of
the RF, the firing rate increases, as shown in @fig-receptivefields (a). The gray rectangle
under the graph represents the duration of the stimulation. When the
outer part of the RF is stimulated there is an inhibition of the cells
response. @fig-receptivefields (a) shows an **OFF-center RF**.
{#fig-receptivefields
width="100%"}
Between 1955 and 1958, David H. Hubel invented a microelectrode that
allowed him to record the activity of individual cells in the cortex. He
then went to work with Torsten N. Wiesel in Kuffler's lab. They used
Hubel's technique to record the response of cells in the visual cortex
of cats; this work resulted in them receiving the Nobel prize in 1981.
In 1959, Hubel and Wiesel published the study that marked the beginning
in understanding how visual information is processed in the brain
@HubelWiesel59. They studied 45 neurons for a period of two to nine
hours from the striate cortex on an anesthetized cat. They exposed each
neuron to a diverse set of visual stimuli containing spots of various
sizes and locations, and **oriented bars**. For most of the neurons they
could locate a region of the retina that produced a firing of the neuron
when stimulated with light. However, not all types of visual stimuli
were effective in driving neurons at the cortical level.
Hubel and Wiesel discovered that some neurons in the visual cortex were
best stimulated by an oriented bar at an specific orientation when it
appeared at the center of the neuron's receptive field. They found
different types of cells in the primary visual cortex, some that were
similar to those found in the retina and LGN (center-surround), others
selective to oriented bars, and more complex ones. They classified each
cell according to its attributes: spatial selectivity, orientation
preference, eye preference (left or right), and the type (simple,
complex, or hypercomplex).
@fig-receptivefields (c) shows an **oriented simple cell**, while @fig-receptivefields (d) shows
another type of simple oriented cell found in the visual cortex. An
oriented cell shows increased firing rate when stimulated with an
oriented bar in the positive region of the RF with the preferred
orientation.
@fig-visual_pathways shows a schematic of the visual pathways from the
retina up to the primary visual cortex.The first visual area in the
visual cortex is called **V1**. It is a sheet of neurons is arranged
along several layers as shown in @fig-visual_pathways. Hubel and Wiesel found that neurons
in V1 are organized along **columns**. When probing with an electrode,
as the electrode went from the surface to the bottom of V1, all the
cells found were selective to the same orientation. When moving the
electrode along one horizontal direction, they found that the preferred
orientation changed smoothly (orientation columns), and when moving the
electrode along the perpendicular horizontal direction, the cells
changed the eye preference, alternating between the two eyes with some
binocular cells between them (ocular dominance columns). A section of
around 1 $\times$ 3 mm (called a **hypercolumn**) covers all
orientations and both eyes for a small portion of the visual field.
Margaret Livingston, in collaboration with David Hubel, discovered color
sensitive neurons @Livingstone1984AnatomyAP organized in blobs
surrounded by orientation-sensitive neurons in the visual cortex.