Resize image

1 回表示 (過去 30 日間)
Nick ALan
Nick ALan 2011 年 12 月 15 日
Hi,This is Nick.I found this pic some where in older posts.I had a pic same like this.I wanted to selct a pixel of size 100*100 or 50*50.
I have to do A) Define Mask size (Y*Y) square input in the code I used. B) Within each area,identify Blank area(white zone)-Brown Infill material (white in picture)-green identify shallow pores -yellow Rock-Blue.
Please give me one example or sample code to solve it.
Thank you, Nick
  2 件のコメント
Image Analyst
Image Analyst 2011 年 12 月 16 日
I see red, brown, white, and dark gray. I don't see yellow, green, or blue. Are you saying that you want a binary image where white and brown are true (white, 1) and the rest of the colors are false (black, 0)?
Nick ALan
Nick ALan 2011 年 12 月 16 日
@ Image Analyst I wanted to select a pixel of size 50*50 and I have to apply colors for the picture which is similar like i am said before.I have to apply brown (white Blank area),White material as green,Shallow pores as yellow and Rock as blue.I have to apply these colors to the picture and I use the Mask size(50*50) in my code.Help me to apply these colors to it.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 12 月 15 日
Y = 50;
findwhite = @(block) block(:,:,1) == block(:,:,2) & block(:,:,1) == block(:,:,3) & block(:,:,1) ~= 0;
whitefound = blkproc(basaltIMG, [Y,Y], @findwhite);
This uses the color definition that white is not black (all 0's) and that white has equal red, green, and blue values. A pixel with RGB of (1,1,1) will be identified as white, and a pixel with RGB of (255,255,254) will be identified as not white.
If you have your own private definition of "white" then implement it instead.
  1 件のコメント
Nick ALan
Nick ALan 2011 年 12 月 16 日
@ Walter ROberson Thank you............

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by