現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
how can extract part of image
2 ビュー (過去 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 で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)