how to convert 8*8 non overlapping blocks into an image?

2 件のコメント

Rik
Rik 2019 年 8 月 16 日
What do you mean exactly? Do you mean something like blockproc?
puja yadavalli
puja yadavalli 2019 年 8 月 16 日
i've converted an image to blocks..now i want the image back using these blocks

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2019 年 8 月 16 日

0 投票

Let I be your 8*8 cell block ..
iwant = cell2mat(I) ;

8 件のコメント

puja yadavalli
puja yadavalli 2019 年 8 月 16 日
mat.PNG
when i applied the cell2mat function,i couldnt retrive the original image from the blocks
KSSV
KSSV 2019 年 8 月 16 日
編集済み: KSSV 2019 年 8 月 16 日
Did you do any operations on the cell? How did you get 8*8 cells? From the image it looks like each cell is same.
puja yadavalli
puja yadavalli 2019 年 8 月 20 日
the pic is when i tried to watermark the 8*8 blocks and rearrange the blocks back as an image
KSSV
KSSV 2019 年 8 月 20 日
Show us the whole code you tried.
Guillaume
Guillaume 2019 年 8 月 21 日
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
puja yadavalli 2019 年 8 月 21 日
編集済み: puja yadavalli 2019 年 8 月 21 日
tq sir..i will use line by line debugger..i was trying to watermark an image ...im just a beginner and trying to learn matlab!
Guillaume
Guillaume 2019 年 8 月 21 日
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
puja yadavalli 2019 年 8 月 21 日
Okay sir..I would see step wise and then ask particular step if any doubt arises..I should have sent the code along with block diagram I was trying to complete..thank you sir

サインインしてコメントする。

質問済み:

2019 年 8 月 16 日

コメント済み:

2019 年 8 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by