Position Of pixel
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
0 投票
heyy.. can anyone help me out in finding out the position of pixel of an binaryimage and the grayscale value of pixel
採用された回答
Sean de Wolski
2011 年 5 月 19 日
Igray(Ibinary); %extract gray values of true binary values
true_locations = find(Ibinary); %indices of binary values
You'll have to be more specific if you want more information.
EDIT per comment/clarification:
%Ibinary is your logical map
%Igray is your grayscale image
%Conversions as necessary
if ~isa(Igray,'double');Igray = double(Igray);end
if ~islogical(Ibinary);Ibinary = logical(Ibinary);end
wtrr = bsxfun(@times,(1:size(Igray,1)).',Igray); %weighted Igray by rows
wtrr = sum(wtrr(Ibinary)); %Sum the ones that matter
wtcc = bsxfun(@times,1:size(Igray,2),Igray); %weighted Igray by columns
wtcc = sum(wtcc(Ibinary)); %sum the ones that matter
Gtot = sum(Igray(:));
CGr = sum(wtrr(:))/Gtot;
CGc = sum(wtcc(:))/Gtot;
%CGr is the CG amongst rows (y) and CGc is the CG amongst columns (x)
7 件のコメント
Gova ReDDy
2011 年 5 月 19 日
danx for ur reply....ill give a detail information abt dis...
I want to find the position of centre of gravity of binary image using the formual:
COG=(summation(position of pixel * grayscale value of pixel) ) %(summation (grayscale value of pixel))...is der anyother way to find out COG
Gova ReDDy
2011 年 5 月 20 日
In this line % wtrr = bsxfun(@times,(1:size(Igray,1)).',Igray) %
what does % (1:size(Igray,1)).',Igray) % means
Gova ReDDy
2011 年 5 月 20 日
what dis %logical % does
Sean de Wolski
2011 年 5 月 20 日
It multiplies element-wise the column vector (1:size(Igray,1)).' by every column of Igray. logical converts an image to binary.
doc logical
doc bsxfun
Gova ReDDy
2011 年 5 月 20 日
Danxxxxxxx...can u please figure out this one
How to prepare images of the Gaussian shaped illumination intensity line with --half width:20 lenght:1200 tilt:0.001
Sean de Wolski
2011 年 5 月 20 日
Nope.
Gova ReDDy
2011 年 5 月 20 日
thanks in advance....can u xplain me what %gauss2mf% function does in detail
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
製品
参考
2011 年 5 月 19 日
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)
