Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a slice along the y axis at an x value such that you have nice boundaries. Then use "conv" to find the convolution of that 1-d vector (containing 0s and 1s) with the central part of an odd Gaussian function. This is like an edge filter, but will be robust to noise. That convolution will give you a bunch of irregularly-spaced peaks. Find the peaks, and count them. Each peak is the boundary between two books. (Sorry, this easy process is very hard to explain without a whiteboard.)</p> <p>"central part of an odd Gaussian function" = imagine a sine function, cut off at plus/minus pi. But the change from positive to negative is closer to a step function. I think you could get what you want by convolving a Gaussian and a step function. (Again, sorry for no whiteboard.)</p> <p>edit2: Here is some Matlab code, to be run interactively so you can see what I mean:</p> <pre><code>x=[-9.5:1:9.5]; y=[-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1]; plot(x,y,'.'); g=exp(-x.*x/8); plot(x,g,'.'); odd_g=conv(y,g);plot([-19:19],odd_g,'.') </code></pre> <p>So, odd_g (or something similar) is the thing you'd want to convolve with the image slice at a given x.</p> <pre><code>peaks=conv(image_slice,odd_g); </code></pre> <p>edit3: Suppose you had </p> <pre><code>image_slice=[1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1]; </code></pre> <p>and notice that I've put in a noisy edge. For the chosen values, when you plot the convolution, </p> <pre><code>plot(conv(image_slice,odd_g) </code></pre> <p>you see that the noise at the one edge gives a slight peak, but it's not as large as a true edge. So you'd find the peaks and discard any less than some cutoff value. And of course pick parameters for odd_g that are best suited to your data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload