Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

25
LINES

< > BotCompany Repo | #1032247 // IntegralImage with ~3#2 bytes per pixel (instead of 4)

Document

IntegralImage with ~2 bytes per pixel
  (instead of 4)
  
  -- doesn't work... probably need column and row high bytes instead. complicated
  
It can almost be done (the actual feasible byte count is 3.03125)

Image itself: 2 bytes per pixel (just cut off and interpret as signed integer)

Helper structure: For every 8*8 block,
  store the missing highest byte
  of pixel in top-left corner
  
(Explanation: In an 8*8 block, the pixel sum
  is at most 8*8*255=16320 which is < the signed int range.)
  
So additional bytes needed per pixel:
  1/64 (for small images)
  1/32 (for big images)
  
=> Total bytes per pixel:
  between 2.01562 and 2.03125
  
Cost for a pixel lookup:
  three fixed shifts, an AND, an array lookup and an addition
  

download  show line numbers   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

-
Snippet ID: #1032247
Snippet name: IntegralImage with ~3#2 bytes per pixel (instead of 4)
Eternal ID of this version: #1032247/7
Text MD5: f458910725a357f3d177f28ceb4fdcde
Author: stefan
Category: javax / imaging
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-23 03:22:27
Source code size: 768 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 132 / 60
Version history: 6 change(s)
Referenced in: