TransWikia.com

How many channels do ultrasound images have?

Data Science Asked on July 16, 2021

I have some ultrasound images. When I read them using cv.imread and check their shape or check them with ndim, it shows 3 channels:

im = cv.imread(data_path+'a1.jpg')
print(im.shape)
im = np.array(im)
print(im.ndim)

the output is:
(154, 139, 3)
3

But when I open them in photoshop and check their mode in Image > Mode, it shows grayscale with 8 bit. Also in windows properties > detail, tab shows 8 bit:
enter image description here

Dose anyone have any idea about that?

One Answer

What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.

There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.

Do not rely on function or software defaults. It is better to work from first principles of the raw data.

Answered by Brian Spiering on July 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP