91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

圖像處理-圖片找不同Find the differences of the two images #Matlab下調用Python接口#SIFT算法應用 博客鏈接: https://blog.csdn.net/qq_34243930/article/details/85316240

資源截圖

代碼片段和文件信息

import?numpy?as?np
import?cv2


def?sift_kp(image):
????gray_image?=?cv2.cvtColor(image?cv2.COLOR_BGR2GRAY)????#?顏色空間轉換
????sift?=?cv2.xfeatures2d_SIFT.create()
????kps?des?=?sift.detectAndCompute(image?None)
????kp_image?=?cv2.drawKeypoints(gray_image?kps?None)?????#?繪制關鍵點的函數
????return?kp_imagekpsdes


def?get_good_match(des1?des2):
????bf?=?cv2.BFMatcher()
????matches?=?bf.knnMatch(des1?des2?k=2)
????good?=?[]
????for?m?n?in?matches:
????????if?m.distance?????????????good.append(m)
????return?good


def?siftImageAlignment(img1?img2):
???_?kp1?des1?=?sift_kp(img1)
???_?kp2?des2?=?sift_kp(img2)
???goodMatch?=?get_good_match(des1?des2)
???if?len(goodMatch)?>?4:
???????ptsA=?np.float32([kp1[m.queryIdx].pt?for?m?in?goodMatch]).reshape(-1?1?2)
???????ptsB?=?np.float32([kp2[m.trainIdx].pt?for?m?in?goodMatch]).reshape(-1?1?2)
???????ransacReprojThreshold?=?2
???????H?status?=cv2.findHomography(ptsA?ptsB?cv2.RANSAC?ransacReprojThreshold);
???????imgOut?=?cv2.warpPerspective(img2?H?(img1.shape[1]img1.shape[0])flags=cv2.INTER_LINEAR?+?cv2.WARP_INVERSE_MAP)
???return?imgOut?H?status


def?siftResult(num):
????img1?=?cv2.imread(‘%s-1.jpg‘?%?num)
????img2?=?cv2.imread(‘%s-2.jpg‘?%?num)

????result__?=?siftImageAlignment(img1img2)

????#?wh_?=?img1.shape
????#?img2?=?cv2.resize(img2(hw))
????#?print(‘img1:‘img1.shape)
????#?print(‘img2:‘img2.shape)

????#?allImg?=?np.concatenate((img1img2result)axis=1)
????#?cv2.namedWindow(‘Result‘cv2.WINDOW_NORMAL)
????#?cv2.imshow(‘Result‘allImg)

????cv2.imwrite(‘result.jpg‘?result)
????cv2.waitKey(0)

siftResult(‘4‘)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1719??2018-12-23?20:23??find_differences要求及源代碼\cvsift.py

?????文件???????1306??1999-11-12?13:19??find_differences要求及源代碼\Final?Project\butterfly.gif

?????文件????6462976??2018-12-27?23:08??find_differences要求及源代碼\Final?Project\Final?project.ppt

?????文件??????64930??2018-12-12?20:01??find_differences要求及源代碼\Final?Project\test2-1.jpg

?????文件??????73861??2018-12-13?18:26??find_differences要求及源代碼\Final?Project\test2-2.jpg

?????文件?????146086??2018-12-13?10:29??find_differences要求及源代碼\Final?Project\timg-1.1.jpg

?????文件?????147725??2018-12-13?09:38??find_differences要求及源代碼\Final?Project\timg-2.2.jpg

?????文件?????108559??2018-12-12?19:56??find_differences要求及源代碼\Final?Project\timg2-1.jpg

?????文件?????115671??2018-12-13?18:42??find_differences要求及源代碼\Final?Project\timg2-2.jpg

?????文件??????84459??2018-12-13?18:45??find_differences要求及源代碼\Final?Project\timgKT-1.jpg

?????文件??????98614??2018-12-13?18:52??find_differences要求及源代碼\Final?Project\timgKT-2.jpg

?????文件???????2556??2018-12-23?21:50??find_differences要求及源代碼\find_differences.m

?????文件???????2215??2018-12-23?21:49??find_differences要求及源代碼\mark_butterfly.m

?????目錄??????????0??2018-12-27?23:08??find_differences要求及源代碼\Final?Project

?????目錄??????????0??2018-12-28?00:33??find_differences要求及源代碼

-----------?---------??----------?-----??----

??????????????7310677????????????????????15


評論

共有 條評論