- train your own detector, just take their architecture
- Turn your images from greyscale into rgb by using the following bit of code(i used this for SSD object detection, but based on your error it seems to be the same issue). The rgb2gray is here:https://www.mathworks.com/matlabcentral/answers/377407-how-to-convert-grayscale-to-rgb
Medical Image Segmentation Using SegNet
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
I labeled gray scale images using Pixel Label in Image Labeler app (MATLAB 2019b). I am using semantic segmentation (https://www.mathworks.com/matlabcentral/fileexchange/66448-medical-image-segmentation-using-segnet) to classify different objects in the images. When I ran this part of the code (I changed the third element in the imageSize to 1 because I am using the gray scale images):
i find this error
Error using segnetLayers>iCheckImageSizeHasThreeElementsForVGG (line 454)
imageSize must have three elements and the third element must be 3 when creating SegNet based off of VGG-16 or
VGG-19.
Error in segnetLayers (line 170)
iCheckImageSizeHasThreeElementsForVGG(args.imageSize);
Error in medImgSegExample3 (line 75)
lgraph = segnetLayers(imageSize,numClasses,'vgg16');
댓글 수: 0
답변 (1개)
Ryan Comeau
2020년 5월 9일
Hello, I have encountered this problem as well. It's sort of hilarious because it's a simple problem and I banged my head against the table as well for like 10 hours. When you are doing transfer learning(the technique of using pre trained weights) your images need to be the same size as the ones which the network was trained on, which includes the color channels. This leaves you with two solutions:
map = hsv(256); % Or whatever colormap you want.
rgbImage = ind2rgb(im, map); % im is a grayscale or indexed image.
You will need to play around with the value in hsv and tune it to your needs.
Hope this helps
RC
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!