我已经使用此函数来计算CIE Lab颜色空间中的颜色差异,但它缺乏速度.由于我不是Java专家,我想知道是否有任何Java专家可以提供一些可以提高速度的技巧.
代码基于注释块中提到的matlab函数.
/**
* Compute the CIEDE2000 color-difference between the sample color with
* CIELab coordinates 'sample' and a standard color with CIELab coordinates
* 'std'
*
* Based on the article:
* "The CIEDE2000 Color-Difference Formula: Implementation Notes,
* Supplementary Test Data, and Mathematical Observations,", G. Sharma,
* W. Wu, E. N. Dalal, submitted to Color Research and Application,
* January 2004.
* available at http://www.ece.rochester.edu/~gsharma/ciede2000/
*/
public static double deltaE2000(double[] lab1, double[] lab2)
{
double L1 = …Run Code Online (Sandbox Code Playgroud) 我正在尝试为 SEO 目的制作一个爬虫,但我似乎无法让 PhantomJS 至少下载这个特定页面: https: //tablet.euroslots.com/home/
\n\n如果我使用 cURL 它工作正常(但显然不处理 javascript):
\n\n\xe2\x9c\x93 1344:0 /cherrytech/js-crawler root\xe2\x80\xba curl https://tablet.euroslots.com/home/\n<!doctype html><!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> ...\nRun Code Online (Sandbox Code Playgroud)\n\n我的 PhantomJS 脚本:
\n\nvar page = require(\'webpage\').create();\n\npage.onResourceRequested = function (request) {\n console.log(\'Request \' + JSON.stringify(request, undefined, 4));\n};\n\npage.onResourceReceived = function(response) {\n console.log(\'Response (#\' + response.id + \', stage "\' + response.stage + \'"): \' + JSON.stringify(response));\n};\n\npage.onResourceError = function(resourceError) {\n console.log(\'Unable to load resource (#\' + resourceError.id + \'URL:\' + resourceError.url + …Run Code Online (Sandbox Code Playgroud)