Im trying to classify dental xray images in jpg format using SqueezeNet but there is error in the first input layer as it accepts only 227x227x3 whereas the jpg image data

조회 수: 2 (최근 30일)
Im trying to classify dental xray images in jpg format using SqueezeNet but there is error in the first input layer as it accepts only 227x227x3 whereas the jpg image data of only 1 layer in gray. How to solve this issue kindly help?

답변 (1개)

Rik
Rik 2023년 8월 28일
The common strategy for using grayscale images in networks designed for color input, is to either replicate the images or to use only a single channel. Sometimes one of the channels is used for some sort of mask, but that depends on the actual project.
IM = uint8(randi([0 255],227,227,1)); % generate example image data
%option 1:
IM_replicated = repmat(IM,1,1,3);
size(IM_replicated)
ans = 1×3
227 227 3
%option 2:
IM_extended = cat(3,IM,uint8(zeros([size(IM) 2])));
size(IM_extended)
ans = 1×3
227 227 3

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by