matlab programming help required
Show older comments
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 Comments
José-Luis
on 9 Aug 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
on 9 Aug 2017
Please show the current code, such that we can suggest an improvement.
charu shree
on 10 Aug 2017
José-Luis
on 10 Aug 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
on 10 Aug 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
on 10 Aug 2017
Answers (1)
Image Analyst
on 9 Aug 2017
0 votes
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F
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 Comments
charu shree
on 10 Aug 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
on 10 Aug 2017
Image Analyst
on 24 Aug 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
on 8 Sep 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
on 8 Sep 2017
Edited: Image Analyst
on 8 Sep 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.
Categories
Find more on Neighborhood and Block Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!