Hello All.
I have been trying to replace the original R, G and B components of an RGB image by applying the attached equations in MATLAB.
I don't know the functions to use. I have tried applying different filters but the results I get are inaccurate.

댓글 수: 8

There is nothing attached so we don't know the functions to use either. In the meantime, here's a snippet that might get you started:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Now do your math on the separate channels, then...
% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
Muftahu Kabir
Muftahu Kabir 2020년 4월 14일
Thank you for the code. Please find attached the equations
Muftahu Kabir
Muftahu Kabir 2020년 4월 15일
I have splitted the image into the three channels. But I don't know the function to use in doing some maths on the channels before using "cat()" to combine all my calculations into a single image
Image Analyst
Image Analyst 2020년 4월 15일
The equations say to set all pixel values to (0,0,0) which is the RGB for pure black. They'll never eve get (255,255,255) because I'' is never anything but (0,0,0) as you can see from equation (5). I think these equations were written down incorrectly. It does not do segmentation when you simply set everything to zero.
Muftahu Kabir
Muftahu Kabir 2020년 4월 22일
Anyone please? Am still yet to resolve it. My main problem is "What function to use in mixing the individual channels using any combination (equation) of my choice".
Image Analyst
Image Analyst 2020년 4월 22일
Everything is zero except I hat if I hat if I'' is more than 0. But from equation (5), I'' is never anything but zero. Hence I hat will never be anything but zero either. I suggest you contact the author for the correct formulas, or look into imgradient().
Mrutyunjaya Hiremath
Mrutyunjaya Hiremath 2020년 4월 24일
There is a problem in given equations
Here is the reults, after some assumptions for intitial values, like Idash ... sigma ...
Muftahu Kabir
Muftahu Kabir 2020년 4월 24일
편집: Muftahu Kabir 2020년 4월 24일
@Mrutyunjaya Hiremath
Interesting.... After using which of the equations did you arrive at your result? I have been trying to get a similar result to yours using equation (4) but I couldn't. Can you please share the code you used?

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

 채택된 답변

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath 2020년 4월 25일

0 개 추천

Hello Muftahu Kabir,
Here is the code ...
clear all;
close all;
clc;
I = imread('1.jpg');
figure, imshow(I);
IR = I(:,:,1);
IG = I(:,:,2);
IB = I(:,:,3);
I4 = I;
I41Index = find((IG - ((IR+IB)/2) + 15) > 0);
I4(I41Index) = 0;
I42Index = find((IR - IB) > 20);
I4(I42Index) = 0;
I43Index = find((IG - IR) > 15);
I4(I43Index) = 0;
figure, imshow(I4);
I5 = I4;
delta = 50;
I51Index = find(I4 > (255 - delta));
I5(I51Index) = 0;
I52Index = find(I4 < delta);
I5(I52Index) = 0;
figure, imshow(I5);
I6 = I5;
I61Index = find(I5 > 0);
I6(I61Index) = 255;
I62Index = find(I5 == 0);
I6(I62Index) = 0;
figure, imshow(I6);
imwrite(I6, 'I6.jpg');

댓글 수: 1

Muftahu Kabir
Muftahu Kabir 2020년 6월 4일
Hello Mrutyunjaya Hiremath,
I truly appreciate your contribution.
It has gone a long way assisting me in doing my research. Thank you so much

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by