{"id":174,"date":"2022-02-24T08:43:10","date_gmt":"2022-02-24T08:43:10","guid":{"rendered":"http:\/\/michaeltsmith.org.uk\/?p=174"},"modified":"2022-03-04T21:37:44","modified_gmt":"2022-03-04T21:37:44","slug":"orientation-from-colour-tag-continue","status":"publish","type":"post","link":"http:\/\/michaeltsmith.org.uk\/?p=174","title":{"rendered":"Orientation from Colour Tag (initial experiment)"},"content":{"rendered":"\n<p><em>This was an initial experiment I ran back in December, to see if this idea might work.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The problem of using polarising filters<\/h2>\n\n\n\n<p>So, one thing I&#8217;ve been thinking about is how to get the orientation from the polarising filters <strong>from a side view.<\/strong> From above it is easy (although the 180 degree symmetry needs resolving) one just uses two cameras (with 0 and 45 degree polarising filters on) and a flat polarising filter on the back of the bee. From the side it&#8217;s more awkward &#8211; with a ridge etc&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Colours<\/h2>\n\n\n\n<p>Anyway, I went back to my original idea of using colours. For this experiment I made a hexagonal &#8216;tube&#8217; &#8211; it&#8217;s a little large in this case (about 5mm across, when I think 3mm is probably the limit &#8211; I made a smaller one yesterday about 3mm across that also worked). I put inside the glass-bead style retroreflector and cover the ends of the tube (maybe needs strengthening using superglue).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"745\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img1tag-1024x745.jpg\" alt=\"tag.jpg\" class=\"wp-image-179\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img1tag-1024x745.jpg 1024w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img1tag-300x218.jpg 300w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img1tag-768x559.jpg 768w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img1tag.jpg 1488w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><figcaption>The 6 colours of the retroreflective tag.<\/figcaption><\/figure>\n\n\n\n<p>I then used a tracking system to take photos of the unit from 8m away (the longest straight line in my house :).<\/p>\n\n\n\n<p>I think maybe this isn&#8217;t as bright as it used to be: the colour camera isn&#8217;t quite as sensitive, the filters absorb some light, and the cylindrical shape rather than a ridge means it&#8217;s also a bit weaker [although works from all angles], and I used one flash instead of four&#8230; but anyway, here&#8217;s some of the photos to give an idea&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"732\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img2grid-1024x732.png\" alt=\"image.png\" class=\"wp-image-180\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img2grid-1024x732.png 1024w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img2grid-300x214.png 300w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img2grid-768x549.png 768w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img2grid.png 1150w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><figcaption>The titles are &#8220;angle [maxRed maxGreen maxBlue] [Max location]&#8221; Ideally I should fit a PSF to the dots taking into account the Bayer filter.<\/figcaption><\/figure>\n\n\n\n<p>To build it I picked 6 filters using their spectra provided by LEE filters, hoping I&#8217;d pick some that would lead to a path that doesn&#8217;t have overlaps. I also just picked filters that transmitted the most light. This could be improved I think &#8211; as you can see the dots aren&#8217;t in a neat circle\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"574\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img3triangle.png\" alt=\"image.png\" class=\"wp-image-181\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img3triangle.png 683w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img3triangle-300x252.png 300w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><figcaption>The location of the 6 filters on the colour triangle<\/figcaption><\/figure>\n\n\n\n<p>This on the same sort of triangle as above (although flipped and rotated, so the two axes represent normalised colour)&#8230; the numbers are roughly (+\/- 15) the angle of the tag. The tag was imaged in order (0,15,30&#8230;345,0,15&#8230;) and the lines join sequential measurements. Currently we are just using the average value for each colour in a square around the tag, but in future this could be improved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"575\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img4twirl.png\" alt=\"image.png\" class=\"wp-image-182\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img4twirl.png 601w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img4twirl-300x287.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><figcaption>The colours on the colour triangle (numbers are the angle of the tag)<\/figcaption><\/figure>\n\n\n\n<p>We can fit a Gaussian process (or other regressor to this)&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"590\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img5gp.png\" alt=\"image.png\" class=\"wp-image-183\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img5gp.png 612w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img5gp-300x289.png 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><figcaption>Contours numbers indicate predicted angle of tag. Dots are training data.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Cross Validation Results<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"262\" src=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img6xval.png\" alt=\"image.png\" class=\"wp-image-184\" srcset=\"http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img6xval.png 397w, http:\/\/michaeltsmith.org.uk\/wp-content\/uploads\/2022\/03\/img6xval-300x198.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><figcaption>Leave one out cross validation<\/figcaption><\/figure>\n\n\n\n<p>MAE = 31 degrees<br>RMSE = 48 degrees<br>(chance level is: MAE 90, RMSE 104).<\/p>\n\n\n\n<p>You can see that there&#8217;s two directions that seem to look similar (-30 &amp; 150 degrees) where it gets a bit confused. One can see why in the colour map plots (where the dots around 330ish and 150ish are a bit jumbled together &#8211; you might even be able to tell by eye looking at the initial photos in the second figure). <\/p>\n\n\n\n<p>Tweaking the choice of colours should help, also taking more close together training points, rather than asking it to interpolate over 15 degree steps.<br>Note also the actual angle of the tag was only accurate to +\/- 15 degrees.<br>Anyway &#8211; this colour-tag idea is another potential approach, instead of the polarising filters.<\/p>\n\n\n\n<p>I only spent a couple of hours or so getting this together, so hopefully I can make a lot of improvements on this in the new year.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This was an initial experiment I ran back in December, to see if this idea might work. The problem of using polarising filters So, one thing I&#8217;ve been thinking about is how to get the orientation from the polarising filters from a side view. From above it is easy (although the 180 degree symmetry needs &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/michaeltsmith.org.uk\/?p=174\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Orientation from Colour Tag (initial experiment)&#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-174","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/174","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=174"}],"version-history":[{"count":4,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":185,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions\/185"}],"wp:attachment":[{"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/michaeltsmith.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}