Questions tagged [uint16]

127 questions
1
vote
2 answers

how to print a uint16 monochrome image in Qt?

I'm trying to print a image from a Dicom file. I pass the raw data to a convertToFormat_RGB888 function. As far as I know, Qt can't handle monochrome 16 bits images. Here's the original image (converted to jpg…
Mark A.
  • 193
  • 1
  • 3
  • 14
0
votes
0 answers

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)…
Tellun
  • 1
  • 1
0
votes
0 answers

Python read binary file of unsigned 16 bit integers (see data)

I must read a binary file in Python. I use this code: import struct import numpy as np fileName = "continuous.dat" with open(fileName, mode='rb') as file: fileContent = file.read() a = struct.unpack("H" * ((len(fileContent)) // 2),…
0
votes
1 answer

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 =…
MarcMVT
  • 1
  • 1
0
votes
0 answers

Getting error when I make libgd-2.2.3 in terminal - Fatal error: too many errors emitted, stopping now [-ferror-limit=]

I keep getting this error when I type make libgd-2.2.3 in the Mac terminal: fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: *** [gd_tiff.lo] Error 1 make[1]: *** [all] Error 2 make: ***…
0
votes
1 answer

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 types of integer: • Signed integers: Signed…
mario7111
  • 61
  • 1
  • 9
0
votes
0 answers

convert multidimensional nd array from uint16 to int16

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 further in my code. Could you please give a quick…
vashista
  • 105
  • 7
0
votes
1 answer

Convert Uint16 -> Byte Image is darker

I want to convert an image with Uint16 pixels to Byte pixels. I'm actually using GDAL library (and gdal_translate command) to do this but the output image is darker than the original Original image Output image Do you know what can i do to convert…
s1o
  • 1
  • 1
0
votes
0 answers

Normalize UInt16 images for Pix2Pix implementation

i'm trying to use this implementation of Pix2Pix algorithm https://github.com/mrzhu-cool/pix2pix-pytorch. In this implementation they are using small UInt8 (max color value : 255) images so they are normalizing their images like this…
s1o
  • 1
  • 1
0
votes
3 answers

Linear interpolation works on Windows but not on my PIC18F, trouble with 8-bit arch?

I've implemented linear interpolation on my PIC18F device where I'm interpolating ADC values with intervals stored in EEPROM. I tested the code and it doesn't calculate properly. So I put it into my computer and the calculations works well so I…
0
votes
1 answer

Convert two 16 Bit Registers to 32 Bit float value flutter

I am using a Modbus flutter lib, reading 2 registers I obtain: [16177, 4660] I need a function to convert it to a 32 bit float value: 0.7 I found this function ByteBuffer buffer = new Uint16List.fromList(fileBytes).buffer; ByteData byteData = new…
TuceT
  • 3
  • 2
0
votes
1 answer

C (Embedded) - Divide uint16 and convert to double

I'm having some problems and getting confused about the proper way of doing some operations with uint16_t and double for C embedded software (Using GCC). Ex1: uint16_t PD_input =723;// Input will always be greater than output uint16_t PD_output…
yaviens
  • 25
  • 7
0
votes
2 answers

Conversion Warning with Bitwise Or and Casted Operands

Code Snippet 1 (shown below) produces the following -Wconversion warning: debug_Wconversion.c:10:57: warning: conversion to ‘uint16_t’ from ‘int’ may alter its value [-Wconversion] result = ((uint16_t) (((uint16_t) byte1) & 0x0050)) |…
0
votes
1 answer

How to calculate Int value from Big-endian representation in Swift?

I'm working on transferring a UInt16 value via BLE. From what I read, for this purpose, I need to convert the UInt16 to UInt8 which will be converted to type Data. I have been referring to this thread. For example, I've used the code…
Visal Rajapakse
  • 1,718
  • 1
  • 9
  • 15
0
votes
1 answer

Converting Uint16List to String or Integer in Dart/Flutter

I'm making an app, where I get data from Modbus protocol. It returns basicly arrays with integers which I need to convert to Strings and Integers. i.e. this should be a device name [53440, 11714, 52701, 10449, 14157, 13876, 41, 0, 0, 0, 0, 0, 53440,…
1 2 3
8 9