Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: A time consuming function
Replies: 2   Last Post: Mar 29, 2012 8:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
draasoft

Posts: 12
Registered: 3/28/12
Problem Solved
Posted: Mar 29, 2012 8:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I think I found the problem,

It was a problem of ty conversion: the input image has to be converted into double (in order to avoid problem with the exponential operator), then the final result should be reconverted into uint8.

Thank you for anyone wanted to help

Here is my fast code:

function [out]=enhance2(in,a,b,c,k)
in=double(in);
[aa bb]=size(in);

dev=stdfilt(in);
M=mean2(in);

H = fspecial('average',[3 3]);
moy = imfilter(in, H);

out=(k*M./(dev+b)).*(in-c.*moy)+moy.^a;

out=uint8(out);

return



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.