From: ImageAnalyst on 25 Mar 2010 08:52 Change the lines to this: stripedImage(:, max(binaryImage,[],2) > 0 ) = 255; subplot(2,2, 3); imshow(stripedImage); title('Horizontal stripes'); axis on; % Get the vertical profile. verticalProfile = (max(binaryImage, 2) == 1);
From: Steven Lord on 25 Mar 2010 09:45 "Sami Oueslati" <Samyw69(a)yahoo.fr> wrote in message news:hofe9d$eee$1(a)fred.mathworks.com... > Ok I will see that and when the strips are in a horizontal way...how I do > that??? Is there a function for rows like 'diff' for columns????? > Thanks. There is ... it is also called DIFF :) Specify the dimension over which to perform the DIFFing. x = magic(4); y1 = diff(x, [], 1) y2 = diff(x, [], 2) y1a = x(2:end, :) - x(1:end-1, :) y2a = x(:, 2:end) - x(:, 1:end-1) -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Sami Oueslati on 27 Mar 2010 02:10 Hi all! It was funny Steven lool....thanks anyway.. ImageAnalyst, a very big thank for your help...finally It works...for the problem of the first white line at the left I've written this code: if (stripeStarts(1) > stripeEnds(1)) stripeStarts = [1, stripeStarts]; stripeEnds = [stripeEnds, size(VerticalProfile,2)]; centerLines = round((stripeStarts(2:end) + stripeEnds(2:end)) / 2); binaryImage1 = stripedImage; binaryImage1(:, centerLines) = 0; subplot(3,2, 4); imshow(binaryImage1, []); title('Vertical Stripes with centerlines'); axis on; else centerLines = round((stripeStarts + stripeEnds) / 2); binaryImage1 = stripedImage; binaryImage1(:, centerLines) = 0; end subplot(3,2, 4); imshow(binaryImage1, []); title('Vertical Stripes'); axis on; I think it's too long but it worked and it's what I'm able to do lool My salutations Sami.
First
|
Prev
|
Pages: 1 2 3 Prev: Using Trapz function Next: plotting equi-distant points given 4 coords points |