Skip to main content
2 votes
1 answer
103 views

how to present uint16 as float16

I have a buffer of float16 elements in the memory I read this buffer to a list but since I use np.ctypeslib I can't read it as float16 so I read it as uint16 and now I want to represent it as float16 ...
Sara N.'s user avatar
  • 43
1 vote
1 answer
144 views

Converting float64 array to uint16 (Python)

I'm having trouble in a data type conversion from float64 to uint16. If I have an array of floats and I try to convert it with array_uint16 = array_float64.astype(np.uint16) is there a sort of "...
Leonardo Castello's user avatar
0 votes
0 answers
65 views

Safely converting a non-owning pointer of multiple uint8_t's to uint16_t's [duplicate]

I am getting data from a serial wire, thus the received data is an array of bytes (uint8_t). but these bytes are essentially a lot of two byte words (uint16_t). I am wondering what the best practice ...
user avatar
0 votes
2 answers
346 views

combine two uint8 into one uint16

I have an array in bytes, content is camera frame 480x640 x 2 bytes per pixel raw = np.asarray (d.GetFrameData ( ), dtype=np.uint8) print (raw, raw.shape, type(raw))` print output is below, 614400=...
Edward Pang's user avatar
0 votes
1 answer
80 views

Casting uint8_t* to int16_t8 in C

I am attempting to adapt an example from here which reads PDM microphone data and prints it to a computer using serial USB. I want to bypass the filtering stage in the example so I can write my own ...
jjjjbbb's user avatar
2 votes
0 answers
644 views

Getting OPC UA array object values (Byte, UInt16) in python client

I am creating a python OPC UA client based on opcua-asyncio github (https://github.com/FreeOpcUa/opcua-asyncio) to read values in an instrument that has a server already set up. My problem lies in ...
wuzhzn's user avatar
  • 21
0 votes
0 answers
237 views

Can I use OpenCV SIFT for 16bit images?

I am trying to register two 16bit images. One is a .dcm CT series and the other is TIFF image. Both are uint16 type and while running SIFT I get this error: cv2.error: OpenCV(4.8.0) D:\a\opencv-...
Tellun's user avatar
  • 1
1 vote
1 answer
93 views

Why is documented Bluetooth Unit8 value being read as a Int16?

What have I tried? I read through GATT_Specification_Supplement_v10.pdf and previous publicly available versions of the document mentioned. I looked at stack overflow questions and 3rd party bluetooth ...
3366784's user avatar
  • 2,475
2 votes
3 answers
435 views

C - convert a struct in a u16_array, where each uint16_t represents only a byte

I have a pretty nasty case on a texas instruments C2000 microcontroller, that is only available to represent uin16_t and not uint8_t. Now I have a struct like the following, where each uint16_t ...
HansPeterLoft's user avatar
2 votes
2 answers
682 views

Modbus home assistant and python struct (little endian, big endian, negative values from uint16)

I have a question regarding to modbus settings. I have read the documentation carefully, tried to search some topics, but unfortunately I did not find an answer to my problem. I have a heat pump, ...
tomdelahaba's user avatar
  • 1,038
1 vote
1 answer
188 views

Kotlin Android Studio how to merge two uint8 to one uint16

I am reading data from bluetooth gatt characteristic. First data is one byte and I am successfully reading it by code: val strValue = characteristic.value[0].toUByte() characteristic.value[1] ...
NIXIE_123's user avatar
0 votes
1 answer
1k views

Python : How to convert Bytes like object to Array of uint16?

I have a bytes-like object from a udp stream. In Matlab I can convert the bytes to a column vector of uint16 by following code: % Build UDP Connection and collect binary data udpr = dsp.UDPReceiver('...
MarcMVT's user avatar
0 votes
1 answer
238 views

what is signed/unsigned integer in Solidity?

I found the following definition about signed/unsigned integers on a Solidity book from Packt: Understanding integers Integers help in storing numbers in contracts. Solidity provides the following two ...
mario7111's user avatar
-3 votes
2 answers
87 views

type conversion from int to class behaving weirdly

So. I am trying to convert a uint16_t (16 byte int) to class. To get the class member varaible. But it is not working as expected. class test{ public: uint8_t m_pcp : 3; // Defining max size as 3 ...
rashi's user avatar
  • 3
0 votes
0 answers
18 views

convert multidimensional nd array from uint16 to int16 [duplicate]

When I read an 16 bit tiff (gray scale image having two dimension) image using scipy, and check its dtype using image.dtype I get uint16 (Uint16 is unassigned 16 bit integer). I want int16 to work ...
vashista's user avatar
  • 105

15 30 50 per page
1
2 3 4 5
9