필터 지우기
필터 지우기

Blue colour range in hsv saturation system?

조회 수: 5 (최근 30일)
Yuchun Ding
Yuchun Ding 2017년 2월 8일
댓글: Yuchun Ding 2017년 2월 9일
I'm trying to increase the intensity of blue pixels in an RGB image and I'm trying to increase the blue only pixel intensity, for example if I have:
imghsv=rgb2hsv(img);
imgs=imghsv(:,:,2);
I roughly set a condition for the blue range
imgs(ii,jj) >0.1 && imgs(ii,jj)<0.4
but I found out some yellow pixels are also enhanced.
I think I might missing something, is there another way where I can enhance the blue colours only in an image?
Thanks!

채택된 답변

Guillaume
Guillaume 2017년 2월 8일
Hum!, the Hue channel (the one that contains the colour information) in a HSV image is the first one.
The limits of the blue hue depends on what you call blue, but it's in the region of 0.5 to 0.7.
So:
imghsv=rgb2hsv(img);
imgh=imghsv(:,:,2);
bluepixels = imgh >= 0.5 & imgh <= 0.7;
The saturation (2nd channel) is completely independent of the hue. You may want to filter pixels with very low saturation as they'll look almost black but it certainly won't help filtering out yellow (or green, or red, or any other colour)
  댓글 수: 1
Yuchun Ding
Yuchun Ding 2017년 2월 9일
aha thanks for this to sum up, I used hsvimg(:,:,1) to find the range and increased the values in hsvimg(:,:,2)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 2월 8일
I think you should be looking at 1/2 to 3/4 at least, perhaps a bit wider around that range
Invoke
colormapeditor
and use the Tools menu to select HSV colormap and look at the range of values.
  댓글 수: 1
Yuchun Ding
Yuchun Ding 2017년 2월 9일
thanks a lot! it's really helped me to located many different colour range!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by