counting pixel of an image?

2 ビュー (過去 30 日間)
vishnu
vishnu 2012 年 2 月 28 日
編集済み: Madhava Teja Munagala 2018 年 2 月 23 日
i have used the thresholding for image ..
the command is
length(find(abs(cw)<=50));
im(length(abs(cw)<=50))=0 ;
(1)for examble 42447 coeffients made to be zero out of 65656. my doubt is whether that remaing (23089 ) pixel only present in that image or else 0 will be presented for the whole 65536 ..
(2)how to count or calculate the number of pixels present in that image ?
(3)i apply the wavelet transform.. after that i apply this can i use this threshold for compression ?
pleased to ask reply from all ..
  1 件のコメント
vishnu
vishnu 2012 年 2 月 29 日
length(find(abs(cw)<=50));
cw(length(abs(cw)<=50))=0 ;
sir ,
(1)length is i calculated to know the how many pixels are present under 50 value
(2) can you explain what is the difference between pixel and coefficients and pixels
(3)after wavelet transform some pixels are made to zero with above code can i say this as compression ...

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

採用された回答

Image Analyst
Image Analyst 2012 年 2 月 29 日
Responding to your comment
(1) The number of pixels under 50 is given more simply by
numPixelsLessThan50 = sum(sum(cw<50));
No need for find() and abs().
(2) A pixel contains the value of your image array at a certain location. I don't know what you are calling coefficients. I don't have the wavelet toolbox so I can't answer any questions about that.
(3)I don't understand what #3 is saying or asking. Something about wavelets, setting to zero, and compression but it's not clear. Ask someone else to reword it.
  6 件のコメント
Image Analyst
Image Analyst 2017 年 12 月 22 日
I'm attaching my RGB program for kmeans(). Generally I feel that kmeans is not a good method for segmentation of RGB images, but for whatever it's worth, it's attached. Don't say I didn't warn you if you don't like the results.
Example based discriminant analysis is better and I'm attaching a demo for that that uses the classify() function. There may be even better methods.
Madhava Teja Munagala
Madhava Teja Munagala 2018 年 2 月 23 日
編集済み: Madhava Teja Munagala 2018 年 2 月 23 日
Take input image, Then based on threshold Img divide into foreground and background, After find means for forground,and background,
if true
% code
end
After that compare pixel with means of both fg ang bg ,
These is concept,how to write program by using otsu 2d

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2012 年 2 月 28 日
Why is length() in there? What are the coefficients? Do you mean pixels instead of coefficients? What is the difference between cw and im?
The number of pixels in an image is:
[rows columns numberOfColorChannels] = size(im);
numberOfPixels = rows*columns;
or
numberOfPixels = rows*columns*numberOfColorChannels;
depending on how you're defining pixel.

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by