32Bit RGBA Image

9 visualizzazioni (ultimi 30 giorni)
Karsten Schulz
Karsten Schulz il 26 Feb 2020
Commentato: Karsten Schulz il 27 Feb 2020
Hello,
i read via MicroMager Core succseedfull images in Graymode - But the device give me an 32bit RGBA Image that would not
display with function imshow()
import mmcorej.*
mmc = CMMCore;
mmc.unloadAllDevices();
mmc.loadSystemConfiguration ('C:\Program Files\Micro-Manager-2.0gamma\DijSDKcameraMgr.cfg');
mmc.prepareSequenceAcquisition('DijSDKcamera');
mmc.startContinuousSequenceAcquisition(0);
imgRaw = mmc.getLastImage(); %mmc.snapImage(); %img = mmc.getImage();
pixelType = 'uint8';%8BIT GRAY default
if depth == 4
pixelType = 'uint32';%32BIT RGBA can't display img as 32BIT RGBA only 16Bit RGB is possible ?
elseif depth == 2
pixelType = 'uint16';%16BIT RGB not supportet by Micromanger normaly 32bit or 8bit
end
img = typecast(imgRaw,pixelType);
img = reshape(img, [width, height]);
img = transpose(img);
cla reset;
imshow(img);
mmc.unloadAllDevices(); %complettly destruct MMCore
How i can convert tzhe image correctly ? The Funktion image(img) Display an point cloud of image, but not in real colors given from map...
thx for any suggestions
Karsten (www.FlexxVision.de)
  4 Commenti
Guillaume
Guillaume il 26 Feb 2020
Modificato: Guillaume il 26 Feb 2020
Please answer Image Analyst question. We need to know the type of imgRaw that's returned by your device. Is it double, uint8 or something else? We also need to know the size. whos imgRaw will give us all that information.
Once we know that, we can probably figure out a way to display your image. It's probably trivial, just split the transparency channel from the colour channels.
Also, doesn't your library document the memory arrangement of the data returned by getLastImage? That would also be useful information for us to have.
Karsten Schulz
Karsten Schulz il 26 Feb 2020
My Camera give me back an RGBA Image R8|G8|B8|A8 = 32 Bit . The alpha channel is zero always i have written the Micromanger Core driver self , so i can say there works in all other cases.
For each colorchannel 8bit its an BYTE Array.
size is : width*height*(bpp/3)
it's also an normal BYTE Buffer , that is waht lastimage or getimage give me back : an field of bytes.
it's not an 16Bit RGB that comes from webcams. But i use High end Color camera in Microscopy.
thx for Help !
Regards Karsten

Accedi per commentare.

Risposta accettata

Guillaume
Guillaume il 26 Feb 2020
"My Camera give me back an RGBA Image R8|G8|B8|A8 = 32 Bit"
"size is : width*height*(bpp/3)"
Shouldn't that be width*height*(bpp/4) ?
Assuming it's 4 bytes per pixel, and that imgRaw is indeed of class uint8:
img = permute(reshape(imgRaw, 4, width, height), [3, 2, 1])
imgRGB = img(:, :, 1:3); %discard alpha channel which is all 0
imshow(imgRGB);
This assumes that the image pixel are stored in row-major order, which your code also assumed.
  16 Commenti
Guillaume
Guillaume il 27 Feb 2020
Oh! I made a typo. It should have been:
imgRGB = img(:, :, [3, 2, 1]); %was missing one :
Karsten Schulz
Karsten Schulz il 27 Feb 2020
Oh Holly Shit men, wonderfull , it's works and do ~8 FPS that is more what i have hope.
Very thx men , and if u need anything in Vision let me now. All Proplematics solved thx
Best regards
Karsten

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by