matlab programming help required

i want to divide an image into overlapping blocks and then apply svd is applied to each block to extract its corresponding singular values feature vectors ......pls can anyone tell me how to do this as i am unable to do it after trying so many times

7 comentarios

José-Luis
José-Luis el 9 de Ag. de 2017
Since you've tried many times, it should be easy for you to show us what you have done and point out where you are stuck and/or where errors arise.
Easier to help you that way.
Jan
Jan el 9 de Ag. de 2017
Please show the current code, such that we can suggest an improvement.
charu shree
charu shree el 10 de Ag. de 2017
@ john simon and jose luis , i am attaching my code. pls help me
José-Luis
José-Luis el 10 de Ag. de 2017
You're still not saying what your problem is.
I can't run your code because I don't have the wavelet toolbox.
charu shree
charu shree el 10 de Ag. de 2017
@ jose-lius ....i will tell u from start. i am having a project in matlab. In that first step is to convert color image into grayscale image. Second step is to apply SWT(stationary wavelet transform) to gray scale image. After this we get 4 different images. They are LL, LH,HL,HH. Third step is to divide LL into overlapping blocks of size B*B and then apply SVD (singular value decomposition) to all these blocks. I am unable to do this third step. first and second step i built the code successfully. So i need help in the third step. pls help me.
Jan
Jan el 10 de Ag. de 2017
Editada: Jan el 10 de Ag. de 2017
@charu shree: Explaining all steps is not useful here. It does not help, if we spend the time to understand the chain of steps. Concentrate on the step, in which you have a problem.
What exactly is "LL"? Is the dividing into the blocks the problem, or the application of the SVD? What exactly is "this third step"? What have you tried so far?
Give us a chance to help you.
charu shree
charu shree el 10 de Ag. de 2017
@jan simon, i want help in dividing an image of size M*N into overlapping blocks of size B*B so that further i should be able to process each block.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 9 de Ag. de 2017

0 votos

For overlapping tiles, as opposed to adjacent, non-overlapping tiles, you can still use blockproc().
If the overlap is the entire tile except for one pixel (in other words the window moves over just one pixel at a time instead of in "jumps" of the whole tile size) then you can use nlfilter().

6 comentarios

charu shree
charu shree el 10 de Ag. de 2017
@image analyst.....pls stop giving same same code every time . My question is pretty simple. How to divide an image into OVERLAPPING BLOCKS so that we can perform further operations ON EACH AND EVERY BLOCKS OBTAINED AFTER DIVISION.
Jan
Jan el 10 de Ag. de 2017
Editada: Jan el 10 de Ag. de 2017
@charu shree: It might be true, that your problem is simple. But you did not explain it clearly yet.
@Image Analyst: The doc of blockproc seems to explain the division into non-overlapping parts. I can defined the block size and a BorderSize. Is overlapping defined by a BorderSize and disableing 'TrimBorder'?
If so: @charu: why not using blockproc? It seems like a direct solution for a simple problem.
charu shree
charu shree el 10 de Ag. de 2017
@image analyst, in ieee paper which i want to implement in matlab, nothing is mentioned about BorderSize and TrimBorder. shall i send u the paper.
Image Analyst
Image Analyst el 24 de Ag. de 2017
charu, sorry but I don't have time to program up a paper for you. Jan, the overlap is supposed to be controlled by the 'border' option. I'm working on an overlapping demo of blockproc() - my previous demos were for non-overlapping blocks. However I'm not sure everyone is consistent in their usage of the term overlapping. I've seen prior questions where people say they want overlapping when it turned out they actually wanted non overlapping blocks. They wanted blocks to be adjacent/touching/stitched/non-overlapping and only called it overlapping because the "blocks" or "tiles" sort of completely covered ("overlapped" in their mind) the image, if you see what I mean.
Frankly I don't see the need for overlapping at all unless you overlap by the block size minus 1, which essentially means you're scanning the image with a window and moving it over one pixel at a time, which is the most common and standard way of doing image filtering and is how functions like imdilate(), imfilter(), nlfilter(), imtophat(), stdfilt(), etc. etc. all work.
TUSHAR MURATKAR
TUSHAR MURATKAR el 8 de Sept. de 2017
@ image analyst....can you tell me how many total number of blocks we will get if we divide an image having rows=486 and columns = 732 into overlapping blocks. The block size is 8x8. Any help in this regard is highly appreciated.
Image Analyst
Image Analyst el 8 de Sept. de 2017
Editada: Image Analyst el 8 de Sept. de 2017
There will be 61 blocks vertically and 92 blocks horizontally if there is no overlap. You could have up to 486 blocks veritcally and 732 blocks horizontally depending on the amount of overlap. In that extreme case (overlapping so much that the block just moves over one pixel), then you're probably better off using nlfilter(). In the majority of cases where people use blockproc(), they don't use an overlap. Why do you want an overlap instead of normal adjacent/touching tiling of the image?
I'm attaching a demo where you can specify overlap, but I really doubt you want any overlap. I'd bet you want just normal tiling and are getting confused with the terminology because when you visualize tiled blocks you think they overlap or cover the image, however with normal tiling the overlap of the tiles with each other is zero.

Iniciar sesión para comentar.

Preguntada:

el 9 de Ag. de 2017

Editada:

el 8 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by