06-22-2023 01:13 PM - edited 06-22-2023 01:31 PM
Hello,
I am using IMAQdx through Python and am experiencing an issue with the raw image frames. Both snap() and grab() seem to only capture a portion of the image. I've attached a images taken using NI MAX (software_image.png) and the IMAQdx library (imaqdx_image.png) for comparison. Note, there is a color difference in these images, but I don't care about this unless its indicative of the problem. I have tried four different cameras including the webcam, but they all have the issue. I have also looked at the raw image frame and have noticed that every 4th entry is zero. I'm assuming this is because the image is output in RGBA, but then shouldn't there be an image array of size w*h*4 instead of w*h*3 (see value of pic_size)? Below I have the simple script I am using to examine the raw frame...
from pylablib.devices.IMAQdx import IMAQdx
# Open Camera
device = IMAQdx.IMAQdxCamera("cam5")
# Send settings
device.enable_raw_readout("frame") # camera format: RGBA 8 Packed
device.set_attribute_value("AcquisitionAttributes/VideoMode", "1920x1520 MJPG 30.00fps")
device.set_attribute_value("CameraAttributes/Exposure/Value", 150000)
# Get image
pic = device.snap() # value: array([66, 101, 102, 0, 66, 101, 102, 0, ..., 75, 108, 111, 0], dtype=uint8)
pic_size = pic.size # value: 8755200 (which is 1920*1520*3)
# Close camera
device.close()
Please let me know if you are aware of any solution to this, I have been struggling for two weeks now.
Specs:
Windows 10 64-bit
Python 3.10 (also tried with 3.6)
pylablib v1.4.1 (also tried all other available versions)
LabVIEW 2021 with Vision Assistant, MAX, IMAQ, IMAQdx, IMAQ IO
Thank you in advance,
hackaway21
06-22-2023 03:14 PM
EDIT: I've included some updated images without the color difference.