Wants to input an rgb image and get the classified image as an rbg instead of greyscale
조회 수: 6 (최근 30일)
이전 댓글 표시
I am new to Matlab and I am finding it difficult to input a color image and give the classified output as color image. Instead I am only able to do for greyscale image. I have done the code for greyscale image. Please help me out. Can someone help me with the code to output as coloured image rather than a grayscale image. I have attached my code as well.
댓글 수: 0
채택된 답변
Image Analyst
2020년 9월 28일
Have you tried colormap() and colorbar() to apply a colormap to the gray levels in the classified image?
댓글 수: 6
Image Analyst
2020년 9월 29일
You can't. Once an RGB true color image has been indexed into a monochrome (indexed) image plus a colormap, it's been quantized and you will lose some of the original colors. You'll get a posterized-looking image if you use ind2rgb(grayImage, map), though it might look reasonable if you chose enough colors to use in the colormap, like a hundred or more. If you have only 16 or fewer colors in your colormap, it will look like a cartoon - posterized.
This has nothing whatsoever with deep learning or classification though.
Saying that this particular image has a stop sign in it classifies that image as having a stop sign in it. But it does not classify every single pixel in the image. For example, it does not say this pixel is from a stop sign, that pixel is from a roadway, and the other pixel is from the sky (or car, or lawn, or whatever). For that you'd need something like SegNet rather than a classification CNN. SegNet will classify every pixel in an image but CNN just says if your image has an object from a predefined set of objects in it.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!