我使用Node.js
运行以下代码。在此代码中,已经进行了histogram equalization
进程。如何显示和保存原始图像和结果(直方图均衡)图像?
var jsfeat = require('./build/jsfeat.js');
var im = require('imagemagick');
var cols = 0;
var rows = 0;
var image = im.identify('abc.jpg', function(err, features){
if (!err){
cols = features.width;
rows = features.height;
}
});
var my_matrix = new jsfeat.matrix_t(cols, rows, jsfeat.U8_t | jsfeat.C4_t, data_buffer = undefined);
var equalization = new jsfeat.matrix_t(cols, rows, jsfeat.U8_t | jsfeat.C4_t);
var result = jsfeat.imgproc.equalize_histogram(my_matrix, equalization);
感谢。