Skip to content

Commit b4a85f8

Browse files
David García Garzónqdot
authored andcommitted
Uses bit shift vs. adaptative normalization
Adaptative normalization to the current frame extrema is ok for visualizing but turns data meaningless for any other purpose. So in order to keep the example useful for all those purpose the dept are just shifted to maximize the dynamic range of the received 11 bits over the 16 representation bits. Signed-off-by: David García Garzón <[email protected]>
1 parent 343c7c1 commit b4a85f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

wrappers/python/demo_cv_async.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
die = False
1010

1111
def display_depth(dev, data, timestamp):
12-
data -= np.min(data.ravel())
13-
data *= 65536 / np.max(data.ravel())
12+
data <<= (16-11) # 11 bits -> 16 bits
1413
image = cv.CreateImageHeader((data.shape[1], data.shape[0]),
1514
cv.IPL_DEPTH_16U,
1615
1)

0 commit comments

Comments
 (0)