patchGNU Octave - Patches: patch #8059, [octave forge] (image) ranktf.m

 
 

patch #8059: [octave forge] (image) ranktf.m

Submitter:  Ming Liu <liuming198904>
Submitted:  Sat 25 May 2013 06:18:15 AM UTC
   
 
Category:  Forge : new function Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 26 May 2013 08:57:21 AM UTC, comment #4: 

Actually rank transform is a good way of implementing "stereo matching" in computer vison. Because it ideally reduces the noise that is harmful to perform the stereo matching. In fact Matlab does not have a similar function. Here is a website for such kind of info:
http://siddhantahuja.wordpress.com/tag/rank-transform/
The author uses three for loops to achieve this.
Rank transform uses a sliding window algorithm, aims to find the rank of every pixel in its neighbors(4,9,16,25... neighbors,the square of 2,3,4,5...). This is why I used two for loops. Considering it is very slow, I am trying to vectorize it.
So take the window size 3 and an image with the size of 10*10 for example. I think:
1. Firstly I need to convert the image to a vector.
2. Then start at the item 1:3 and item 11:13 and item 21:23 as the first step. Try to find the rank of item 2 in all these items
3. ...
Is it a clear and a correct way to go? Or anyone has a better solution?

Ming Liu <liuming198904>
Sat 25 May 2013 04:40:10 PM UTC, comment #3: 

Is there a matlab function that performs something similar to this so we can make it compatible? I don't find one.

Also, this function has 2 for loops to iterate over all pixels which will make it very slow. Could you vectorize it?

Carnë Draug <carandraug>
Group Member
Sat 25 May 2013 06:29:42 AM UTC, comment #2: 


example:

Irank = ranktf('test.png',9);
imshow(Irank)

Ming Liu <liuming198904>
Sat 25 May 2013 06:24:22 AM UTC, comment #1: 

usage:

Irank = ranktf(image, window);
imshow(Irank,[]);


sorry, the 'windowsize' in the previous email is actually 'window', sorry for this typo

Ming Liu <liuming198904>
Sat 25 May 2013 06:18:15 AM UTC, original submission:  

rank transform for an image.
image is the real name of an image. windowsize is the size of window to
be used for the rank transform, it must be an odd possitive integer number
greater than 3
I is the rank transformed image, based on the window size you choose.
For example, if the  window size is 3x3 and apply
the window to the original grayscale image, then the center of the pixels
within the window from the original grayscale image will be
replaced by the ‘rank’ of the center pixel value. So it is between
1 and 9, assuming there are no same pixel values. The advantage is all the
pixel values in the image at last will be replaced by their ranks. So
the noise and other mistakes during taking the photo will be ideally
ignored. All the pixel values will be in a small range (the square of
the window size). This is a very useful function in image processing

Ming Liu <liuming198904>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #28166:  Ming_Liu_ranktf.patch added by liuming198904 (2KiB - application/octet-stream)
file #28167:  ranktf.m added by liuming198904 (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by liuming198904 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-10 mtmiller CategoryNone Forge : new function
        Summary[new function for image package] ranktf.m [octave forge] (image) ranktf.m
    2013-05-28 jwe Carbon-CopyRemoved -email is unavailable- -
    2013-05-25 liuming198904 Attached File- Added Ming_Liu_ranktf.patch, #28166
        Attached File- Added ranktf.m, #28167
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code