the below code changes rgb image to grey ,can the same partision done without changing the image to grey??
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
dataTop = rgb2gray(data(1:240, :,:));
dataMiddle = rgb2gray(data(241:480, :, :));
dataBottom = rgb2gray(data(481:end, :, :));
Accepted Answer
Image Analyst
on 4 Apr 2013
Edited: Image Analyst
on 4 Apr 2013
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 Comments
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??
vishnu andavar
on 4 Apr 2013
Edited: Image Analyst
on 4 Apr 2013
plz check this to understand what i am asking. http://www.mathworks.in/matlabcentral/answers/68433-how-to-divide-the-matlab-image-into-3-sections-or-boxs
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??
See my color detection demo where I find red: http://www.mathworks.com/matlabcentral/fileexchange/31118-color-segmentation-by-delta-e-color-difference
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Products
See Also
on 4 Apr 2013
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)