Questions tagged [uint16]
127 questions
0
votes
1 answer
How can I save uint16 NumPy arrays with JPEG compression, and load uint16 JPEG compressed data?
If I have a NumPy array with dtype=np.uint16, how can I save the data as uint16 JPEG compressed?
How can I then load the uint16 JPEG compressed data?
It doesn't seem like Pillow supports this, at least not by saving the file as jpg extension, see…

user3731622
- 4,844
- 8
- 45
- 84
0
votes
1 answer
uint16 to xx.x float -- fastest algorithm?
I receive data from a temperature sensor that is formatted as two bytes which are a binary encoding of the fixed-width, floating point data. The encoding scheme can be demonstrated in the following table:
| temperature | hexadecimal | int16 |
| 0.1…

Brandon Dube
- 428
- 1
- 10
- 26
0
votes
0 answers
strange problem reading uint16 images in tensorflow 1.12
I am currently working on an optical flow project and I come across a strange error.
I have uint16 images stored in bytes in my TFrecords. When I read the TFrecords from my local machine it is giving me uint16 values, but when I deploy the same…

vinay s
- 23
- 1
- 5
0
votes
2 answers
Convert Base64 String to Javascript Uint16Array?
I'm working in an Javascript application that receives a base64 array. This array encodes a 16 bits per pixel raw image.
Thus, I would like to do some calculations in it. For this, I need to unpack this Base64 string in a Uint16Array, so I can…

Fernando
- 1,477
- 2
- 14
- 33
0
votes
1 answer
How to cast uint16_t into a float in C++
I am running C++14 on MacOS High Sierra.
I have an uint16_t returned from a method and the value can range from 100 to like 8000 odd.
I want to convert it to a float. So, if it is 289 then the float should be 289.0. I am trying all different ways to…

TheWaterProgrammer
- 7,055
- 12
- 70
- 159
0
votes
2 answers
Compare uint8_t and uint16_t in c++
i would like to test if a value of an input variable passed one byte size or know so i write this code
{
uint8_t x;
cout << " enter x" << endl;
cin >> hex >> x;
cout << hex << x;
uint8_t y ;
y = x >> 4 ;
cout << hex <<…

gerrard2461
- 305
- 1
- 6
- 21
0
votes
2 answers
How to convert string to int without skip first zeros's swift?
Note- I am not trying to convert hexttoInt Here ..
what i want to achieve is I have 9 digits of serial number 305419896(Decimal) in Hex format is 12345678.. I am just trying to take 0x1234 as one value and 0x5678 as other value..
My decimal number…

tp2376
- 690
- 1
- 7
- 23
0
votes
2 answers
Passing uint16_t variable to function expecting an uint8_t variable danger
I have been trying to solve a bug in work for a while and finally I found it. It turns out that one function was passing a variable of size uint16_t to another function which accepts a variable of size uint8_t, even without any explicit casting.…

Engineer999
- 3,683
- 6
- 33
- 71
0
votes
2 answers
Concatenate strings, convert to ushort, compare against ushort
So I have some constants:
const ushort _WIN32_WINNT_NT4 = 0x0400;
const ushort _WIN32_WINNT_WIN2K = 0x0500;
....
And then I have a major version number, minor version number, and service pack number, that, when you concatenate those together, it's…

vapcguy
- 7,097
- 1
- 56
- 52
0
votes
1 answer
Simple program convert int16_t array to uint16_t
I have used the WinFilter Program to compute the FIR filter on C code but I got a issue:
The program only provide the 16 bits signed array and i need to that this vector be a unsigned int. So i am looking for a simple solution to relocated the array…

miguel747
- 3
- 1
- 5
0
votes
0 answers
From uint to decimal
I'm getting data from an ADC through SPI: I save the data into an array of type uint16_t and I use a terminal to see the result.
How can I see this result in decimal instead of unsigned int?
I need to know if the values I get are what I really…

Marc203
- 1
0
votes
1 answer
Swift 2.2: Bug in UInt16?
In my class I define a default port as follows:
private let DEFAULT_PORT: UInt16 = UInt16(47300)
(I also tried : private let DEFAULT_PORT: UInt16 = 47300 )
This should be perfectly ok as the maximum number of UInt16 is 65'535.
The app crashes in…

Jeyhey
- 490
- 3
- 16
0
votes
1 answer
MATLAB error - Undefined function "imrotate" for input arguments of type 'int16'
I don't know what's going on. I need some advice or resolution for this problem
The following code is:
ax_slice = reshape(im(:,:,slices/2),rows,cols);
sag_slice = reshape(im(:,cols/2,:),rows,slices);
cor_slice =…

Ba Go
- 1
- 1
0
votes
1 answer
std::copy runtime_error when working with uint16_t's
I'm looking for input as to why this breaks. See the addendum for contextual information, but I don't really think it is relevant.
I have an std::vector depth_buffer that is initialized to have 640*480 elements. This means that the total…

svenevs
- 833
- 9
- 24
0
votes
1 answer
How to set value of (initialize) unichar/UInt16 in hexadecimal in Swift
I want to set the value of a constant UInt16 to a hexadecimal value.
I know that the way to set a Swift Character is
let myValue: Character = "\u{1820}"
so I tried
let myValue: UInt16 = "\u{1820}"
let myValue: unichar = "\u{1820}"
let myValue:…

Suragch
- 484,302
- 314
- 1,365
- 1,393