Matlab调用Java版JPEG2000图像压缩工具:jj2000-4.1

2023-12-16 21:10

本文主要是介绍Matlab调用Java版JPEG2000图像压缩工具:jj2000-4.1,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Matlab调用Java版JPEG2000图像压缩工具:jj2000-4.1


0. 简介

0.1. JPEG与JPEG2000

大家知道JPEG是基于离散余弦变换(DCT)的图像压缩标准,而JPEG2000是基于小波变换(DWT)的图像压缩标准,当然不同的还有编码算法。JPEG与JPEG2000及其扩展 Joint Photographic Experts Group 组织创建和维护, 更多信息参见维基百科:JPEG2000,或者JPEG官网: http://www.jpeg.org/,里面提供了C++、C、Java等语言的实现,请根据需要自行下载。

0.2. jj2000简介

JJ2000实现的是JPEG2000标准中的part1部分,纯由Java语言写成,项目官网:http://jpeg2000.epfl.ch/,但该网址本人试图访问多次,未果;在JPEG官网也提供了下载链接:https://code.google.com/p/jj2000/,不过版本号是5.1,此外Google Code明年将关闭服务,本人将其导出到了GitHub,下载链接点我。对于文章使用的版本下载,待会介绍。


1. 工具

硬件:PC机

软件:Matlab、Jpeg2000Gui、Java虚拟机、jj2000-4.1

Note:软件工具下载链接请百度或谷歌,当然,Jpeg2000Gui、jj2000-4.1、以及Google基于jj2000-5.1修改的的jj2000-master,也可以点此下载。

             Jpeg2000Gui 是Nikola Sprljan 写的一个调用jj2000-4.1.jar工具包的 matlab GUI 程序,为方便使用,本人进行了一定的修改。


2. 步骤与方法

2.0 安装软件工具

没有安装MATLAB 和 Java虚拟机的,请自行安装。Java虚拟机根据自己需要选择,有:Microsoft JVM,Sun‘s Java等等,’其环境变量的配置,见2.1软件配置。

Jpeg2000Gui 和 jj2000-4.1无需安装,解压即可。


2.1 软件配置

2.1.1 Java虚拟机的环境变量配置

按照提示安装好Java虚拟机后,还需要配置环境变量,按照下述流程打开环境变量设置页:

控制面板(Control Panel)——> 系统(system)——>  高级系统设置(Advanced system settings)——> 高级(Advanced)——> 环境变量(Environment Variables)


图2-1 环境变量设置界面

如上图所示,包含两类环境变量:用户环境变量 和 系统环境变量。我们需要在用户环境变量中添加 JAVA_HOME 环境变量,在系统变量里添加 CLASSPATH 环境变量 和 新建(如果没有的话)或修改(如果有的话)PATH环境变量。它们的值如下面绿色部分:

JAVA_HOME=JavaPath(JavaPath是Java的安装路径,如E:\Program Files\Java\jdk1.7.0_51

PATH=.;%JAVA_HOME%\bin(等同于E:\Program Files\Java\jdk1.7.0_51\bin)

CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

下面,给出图解

参照上图2-1,点击“用户变量(User Variables for ... )” 区域的“新建(New)”,在弹出窗口中,按下图输入, 点击OK,创建JAVA_HOME环境变量,注意你的JAVA安装路径。


图2-2 JAVA_HOME 环境变量

参照上图2-1,点击“系统环境变量(System variables)” 区域的“新建(New)”,在弹出窗口中,输入CLASSPATH环境变量名,及其对应的值,点击OK创建。

参照上图2-1,找到“系统环境变量(System variables)” 区域PATH环境变量,点击“编辑(Edit)”,在变量值前端输入PATH的值,如下图2-3所示:


图2-3 给Path环境变量添加值

这样环境变量就配置好了。

测试:为了测试环境变量配置是否成功,在运行里输入cmd,打开DOS窗口,输入:Java -version,若输出下图所示信息,则表明配置成功。


图2-4 Java 的环境变量配置成功

2.1.2 jj2000-4.1.jar工具包的环境变量配置

在jj2000-4.1文件夹中找到jj2000-4.1.jar (没有的话自行编译),并将其复制到要存放的路径下。

jj2000-4.1.jar是一个Java类包,为了能够在任意路径下自由调用,将其路径添加进上面建立的CLASSPATH环境变量里去。假设jj2000-4.1.jar的路径是:

D:\Workspace\Matlab\DIP\jpeg2000\Jpeg2000Gui\jj2000-4.1.jar,那么,就把它添加进CLASSPATH环境变量的值里面,用; 隔开,这样就添加好了。


测试:为了测试环境变量配置是否成功,在运行里输入cmd,打开DOS窗口,输入:Java JJ2KEncoder -u,若输出下图所示信息,则表明配置成功,此命令是查看 JJ2KEncoder 的使用帮助。


图2-5 JJ2KEncoder 参数选项

2.2 jj2000-4.1.jar 的使用

找到jj2000中的 README 文件,使用写字板打开,在里面可以找到,jj2000-4.1工具的调用方法。下面进行简要介绍:


Windows下,使用命令添加环境变量:set CLASSPATH=<jjdir>/jj2000-4.1.jar;%CLASSPATH%,其中,<jjdir>,为jj2000-4.1.jar 所在文件夹路径。


本文使用的是Sun的JDK,编解码命令如下,其它虚拟机请参见 README 文件。


2.2.1 DOS下执行编解码

Windows下,编码命令:

                                          java JJ2KEncoder <args>

                         解码命令:

                                          java JJ2KDecoder <args>

其中,<args>,为可选参数,使用Java JJ2KEncoder -u 可以查看具体参数选项,如-i 是输入文件参数,-o 是输出文件参数,-rate 用以指定压缩比。


如下命令,以“pict.pgm”文件为输入,进行8倍的压缩编码,输出文件为“pict_JJ2.j2k”。

Java JJ2KEncoder -i pict.pgm -o pict_JJ2.j2k -rate 1

 

2.2.2 Matlab下通过DOS执行

如果在Matlab下调用,可以使用Matlab自带的  dos  函数,将命令加载到DOS运行,格式如下,其中,cmdstr为命令字符串。

[s,w] = dos(cmdstr)


2.2.3 Matlab下直接执行Java命令

如果想直接在Matlab中使用Java命令,需要在Java命令前加感叹号 ! ,如在Matlab命令窗口,输入:!Java -version,则输出,下图所示信息:



图2-6 在Matlab中查看 Java 版本信息

同样,如果想运行 JJ2KEncoder 命令,可以使用:

!Java JJ2KEncoder -i pict.pgm -o pict_JJ2.j2k -rate 1


2.2.4 Jpeg2000Gui 运行结果示例

Jpeg2000Gui 实现了在Matlab下的调用,请参考之,下面给出本人修改后的一个运行结果图。


图2-7 jpeg2000Gui 运行结果示例

图中实现的是 16 倍的压缩,PSNR在23.0dB,还是很高的!

3. Note

1. 如果出现Matlab调用不成功,而在DOS下调用成功的情况,请注销重启系统

2. 在dos下 输入:Java JJ2KEncoder -u >>C:\help.txt,可以将结果输出到help.txt文件。

4. 附录

4.1 JJ2KEncoder参数选项

Usage:JJ2KEncoder args...The exit code of the encoder is non-zero if an error occurs.Note: Many encoder modules accept tile-component specific parameters. Theseparameters must be provided according to the pattern:"[<tile-component idx>] <param>" (repeated as many time as needed).<tile-component idx> respect the following policy according to the degreeof priority:(1) t<idx> c<idx> : Tile-component specification.(2) t<idx> : Tile specification.(3) c<idx> : Component specification(4) <void> : Default specification.Where the priorities of the specifications are:(1) > (2) > (3) > (4), ('>' means "overrides")<idx>: ',' separates indexes, '-' separates bounds of indexes list. (ex:0,2-4 means indexes 0,2,3 and  4).The following arguments are recognized:-u [on|off] (default = off)Prints usage information. If specified all other arguments (except 'v')are ignored-v [on|off] (default = off)Prints version and copyright information.-verbose (default = on)Prints information about the obtained bit stream.-o <file name>Mandatory argument. This option specifies the name of the output fileto which the codestream will be written.-i <image file> [<image file> [<image file> ... ]]Mandatory argument. This option specifies the name of the input imagefiles. Supported formats are PGM (raw), PPM (raw) and PGX, which is asimple extension of the PGM file format for single component datasupporting arbitrary bitdepths. If the extension is '.pgm', PGM-rawfile format is assumed, if the extension is '.ppm', PPM-raw file formatis assumed, otherwise PGX file format is assumed. PGM and PPM files areassumed to be 8 bits deep. A multi-component image can be specified byeither specifying several PPM and/or PGX files, or by specifying onePPM file.-lossless [on|off] (default = off)Specifies a lossless compression for the encoder. This options isequivalent to use reversible quantization ('-Qtype reversible') and 5x3wavelet filters pair ('-Ffilters w5x3'). Note that this option cannotbe used with '-rate'. When this option is off, the quantization typeand the filters pair is defined by '-Qtype' and '-Ffilters'respectively.-rate <output bitrate in bpp> (default = 100)This is the output bitrate in bits per pixel.-tref <x> <y> (default = 0 0)Sets the origin of the tile partitioning on the reference grid, withrespect to the canvas origin. The value of 'x' ('y') specified can notbe larger than the 'x' one specified in the ref option.-ref <x> <y> (default = 0 0)Sets the origin of the image in the canvas system. It sets thecoordinate of the top-left corner of the image reference grid, withrespect to the canvas origin-tiles <nominal tile width> <nominal tile height> (default = 0 0)This option specifies the maximum tile dimensions to use. If bothdimensions are 0 then no tiling is used.-tile_parts <packets per tile-part> (default = 0)This option specifies the maximum number of packets to have in onetile-part. 0 means include all packets in first tile-part of each tile-pfile <filename of arguments file>Loads the arguments from the specified file. Arguments that arespecified on the command line override the ones from the file.The arguments file is a simple text file with one argument per line ofthe following form:<argument name>=<argument value>If the argument is of boolean type (i.e. its presence turns a featureon), then the 'on' value turns it on, while the 'off' value turns itoff. The argument name does not include the '-' or '+' character. Longlines can be broken into several lines by terminating them with ''.Lines starting with '#' are considered as comments. This option is notrecursive: any 'pfile' argument appearing in the file is ignored.-pph_main [on|off] (default = off)Packs the packet headers in the main header.-pph_tile [on|off] (default = off)Packs the packet headers in the tile headers.-file_format [on|off] (default = off)Puts the JPEG 2000 codestream in a JP2 file format wrapper.-disable_jp2_extension [on|off] (default = off)JJ2000 automatically adds .jp2 extension when using'file_format'option. This option disables it when on.-debug (default = off)Print debugging messages when an error is encountered.-Mct [<tile index>] [on|off] ...Specifies to use component transformation with some tiles.  If thewavelet transform is reversible (w5x3 filter), the Reversible ComponentTransformation (RCT) is applied. If not (w9x7 filter), the IrreversibleComponent Transformation (ICT) is used.-Ffilters [<tile-component idx>] <id> [ [<tile-component idx>] <id> ...]Specifies which filters to use for specified tile-component.<tile-component idx>: see general note<id>: ',' separates horizontal and vertical filters, ':' separatesdecomposition levels filters. JPEG 2000 part I only supports w5x3 andw9x7 filters.-Wwt [full] (default = full)Specifies the wavelet transform to be used. Possible value is: 'full'(full page). The value 'full' performs a normal DWT.-Wlev <number of decomposition levels> (default = 5)Specifies the number of wavelet decomposition levels to apply to theimage. If 0 no wavelet transform is performed. All components and alltiles have the same number of decomposition levels.-Qguard_bits [<tile-component idx>] <gb> [ [<tile-component idx>] <gb>...] (default = 2)The number of bits used for each tile-component in the quantizer toavoid overflow (gb).-Qstep [<tile-component idx>] <bnss> [ [<tile-component idx>] <bnss> ...](default = 0.0078125)This option specifies the base normalized quantization step size (bnss)for tile-components. It is normalized to a dynamic range of 1 in theimage domain. This parameter is ignored in reversible coding.-Qtype [<tile-component idx>] <id> [ [<tile-component idx>] <id> ...]Specifies which quantization type to use for specified tile-component.By default (if '-lossless is not specified'), the quantization stepsize is 'expounded'.<tile-component idx> : see general note.<id>: Supported quantization types specification are : 'reversible' (noquantization), 'derived' (derived quantization step size) and'expounded'.Example: -Qtype reversible or -Qtype t2,4-8 c2 reversible t9 derived.-Rno_rect [on|off] (default = off)This argument makes sure that the ROI mask generation is not done usingthe fast ROI mask generation for rectangular ROIs regardless of whetherthe specified ROIs are rectangular or not-Rstart_level <level> (default = -1)This argument forces the lowest <level> resolution levels to belong tothe ROI. By doing this, it is possible to avoid only gettinginformation for the ROI at an early stage of transmission.<level> = 0means the lowest resolution level belongs to the ROI, 1 means the twolowest etc. (-1 deactivates the option)-Ralign [on|off] (default = off)By specifying this argument, the ROI mask will be limited to coveringonly entire code-blocks. The ROI coding can then be performed withoutany actual scaling of the coefficients but by instead scaling thedistortion estimates.-Rroi [<component idx>] R <left> <top> <width> <height> or [<componentidx>] C <centre column> <centre row> <radius> or [<component idx>] A<filename>Specifies ROIs shape and location. The shape can be either rectangular'R', or circular 'C' or arbitrary 'A'. Each new occurrence of an 'R', a'C' or an 'A' is a new ROI. For circular and rectangular ROIs, allvalues are given as their pixel values relative to the canvas origin.Arbitrary shapes must be included in a PGM file where non 0 valuescorrespond to ROI coefficients. The PGM file must have the size as theimage. The component idx specifies which components contain the ROI.The component index is specified as described by points 3 and 4 in thegeneral comment on tile-component idx. If this option is used, thecodestream is layer progressive by default unless it is overridden bythe 'Aptype' option.-Cpp [<tile-component idx>] <dim> <dim> [<dim> <dim>] [ [<tile-componentidx>] ...]Specifies precinct partition dimensions for tile-component. The firsttwo values apply to the highest resolution and the following ones (ifany) apply to the remaining resolutions in decreasing order. If lessvalues than the number of decomposition levels are specified, then thelast two values are used for the remaining resolutions.-Clen_calc [<tile-component idx>] near_opt|lazy_good|lazy[[<tile-component idx>] ...] (default = near_opt)Specifies the algorithm to use in calculating the necessary MQ lengthfor each decoding pass. The best one is 'near_opt', which performs arather sophisticated calculation and provides the best results. The'lazy_good' and 'lazy' are very simple algorithms that provide ratherconservative results, 'lazy_good' one being slightly better. Do notchange this option unless you want to experiment the effect ofdifferent length calculation algorithms.-Cterm [<tile-component idx>] near_opt|easy|predict|full[[<tile-component idx>] near_opt|easy|predict|full ...] (default =near_opt)Specifies the algorithm used to terminate the MQ codeword. The mostefficient one is 'near_opt', which delivers a codeword which in almostall cases is the shortest possible. The 'easy' is a simpler algorithmthat delivers a codeword length that is close to the previous one (inaverage 1 bit longer). The 'predict' is almost the same as the 'easy'but it leaves error resilient information on the spare leastsignificant bits (in average 3.5 bits), which can be used by a decoderto detect errors. The 'full' algorithm performs a full flush of the MQcoder and is highly inefficient.It is important to use a good termination policy since the MQ codewordcan be terminated quite often, specially if the 'Cbypass' or'Creg_term' options are enabled (in the normal case it would beterminated once per code-block, while if 'Creg_term' is specified itwill be done almost 3 times per bit-plane in each code-block).-Cseg_symbol [<tile-component idx>] on|off[ [<tile-component idx>] on|off...] (default = off)Inserts an error resilience segmentation symbol in the MQ codeword atthe end of each bit-plane (cleanup pass). Decoders can use thisinformation to detect and conceal errors.'on' enables, 'off' disablesit.-Ccausal [<tile-component idx>] on|off[ [<tile-component idx>] on|off...] (default = off)Uses vertically stripe causal context formation. If this is enabled thecontext formation process in one stripe is independant of the nextstripe (i.e. the one below it). 'on' enables, 'off' disables it.-Creg_term [<tile-component idx>] on|off[ [<tile-component idx>] on|off...] (default = off)If this is enabled the codeword (raw or MQ) is terminated on a byteboundary after each coding pass. In this case it is important to use anefficient termination algorithm, see the 'Cterm' option. 'on' enables,'off' disables it.-CresetMQ [<tile-component idx>] on|off[ [<tile-component idx>] on|off...] (default = off)If this is enabled the probability estimates of the MQ coder are resetafter each arithmetically coded (i.e. non-lazy) coding pass. 'on'enables, 'off' disables it.-Cbypass [<tile-component idx>] on|off[ [<tile-component idx>] on|off...] (default = off)Uses the lazy coding mode with the entropy coder. This will bypass theMQ coder for some of the coding passes, where the distribution is oftenclose to uniform. Since the MQ codeword will be terminated at leastonce per lazy pass, it is important to use an efficient terminationalgorithm, see the 'Cterm' option.'on' enables, 'off' disables it.-Cblksiz [<tile-component idx>] <width> <height> [[<tile-component idx>]<width> <height>] (default = 64 64)Specifies the maximum code-block size to use for tile-component. Themaximum width and height is 1024, however the surface area (i.e. widthx height) must not exceed 4096. The minimum width and height is 4.-Alayers <rate> [+<layers>] [<rate [+<layers>] [...]] (default = 0.015+20 2.0 +10)Explicitly specifies the codestream layer formation parameters. The<rate> parameter specifies the bitrate to which the first layer shouldbe optimized. The <layers> parameter, if present, specifies the numberof extra layers that should be added for scalability. These extralayers are not optimized. Any extra <rate> and <layers> parameters addmore layers, in the same way. An additional layer is always added atthe end, which is optimized to the overall target bitrate of the bitstream. Any layers (optimized or not) whose target bitrate is higherthat the overall target bitrate are silently ignored. The bitrates ofthe extra layers that are added through the <layers> parameter areapproximately log-spaced between the other target bitrates. If several<rate> [+<layers>] constructs appear the <rate> parameters must appearin increasing order. The rate allocation algorithm ensures that allcoded layers have a minimal reasonable size, if not these layers aresilently ignored.-Aptype [<tile idx>] res|layer|res-pos|pos-comp|comp-pos [res_startcomp_start layer_end res_end comp_end prog] [[res_start comp_startly_end res_end comp_end prog] ...] [[<tile-component idx>] ...]Specifies which type of progression should be used when generating thecodestream. The 'res' value generates a resolution progressivecodestream with the number of layers specified by 'Alayers' option. The'layer' value generates a layer progressive codestream with multiplelayers. In any case the rate-allocation algorithm optimizes for bestquality in each layer. The quality measure is mean squared error (MSE)or a weighted version of it (WMSE). If no progression type is specifiedor imposed by other modules, the default value is 'layer'.It is also possible to describe progression order changes. In thiscase, 'res_start' is the index (from 0) of the first resolution level,'comp_start' is the index (from 0) of the first component, 'ly_end' isthe index (from 0) of the first layer not included, 'res_end' is theindex (from 0) of the first resolution level not included, 'comp_end'is index (from 0) of the first component not included and 'prog' is theprogression type to be used for the rest of the tile/image. Severalprogression order changes can be specified, one after the other.-Peph [<tile idx>] on|off[ [<tile  idx>] on|off ...] (default = off)Specifies whether end of packet header (EPH) markers should be  used.'on' enables, 'off' disables it.-Psop [<tile idx>] on|off[ [<tile idx>] on|off ...] (default = off)Specifies whether start of packet (SOP) markers should be used. 'on'enables, 'off' disables it.Send bug reports to: jj2000-bugs@ltssg3.epfl.ch



4.2 JJ2KDecoder参数选项


Usage:JJ2KDecoder args...The exit code of the decoder is non-zero if an error occurs.The following arguments are recongnized:-Cer [on|off] (default = on)Specifies if error detection should be performed by the entropy decoderengine. If errors are detected they will be concealed and the resultingdistortion will be less important. Note that errors can only bedetected if the encoder that generated the data included errorresilience information.-Cverber [on|off] (default = on)Specifies if the entropy decoder should be verbose about detectederrors. If 'on' a message is printed whenever an error is detected.-Rno_roiThis argument makes sure that the no ROI de-scaling is performed.Decompression is done like there is no ROI in the image-cdstr_info (default = off)Display information about the codestream. This information is:- Marker segments value in main and tile-part headers,- Tile-part length and position within the code-stream.-debug (default = off)Print debugging messages when an error is encountered.-parsing (default = on)Enable or not the parsing mode when decoding rate is specified('-nbytes' or '-rate' options). If it is false, the codestream isdecoded as if it were truncated to the given rate. If it is true, thedecoder creates, truncates and decodes a virtual layer progressivecodestream with the same truncation points in each code-block.-nbytes <decoding rate in bytes> (default = -1)Specifies the decoding rate in bytes. The codestream is either parsed(default) or truncated depending the command line option '-parsing'. Tospecify the decoding rate in bits per pixel, use '-rate' optionsinstead.-rate <decoding rate in bpp> (default = 100)Specifies the decoding rate in bits per pixel (bpp) where the number ofpixels is related to the image's original size (Note: this number isnot affected by the '-res' option). The codestream is either parsed(default) or truncated depending the command line option '-parsing'. Tospecify the decoding rate in bytes, use '-nbytes' options instead.-o <filename>This is the name of the file to which the decompressed image iswritten. If no output filename is given, the image is displayed on thescreen. Output file format is PGX by default. If the extension is'.pgm' then a PGM file is written as output, however this is onlypermitted if the component bitdepth does not exceed 8. If the extensionis '.ppm' then a PPM file is written, however this is only permitted ifthere are 3 components and none of them has a bitdepth of more than 8.If there is more than 1 component, suffices '-1', '-2', '-3', ... areadded to the file name, just before the extension, except for PPM fileswhere all three components are written to the same file.-i <filename or url>The file containing the JPEG 2000 compressed data. This can be either aJPEG 2000 codestream or a JP2 file containing a JPEG 2000 codestream.In the latter case the first codestream in the file will be decoded. Ifan URL is specified (e.g., http://...) the data will be downloaded andcached in memory before decoding. This is intended for easy use inapplets, but it is not a very efficient way of decoding network serveddata.-res <resolution level index>Specifies the resolution level wanted for the decoded image (0 meansthe lowest available resolution, the last resolution  level gives animage with original dimension). If given index is greater than thenumber of available resolution levels of the compressed image, thedecoded image has the lowest available resolution (among alltile-components). Note that this option affects only the inversewavelet transform and not the number  of bytes read by the codestreamparser: this number of bytes depends only on options '-nbytes' or'-rate'.-pfile <filename>Loads the arguments from the specified file. Arguments that arespecified on the command line override the ones from the file.The arguments file is a simple text file with one argument per line ofthe following form:<argument name>=<argument value>If the argument is of boolean type (i.e. its presence turns a featureon), then the 'on' value turns it on, while the 'off' value turns itoff. The argument name does not include the '-' or '+' character. Longlines can be broken into several lines by terminating them with '\'.Lines starting with '#' are considered as comments. This option is notrecursive: any 'pfile' argument appearing in the file is ignored.-verbose [on|off] (default = on)Prints information about the decoded codestream-v [on|off] (default = off)Prints version and copyright information-u [on|off] (default = off)Prints usage information. If specified all other arguments (except 'v')are ignoredSend bug reports to: jj2000-bugs@ltssg3.epfl.ch






这篇关于Matlab调用Java版JPEG2000图像压缩工具:jj2000-4.1的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/501901

相关文章

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小

SpringBoot实现微信小程序支付功能

《SpringBoot实现微信小程序支付功能》小程序支付功能已成为众多应用的核心需求之一,本文主要介绍了SpringBoot实现微信小程序支付功能,文中通过示例代码介绍的非常详细,对大家的学习或者工作... 目录一、引言二、准备工作(一)微信支付商户平台配置(二)Spring Boot项目搭建(三)配置文件

解决SpringBoot启动报错:Failed to load property source from location 'classpath:/application.yml'

《解决SpringBoot启动报错:Failedtoloadpropertysourcefromlocationclasspath:/application.yml问题》这篇文章主要介绍... 目录在启动SpringBoot项目时报如下错误原因可能是1.yml中语法错误2.yml文件格式是GBK总结在启动S

Spring中配置ContextLoaderListener方式

《Spring中配置ContextLoaderListener方式》:本文主要介绍Spring中配置ContextLoaderListener方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录Spring中配置ContextLoaderLishttp://www.chinasem.cntene

基于Python实现高效PPT转图片工具

《基于Python实现高效PPT转图片工具》在日常工作中,PPT是我们常用的演示工具,但有时候我们需要将PPT的内容提取为图片格式以便于展示或保存,所以本文将用Python实现PPT转PNG工具,希望... 目录1. 概述2. 功能使用2.1 安装依赖2.2 使用步骤2.3 代码实现2.4 GUI界面3.效

java实现延迟/超时/定时问题

《java实现延迟/超时/定时问题》:本文主要介绍java实现延迟/超时/定时问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Java实现延迟/超时/定时java 每间隔5秒执行一次,一共执行5次然后结束scheduleAtFixedRate 和 schedu

Java Optional避免空指针异常的实现

《JavaOptional避免空指针异常的实现》空指针异常一直是困扰开发者的常见问题之一,本文主要介绍了JavaOptional避免空指针异常的实现,帮助开发者编写更健壮、可读性更高的代码,减少因... 目录一、Optional 概述二、Optional 的创建三、Optional 的常用方法四、Optio

Spring Boot项目中结合MyBatis实现MySQL的自动主从切换功能

《SpringBoot项目中结合MyBatis实现MySQL的自动主从切换功能》:本文主要介绍SpringBoot项目中结合MyBatis实现MySQL的自动主从切换功能,本文分步骤给大家介绍的... 目录原理解析1. mysql主从复制(Master-Slave Replication)2. 读写分离3.

基于Python和MoviePy实现照片管理和视频合成工具

《基于Python和MoviePy实现照片管理和视频合成工具》在这篇博客中,我们将详细剖析一个基于Python的图形界面应用程序,该程序使用wxPython构建用户界面,并结合MoviePy、Pill... 目录引言项目概述代码结构分析1. 导入和依赖2. 主类:PhotoManager初始化方法:__in

idea maven编译报错Java heap space的解决方法

《ideamaven编译报错Javaheapspace的解决方法》这篇文章主要为大家详细介绍了ideamaven编译报错Javaheapspace的相关解决方法,文中的示例代码讲解详细,感兴趣的... 目录1.增加 Maven 编译的堆内存2. 增加 IntelliJ IDEA 的堆内存3. 优化 Mave