I can't use function jpeg2im
古いコメントを表示
when i type i.e. >> f1=jpeg2im(c1);
i face these errors
??? Attempt to execute SCRIPT unravel as a function: C:\Program Files\MATLAB\R2010b\bin\unravel.m
Error in ==> huff2mat at 61 x = unravel(y.code', link, m * n); % Decode using C 'unravel'
Error in ==> jpeg2im at 42 x = huff2mat(y.huffman); % Huffman decode.
and unravel.m has not any code.
%UNRAVEL Decodes a variable-length bit stream. % X = UNRAVEL(Y, LINK, XLEN) decodes UINT16 input vector Y based on % transition and output table LINK. The elements of Y are % considered to be a contiguous stream of encoded bits--i.e., the % MSB of one element follows the LSB of the previous element. Input % XLEN is the number code words in Y, and thus the size of output % vector X (class DOUBLE). Input LINK is a transition and output % table (that drives a series of binary searches): % % 1. LINK(0) is the entry point for decoding, i.e., state n = 0. % 2. If LINK(n) < 0, the decoded output is LINK(n); set n = 0. % 3. If LINK(n) > 0, get the next encoded bit and transition to % state [LINK(n) - 1] if the bit is 0, else LINK(n).
% Copyright 2002-2009 R. C. Gonzalez, R. E. Woods, and S. L. Eddins % From the book Digital Image Processing Using MATLAB, 2nd ed., % Gatesmark Publishing, 2009. % % Book web site: http://www.imageprocessingplace.com % Publisher web site: http://www.gatesmark.com/DIPUM2e.htm
4 件のコメント
vivek kumar
2018 年 5 月 14 日
移動済み: Walter Roberson
2025 年 1 月 4 日
facing the same issue please help
Divyashree
2025 年 1 月 4 日
編集済み: Walter Roberson
2025 年 1 月 4 日
function x = jpeg2im(y)
narginchk(1,1);
m = [16 11 10 16 24 40 51 61;
12 12 14 19 26 58 60 55;
14 13 16 24 40 57 69 56;
14 17 22 29 51 87 80 62;
18 22 37 56 68 109 103 77;
24 35 55 64 81 104 113 92;
49 64 78 87 103 121 120 101;
72 92 95 98 112 100 103 99];
order = [1 9 2 3 10 17 25 18 11 4 5 12 19 26 33 ...
41 34 27 20 13 6 7 14 21 28 35 42 49 57 50 ...
43 36 29 22 15 8 16 23 30 37 44 51 58 59 52 ...
45 38 31 24 32 39 46 53 60 61 54 47 40 48 55 ...
62 63 56 64];
rev = order;
for k = 1:length(order)
rev(k) = find(order == k);
end
m = double(y.quality)/100 * m;
xb = double(y.numblocks);
sz = double(y.size);
xn = sz(2);
xm = sz(1);
x = huff2mat(y.huffman);
eob = max(x(:));
z = zeros(64, xb); k=1;
for j = 1:xb
for i = 1:64
if x(k) == eob
k = k+1; break;
else
z(i, j) = x(k);
k = k +1;
end
end
end
z = z(rev, :);
x = col2im(z, [8 8], [xm xn],'distinct');
blockSize = [8 8];
x = blockproc(x, blockSize, @(x) x .* p1, m);
t = dctmtx(8);
x = blockproc(x, [8 8], 'p1 * x * p2', t', t);
x = uint8(x + 128);
% EDIT: COPYRIGHT code deleted.
i am getting this error
Error using blockproc>parse_inputs (line 1026)
Named parameters must have a corresponding value.
Error in blockproc (line 226)
[source,fun,options] = parse_inputs(source,block_size,fun,args{:});
Error in jpeg2im (line 43)
x = blockproc(x, blockSize, @(x) x .* p1, m);
please help me
@Divyashree: I do not see any syntax in the BLOCKPROC dodocumentation that matches how you are calling it. After the 3rd input (the function handle) the documentation states that you can provide name-value pairs. But instead of following what the documentation describes, you have provided a single numeric input:
x = blockproc(x, blockSize, @(x) x .* p1, m);
% ^ what do you expect this to do?
The function handle is not written to accept a BLOCK STRUCT as the documenation explains:
P1 is not defined anywhere.
The syntax of the next BLOCKPROC call does not follow the documentation either.
Divyashree
2025 年 1 月 6 日
Thank you so much I got the output. Can you give me refrence text book name for video compression using matlab like Digital image processing using matlab (Gonzalez). So it will be useful for my research work.
回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Import, Export, and Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
