Dogs have dichromatic vision, with cones that discern blue and yellow. We can think of a dog’s vision as shades of blue, yellow, gray, and brown. They don’t perceive the differences between shades of red and green, somewhat like human beings who experience red-green color blindness.
The Ishihara test is a color vision test designed to screen for red-green color deficiencies. It’s likely the one you think of when you picture a color vision test. The test uses images called Ishihara plates. Each depicts a solid disk made of randomly sized dots, some of which are random similar shades of green, others random similar shades of red. Within the pattern, dots of the same color outline or form a number or shape that is clearly visible to those with normal color vision, and invisible, or hard to see, to those with a red–green color vision defect.
(From Wikipedia: Ishihara test and Dog anatomy - Vision)
Armed with this knowledge, and some visually pleasing circle packing techniques (Generating visually pleasing circle packs - Mathematica StackExchange), we can make an Ishihara Plate representing a bone. In other words: A color vision test for dogs (see the image above, or the Ishihara Plate code below).
The Ishihara test is a color vision test designed to screen for red-green color deficiencies. It’s likely the one you think of when you picture a color vision test. The test uses images called Ishihara plates. Each depicts a solid disk made of randomly sized dots, some of which are random similar shades of green, others random similar shades of red. Within the pattern, dots of the same color outline or form a number or shape that is clearly visible to those with normal color vision, and invisible, or hard to see, to those with a red–green color vision defect.
(From Wikipedia: Ishihara test and Dog anatomy - Vision)
Armed with this knowledge, and some visually pleasing circle packing techniques (Generating visually pleasing circle packs - Mathematica StackExchange), we can make an Ishihara Plate representing a bone. In other words: A color vision test for dogs (see the image above, or the Ishihara Plate code below).
So how do dog see this image? We can use the CanineVision function from the Wolfram Function Repository to find out:
In[]:=
Out[]=
Better yet, we can animate smoothly between the dog and human views by interpolating between them like so, and exporting the result as a GIF loop:
ExportFileNameJoin[{NotebookDirectory[],"humanToDogVisionLoop.gif"}],&@TableBlend
,
,x,{x,0,1,.05},"DisplayDurations"
1
12
Ishihara Plate Code:
Ishihara Plate Code:
In[]:=
ShowModule{(*Params:*)n=1000,reg=#1,minRad=5,maxRad=100,padding=2.5,colors=#2,nSamplePoints(*=4000*),samples=40000,iterations=20,maxTries=500,(*Localvars:*)regBoundary,regSamplePoints,centers={},radii={},(*Localfunctions:*)distanceToDiscs,viableRad,nextDisk},(*Computetheregionboundary:*)regBoundary=RegionBoundary[reg];(*Pre-sampletheregionwithMax[n,nSamplePoints]roughlyequallyspacedpoints.Thissavescomputationtime:*)nSamplePoints=4n;regSamplePoints=;(*Defineafunctiontogetthedistancesfromapointtoexistingdisksspecifiedbyalistofcentersandradii:*)distanceToDiscs=;(*Defineafunctiontogetthecandidateradiusforanewdiskbasedonisposition:*)viableRad=&;(*Defineafunctiontoattempttofitanewdiskintheregion:*)nextDisk=&;(*Filltheenclosingregionwithdisks:*)(*Notethatit'spossibletogetfewerdisksthanrequested:*)Most[First[Last[Reap[Module[{latestDisk},Until[FailureQ[latestDisk],latestDisk=Sow@nextDisk[]]]]]]]//Graphics[Thread[{RandomChoice[colors,Length[#]],#}]]&&@@@ThreadImageMeshColorNegate,ImageMesh*Image[DiskMatrix[{550,550}]],{{,,},{,,}},ImageSize->687//Rasterize
Out[]=
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
How do dogs see colors? Exploring canine vision with Ishihara color blindness tests
by Phileas Dazeley-Gaist
Wolfram Community, STAFF PICKS, September 18, 2024
https://community.wolfram.com/groups/-/m/t/3276647
by Phileas Dazeley-Gaist
Wolfram Community, STAFF PICKS, September 18, 2024
https://community.wolfram.com/groups/-/m/t/3276647