matlab code for JPEG2000

Can any one soon provide me matlab code for implementing JPEG2000 . Thank you in advance.

 采纳的回答

Steven Lord
Steven Lord 2018-11-14

0 个投票

Just call imwrite with 'jp2' or 'jpx' as the fmt input argument.

6 个评论

N/A
N/A 2018-11-15
编辑:madhan ravi 2018-11-15
its is working for jpg but not for jp2 or jpx
following error is coming--
??? Error using ==> imwrite
Invalid input syntax
Error in ==> jpeg2000impt at 2
imwrite(X,'newImage.jp2','jp2')
Thank you
That should be accepted in current matlab . which release are you using ?
I am using version 7.0.0.19920 (R14)
sir can you you help me in this @walter-roberson?
Thank you.
No, I cannot assist you with that. See Legal Problems

请先登录,再进行评论。

更多回答(1 个)

If possible then Can any one do it for me as I dont have new version.
It will be a great help, please do it.
I am attaching required files --
thank you in advance.
X = imread('C:\work\Lena.png');
imwrite(X,'newImage.jp2','jp2','Comment','My JPEG2000 file')
imfinfo('newImage.jp2')
imfinfo('Lena.png')
Lena.png

6 个评论

>> imfinfo('newImage.jp2')
ans =
struct with fields:
Filename: '/Users/roberson/MATLAB/4/429/429805/newImage.jp2'
FileModDate: '15-Nov-2018 12:22:28'
FileSize: 331669
Format: 'JP2'
FormatVersion: []
Width: 512
Height: 509
BitDepth: 24
ColorType: 'truecolor'
BitsPerSample: [8 8 8]
CodeBlockDims: [64 64]
CodestreamComponents: 3
CodestreamProfile: 'PROFILE2'
ColorSpace: 'sRGB'
Comments: {'My JPEG2000 file'}
ChannelDefinition: {3×3 cell}
ImageStartLocation: [1 1]
NumberOfTiles: 1
ProgressionOrder: 'LRCP: Layer, Resolution, Component, Position'
QualityLayers: 1
TileSize: [509 512]
WaveletDecompositionLevels: 4
WaveletKernel: '9x7'
WidthSubSampling: [1 1 1]
HeightSubSampling: [1 1 1]
>> imfinfo('index.png')
ans =
struct with fields:
Filename: '/Users/roberson/MATLAB/4/429/429805/index.png'
FileModDate: '15-Nov-2018 12:19:52'
FileSize: 236547
Format: 'png'
FormatVersion: []
Width: 512
Height: 509
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: [137 80 78 71 13 10 26 10]
Colormap: []
Histogram: []
InterlaceType: 'none'
Transparency: 'none'
SimpleTransparencyData: []
BackgroundColor: []
RenderingIntent: []
Chromaticities: []
Gamma: 0.454549998044968
XResolution: []
YResolution: []
ResolutionUnit: []
XOffset: []
YOffset: []
OffsetUnit: []
SignificantBits: []
ImageModTime: []
Title: []
Author: []
Description: []
Copyright: []
CreationTime: []
Software: []
Disclaimer: []
Warning: []
Source: []
Comment: []
OtherText: []
I notice the jp2 is larger than the png.
Thank you so much sir for this. I will be in debt for this great help.
Please do one last favour can you please share the resultant newimage with me. Actually I need it to show comparison with JPEG and JPEG2000.
Thank you once again.
R2010a or later for JPEG 2000 support.
Your R14 (7.0.0) is over 14 years old. Time for you to upgrade.
Okay .
thank you sir.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Convert Image Type 的更多信息

产品

版本

R2014a

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by