From: Akshay Chaudhari on 6 Feb 2010 20:05 Thanks for the help, I'll change the name of the image, just to avoid confusion in the future. In terms of the image that I used, here is link for it: http://drop.io/b2r3eej In the variable editor it says up as a "a x b" matrix, not a "p x q x r" matrix.
From: ImageAnalyst on 6 Feb 2010 23:29 On Feb 6, 8:05 pm, "Akshay Chaudhari" <sickofhotm...(a)gmail.com> wrote: > Thanks for the help, I'll change the name of the image, just to avoid confusion in the future. In terms of the image that I used, here is link for it:http://drop.io/b2r3eej > > In the variable editor it says up as a "a x b" matrix, not a "p x q x r" matrix. ------------------------------------------------------------------------------------------------------ No it doesn't. I downloaded binary.png and it says it is a color image. It says it's a 322 x 427 x 3 image. I changed your code to convert it to a monochrome image, and changed the name back to originalImage instead of Image. Now it works. Fixed code is below: originalImage = imread('C:\Documents and Settings\tk2013\My Documents \Temporary stuff\binary.png'); [rows columns numberOfColors] = size(originalImage); if numberOfColors > 1 originalImage = originalImage(:,:,1); end bw = im2bw(originalImage, graythresh(originalImage)); binaryImage = imfill(bw, 'holes'); axis square; set(gcf, 'Position', get(0, 'ScreenSize')); % Display the binary image. labeledImage = bwlabel(bw, 8); % Label each blob so we can make measurements of it subplot(3, 3, 4); imagesc(labeledImage); title('Labeled Image, from bwlabel()'); axis square; % Get all the blob properties. Can only pass in originalImage in version R2008a and later. blobMeasurements = regionprops(labeledImage, originalImage, 'all');
From: Akshay Chaudhari on 7 Feb 2010 00:24 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <1f7e66a1-e1a7-45f0-9951-6cf9dfc01efa(a)c28g2000vbc.googlegroups.com>... > On Feb 6, 8:05 pm, "Akshay Chaudhari" <sickofhotm...(a)gmail.com> wrote: > > Thanks for the help, I'll change the name of the image, just to avoid confusion in the future. In terms of the image that I used, here is link for it:http://drop.io/b2r3eej > > > > In the variable editor it says up as a "a x b" matrix, not a "p x q x r" matrix. > > ------------------------------------------------------------------------------------------------------ > No it doesn't. I downloaded binary.png and it says it is a color > image. It says it's a 322 x 427 x 3 image. I changed your code to > convert it to a monochrome image, and changed the name back to > originalImage instead of Image. Now it works. Fixed code is below: > > originalImage = imread('C:\Documents and Settings\tk2013\My Documents > \Temporary stuff\binary.png'); > [rows columns numberOfColors] = size(originalImage); > if numberOfColors > 1 > originalImage = originalImage(:,:,1); > end > bw = im2bw(originalImage, graythresh(originalImage)); > binaryImage = imfill(bw, 'holes'); > axis square; > set(gcf, 'Position', get(0, 'ScreenSize')); > % Display the binary image. > labeledImage = bwlabel(bw, 8); % Label each blob so we can make > measurements of it > subplot(3, 3, 4); imagesc(labeledImage); title('Labeled Image, from > bwlabel()'); axis square; > % Get all the blob properties. Can only pass in originalImage in > version R2008a and later. > blobMeasurements = regionprops(labeledImage, originalImage, 'all'); Oh ok, I see. So the problem was that the image was a three dimensional image? How did you convert it to a monochromatic image? Thanks for all the help so far!
From: ImageAnalyst on 7 Feb 2010 10:36 I converted it to a monochrome image by taking the red channel: originalImage = originalImage(:,:,1); Since it's just black and white (although it's not binary nor monochrome) all the color channels are the same so taking the red one is as good as taking any or as good (but faster) than calling rgb2ind().
From: Akshay Chaudhari on 7 Feb 2010 16:44 I tried running it, it works, but for some reason, the it only sees 1 blob. There are three distinct blobs in the image and I can't seem to figure out what is wrong. The bwboundaries seems to be working fine, but even in my variable editor, numberofblobs is 1.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Matlab Noob.. can anyone help? Next: about intel c++ compiler 11 |