I was working with rbbox on my Matlab GUI application to create squares that marked important stuff inside an image. I recently needed to move away from the rectangle based approach to a polygon based approach. This meant not using rbbox. I found cool im* commands that did what I needed. These commands include imrect, impoly and imfreehand.
Today I pretty much finished the coding of the new version (with some little issues to resolve). When I did my final tests, I noticed that the new version lagged just a little when doing annotation actions (creating, moving, deleting…). I took this a bit further and did a very simple “top” based test to compare two versions of the GUI. The first version is the current one that implements the annotations with im* commands. And the other version is the one that I replaced that used the rbbox command.
In the figure, red line means the execution with the rm* functions, blue means rbbox. Notice that at the begining there is a spike that is comparable in the two cases. This is the GUI initialization.
In both lines there is a second spike that represents the start of a rectangle creation. Notice that the imrect (red) command uses 100% of one of my CPUs while the rbbox uses 50% approx.
After I created the rectangle I stretched it a bit before finalizing the tests. Notice that the stretch action in the imrect line (red) is eating at my CPU. It has a second spike that reaches close to 100%. While the rbbox line (blue) has a milder footprint and does not go past 50%.
So: What is imrect doing that eats up most of my CPU? I have no idea :(. But it’s annoying. One explanation could be the extra functionality that im* functions bring to the GUI. But given the performance of rbbox, I’m left with the impression that it could be done better.
please help me for matlab image processing. my mail adres: email@example.com
I’ve been frustrated with Matlab myself :). If you have any specific questions, ask through here. It would be much better to publish the discussion and have it available for anybody that is interested. You can also checkout my annotation app at https://github.com/Joelgranados/annotation. It has a lot of Matlab code dealing with images.
Hope it helps
hi, pls give me idea how for medical images for neural network based segmentation. ihave to the lumbar MR images. pls help me.
I guess you are looking for a place to start. You can begin reading about Neural Networks and getting to know how matlab does it. These links will probably get you started: http://www.mathworks.com/products/neural-network/, http://en.wikipedia.org/wiki/Neural_network. If you are studying in a University, I would suggest to get into a Machine Learning class, something that will teach you the basics of stuff like NN, SVM …
Notice that I can’t tell you how to do segmentation for MRI images. There is lots of research going on in this field and there is tons of ways to do it. Also, I am no expert in medical uses of Machine learning.
I would also suggest you take a look at papers from CS digital libraries: http://dl.acm.org/, http://ieeexplore.ieee.org/Xplore/guesthome.jsp
Hope it helps
Can you please let me know how to use imroi command. The ROi I would like to extract is irregular in shape I am willing to read only that section . is it possible using imroi. what is the sequence of commands. what is h and h_im here. How to create mask.
I have not used the imroi class. The way I have created my regions of interest is from interactions of the user with an image axis. I have used impoly, imrect and friends. Look at line 256 of https://github.com/Joelgranados/EcoAN/blob/master/src/annotation_gui.m for examples on how I used them.
I did not really need to do the masks in this code, but you need to search for methods that take a polygon (series of vertices) and transforms them into an image (e.g. http://www.mathworks.se/help/images/ref/poly2mask.html)
Hope it helps
I’ve experienced this issue! (Currently am experiencing it now)
Imroi and all the im* functions in MATLAB use so much processing power that my MacBook’s fan is on full! Haven’t found an explanation for the code inefficiency though :/