連結已複製
Sorry, the image is too low resolution for me to quite make out what your design looks like. Could you upload a higher resolution version (if you can't do it on this forum, upload it at a free image sharing site such as imgur.com) and post a couple of details about what output you are getting.
Did you intend it to be a 2x2 convolution matrix? to avoid half pixel shifts you need to do an odd number filter, like 3x3 or 5x5. But you have a x4 overall gain, so I guess you've got a very bright white output image?
You also restrict your image size to 300 wide.When you are doing your filter, you are adding the pixel values but they are in uint8 format, so the sum can't get above 255. You have to make sure that the bit widths accommodate your sum to get large enough. ALSO you need to divide the result by your filter size. So if you are doing a 3x3 blur you should be adding the pixel values of the 9 pixels and then dividing the sum by 9.
In the attached simulink file, i simply did 3x3 blurring (as an average of pixel values) on the individual R,G,B channels. The blurring works if all your bitwidths are set correctly. For example the accumulator bitwidth is set to 16 instead of 8 (although 16 is far too much). Then I also have a gain block of 1/9 to average the sums. Also I'm just using the native simulink library, not dsp builder but the concepts remain.