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

1  
IntegralImage with ~2 bytes per pixel
2  
  (instead of 4)
3  
  
4  
  -- doesn't work... probably need column and row high bytes instead. complicated
5  
  
6  
It can almost be done (the actual feasible byte count is 3.03125)
7  
8  
Image itself: 2 bytes per pixel (just cut off and interpret as signed integer)
9  
10  
Helper structure: For every 8*8 block,
11  
  store the missing highest byte
12  
  of pixel in top-left corner
13  
  
14  
(Explanation: In an 8*8 block, the pixel sum
15  
  is at most 8*8*255=16320 which is < the signed int range.)
16  
  
17  
So additional bytes needed per pixel:
18  
  1/64 (for small images)
19  
  1/32 (for big images)
20  
  
21  
=> Total bytes per pixel:
22  
  between 2.01562 and 2.03125
23  
  
24  
Cost for a pixel lookup:
25  
  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: 71 / 38
Version history: 6 change(s)
Referenced in: [show references]