필터 지우기
필터 지우기

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 CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by