What does the LineBufferSize property of Median Filter actually mean?

1 view (last 30 days)
Hello. I need help with understanding of http://www.mathworks.com/help/visionhdl/ref/visionhdl.medianfilter-class.html#bt46bx9-6 The description for LineBufferSize property says: "Choose a power of 2 that accommodates the number of active pixels in a horizontal line. If you specify a value that is not a power of two, the object uses the next largest power of two. The object allocates N - 1-by-LineBufferSize memory locations to store the pixels used to compute the median value. N is the number of lines in the square region specified in Neighborhood size."
1. Is there anywhere separate block or function for hdl coder to operate with pixel and its neighborhood?
2. Does this mean if I have 320 active pixels per line so I need to set 512 value for LineBufferSize at least?
3. Does object allocate N separate vectors with LineBufferSize lengh or matrix (N-1)xLineBufferSize? If second option, could you explain why so?

Accepted Answer

Brian Ogilvie
Brian Ogilvie on 4 Apr 2016
Hi Vladislav,
Yes, you have correctly understood the LineBufferSize property for the Median Filter. It is the length of the active video line that must be buffered for operations that span multiple lines, so for 320 active pixels, you should use at least 512. In an FPGA there may be an advantage to using the block RAM size, typically 2048, and that is why that value is the default.
For pixel and neighborhood operations, you should choose the Vision HDL Toolbox Image Filter block from the Filtering library. This allows arbitrary image filter kernels up to 16 by 16.
The internal memory allocation is a matrix in the software simulation in MATLAB or Simulink and separate buffer RAM memories in the generated HDL code.
I hope this answers your questions but feel free to ask more here or via the normal support channel.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!