이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
extracting the channels from the corrected image
조회 수: 4 (최근 30일)
이전 댓글 표시
iam working with rgb fundus images
my task is to convert the rgb image to hsv space and extract the channels and
perform brightness correction in the image
now i am little confused on how to extract the channels of the corrected image
the corrected image is not saved as jpg format
could anyone help me to solve this issue
i have also attached the coding
thank you in advance
답변 (1개)
Ameer Hamza
2020년 4월 12일
You converted the image to RGB after applying correction. You can extract the RGB channels by indexing along third dimension
R = newRGBImage(:,:,1);
G = newRGBImage(:,:,2);
B = newRGBImage(:,:,3);
댓글 수: 29
LAXMI PRIYANKA
2020년 4월 13일
iam getting the folowing error
Undefined function 'newRGBImage' for input arguments of type 'char'.
Ameer Hamza
2020년 4월 13일
LAXMI, the newRGBImage is defined in your code. Add this after these lines in your code
meanV = mean2(V);
newV = meanV + 1.5 * (V - meanV); % Increase contrast by factor of 1.5
newS = 1.5 * S; % Increase contrast by factor of 1.5
newHSVImage = cat(3, H, newS, newV);
newRGBImage = hsv2rgb(newHSVImage);
R = newRGBImage(:,:,1);
G = newRGBImage(:,:,2);
B = newRGBImage(:,:,3);
LAXMI PRIYANKA
2020년 4월 14일
it worked great thank you sir
i would also like to ask you another help regarding applying CLAHE to the extraxcted green channel
i have been searching for weeks together and would be really happy if you could hep me with the source code
thanking you in advance
Ameer Hamza
2020년 4월 14일
What about this: https://www.mathworks.com/help/images/ref/adapthisteq.html
LAXMI PRIYANKA
2020년 4월 14일
i read it sir
when i use clahe i get the following error
Undefined function 'localcontrast' for input arguments of type 'double'.
i have also attached the codings
Ameer Hamza
2020년 4월 14일
Change the line 40 and 41 in your code to
data = localcontrast(im2uint8(newRGBImage), edgeThreshold, amount);
PSNR1 = psnr(im2double(data), newRGBImage);
LAXMI PRIYANKA
2020년 4월 14일
sir just now tried those codins with rgb image in the place of tif image
not working
getting errors
Error using adapthisteq
Expected input number 1, I, to be two-dimensional.
Error in adapthisteq>parseInputs (line 416)
validateattributes(I, {'uint8', 'uint16', 'double', 'int16', 'single'}, ...
Error in adapthisteq (line 154)
[I, selectedRange, fullRange, numTiles, dimTile, clipLimit, numBins, ...
Error in s (line 2)
J = adapthisteq(I,'clipLimit',0.02,'Distribution','rayleigh');
Error using adapthisteq
Expected input number 1, I, to be two-dimensional.
Error in adapthisteq>parseInputs (line 416)
validateattributes(I, {'uint8', 'uint16', 'double', 'int16', 'single'}, ...
Error in adapthisteq (line 154)
[I, selectedRange, fullRange, numTiles, dimTile, clipLimit, numBins, ...
Undefined function or variable 'L'.
Undefined function or variable 'L'.
Undefined function 'rgb2lab' for input arguments of type 'double'.
LAXMI PRIYANKA
2020년 4월 14일
i tried with the coding in line 40 and 41
error displayed as
Undefined function 'localcontrast' for input arguments of type 'uint8'.
LAXMI PRIYANKA
2020년 4월 14일
will this be due to the version of matlab?
i am currently using matlab2014a
if it is that i have to install the latest or the next version say2015 or higher
what should i do at this time
help me please with this regard
Ameer Hamza
2020년 4월 14일
I am not sure if this is related to MATLAB version. I am running the code on R2020a.
Ameer Hamza
2020년 4월 15일
The code works fine on R2020a using this image, but there is any error when making the final figures. There is a mistake in typing the name of variables. There is no variable name image in your code, but these lines are trying to call imshow on it.
figure('name','LCM-CLAHE','NumberTitle','off')
%da=adapthisteq(data);
%%%% <------ There is no variable named image in your code
imshow([image uint8(output)]); % Concatenate original and CLAHE image
figure('name','Histogram of input image','NumberTitle','off'); imhist(image); %Show the histogram of original image, LCM output and CLAHE output
figure('name','Histogram of LCM output','NumberTitle','off');imhist(data);
figure('name','Histogram of CLAHE output','NumberTitle','off');imhist(uint8(output));
PSNR = psnr(uint8(output), image);
fprintf('\n The Peak-SNR value of LCM-CLAHE is %0.4f', PSNR);
normal = adapthisteq(image,'clipLimit',0.02,'Distribution','rayleigh');
%imshow([image normal]);
PSNR0 = psnr(normal,image);
fprintf('\n The Peak-SNR value of CLAHE is %0.4f', PSNR0);
he = histeq(image);
PSNR2 = psnr(he,image);
fprintf('\n The Peak-SNR value of HE is %0.4f', PSNR2);
LAXMI PRIYANKA
2020년 4월 15일
so i am supposed to use newRGBImage in the place of image .
am i right sir
LAXMI PRIYANKA
2020년 4월 15일
sir could u help me to solve the error
what should i specify in the place of image in the coding
Ameer Hamza
2020년 4월 15일
I am not sure. I also though this, but output just have one channel and newRGBImage has three channel so the lines
imshow([newRGBImage uint8(output)]);
..
..
PSNR0 = psnr(normal,newRGBImage);
give error.
LAXMI PRIYANKA
2020년 4월 15일
sir
i have to apply clahe for the green channel extracted from the newRGBImage
so now i'll try with the G channel , but the G channel is of data type
double ie 960x1440 double
what should i do please help me
LAXMI PRIYANKA
2020년 4월 15일
data = localcontrast(im2int8(G), edgeThreshold, amount);
PSNR1 = psnr(im2double(data), G);
Error: Undefined function 'im2int8' for input arguments of type 'double'.
Undefined function or variable 'data'.
Ameer Hamza
2020년 4월 15일
The correct function name is im2uint8, not im2int8
data = localcontrast(im2uint8(G), edgeThreshold, amount);
LAXMI PRIYANKA
2020년 4월 15일
Undefined function 'localcontrast' for input arguments of type 'uint8'. again i get the same error
LAXMI PRIYANKA
2020년 4월 15일
Warning: Image is too big to fit on screen; displaying at 50%
> In imuitools\private\initSize at 71
In imshow at 282
In maincodecheck at 25
Warning: Image is too big to fit on screen; displaying at 50%
> In imuitools\private\initSize at 71
In imshow at 282
In maincodecheck at 31
Warning: Image is too big to fit on screen; displaying at 50%
> In imuitools\private\initSize at 71
In imshow at 282
In maincodecheck at 33
Undefined function 'localcontrast' for input arguments of type 'uint8'.
Error in maincodecheck (line 40)
data = localcontrast(im2uint8(G), edgeThreshold, amount);
these are the errors which i get while running the coding as a whole
Ameer Hamza
2020년 4월 15일
Rest are errors. The actual warning is
Undefined function 'localcontrast' for input arguments of type 'uint8'.
Which is probably caused by the old version of MATLAB. I am not sure which input type is compatible with localcontrast in this version of MATLAB.
LAXMI PRIYANKA
2020년 4월 15일
ok sir thank you for your help
and is it possible to guide me so as to get the udated version of Matlab
i am also trying with other codings and i'll ask you after executing the codes
Ameer Hamza
2020년 4월 15일
If you don't already have one, you will need to get a MATLAB license to use the latest release.
Ameer Hamza
2020년 4월 15일
Depend on your requirement and the license type applicable to you. get more information here: https://www.mathworks.com/pricing-licensing.html
LAXMI PRIYANKA
2020년 4월 15일
sir now i tried with adaphist function for applying clahe
[f_name p_name]=uigetfile('*','select the image');
input_img=imresize(imread(strcat(p_name,f_name)),[512,512]);
imshow(input_img),title('Input Image');
[xRes,yRes]=size(input_img);
Min=0;
Max=255;
NrX=2;
NrY=2;
NrBins=256;
Cliplimit=0.01;
% I = imread('tire.tif');
J = adapthisteq(im2uint8(input_img),'clipLimit',0.02,'Distribution','rayleigh');
imshowpair(im2uint8(input_img),J,'montage');
title('Original Image (left) and Contrast Enhanced Image (right)')
the abve codings after execution displays the following error
Error using adapthisteq
Expected input number 1, I, to be two-dimensional.
Error in adapthisteq>parseInputs (line 416)
validateattributes(I, {'uint8', 'uint16', 'double', 'int16', 'single'}, ...
Error in adapthisteq (line 154)
[I, selectedRange, fullRange, numTiles, dimTile, clipLimit, numBins, ...
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)