{"id":186,"date":"2022-03-11T16:30:43","date_gmt":"2022-03-11T16:30:43","guid":{"rendered":"http:\/\/michaeltsmith.org.uk\/?p=186"},"modified":"2022-03-11T16:30:43","modified_gmt":"2022-03-11T16:30:43","slug":"bayer-filter","status":"publish","type":"post","link":"http:\/\/michaeltsmith.org.uk\/?p=186","title":{"rendered":"Bayer Filter"},"content":{"rendered":"\n<p>One issue I thought might be a problem is that the pixels on a camera don&#8217;t really each measure all 3 colours. Instead, they each measure one colour &amp; the colours are then interpolated. This isn&#8217;t a problem if the object being photographed spans many pixels, but what if the object is a tiny bright dot, as in our situation.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/3\/37\/Bayer_pattern_on_sensor.svg\/350px-Bayer_pattern_on_sensor.svg.png\" alt=\"\"\/><figcaption>An example Bayer filter (from <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bayer_filter\">wikipedia<\/a>)<\/figcaption><\/figure>\n\n\n\n<p>An example photo of &#8220;What the ladybird heard&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"576\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-4.png\" alt=\"\" class=\"wp-image-191\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-4.png 577w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-4-300x300.png 300w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-4-150x150.png 150w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-4-100x100.png 100w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><figcaption>Example photo of What the Ladybird Heard cover: The raw data from the camera. The yellow cover of the book doesn&#8217;t have much blue, so the blue pixels are darker.<\/figcaption><\/figure>\n\n\n\n<p>Sadly the problem of the filter seems to be impacting our bee-orientation\/id experiment. Here I rotate a tag 360:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"648\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-1.png\" alt=\"\" class=\"wp-image-188\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-1.png 666w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-1-300x292.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><figcaption>The in-focus result (notice the dot colours don&#8217;t smoothly transition)<br><\/figcaption><\/figure>\n\n\n\n<p>The result is less accurate predictions of orientation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"582\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-2.png\" alt=\"\" class=\"wp-image-189\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-2.png 625w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-2-300x279.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><figcaption>Points plotted on colour triangle (number = angle in degrees)<\/figcaption><\/figure>\n\n\n\n<p>If we adjust the focus of the lens so the tag isn&#8217;t in focus, the colours are more reliable:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1003\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-1024x1003.png\" alt=\"\" class=\"wp-image-187\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-1024x1003.png 1024w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-300x294.png 300w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-768x752.png 768w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image.png 1435w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><figcaption>Progression of tag colour as it rotates (in 14-16 a non-tag was found by mistake)<\/figcaption><\/figure>\n\n\n\n<p>This leads to a more reliable prediction:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-3.png\" alt=\"\" class=\"wp-image-190\" width=\"616\" height=\"587\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-3.png 616w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/image-3-300x286.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><figcaption>Points plotted on colour triangle (number = angle in degrees)<\/figcaption><\/figure>\n\n\n\n<p>I think the plan now is to:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Collect more data but download raw (without interpolation) &#8211; this also saves bandwidth from the camera.<\/li><li>Look at fitting the PSF using this raw data.<\/li><li>Maybe leave the camera just a little out of focus, to ensure all the colours are detected.<\/li><\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One issue I thought might be a problem is that the pixels on a camera don&#8217;t really each measure all 3 colours. Instead, they each measure one colour &amp; the colours are then interpolated. This isn&#8217;t a problem if the object being photographed spans many pixels, but what if the object is a tiny bright &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/michaeltsmith.org.uk\/?p=186\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Bayer Filter&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186"}],"version-history":[{"count":1,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":192,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions\/192"}],"wp:attachment":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}