my work is feature extraction for character recognition.i have to split 100*100 binary image into diagonal style left and right directions of 20 regions... suggest me pls..
Show older comments
Accepted Answer
More Answers (1)
Walter Roberson
on 9 Sep 2015
0 votes
You need to define the scan pattern to use. Diagonals in matrices most naturally divide into an odd number, not an even number. For example in an 8 x 8 matrix, the matrix divides naturally into diagonals of length 1+2+3+4+5+6+7+8+7+6+5+4+3+2+1 = 64, which is 15 diagonals that would traditionally be numbered -7 to +7
In the example diagram you show, look at the bottom row. The left square is white. If we take that square as column 1, and let the columns be evenly spaced apart by distance D, then because the right column is also white, we arrive at the equation 1 + 10*D = 100 for some D. Clearly D cannot be integral.
7 Comments
Naarani P
on 10 Sep 2015
Image Analyst
on 10 Sep 2015
What form do you want these 20 bands (10 for each slant direction I presume) in? Each band will have a different number of pixels in it. Do you want each band to be a cell array containing a 1-D list of all the pixel values in that band?
Walter Roberson
on 10 Sep 2015
Here are 20 diagonals that cover the image, but the second half are not symmetric length with the first. I am investigating
B = fliplr(YourImage);
diags = cell(20,1);
for J = 1 : 20
T = cell(10,1);
for K = 1:10
T{K} = diag(B, (J-11)*10+K);
end
diags{J} = vertcat(T{:});
end
Naarani P
on 11 Sep 2015
Naarani P
on 11 Sep 2015
Image Analyst
on 11 Sep 2015
Edited: Image Analyst
on 11 Sep 2015
The image you showed at the very top is not binary - there are several gray levels there. Which variable is your binary image? Which line converts it into gray levels other than 0 and 1 (or 0 and 255)?
Walter Roberson
on 11 Sep 2015
My testing shows that the output is a cell array of whatever class YourImage is.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
