How to reduce execution time of a code in matlab R2013a
1 view (last 30 days)
Show older comments
Attached is the complete code for "Copy move image forgery detection using PCA". The input and output required are also attached with the post. Problem is this code works only for input1, and for other input images it just shows its input image as the output. Please help to rectify the code.kindly also suggest something to reduce the execution time of the code which is nearly 15 minutes.
3 Comments
Answers (1)
Brendan Hamm
on 22 May 2015
Edited: Brendan Hamm
on 22 May 2015
To reduce execution time, run the code in the Profiler.
Looking at your code I would suggest attempting to remove the loops if possible and vectorize your code. Furthermore, I would suggest not using the disp() function inside of a for-loop as this takes valuable resources and is not usually necessary. Lastly pre-allocate space for x1,*y1*,etc. that are assigned in the loop. By not pre-allocating you are making a new copy of the data stored in the vector at every iteration in your loop.
See Also
Categories
Find more on Image Data Workflows 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!