Prev: perfcurve function?? simple
Next: fmincon
From: sanjay on 24 Apr 2010 12:27 Hi all, How to define radius by treating somw origin and check whether white pixel exist within that radius
From: ImageAnalyst on 24 Apr 2010 15:49 On Apr 24, 12:27 pm, "sanjay " <sanjaym...(a)yahoo.com> wrote: > Hi all, > > How to define radius by treating somw origin and check whether white pixel exist within that radius ------------------------------------------------- Can you explain again. This sounds unintelligible. For example, what is somw? What does it mean to "treat" an origin? You should put more effort into your question than someone will put answering it. If you don't care enough to do that then no one will care to help you. Maybe you can post some sample data with your best shot at coding it up. Don't make people trying to help you come up with code to generate an image with lit up pixels or whatever you're trying to do. Make it easy for people to help you.
From: sanjay on 25 Apr 2010 09:52 Dear Sir, I am new to matlab pls help me. I have a binary image which is thinned and then I found centroid for each connected component, Then I specify some radii considering centroid as origin. How to find whether white pixel exist within that circle in matlab. I am sending code . Pls send me code in matlab to check white pixel exist within specified radii having centroid as origin. Thanks in advance. r = 0.02; t = bwmorph(bw, ‘thin’,Inf); figure,imshow(t);title(’thinned image’); [L, n] = bwlabel(t); hold on for k = 1:n [r,c] = find(L == k); rbar = mean(r); cbar = mean(c); plot(cbar,rbar, ‘g.’); hold off end
From: Walter Roberson on 25 Apr 2010 11:28 sanjay wrote: > How > to find > whether white pixel exist within that circle in matlab. [X, Y] = ndgrid(1:size(TheImage,1), 1:size(TheImage,2)); NumWhitePixInRadius = sum(sum(TheImage((X-XCenter).^2 + (Y-YCenter).^2 <= TheRadius.^2))); Note that this code relies upon the image being black (0) and white (1) with no other values. If white is encoded some other way, the code is not difficult to modify. It does, however, get more complex for TrueColor images.
|
Pages: 1 Prev: perfcurve function?? simple Next: fmincon |