ScratchData LogoScratchData
Back to sly_i's profile

Scanner with some optimizations

SLsly_i•Created March 29, 2023
Scanner with some optimizations
11
8
148 views
View on Scratch

Instructions

Latest version: https://scratch.mit.edu/projects/919975360 Added some optimizations to improve scanning speed of @griffpatch's scanner Tap on picture to scan Griffpatch's reference scanner project: https://scratch.mit.edu/projects/827805681 Camera version on https://scratch.mit.edu/projects/915814045

Description

@Layzej/@geotale/@griffpatch did amazing advances in scanner logic it is difficult to get any improvements. Marginal perf increase about 40% from using last y lookup and combining scanpass 1,2 & 3 using a 405 (9 reds x 9 greens x 5 blues) colors1st list and then use check8 with ordered edge fallback on scanpass 2 and 3 @Geotale's binary tree search is so fast, you only can perform one extra color check before any extra logic slows the default BT search. The render method uses a branchless RLE data structure Lasty : 156k vs 205k color checks or 12s vs 14s :check8: 135k vs 205k color checks or 11s vs 14s :colors1st 101k vs 205k color checks or 7s vs 14s 20-Apr-2023: Added check7 to final ScanPass based on @chrome_cat suggestion for a good performance boost 5 May 2023: Scan 1 combined old scan 1,2 & 3 using 405 color list and added check8 for scan pass 2 & 3 Scan 2 require the full 64 color list/checks needs the 64 check 2300 times I experimented with 2 pass scan but checking 2601 rather than 405 color list, but slows the the initial scan too much on low speed devices.

Project Details

Project ID827802935
CreatedMarch 29, 2023
Last ModifiedJanuary 12, 2024
SharedApril 4, 2023
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root