How can I scientifically explain the following code in my article? I really need to know this as soon as possible. [m,n,l]=size(RGB); for i=1:m for j=1:n re

1 Ansicht (letzte 30 Tage)
How can I scientifically explain the following code in my article? I really need to know this as soon as possible.
[m,n,l]=size(RGB);
for i=1:m
for j=1:n
red = RGB(i,j,1);
green = RGB(i,j,2);
blue = RGB(i,j,3);
if (((red<green))||(red<blue))
RGB(i,j,1)=0;
RGB(i,j,2)=0;
RGB(i,j,3)=0;
end
end
end
  5 Kommentare
MAHDI JAVADI
MAHDI JAVADI am 10 Mär. 2022
@Rik actually I can't understand line if but for my article I need totally description. so if you can help me please take me a paragraph for it. thanks
Rik
Rik am 11 Mär. 2022
Bearbeitet: Rik am 11 Mär. 2022
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
This page is now archived

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 10 Mär. 2022
I doubt this is good enough for a peer reviewed journal. I'd reject it too. Not just because you don't know what your code is doing, but for several other reasons too. Basically you're masking out pixels where the red is less than the blue and green values, like for example make the image black unless the pixel is bluish, greeninsh, or cyan-ish. If you can't describe what those simple lines are doing then you probably are not knowledgeable to deserve to have this in a peer reviewed journal. Sorry, I don't mean to hurt your feelings, I'm just being brutally honest.
Beyond that you need to decide if a simple color classification is a novel enough application to publish. I mean certainly color classification has been done before (and is not publication worthy by itself), and probably even color classification for leaf diseases has already been published, so what new discovery are you trying to publish?
% Get dimensions of image.
[m,n,l]=size(RGB);
% For every pixel, blacken the pixel if the red value is the darkest.
for i=1:m % For every row
for j=1:n % For every column
% Get the individual colors for this one pixel.
red = RGB(i,j,1);
green = RGB(i,j,2);
blue = RGB(i,j,3);
% See if the red value is the darkest.
if (((red<green))||(red<blue))
% The red value is the darkest so blacken the image at this pixel.
RGB(i,j,1)=0;
RGB(i,j,2)=0;
RGB(i,j,3)=0;
end
end
end
The whole thing could be done like in 3 lines like this:
[red, green, blue] = imsplit(RGB);
mask = (red < green) & (red < blue);
% Mask the image using bsxfun() function to multiply the mask by each channel individually. Works for gray scale as well as RGB Color images.
maskedRgbImage = bsxfun(@times, RGB, cast(mask, 'like', RGB));

Weitere Antworten (2)

MAHDI JAVADI
MAHDI JAVADI am 11 Mär. 2022
@Rik I just wanted to thank you for your answers but I mistyped the question. I did not mean rudeness

MAHDI JAVADI
MAHDI JAVADI am 11 Mär. 2022
Bearbeitet: MAHDI JAVADI am 11 Mär. 2022
@image analyst thanks for your respond. that was a good points in your comment.

Kategorien

Mehr zu Text Data Preparation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by