| 4 | 1/1 | 返回列表 |
| 查看: 655 | 回復(fù): 3 | |||
472381565新蟲 (小有名氣)
|
[求助]
給這段MATLAB程序中沒加注解的地方加上注解。
|
|
I1 = double(imread('X6.jpg')); [h1 w1 d1] = size(I1); I2 = double(imread('X7.jpg')); [h2 w2 d2] = size(I2); %顯示圖像并在顯示的圖像上取坐標(biāo) figure; subplot(1,2,1); image(I1/255); axis image; hold on; title('first input image'); [X1 Y1] = ginput2(2); %在第一幅圖像上確定2個(gè)點(diǎn) subplot(1,2,2); image(I2/255); axis image; hold on; title('second input image'); [X2 Y2] = ginput2(2); %在第二幅圖像上取2個(gè)點(diǎn) Z = [ X2' Y2' ; Y2' -X2' ; 1 1 0 0 ; 0 0 1 1 ]'; xp = [ X1 ; Y1 ]; t = Z \ xp; a = t(1); b = t(2); tx = t(3); ty = t(4); T = [a b tx ; -b a ty ; 0 0 1]; cp = T*[ 1 1 w2 w2 ; 1 h2 1 h2 ; 1 1 1 1 ]; Xpr = min( [ cp(1, 0 ] ) : max( [cp(1, w1] );Ypr = min( [ cp(2, 0 ] ) : max( [cp(2, h1] ); [Xp,Yp] = ndgrid(Xpr,Ypr); [wp hp] = size(Xp); X = T \ [ Xp( Yp( ones(wp*hp,1) ]'; clear Ip; xI = reshape( X(1, ,wp,hp)';yI = reshape( X(2, ,wp,hp)';Ip(:,:,1) = interp2(I2(:,:,1), xI, yI, '*bilinear'); Ip(:,:,2) = interp2(I2(:,:,2), xI, yI, '*bilinear'); Ip(:,:,3) = interp2(I2(:,:,3), xI, yI, '*bilinear'); offset = -round( [ min( [ cp(1, 0 ] ) min( [ cp(2, 0 ] ) ] );Ip(1+offset(2):h1+offset(2),1+offset(1):w1+offset(1), = double(I1(1:h1,1:w1, );figure; image(Ip/255); axis image; title('mosaic image'); |
新蟲 (小有名氣)
專家顧問 (職業(yè)作家)
![]() |
專家經(jīng)驗(yàn): +3 |
|
| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 08工學(xué)調(diào)劑 +3 | 用戶573181 2026-03-20 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 085410人工智能專碩317求調(diào)劑(0854都可以) +4 | xbxudjdn 2026-03-18 | 4/200 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +8 | 墨墨漠 2026-03-18 | 8/400 |
|
|
[考研] 307求調(diào)劑 +9 | 冷笙123 2026-03-17 | 9/450 |
|
|
[考研] 294求調(diào)劑材料與化工專碩 +14 | 陌の森林 2026-03-18 | 14/700 |
|
|
[考研] 317求調(diào)劑 +3 | 申子申申 2026-03-19 | 6/300 |
|
|
[考研] 一志愿天大材料與化工(085600)總分338 +5 | 蔡大美女 2026-03-13 | 5/250 |
|
|
[考研] 本科鄭州大學(xué)物理學(xué)院,一志愿華科070200學(xué)碩,346求調(diào)劑 +4 | 我不是一根蔥 2026-03-18 | 4/200 |
|
|
[考研] 0854可跨調(diào)劑,一作一項(xiàng)核心論文五項(xiàng)專利,省、國級(jí)證書40+數(shù)一英一287 +8 | 小李0854 2026-03-16 | 8/400 |
|
|
[考研] 0703化學(xué)求調(diào)劑 總分331 +3 | ZY-05 2026-03-13 | 3/150 |
|
|
[考研] 生物學(xué)071000 329分求調(diào)劑 +3 | 我愛生物生物愛?/a> 2026-03-17 | 3/150 |
|
|
[考研] 一志愿蘇州大學(xué)材料工程(085601)專碩有科研經(jīng)歷三項(xiàng)國獎(jiǎng)兩個(gè)實(shí)用型專利一項(xiàng)省級(jí)立項(xiàng) +6 | 大火山小火山 2026-03-16 | 8/400 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] 藥學(xué)383 求調(diào)劑 +3 | 藥學(xué)chy 2026-03-15 | 4/200 |
|
|
[考研] 318求調(diào)劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 277材料科學(xué)與工程080500求調(diào)劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考研] 070305求調(diào)劑 +3 | mlpqaz03 2026-03-14 | 4/200 |
|
|
[考研] 085601材料工程315分求調(diào)劑 +3 | yang_0104 2026-03-15 | 3/150 |
|
|
[考研] 266求調(diào)劑 +4 | 學(xué)員97LZgn 2026-03-13 | 4/200 |
|
|
[碩博家園] 085600 260分求調(diào)劑 +3 | 天空還下雨么 2026-03-13 | 5/250 |
|