Matlab†
YUVを扱う†
- VQEG format:4:2:2 (Abekas YUV)
function imageY = imgShowVQEG(nameSequence, fnum)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% imshow Images of VQEG
% for 4_2_2_format
% Cb Y Cr Y Cb Y Cr ....
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%fname = selectSequence(nameSequence);
fname=nameSequence;
framesize = [1440 486]; %width, height
precision = 'uint8=>uint8';
fid = fopen(fname,'rb');
offset = fnum*1440*486;
status = fseek(fid,offset,'bof');
p = fread(fid,framesize,precision);
imageY = p(2:2:1440,:).'; % only gray pixels'
imageU = p(1:4:1440,:).'; % Cb
imageV = p(3:4:1440,:).'; % Cr
fclose(fid);
figure,
imshow(imageY);
- format:4:2:0(berkeley YUV)
function [imgY, imgU, imgV] = imgShowQcif(nameSequence, fnum, isShow)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% imshow Images of Qcif
% for 4_2_0_format
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fname = nameSequence;
framesize = 176*144*1.5; %the number of Y*U*V
offsetY=176*144;
offsetU=offsetY+176*144/4;
precision = 'uint8=>uint8';
fid = fopen(fname,'rb');
offset = fnum*framesize;
status = fseek(fid,offset,'bof');
p = fread(fid,framesize,precision);
imgY = p(1:offsetY);
imgU = p(offsetY+1:offsetY+176*144/4);
imgV = p(offsetU+1:offsetU+176*144/4);
fclose(fid);
clear p
imgY = reshape(imgY,176,144)';
imgU = reshape(imgU,176/2,144/2)';
imgV = reshape(imgV,176/2,144/2)';
if(isShow)
figure, imshow(imgY);
figure, imshow(imgU);
figure, imshow(imgV);
end;
psedo noise†
function out = pnsamp1(r,g,number)
% PN Sequence Generator
% 関数書式 / out = pnsamp1(s,g,m,number)
% r : 初期状態
% g : 回路構成多項式
% number : PNシーケンス信号のサイズ
% out : PNシーケンス信号
%
% 例1
% init = [1 1 1 1 1 1 1 1 1]; % シフトレジスタの初期状態量
% poly = [1 0 0 0 0 1 0 0 0 1]; % フィードバック回路(多項式)
% number = 51; % PNシーケンス信号の長さ
% out = pnsamp1(init,poly,number); % PNシーケンス信号作成
br = zeros(1,length(r));
for t=1:number
br(1) = mod(r*[g(2:end)]',2);
br(2:end) = r(1:end-1);
out(t) = r(end);
r = br;
end
no return でおながいします†
久しぶりにつかってみたら、参照渡し(Call by reference?)ができないことに気づく。
あれ、値渡しのみなのかい・・・。
Matlab Function†
Wrapper†
int[][] wrapperFunction(int[][] src) {
function(src);
return src;
}
- (ゥ)ラッパーは、C、もしくはJAVAサイドで用意しないとだめだよね?きっと。
- コンストラクタに、入力されてしまう場合はどうする?
- といいますと?
- いいのか。(ゥ)ラッパーメソッド内でNewすればいいだけか。
- でも、それはそのクラス内にメソッド追加でいいか。無理に(ゥ)ラッパーしなくてもいいのか
- 本質的に必要でないメソッド追加よりは,Matlab専用ラッパーのほうが無理がないともいえる。
- なるほど。1つmatlabへのwrapper用クラスを作って、そこにバンバンwrapperMethodsを追加していけばいいのか。使う側はそのクラスだけを理解していれば使えるし。
- クラスの名前を決めないとなぁ
- WrapperFunctionsToMatlab.java ?
- MatlabWrapper.java
じゃ、こんなの?
int[][] wrapperWaveletDecompose(int[][] src, int level){
WaveletTransform2D wavelet;
wavelet = new WaveletTransform2D(src, false);
for(int iLevel=0; iLevel<level, iLevel++)
wavelet.decompose();
return src;
}
javaを使いたいんです、wavelet、mctfとかを使い回したいんです†
jarさえ作ってしまえばあとは簡単。ほとんどjava。でも、参照渡しできないんだったら、ちょっと扱いづらいような…。
javaaddpath /home/xxx/work/java/myclasses.jar
import packageA.* packageB,*;
たとえばこんな感じ (m_script.m)
import j2kwrapper.*;
array=ones(240,320,'single');
isInplace = false;
wavelet = WaveletTransfrom2D(array, isInplace); %new
wavelet.decompose(); % 1-level decompose
参照渡しなら結果がarrayに更新。
でも、されない…
array = wavelet.getDataInt(); % return int32
array = wavelet.getDataFloat(); % return single
- まじめに、import から記述したのは初めてかも。eclipseありがとう。
なんだ?関数ハンドルとは†
@function_name
リンク†
#urlbookmark(below)
- xqXUkNGzoAXoOaTWBQq -- comment5, http://www.class.csupomona.edu/ v i a g r a online, lxakvr, 2012-07-09 (月) 09:56:45
- KNIiNkVnnKjXKYuX -- comment3, http://www.gunninggroup.com/callaway/solutions.html buy viagra without prescriptions, >:(, http://www.gunninggroup.com/callaway/services.html buy cialis no prescription, =-]]], 2012-07-08 (日) 20:49:02
- ADBzgnYZpzzbQ -- comment3, http://www.gunninggroup.com/callaway/contact.html brand viagra online, =[[, http://www.gunninggroup.com/callaway/directions-atlanta.html pfizer viagra, =(((, http://www.gunninggroup.com/callaway/management.html cialis 20 mg, uul, 2012-07-08 (日) 11:29:49
- RLrwyhcBdKcNe -- comment5, http://researchreview.com/ buy viagra in new zealand online, 417030, http://www.waaids.com/Latest/ viagra australia online, cue, http://www.waaids.com/Counselling/ cialis australia, 443579, 2012-07-07 (土) 22:07:47
- yoUZfsfgWAdKsvDpzrW -- comment1, http://www.rether.com/ISMD.htm buy ritalin online, 234657, http://www.rether.com adderall, 105322, 2012-07-07 (土) 16:39:31
- aQhSGQALodS -- comment1, http://www.envirofieldschool.com/ cialis, 480677, 2012-07-07 (土) 05:11:51
- VVVYkeuZYkySnMcI -- comment2, http://www.laddinc.com/customer-resources/helpful-hints.html buy cialis no prescription, aeiug, http://www.laddinc.com/our-products/application-examples.html brand viagra, 657699, http://www.laddinc.com/our-products/product-datasheets.html pfizer viagra online, 774863, 2012-07-06 (金) 20:09:44
- ovgolSPIIFfrXWRTbE -- comment6, http://www.laddinc.com/about-us/contact-us.html viagra without rx, 867, http://www.laddinc.com/about-us/employment-opportunities.html cheap cialis 20mg, :-D, 2012-07-06 (金) 13:41:43
- YGnmJoEaManW -- comment2, http://fppf.com/index.php/component/banners/click/9 purchase cialis online, 029, http://www.merrimacknh.gov/CallMapping buy levitra overnight, 8OO, 2012-07-05 (木) 16:59:54
- tCeGknTEXOeqscYgN -- comment1, http://mediaserve.nmt.edu/website/ cheap cialis online, jbjj, http://www.multimediaib.com/ comprar cialis sin receta, 5732, http://wvvln.org/ levitra, =[[, 2012-07-05 (木) 00:30:45
- UMOYzqXWGJ -- CiqEBQ <a href="http://xdrwgjvnernb.com/">xdrwgjvnernb</a>, [url=http://waooftwvopgo.com/]waooftwvopgo[/url], [link=http://ypnyzpygqbxi.com/]ypnyzpygqbxi[/link], http://aizdlzwgjdiu.com/ 2012-07-03 (火) 03:43:53
- ドキュメント -- 2005-11-03 01:46:02 (木)
- 関数引数 -- 2005-11-03 01:45:14 (木)
- テクニカルノート -- 2005-11-03 01:44:17 (木)
その他†
FIR