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

 Réponse acceptée

Steven Lord
Steven Lord le 14 Nov 2018

0 votes

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

6 commentaires

N/A
N/A le 15 Nov 2018
Modifié(e) : madhan ravi le 15 Nov 2018
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
imwrite(X,'newImage.jp2')
Walter Roberson
Walter Roberson le 15 Nov 2018
That should be accepted in current matlab . which release are you using ?
N/A
N/A le 15 Nov 2018
I am using version 7.0.0.19920 (R14)
N/A
N/A le 15 Nov 2018
sir can you you help me in this @walter-roberson?
Thank you.
Walter Roberson
Walter Roberson le 15 Nov 2018
No, I cannot assist you with that. See Legal Problems

Connectez-vous pour commenter.

Plus de réponses (1)

N/A
N/A le 15 Nov 2018

0 votes

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 commentaires

Walter Roberson
Walter Roberson le 15 Nov 2018
Modifié(e) : Walter Roberson le 15 Nov 2018
>> 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: []
Walter Roberson
Walter Roberson le 15 Nov 2018
I notice the jp2 is larger than the png.
N/A
N/A le 15 Nov 2018
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.
Walter Roberson
Walter Roberson le 15 Nov 2018
Walter Roberson
Walter Roberson le 15 Nov 2018
Modifié(e) : Walter Roberson le 15 Nov 2018
R2010a or later for JPEG 2000 support.
Your R14 (7.0.0) is over 14 years old. Time for you to upgrade.
N/A
N/A le 15 Nov 2018
Okay .
thank you sir.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Produits

Version

R2014a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by