| 4 | 1/1 | 返回列表 |
| 查看: 656 | 回復(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ā)表 | |
|---|---|---|---|---|
|
[考研] 281求調(diào)劑(0805) +12 | 煙汐憶海 2026-03-16 | 23/1150 |
|
|---|---|---|---|---|
|
[考研] 265求調(diào)劑 +9 | 梁梁校校 2026-03-19 | 9/450 |
|
|
[考研] 290求調(diào)劑 +4 | ^O^乜 2026-03-19 | 4/200 |
|
|
[考研] 0817 化學(xué)工程 299分求調(diào)劑 有科研經(jīng)歷 有二區(qū)文章 +20 | rare12345 2026-03-18 | 20/1000 |
|
|
[考研]
|
不想起名字112 2026-03-19 | 3/150 |
|
|
[考研] 288求調(diào)劑,一志愿華南理工大學(xué)071005 +5 | ioodiiij 2026-03-17 | 5/250 |
|
|
[考研] 一志愿北京化工大學(xué)0703化學(xué)318分,有科研經(jīng)歷,求調(diào)劑 +3 | 一瓶苯甲酸 2026-03-14 | 3/150 |
|
|
[考研] 286求調(diào)劑 +6 | lemonzzn 2026-03-16 | 10/500 |
|
|
[教師之家] 焦慮 +9 | 水冰月月野兔 2026-03-13 | 13/650 |
|
|
[考研] 311求調(diào)劑 +4 | 冬十三 2026-03-18 | 4/200 |
|
|
[考研] 一志愿武理材料305分求調(diào)劑 +5 | 想上岸的鯉魚 2026-03-18 | 6/300 |
|
|
[考研] 085601專碩,總分342求調(diào)劑,地區(qū)不限 +5 | share_joy 2026-03-16 | 5/250 |
|
|
[考研] 311求調(diào)劑 +11 | 冬十三 2026-03-15 | 12/600 |
|
|
[考研] 302求調(diào)劑 +10 | 呼呼呼。。。。 2026-03-17 | 10/500 |
|
|
[考研] 277調(diào)劑 +5 | 自由煎餅果子 2026-03-16 | 6/300 |
|
|
[考研] 考研化學(xué)學(xué)碩調(diào)劑,一志愿985 +4 | 張vvvv 2026-03-15 | 6/300 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] 藥學(xué)383 求調(diào)劑 +3 | 藥學(xué)chy 2026-03-15 | 4/200 |
|
|
[考研] 085601材料工程315分求調(diào)劑 +3 | yang_0104 2026-03-15 | 3/150 |
|
|
[考研] 招收0805(材料)調(diào)劑 +3 | 18595523086 2026-03-13 | 3/150 |
|