windows7 64位机上,libjpeg-turbo的安装和使用

2023-11-11

libjpeg-turbo是对libjpeg的扩展,支持SIMD指令,如X86架构的MMXSSESSE23DNOWARM架构的NEON,在对jpeg进行编码和解码的过程中能提高速度。

MMX:多媒体扩展的缩写,第六代CPU芯片重要特点,57条指令。

SSE2:SIMD流技术扩展2,144个新增指令,被MMX优化过的程序很容易被SSE2进行更深层次的优化。

NEON:可加速多媒体和信号处理算法,它是ARM系列处理器的128位SIMD架构扩展。

在速度上,libjpeg-turbo一般是libjpeg的2-4倍。它既能调用libjpegAPI,又可调用TurboJPEG API。可以使用libjpeg-turbo替代libjpeg。

编译libjpeg-turbo:

1、从https://sourceforge.net/projects/libjpeg-turbo/通过TortoiseSVN下载libjpeg-turbo最新源代码,将其保存到D:\soft\libjpeg-turbo文件夹下;

2、从http://www.cmake.org/下载最新版的CMake,并安装;

3、在D:\soft\libjpeg-turbo文件夹下手动创建一个vs2010文件夹;

4、打开CMake,其中where isthe source code选项,选择D:/soft/libjpeg-turbo/libjpeg-turbo;where to build thebinaries选项,选择D:/soft/libjpeg-turbo/vs2010;

5、点击Configure,在弹出的对话框中选择VisualStudio 10,其它默认,点击Finish;

6、如果有红色框显示,继续点击Configure(将CMAKE_INSTALL_PREFIX中的value改为D:\libjpeg-turbo);

7、点击Generate,此时会在vs2010文件夹中看到libjpeg-turbo.sln文件;

8、从https://sourceforge.net/projects/nasm/下载最新版的nasm;

9、将nasm安装到D:\ProgramFiles\NASM文件夹下,并将其中的nasm.exe和ndisasm.exe两个文件拷贝到C:\ProgramFiles\Microsoft Visual Studio 10.0\VC\bin下(如果是64位,则拷贝到C:\ProgramFiles (x86)\Microsoft Visual Studio 10.0\VC\bin),将其D:\ProgramFiles\NASM添加到系统环境变量中;

10、打开libjpeg-turbo.sln,分别在Debug和Release下,选择Solution Explorer里的Solution libjpeg-turbo,点击右键,运行”Rebuild Solution”,然后选中INSTALL, build;

11、全部完成后会在D:\libjpeg-turbo文件夹下生成bin、doc、lib、include四个文件夹,编译成功(说明:默认的Debgu和Release下生成的所有文件夹都相同,注意区分);

12、打开vs2010,新建一个控制台应用程序,为vs2010配置libjpeg-turbo环境:选择View--> Properties Manager-->分别选中DebugRelease上的Microsoft.Cpp.Win32.user,点击右键-->PropertiesVC++ DirectoriesInclude DirectoriesD:\libjpeg-turbo\includeLibrary DirectoriesD:\libjpeg-turbo\lib

13、选中工程-->Properties-->Configuration Properties-->Linker-->Input-->AdditionalDependenciesDebugRelease,添加相应的.lib库;

14、D:\libjpeg-turbo\bin加入到windows系统环境变量Path中,重启。

新建一个控制台工程:

1、将jconfig.h文件拷贝到该工程目录下;

2、stdafx.h:

#pragma once

#include "targetver.h"

#include <stdio.h>

#include "D:/Soft/libjpegturbo/libjpegturbo/jpeglib.h"

3、stdafx.cpp:

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
#ifdef _DEBUG
	#pragma comment(lib, "D:/Soft/libjpegturbo/vs2010/Debug/jpeg-static.lib")
#else
	#pragma comment(lib, "D:/Soft/libjpegturbo/vs2010/Release/jpeg-static.lib")
#endif

4、main.cpp:

#include "stdafx.h"
#include <iostream>

#include <stdio.h>
#include <setjmp.h>
#include <string.h>
#include <stdlib.h>

using namespace std;

int read_JPEG_file(string strImageName)
{
	/* This struct contains the JPEG decompression parameters and pointers to
     * working space (which is allocated as needed by the JPEG library).
     */
	struct jpeg_decompress_struct cinfo;
	/* We use our private extension JPEG error handler.
     * Note that this struct must live as long as the main JPEG parameter
     * struct, to avoid dangling-pointer problems.
     */
	struct jpeg_error_mgr jerr;
	/* More stuff */
	FILE * infile;/* source file */
	JSAMPARRAY buffer;/* Output row buffer */
	int row_stride;/* physical row width in output buffer */

	/* In this example we want to open the input file before doing anything else,
	 * so that the setjmp() error recovery below can assume the file is open.
	 * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
	 * requires it in order to read binary files.
	 */
	if ((infile = fopen(strImageName.c_str(), "rb")) == NULL) {
		fprintf(stderr, "can't open %s\n", strImageName);
		return -1;
	}

	/* Step 1: allocate and initialize JPEG decompression object */
	/* We set up the normal JPEG error routines, then override error_exit. */
	cinfo.err = jpeg_std_error(&jerr);
	/* Establish the setjmp return context for my_error_exit to use. */
	//if (setjmp(jerr.setjmp_buffer)) {
		/* If we get here, the JPEG code has signaled an error.
		 * We need to clean up the JPEG object, close the input file, and return.
		 */
		//jpeg_destroy_decompress(&cinfo);
		//fclose(infile);
		//return -1;
	//}

	/* Now we can initialize the JPEG decompression object. */
	jpeg_create_decompress(&cinfo);

	/* Step 2: specify data source (eg, a file) */
	jpeg_stdio_src(&cinfo, infile);

	/* Step 3: read file parameters with jpeg_read_header() */
	jpeg_read_header(&cinfo, TRUE);
	/* We can ignore the return value from jpeg_read_header since
	 *   (a) suspension is not possible with the stdio data source, and
     *   (b) we passed TRUE to reject a tables-only JPEG file as an error.
     * See libjpeg.txt for more info.
     */
	printf("image_width = %d\n", cinfo.image_width);
	printf("image_height = %d\n", cinfo.image_height);
	printf("num_components = %d\n", cinfo.num_components);

	/* Step 4: set parameters for decompression */
	/* In this example, we don't need to change any of the defaults set by
     * jpeg_read_header(), so we do nothing here.
     */
	printf("enter scale M/N:\n");
	//scanf("%d/%d", &cinfo.scale_num, &cinfo.scale_denom);
	cinfo.scale_num = 2;
	cinfo.scale_denom = 4;
	printf("scale to : %d/%d\n", cinfo.scale_num, cinfo.scale_denom);

	/* Step 5: Start decompressor */
	jpeg_start_decompress(&cinfo);
	/* We can ignore the return value since suspension is not possible
     * with the stdio data source.
     */

	//输出的图象的信息
	printf("output_width = %d\n", cinfo.output_width);
	printf("output_height = %d\n", cinfo.output_height);
	printf("output_components = %d\n", cinfo.output_components);

	/* We may need to do some setup of our own at this point before reading
	 * the data.  After jpeg_start_decompress() we have the correct scaled
     * output image dimensions available, as well as the output colormap
     * if we asked for color quantization.
     * In this example, we need to make an output work buffer of the right size.
     */ 
	/* JSAMPLEs per row in output buffer */
	row_stride = cinfo.output_width * cinfo.output_components;
	/* Make a one-row-high sample array that will go away when done with image */
	buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);

	/* Step 6: while (scan lines remain to be read) */
    /*           jpeg_read_scanlines(...); */
	/* Here we use the library's state variable cinfo.output_scanline as the
     * loop counter, so that we don't have to keep track ourselves.
     */
	while (cinfo.output_scanline < cinfo.output_height) {
    /* jpeg_read_scanlines expects an array of pointers to scanlines.
     * Here the array is only one element long, but you could ask for
     * more than one scanline at a time if that's more convenient.
     */
		jpeg_read_scanlines(&cinfo, buffer, 1);
		/* Assume put_scanline_someplace wants a pointer and sample count. */
		//put_scanline_someplace(buffer[0], row_stride);
	}

	/* Step 7: Finish decompression */
	jpeg_finish_decompress(&cinfo);
    /* We can ignore the return value since suspension is not possible
     * with the stdio data source.
     */

	/* Step 8: Release JPEG decompression object */
	/* This is an important step since it will release a good deal of memory. */
	jpeg_destroy_decompress(&cinfo);

	/* After finish_decompress, we can close the input file.
	 * Here we postpone it until after no more JPEG errors are possible,
	 * so as to simplify the setjmp error logic above.  (Actually, I don't
	 * think that jpeg_destroy can do an error exit, but why assume anything...)
	 */
	fclose(infile);

    /* At this point you may want to check to see whether any corrupt-data
     * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
     */

	return 0;
}

int write_JPEG_file(string strImageName, int quality)
{
	unsigned char* image_buffer;	/* Points to large array of R,G,B-order data */
	int image_height = 200;	/* Number of rows in image */
	int image_width = 400;	/* Number of columns in image */

	/* This struct contains the JPEG compression parameters and pointers to
     * working space (which is allocated as needed by the JPEG library).
     * It is possible to have several such structures, representing multiple
     * compression/decompression processes, in existence at once.  We refer
     * to any one struct (and its associated working data) as a "JPEG object".
     */
    struct jpeg_compress_struct cinfo;

	/* This struct represents a JPEG error handler.  It is declared separately
     * because applications often want to supply a specialized error handler
     * (see the second half of this file for an example).  But here we just
     * take the easy way out and use the standard error handler, which will
     * print a message on stderr and call exit() if compression fails.
     * Note that this struct must live as long as the main JPEG parameter
     * struct, to avoid dangling-pointer problems.
     */
	struct jpeg_error_mgr jerr;
	/* More stuff */
	FILE * outfile;		/* target file */
	JSAMPROW row_pointer[1];	/* pointer to JSAMPLE row[s] */
	int row_stride;		/* physical row width in image buffer */

	/* Step 1: allocate and initialize JPEG compression object */

    /* We have to set up the error handler first, in case the initialization
     * step fails.  (Unlikely, but it could happen if you are out of memory.)
     * This routine fills in the contents of struct jerr, and returns jerr's
     * address which we place into the link field in cinfo.
     */
	cinfo.err = jpeg_std_error(&jerr);
	/* Now we can initialize the JPEG compression object. */
	jpeg_create_compress(&cinfo);

	/* Step 2: specify data destination (eg, a file) */
    /* Note: steps 2 and 3 can be done in either order. */

    /* Here we use the library-supplied code to send compressed data to a
     * stdio stream.  You can also write your own code to do something else.
     * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
     * requires it in order to write binary files.
     */
	if ((outfile = fopen(strImageName.c_str(), "wb")) == NULL) {
		fprintf(stderr, "can't open %s\n", strImageName);
		//exit(1);
		return -1;
	}
	jpeg_stdio_dest(&cinfo, outfile);

	/* Step 3: set parameters for compression */
	/* First we supply a description of the input image.
	 * Four fields of the cinfo struct must be filled in:
	 */
	cinfo.image_width = image_width; 	/* image width and height, in pixels */
	cinfo.image_height = image_height;
	cinfo.input_components = 3;		/* # of color components per pixel */
	cinfo.in_color_space = JCS_RGB; 	/* colorspace of input image */
	/* Now use the library's routine to set default compression parameters.
	 * (You must set at least cinfo.in_color_space before calling this,
	 * since the defaults depend on the source color space.)
	 */
	jpeg_set_defaults(&cinfo);
	/* Now you can set any non-default parameters you wish to.
	 * Here we just illustrate the use of quality (quantization table) scaling:
	 */
	jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);

	/* Step 4: Start compressor */
	/* TRUE ensures that we will write a complete interchange-JPEG file.
	 * Pass TRUE unless you are very sure of what you're doing.
	 */
	jpeg_start_compress(&cinfo, TRUE);

	/* Step 5: while (scan lines remain to be written) */
	/*           jpeg_write_scanlines(...); */
	/* Here we use the library's state variable cinfo.next_scanline as the
	 * loop counter, so that we don't have to keep track ourselves.
	 * To keep things simple, we pass one scanline per call; you can pass
	 * more if you wish, though.
	 */
	row_stride = image_width * 3;	/* JSAMPLEs per row in image_buffer */

	image_buffer = new unsigned char[row_stride * cinfo.image_height];
	memset(image_buffer, 0xff, row_stride * cinfo.image_height);
	
	int line = 0;
	//while (cinfo.next_scanline < cinfo.image_height) {
	while (line < cinfo.image_height) {
		/* jpeg_write_scanlines expects an array of pointers to scanlines.
		 * Here the array is only one element long, but you could pass
		 * more than one scanline at a time if that's more convenient.
		 */
		//row_pointer[0] = &image_buffer[cinfo.next_scanline * row_stride];
		row_pointer[0] = &image_buffer[line * row_stride];
		jpeg_write_scanlines(&cinfo, row_pointer, 1);

		line ++;
	}

	delete image_buffer;

	/* Step 6: Finish compression */
	jpeg_finish_compress(&cinfo);
	/* After finish_compress, we can close the output file. */
	fclose(outfile);

	/* Step 7: release JPEG compression object */
	/* This is an important step since it will release a good deal of memory. */
	jpeg_destroy_compress(&cinfo);

	return 0;
}

struct Image
{
	int bpp;
	int width;
	int height;
	unsigned char* data;
};

struct jerror_mgr
{
	jpeg_error_mgr base;
	jmp_buf        jmp;
};

METHODDEF(void) jerror_exit(j_common_ptr jinfo)
{
	jerror_mgr* err = (jerror_mgr*)jinfo->err;
	longjmp(err->jmp, 1);
}

METHODDEF(void) joutput_message(j_common_ptr)
{
}

bool Image_LoadJpeg(Image* image, unsigned char* img_data, unsigned int img_size)
{
	jpeg_decompress_struct jinfo;
	jerror_mgr jerr;

	jinfo.err = jpeg_std_error(&jerr.base);
	jerr.base.error_exit = jerror_exit;
	jerr.base.output_message = joutput_message;
	jpeg_create_decompress(&jinfo);

	image->data = NULL;

	if (setjmp(jerr.jmp)) goto bail;

	jpeg_mem_src(&jinfo, img_data, img_size);

	if (jpeg_read_header(&jinfo, TRUE) != JPEG_HEADER_OK) goto bail;

	jinfo.dct_method = JDCT_FLOAT; // change this to JDCT_ISLOW on Android/iOS

	if (!jpeg_start_decompress(&jinfo)) goto bail;

	if (jinfo.num_components != 1 && jinfo.num_components != 3) goto bail;

	image->data = new (std::nothrow) unsigned char [jinfo.output_width * jinfo.output_height * jinfo.output_components];
	if (!image->data) goto bail;

	{
		JSAMPROW ptr = image->data;
		while (jinfo.output_scanline < jinfo.output_height)
		{
			if (jpeg_read_scanlines(&jinfo, &ptr, 1) != 1) goto bail;

			ptr += jinfo.output_width * jinfo.output_components;
		}
	}

	if (!jpeg_finish_decompress(&jinfo)) goto bail;

	image->bpp = jinfo.output_components;
	image->width = jinfo.output_width;
	image->height = jinfo.output_height;

	jpeg_destroy_decompress(&jinfo);

	return true;

bail:
	jpeg_destroy_decompress(&jinfo);
	if (image->data) delete [] image->data;

	return false;
}

struct ImageData {
	unsigned char *pixels;
	long  width;
	long height;
};

int TestImage(string strSrcImageName, string strDstImageName)
{
	//read
	struct jpeg_decompress_struct cinfo_decompress;
	FILE* infile;
	int row_stride;
	struct jpeg_error_mgr jerr;

	if ((infile = fopen(strSrcImageName.c_str(), "rb")) == NULL) {
		fprintf(stderr, "can't open %s\n", strSrcImageName);
		return -1;
	}

	cinfo_decompress.err = jpeg_std_error(&jerr);
	jpeg_create_decompress(&cinfo_decompress);
	jpeg_stdio_src(&cinfo_decompress, infile);
	int ret = jpeg_read_header(&cinfo_decompress, TRUE);
	if (ret != JPEG_HEADER_OK) return -1;
	jpeg_start_decompress(&cinfo_decompress);
	row_stride = cinfo_decompress.output_width * cinfo_decompress.output_components;
	int buffer_height = 1;
	JSAMPARRAY buffer = (JSAMPARRAY)malloc(sizeof(JSAMPROW) * buffer_height);
	buffer[0] = (JSAMPROW)malloc(sizeof(JSAMPLE) * row_stride);
	//JSAMPARRAY buffer = (*cinfo_decompress.mem->alloc_sarray)((j_common_ptr)&cinfo_decompress, JPOOL_IMAGE, row_stride, 1);
	ImageData *imageData;
	imageData = new ImageData;
	imageData->width = cinfo_decompress.output_width;
	imageData->height = cinfo_decompress.output_height;

	imageData->pixels = new unsigned char [cinfo_decompress.output_width * cinfo_decompress.output_height * cinfo_decompress.output_components];
	long counter = 0;

	while (cinfo_decompress.output_scanline < cinfo_decompress.output_height) {
		jpeg_read_scanlines(&cinfo_decompress, buffer, 1);
		memcpy(imageData->pixels + counter, buffer[0], row_stride);
		counter += row_stride;
	}

	jpeg_finish_decompress(&cinfo_decompress);
	jpeg_destroy_decompress(&cinfo_decompress);

	fclose(infile);

	//write
	unsigned char* image_buffer;
	int image_height = cinfo_decompress.output_height;
	int image_width = cinfo_decompress.output_width;
	FILE * outfile;
	JSAMPROW row_pointer[1];
	int row_stride_dst;
	struct jpeg_compress_struct cinfo_compress;
	cinfo_compress.err = jpeg_std_error(&jerr);
	jpeg_create_compress(&cinfo_compress);

	if ((outfile = fopen(strDstImageName.c_str(), "wb")) == NULL) {
		fprintf(stderr, "can't open %s\n", strDstImageName);
		//exit(1);
		return -1;
	}

	jpeg_stdio_dest(&cinfo_compress, outfile);

	cinfo_compress.image_width = image_width;
	cinfo_compress.image_height = image_height;
	cinfo_compress.input_components = 3;
	cinfo_compress.in_color_space = JCS_YCbCr;

	int quality = 70;
	jpeg_set_defaults(&cinfo_compress);	
	jpeg_set_quality(&cinfo_compress, quality, TRUE);
	jpeg_start_compress(&cinfo_compress, TRUE);

	row_stride_dst = image_width * 3;

	image_buffer = new unsigned char[row_stride_dst * cinfo_compress.image_height];
	memcpy(image_buffer, imageData->pixels, row_stride_dst * cinfo_compress.image_height);

	while (cinfo_compress.next_scanline < cinfo_compress.image_height) {
		row_pointer[0] = &image_buffer[cinfo_compress.next_scanline * row_stride_dst];
		jpeg_write_scanlines(&cinfo_compress, row_pointer, 1);
	}

	jpeg_finish_compress(&cinfo_compress);
	fclose(outfile);
	jpeg_destroy_compress(&cinfo_compress);

	if (imageData) {
		delete imageData;
		imageData = NULL;
	}

	if (image_buffer)
		delete [] image_buffer;
	
	return 0;
}

int main(int argc, char* argv[])
{
	string strImageName = "1.jpg";
	int flag1 = read_JPEG_file(strImageName);
	if (flag1 == 0) cout<<"read ok!"<<endl;
	else cout<<"read error!"<<endl;

	strImageName = "2.bmp";
	int flag2 = write_JPEG_file(strImageName, 80);
	if (flag2 == 0) cout<<"write ok!"<<endl;
	else cout<<"write error!"<<endl;

	string strSrcImageName = "a.jpg";
	string strDstImageName = "b.jpg";
	int flag3 = TestImage(strSrcImageName, strDstImageName);
	if (flag3 == 0) cout<<"test ok!"<<endl;
	else cout<<"test error!"<<endl;

	return 0;
}

参考文献:

1、  http://libjpeg-turbo.virtualgl.org/

2、  http://www.linuxsir.org/bbs/thread374093.html

3、  http://blog.sina.com.cn/s/blog_a5b979d30101af56.html

4、  http://blog.csdn.net/jwzhangjie/article/details/8807409

5、  http://blog.csdn.net/hongwazi_2010/article/details/9153087

GitHubhttps://github.com//fengbingchun/OCR_Test

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

windows7 64位机上,libjpeg-turbo的安装和使用 的相关文章

  • 海思3559A上编译libjpeg-turbo源码操作步骤

    1 从https github com libjpeg turbo libjpeg turbo releases tag 2 0 2 下载libjpeg turbo 2 0 2版本 2 脚本build sh内容如下 cmake DCMAKE
  • 边缘检测、Hough变换、轮廓提取、种子填充、轮廓跟踪

    转自 http blog sina com cn s blog 6c083cdd0100nm4s html 7 1 边沿检测 我们给出一个模板 和一幅图象 不难发现原图中左边暗 右边亮 中间存在着一条明显的边界 进行模板操作后的结果如下 可
  • 数字水印简介

    转自 http baike baidu com view 39205 htm 数字水印 Digital Watermarking 技术是将一些标识信息 即数字水印 直接嵌入数字载体当中 包括多媒体 文档 软件等 或是间接表示 修改特定区域的
  • 图片像素、英寸、厘米之间的单位换算

    转自 http hi baidu com cjg501 blog item f040fc0898d5379f0b7b8244 html 今天朋友用photoshop处理图片时要把图片保存指定的大小 但她只对厘米要形像感 可是在软件里保存的图
  • 图像处理库(fbc_cv):源自OpenCV代码提取

    在实际项目中会经常用到一些基本的图像处理操作 而且经常拿OpenCV进行结果对比 因此这里从OpenCV中提取了一些代码组织成fbc cv库 项目fbc cv所有的代码已放到GitHub中 地址为 https github com feng
  • CImg库介绍

    转自 http www cppprog com 2009 0424 106 html CImg是一个跨平台的C 的图像处理库 提供了加载 处理 显示 保存等一系列功能 其中的图像处理功能尤其强大 首先 建议先到这里欣赏一下使用CImg代码做
  • 灰度图像直方图均衡化公式及实现

    图像的直方图 直方图是图像中像素强度分布的图形表达方式 它统计了每一个强度值所具有的像素个数 直方图均衡化 是通过拉伸像素强度分布范围来增强图像对比度的一种方法 是图像处理领域中利用图像直方图对对比度进行调整的方法 均衡化指的是把一个分布
  • Spline interpolation and Savitzki-Golay smoothing

    转自 http octave 1599824 n4 nabble com Spline interpolation and Savitzki Golay smoothing td1675136 html natural cubic spli
  • 图像通用操作Python的实现

    平时经常会对一个目录下的图像做统一处理 如缩放 旋转等等 之前使用C 处理 有时不是很方便 发现使用Python比较简单 代码量又很少 在Anacanda下执行起来也比较方便 因此 打算在后面遇到图像的常规处理时都将其实现放入到同一个py文
  • windows7 64位机上,libjpeg-turbo的安装和使用

    libjpeg turbo是对libjpeg的扩展 支持SIMD指令 如X86架构的MMX SSE SSE2 3DNOW ARM架构的NEON 在对jpeg进行编码和解码的过程中能提高速度 MMX 多媒体扩展的缩写 第六代CPU芯片重要特点
  • JavaScript图像处理(5) - 曲线操作(Curve Manipulation)

    直方图均衡作为一个自动的方法虽然可以在大多数情况下获得不错的效果 但是很多时候也受限于其单一的功能而无法满足多样化的图像处理需求 尤其是在图像的艺术处理方面 直方图均衡往往并不能达到期望的效果 有时候我们需要增强图像中的高光或者是明亮的背景
  • vtk表面提取参数研究

    marching cubes是三维图形处理中常见的算法 实际使用中 对一个影像数据做表面提取 然后平滑得到一个组织表面是一个常用功能 下面这段代码是参考3d slicer的分割流程的代码 boneExtractor vtkMarchingC
  • Leptonica在VS2010中的编译及简单使用举例

    在tesseract ocr中会用到leptonica库 这里对leptonica简单介绍下 Leptonica是一个开源的图像处理和图像分析库 它的license是BSD 2 clause 它主要包括的操作有 位图操作 仿射变换 形态学操
  • 海思3559A上编译libyuv源码操作步骤

    1 下载libyuv源代码 执行 git clone https chromium googlesource com libyuv libyuv 2 通过CMakeLists txt编译生成库 build sh脚本内容如下 cmake DC
  • 图像相似度计算之直方图方法OpenCV实现

    操作步骤 1 载入图像 灰度图或者彩色图 并使其大小一致 2 若为彩色图 增进行颜色空间变换 从RGB转换到HSV 若为灰度图则无需变换 3 若为灰度图 直接计算其直方图 并进行直方图归一化 4 若为彩色图 则计算其彩色直方图 并进行彩色直
  • 适用于 Android 的 libjpeg-turbo

    I need libjpeg turbo对于安卓NDK 有人设法将其编译为 a 静态 lib 吗 我已经尝试了几次 但它只给了我很多错误 安装Android NDK 以下说明经过验证r8b 老版本可能有问题 我不知道 获取 Android
  • Android 上 libjpeg-turbo 的集成或构建说明

    在互联网上可以找到各种提到 Android 版 libjpeg turbo 的页面 example http comments gmane org gmane linux linaro devel 6967 他们都指向存储库here htt
  • 有多少 Android 设备受益于 Libjpeg-turbo 优化?

    The libjpeg turbo http libjpeg turbo virtualgl org 该项目 使用 SIMD 指令 MMX SSE2 NEON 来加速 x86 x86 64 和 ARM 系统上的基线 JPEG 压缩和解压缩
  • 如何使用 libjpeg-turbo 编译 OpenCV?

    我在我的一个 C 项目中在 OS X Lion 上使用 OpenCV 2 3 1 虽然我的项目按原样运行得很好 但它很大程度上依赖于 JPEG 解码和编码 我想通过使用 libjpeg turbo 来获得加速 但我找不到与 libjpeg
  • 如何在 libjpeg-turbo 中使用 jpeg_mem_src、jpeg_mem_dest?

    libjpeg8 包含这两个函数 但在 libjpeg turbo 中包含以下函数 jconfig h define JPEG LIB VERSION 62 jpeglib h if JPEG LIB VERSION gt 80 Data

随机推荐

  • vue权限管理系统

    vue权限系统 后台管理系统一般都会有权限模块 用来控制用户能访问哪些页面和哪些数据接口 大多数管理系统的页面都长这样 左边为菜单 分为两级 右边为图表显示区域 有增删改查的按钮 表的结构 SET NAMES utf8mb4 SET FOR
  • Node.JS如何升级

    一 前言 网上许多的NodeJS升级使用全局N模块很多情况下会不成功 所以这里介绍一种方便快捷的升级NodeJS方法 二 升级NodeJS版本 在官网将LTS版本的NodeJS下载下来 历史版本 不用卸载较低版本 直接打开安装包安装 一直N
  • 罗马数字转整数(Java实现)

    罗马数字转整数 Java实现 罗马数字包含以下七种字符 I V X L C D 和 M 字符 数值 I 1 V 5 X 10 L 50 C 100 D 500 M 1000 例如 罗马数字 2 写做 II 即为两个并列的 1 12 写做 X
  • 配置常用yum源(国内yum源)

    记录 356 场景 在CentOS 7 9操作系统上 使用国内开源镜像站配置常用yum源 满足使用yum命令安装各类软件需求 包括CentOS基础包 epel包 scl包 k8s等 版本 操作系统 CentOS 7 9 开源镜像站 阿里云开
  • Mybatis学习笔记2:CRUD操作及MybatisConfig.xml配置解析

    一 CRUD操作 1 select select语句有很多属性可以详细配置每一条sql语句 sql的返回值类型 传入sql语句的参数类型 命名空间唯一标识符 接口中的方法名与映射文件中的sql语句id要对应 id parameterType
  • Eclipse 乱码 解决方案总结(UTF8 -- GBK)

    UTF8 gt GBK GBK gt UTF8 eclipse的中文乱码问题 一般不外乎是由操作系统平台编码的不一致导致 如Linux中默认的中文字体编码问UTF8 而Windows默认的中文编码为GBK 因此将Linux和Windows下
  • 图像均值滤波简介及实现

    一 均值滤波简介和原理 均值滤波 是图像处理中常用的手段 从频率域观点来看均值滤波是一种低通滤波器 高频信号将会去掉 均值滤波可以帮助消除图像尖锐噪声 实现图像平滑 模糊等功能 理想的均值滤波是用每个像素和它周围像素计算出来的平均值替换图像
  • ubuntu-多网卡聚合-bond技术教程-配置interfaces

    目录 1 Bond的工作模式 2 配置步骤 3 删除bond 4 总结 5 发现的问题 注意 以下配置步骤 只测试了ubuntu20 04有效 其他版本没试过 经查阅资料 建议ubuntu20 04以前的版本使用本文章方法 含ubuntu2
  • IntelliJ IDEA常用插件及其安装

    插件列表 环境 MacOS平台 IDEA版本 2019 3 类别 插件名称 插件描述 备注 美化 Material Theme UI不免费了 建议用Solarized Themes 一款IDEA主题插件 个人用Light Owl或Solar
  • 用jackson序列化No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer

    jackson序列化 用jackson将对象序列化字符串的时候出现了下面No serializer found for class org hibernate proxy pojo javassist JavassistLazyInitia
  • 【FFmpeg实战】FFplay音频滤镜分析

    原文地址 https juejin cn post 7153334309208719368 音频流的 滤镜是通过 configure audio filters 函数来创建的 因为 ffplay 为了代码的通用性 即便命令行参数不使用滤镜
  • 因计算机中丢失msvcr120.dll,msvcr120.dll丢失怎样修复 附解决方法

    运程程序时如果提示这个 那么是因为你的电脑里没有vc 运行库导致的 不要从网上一个一个下载msvcr120 dll这样的文件放到系统目录里 因为有很多文件 真正的解决方法是下载并安装微软VC 2013版运行库 就可以修复这个问题 直接百度搜
  • 算法记录题四

    1 什么是集成学习算法 2 集成学习主要有哪几种框架 并简述他们的工作过程 3 Boosting算法有哪两类 他们之间的区别是什么 4 什么是偏差和方差 5 如何从减少方差和偏差的角度解释Boosting和Bagging的康 6 随机森林的
  • 【MySQL】SQL之CASE WHEN用法详解

    目录 一 简单CASE WHEN函数 二 CASE WHEN条件表达式函数 三 常用场景 场景1 不同状态展示为不同的值 场景2 统计不同状态下的值 场景3 配合聚合函数做统计 场景4 CASE WHEN中使用子查询 场景5 经典行转列 结
  • 51 openEuler搭建PostgreSQL数据库服务器-安装、运行和卸载

    文章目录 51 openEuler搭建PostgreSQL数据库服务器 安装 运行和卸载 51 1 安装 51 2 运行 51 2 1 初始化数据库 51 2 2 启动数据库 51 2 3 登录数据库 51 2 4 配置数据库账号密码 51
  • js实现雪花飘落效果

    js实现雪花飘落效果 我们可以先看看效果 点这里 雪花 其实总的代码都不到 100 行 代码很少 因此 css 样式 和 js 代码我都放在一个 HTML 文件里面了 我们先看看主体的 HTML 代码 div div html 的代码就只有
  • 搭建目标检测模型之Domain Adaptive Faster R-CNN for Object Detection in the Wild

    搭建环境 方法1 直接搭建环境 报错及解决方法 准备数据集 官方数据集 训练模型 测试模型 训练结果 有问题 搭建环境 方法1 直接搭建环境 克隆项目Domain Adaptive Faster RCNN PyTorch git clone
  • 华为od机试题8 真题

    华为od机试题 真题 10 输出最多类型的个数 11 树根节点到最小的叶子节点的路径 12 货车最大载货量 13 太阳能板最大面积 14 单词接龙 17 输出连续出现次数第k多的字母的次数 18 喊7 19 删除出现次数最少的字符 以下题目
  • actuator--基础--08--application.yml配置

    actuator 基础 08 application yml配置 management endpoints 暴露 EndPoint 以供访问 有jmx和web两种方式 exclude 的优先级高于 include jmx exposure
  • windows7 64位机上,libjpeg-turbo的安装和使用

    libjpeg turbo是对libjpeg的扩展 支持SIMD指令 如X86架构的MMX SSE SSE2 3DNOW ARM架构的NEON 在对jpeg进行编码和解码的过程中能提高速度 MMX 多媒体扩展的缩写 第六代CPU芯片重要特点