the below code changes rgb image to grey ,can the same partision done without changing the image to grey??

dataTop = rgb2gray(data(1:240, :,:));
dataMiddle = rgb2gray(data(241:480, :, :));
dataBottom = rgb2gray(data(481:end, :, :));

 채택된 답변

Image Analyst
Image Analyst 2013년 4월 4일
편집: Image Analyst 2013년 4월 4일
I'm not sure of the question. You cannot do the same thing by doing something different, obviously. So you can't change the image to gray without changing the image to gray. If you don't want to call rgb2gray(), then don't.

댓글 수: 9

what i meant in the question is i need to divide a rgb image of 1024*720 to 1024*240 1204*240 1024*240 but by using above command it changes image to grey,i want to segmant my image without changing it into grey.
And what happens if, like I said, you simply don't call rgb2gray()?
if i don't call that the image doesn't get divided,right??but i need to divide the image,how can i do??
In that case the poster needed a grayscale image, but you don't. So just try this:
dataTop = data(1:240, :,:);
dataMiddle = data(241:480, :, :);
dataBottom = data(481:end, :, :);
one more doubt,where do i need to copy the above code actually in the program??and how do i control the 3 data section at one time?
Copy it into the place in the program where you want to split the image into 3 images.
You can't control anything "at one time" unless you have the Parallel Processing Toolbox.
sir,its like after diving into three,i need to check if any red object is present in all 3 sections,if yes in section then that section 1 motor should work,can this be done??

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by