adds sumexpgradcomp energy
This commit is contained in:
parent
f3cb18d9a0
commit
1521da1120
@ -113,8 +113,27 @@ std::string function = "grad";
|
|||||||
(fabs((float)source[indexPixel_right + ch] - \
|
(fabs((float)source[indexPixel_right + ch] - \
|
||||||
source[indexPixel + ch])))); \
|
source[indexPixel + ch])))); \
|
||||||
} \
|
} \
|
||||||
|
} else if (function == "sumexpgradcomp") { \
|
||||||
|
\
|
||||||
|
for (auto ch = 0; ch < (nbColorChannels); ch++) { \
|
||||||
|
dest += (std::exp(fabs((float)source[indexPixel_up + ch] - \
|
||||||
|
source[indexPixel + ch]) / \
|
||||||
|
255) + \
|
||||||
|
\
|
||||||
|
std::exp(fabs((float)source[indexPixel_down + ch] - \
|
||||||
|
source[indexPixel + ch]) / \
|
||||||
|
255) + \
|
||||||
|
\
|
||||||
|
std::exp(fabs((float)source[indexPixel_left + ch] - \
|
||||||
|
source[indexPixel + ch]) / \
|
||||||
|
255) + \
|
||||||
|
std::exp(fabs((float)source[indexPixel_right + ch] - \
|
||||||
|
source[indexPixel + ch]) / \
|
||||||
|
255)); \
|
||||||
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
std::cerr << "function " << function << " not available" << std::endl; \
|
std::cerr << "no implementation found for function \"" << function << "\"" \
|
||||||
|
<< std::endl; \
|
||||||
exit(1); \
|
exit(1); \
|
||||||
};
|
};
|
||||||
// Le alpha n'est pas pris en compte dans l'énergie
|
// Le alpha n'est pas pris en compte dans l'énergie
|
||||||
|
Loading…
x
Reference in New Issue
Block a user