convert block cell to image
Show older comments
how to convert 8*8 non overlapping blocks into an image?
2 Comments
Rik
on 16 Aug 2019
What do you mean exactly? Do you mean something like blockproc?
puja yadavalli
on 16 Aug 2019
Answers (1)
KSSV
on 16 Aug 2019
Let I be your 8*8 cell block ..
iwant = cell2mat(I) ;
8 Comments
puja yadavalli
on 16 Aug 2019
puja yadavalli
on 20 Aug 2019
KSSV
on 20 Aug 2019
Show us the whole code you tried.
Guillaume
on 21 Aug 2019
Your code starts with moderately useful comments and then quickly gives up. Unfortunately, the uncommented part is the one that need comments the most in order to understand what is going on.
I suspect that you've pieced this code together from various answers, without thinking much about the overall architecture. You need to review your code line by line and think if it makes sense. I would suggest that you run your code line by line using the debugger and after each line think: did this make sense? Was it actually useful?
e.g, at the start you get the size of the image as m,n (you already know what it is since you forced it to 512x512, but it's always a good idea to ask for it anyway), however on the next line you hardcode (wrongly!) the number of blocks. The number of blocks depend on the the size of the image.
Later on, you have the unnecessary variable counti and countj (they're always equal to i and j)
Then you have variables that are never used such as b and iwant.
I gave up trying to understand after that.
puja yadavalli
on 21 Aug 2019
Edited: puja yadavalli
on 21 Aug 2019
Guillaume
on 21 Aug 2019
I'm sorry, due to the lack of explanation it would require too much of my time to try to understand your code, let alone find what is wrong with it. The first thing you need to do is comment your code, to explain what each major step is trying to do.
puja yadavalli
on 21 Aug 2019
Categories
Find more on Neighborhood and Block Processing 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!