I want to process my image as blocks of size 5*5 and want to map each block to a value based on the color of its central pixel. Next I want to perform block matching with blocks of same or similar key. Please help with matlab code.

2 vues (au cours des 30 derniers jours)
For the example code, please map the central pixel to black. How can the key values be stored for easily being processed in further steps

Réponse acceptée

Image Analyst
Image Analyst le 1 Déc 2015
See my blockproc demos, attached. They demonstrate a variety of ways to use blockproc. Feel free to adapt.
  2 commentaires
Merlyn Tom
Merlyn Tom le 1 Déc 2015
Thankyou for the blockproc demos. Please give an example of how the central pixel of the block can be accessed and processed when using blockproc.
Image Analyst
Image Analyst le 1 Déc 2015
You'd have to use myFilter in blockproc_demo2. Then in there you have the block as array3x3. So to get the middle pixel (its gray level), you'd do:
middlePixel = array3x3(2,2);
I seriously doubt you'd need to do this unless you're doing something highly specialized. You might be able to just modify some kernel if you're doing regular filtering.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by