이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
how can extract part of image
조회 수: 1 (최근 30일)
이전 댓글 표시
fereshte
2014년 6월 10일
hi i want to extract red region from my image.please help me.i attached it
채택된 답변
Image Analyst
2014년 6월 10일
Do you have the original gray scale image, or just this pseudocolored image? If you unfortunately have only the pseudocolored image, see my color segmentation demos in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
댓글 수: 32
Image Analyst
2014년 6월 10일
Did you try the green image icon? Or the paperclip icon? And you'd need to give the reader for it since it's probably in some floating point format if it's temperatures. If it's only gray levels, then we can work with that via simple thresholding.
fereshte
2014년 6월 10일
Image Analyst
2014년 6월 11일
편집: Image Analyst
2014년 6월 11일
OK, so you don't have the original image. All you have is a pseudocolored image. So my answer remains as above - use color segmentation like in my demos. My "simple color detection" already does red so there's not much you need to change except the filename.
fereshte
2014년 6월 11일
this image was original image.youre demo detection every color such as red,green and etc.but i have extract Total area under the toes that include several colors.i have just inside the area marked.
Image Analyst
2014년 6월 11일
Find out what black is. Maybe the RGB is [0,0,0] or [23,32,18] or whatever. So extract the color bands.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Then threshold
binaryR = redChannel > 10; % or whatever value you want/need.
binaryG = greenChannel > 10; % or whatever value you want/need.
binaryB = blueChannel > 10; % or whatever value you want/need.
Then combine
binaryImage = binaryR & binaryG & binaryB;
% Then count the number of pixels.
numPixels = sum(binaryImage(:));
fereshte
2014년 6월 12일
I'm really confused and dont know how i get this part of image by this code. i extracted heel of this image but i dont extract upper part of footprint image by matlab code
Image Analyst
2014년 6월 12일
What does "extract" mean to you exactly? Do you mean like crop out into a smaller separate image? Or to make measurements with regionprops()? Do you want the whole foot or just the red region? You've said both so please clarify.
fereshte
2014년 6월 13일
편집: fereshte
2014년 6월 13일
ok. i extracted heel from this image to check change of colors in this region.now i want to do for part of the same rectangular area that I have highlighted in red.I want this region only like what I have to Heel.heel image attached.
I want the whole picture become black except for area that marked by red lines.
thank you
Image Analyst
2014년 6월 13일
You mean the red "box" in the image you first posted above? How are the edges defined? It goes out far away from the red "ball of the foot" region.
fereshte
2014년 6월 13일
yes in firs post.not important that this region is far away from the red region.i want just extract this region.my friend write me a code that extract heel of foot.i dont know how defined it.
Image Analyst
2014년 6월 13일
Alright, I had some spare time this afternoon and downloaded your image and wrote the attached program for you (test.m in blue below the screenshot image). Can you mark the answer as accepted if this does what you asked for? Thanks.
Image Analyst
2014년 6월 13일
Yes it is small. If you want to resize it for some reason, you can use imresize().
fereshte
2014년 6월 13일
no.My goal is to obtain the total area under my big toe like the area that I've marked in red.marked region in binary image is very small area.
fereshte
2014년 6월 14일
how change it to obtain purpose region?
measurements = regionprops(labeledImage, 'BoundingBox');
Image Analyst
2014년 6월 14일
measurements = regionprops(labeledImage, 'BoundingBox', 'Area');
Just add in any additional measurements you want it to take.
Image Analyst
2014년 6월 14일
Not sure why you want to do that, but you can convert a binary image into a color image (that's just black and white) by doing this:
colorImage = cat(3, binaryImage, binaryImage, binaryImage);
It will look just like the binary image but it will be color with only two colors: black and white. Kind of useless if you ask me.
fereshte
2014년 6월 17일
is it possible in the code that outputs be colored at all stages instead of binary image?
fereshte
2014년 6월 17일
same binary image but with main colors.i want to processing on colored extraction parts and dont need to binary image same heel image i want convert binary image to colored image
Image Analyst
2014년 6월 17일
I gave you code above that extracts the image with the original colors. If that's not what you meant, then try to find a native English speaker to describe what you want.
fereshte
2014년 6월 17일
youre code is true but output was binary. i enter colorImage = cat(3, binaryImage, binaryImage, binaryImage) in code but dont give me the image with the original colors.
:(
Image Analyst
2014년 6월 18일
A binary image is just one step of my total program. If you look above at the screenshot in the above comment, you'll see an RGB subimage extracted. I gave you the cat() answer though I have no idea why you want to do that. Of course it does not give you the image with the original colors. I gave you code that did that. Why you asked for to convert the binary image into a color image is baffling to me. I don't know why you wanted to do that, and I did not do that in my code, but I gave you the code anyway because you explicitly and specifically asked for it. Again, I don't know why you asked for that or what you want to do with that, especially since I gave you the color image cropped from the original based on the binary image which I used as a mask to determine the cropping rectangle.
Image Analyst
2014년 6월 18일
I don't know what that means. Do you mean like you want to mask the image so that it remains the full size but just zeros out (blackens) the image outside the mask?
fereshte
2014년 6월 18일
The part where to use the mask,convert to color image. I had a change in your program and get a binary image. I want white region convert to original colors and black parts remain the same.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)