Diff
checker
Text
Text
Bilder
Dokumente
Excel
Ordner
Legal
Enterprise
Desktop-App
Preise
Einloggen
Diffchecker Desktop herunterladen
Texte vergleichen
Finde den Unterschied zwischen zwei Textdateien
Werkzeuge
Verlauf
Live-Editor
Leerzeichen ausblenden
Gleiches ausblenden
Zeilenumbruch aus
Ansicht
Zweispaltig
Einspaltig
Vergleichsgenauigkeit
Intelligent
Wort
Zeichen
Textstile
Darstellung ändern
Syntaxhervorhebung
Syntax auswählen
Ignorieren
Text umwandeln
Zur ersten Änderung
Eingabe bearbeiten
Diffchecker Desktop
Der sicherste Weg, Diffchecker zu nutzen. Hol dir die Desktop-App: Deine Diffs verlassen nie deinen Computer!
Desktop holen
Untitled diff
Erstellt
vor 8 Jahren
Diff läuft nie ab
Löschen
Exportieren
Teilen
Erklären
3 Entfernungen
Zeilen
Gesamt
Entfernt
Zeichen
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
53 Zeilen
Kopieren
20 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Zeichen
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
72 Zeilen
Kopieren
Kopieren
Kopiert
Kopieren
Kopiert
const cv = require('
../
');
const cv = require('
opencv4nodejs
');
const matchFeatures = ({ img1, img2, detector, matchFunc }) => {
const matchFeatures = ({ img1, img2, detector, matchFunc }) => {
// detect keypoints
// detect keypoints
const keyPoints1 = detector.detect(img1);
const keyPoints1 = detector.detect(img1);
const keyPoints2 = detector.detect(img2);
const keyPoints2 = detector.detect(img2);
// compute feature descriptors
// compute feature descriptors
const descriptors1 = detector.compute(img1, keyPoints1);
const descriptors1 = detector.compute(img1, keyPoints1);
const descriptors2 = detector.compute(img2, keyPoints2);
const descriptors2 = detector.compute(img2, keyPoints2);
// match the feature descriptors
// match the feature descriptors
const matches = matchFunc(descriptors1, descriptors2);
const matches = matchFunc(descriptors1, descriptors2);
// only keep good matches
// only keep good matches
const bestN = 40;
const bestN = 40;
const bestMatches = matches.sort(
const bestMatches = matches.sort(
(match1, match2) => match1.distance - match2.distance
(match1, match2) => match1.distance - match2.distance
).slice(0, bestN);
).slice(0, bestN);
Kopieren
Kopiert
Kopieren
Kopiert
matchedPoints1 = [];
matchedPoints2 = [];
for( let i = 0; i < bestMatches.length; i++ ){
//-- Get the keypoints from the good matches
matchedPoints1.push( keyPoints1[ bestMatches[i].queryIdx ].point );
matchedPoints2.push( keyPoints2[ bestMatches[i].trainIdx ].point );
}
const homography = cv.findHomography(matchedPoints1, matchedPoints2).homography;
const srcCorners = new cv.Mat([[
[0, 0, 1],
[img1.cols, 0, 1],
[img1.cols, img1.rows, 1],
[0, img1.rows, 1]
]], cv.CV_32F3C);
const dstCoordinates = srcCorners.perspectiveTransform(homography)
console.log(dstCoordinates);
return cv.drawMatches(
return cv.drawMatches(
img1,
img1,
img2,
img2,
keyPoints1,
keyPoints1,
keyPoints2,
keyPoints2,
bestMatches
bestMatches
);
);
};
};
Kopieren
Kopiert
Kopieren
Kopiert
const img1 = cv.imread('
../data/
s0.jpg');
const img1 = cv.imread('
s0.jpg');
const img2 = cv.imread('
../data/
s1.jpg');
const img2 = cv.imread('
s1.jpg');
// check if opencv compiled with extra modules and nonfree
// check if opencv compiled with extra modules and nonfree
if (cv.xmodules.xfeatures2d) {
if (cv.xmodules.xfeatures2d) {
const siftMatchesImg = matchFeatures({
const siftMatchesImg = matchFeatures({
img1,
img1,
img2,
img2,
detector: new cv.SIFTDetector({ nFeatures: 2000 }),
detector: new cv.SIFTDetector({ nFeatures: 2000 }),
matchFunc: cv.matchFlannBased
matchFunc: cv.matchFlannBased
});
});
cv.imshowWait('SIFT matches', siftMatchesImg);
cv.imshowWait('SIFT matches', siftMatchesImg);
} else {
} else {
console.log('skipping SIFT matches');
console.log('skipping SIFT matches');
}
}
const orbMatchesImg = matchFeatures({
const orbMatchesImg = matchFeatures({
img1,
img1,
img2,
img2,
detector: new cv.ORBDetector(),
detector: new cv.ORBDetector(),
matchFunc: cv.matchBruteForceHamming
matchFunc: cv.matchBruteForceHamming
});
});
cv.imshowWait('ORB matches', orbMatchesImg);
cv.imshowWait('ORB matches', orbMatchesImg);
Gespeicherte Diffs
Originaltext
Datei öffnen
const cv = require('../'); const matchFeatures = ({ img1, img2, detector, matchFunc }) => { // detect keypoints const keyPoints1 = detector.detect(img1); const keyPoints2 = detector.detect(img2); // compute feature descriptors const descriptors1 = detector.compute(img1, keyPoints1); const descriptors2 = detector.compute(img2, keyPoints2); // match the feature descriptors const matches = matchFunc(descriptors1, descriptors2); // only keep good matches const bestN = 40; const bestMatches = matches.sort( (match1, match2) => match1.distance - match2.distance ).slice(0, bestN); return cv.drawMatches( img1, img2, keyPoints1, keyPoints2, bestMatches ); }; const img1 = cv.imread('../data/s0.jpg'); const img2 = cv.imread('../data/s1.jpg'); // check if opencv compiled with extra modules and nonfree if (cv.xmodules.xfeatures2d) { const siftMatchesImg = matchFeatures({ img1, img2, detector: new cv.SIFTDetector({ nFeatures: 2000 }), matchFunc: cv.matchFlannBased }); cv.imshowWait('SIFT matches', siftMatchesImg); } else { console.log('skipping SIFT matches'); } const orbMatchesImg = matchFeatures({ img1, img2, detector: new cv.ORBDetector(), matchFunc: cv.matchBruteForceHamming }); cv.imshowWait('ORB matches', orbMatchesImg);
Bearbeitung
Datei öffnen
const cv = require('opencv4nodejs'); const matchFeatures = ({ img1, img2, detector, matchFunc }) => { // detect keypoints const keyPoints1 = detector.detect(img1); const keyPoints2 = detector.detect(img2); // compute feature descriptors const descriptors1 = detector.compute(img1, keyPoints1); const descriptors2 = detector.compute(img2, keyPoints2); // match the feature descriptors const matches = matchFunc(descriptors1, descriptors2); // only keep good matches const bestN = 40; const bestMatches = matches.sort( (match1, match2) => match1.distance - match2.distance ).slice(0, bestN); matchedPoints1 = []; matchedPoints2 = []; for( let i = 0; i < bestMatches.length; i++ ){ //-- Get the keypoints from the good matches matchedPoints1.push( keyPoints1[ bestMatches[i].queryIdx ].point ); matchedPoints2.push( keyPoints2[ bestMatches[i].trainIdx ].point ); } const homography = cv.findHomography(matchedPoints1, matchedPoints2).homography; const srcCorners = new cv.Mat([[ [0, 0, 1], [img1.cols, 0, 1], [img1.cols, img1.rows, 1], [0, img1.rows, 1] ]], cv.CV_32F3C); const dstCoordinates = srcCorners.perspectiveTransform(homography) console.log(dstCoordinates); return cv.drawMatches( img1, img2, keyPoints1, keyPoints2, bestMatches ); }; const img1 = cv.imread('s0.jpg'); const img2 = cv.imread('s1.jpg'); // check if opencv compiled with extra modules and nonfree if (cv.xmodules.xfeatures2d) { const siftMatchesImg = matchFeatures({ img1, img2, detector: new cv.SIFTDetector({ nFeatures: 2000 }), matchFunc: cv.matchFlannBased }); cv.imshowWait('SIFT matches', siftMatchesImg); } else { console.log('skipping SIFT matches'); } const orbMatchesImg = matchFeatures({ img1, img2, detector: new cv.ORBDetector(), matchFunc: cv.matchBruteForceHamming }); cv.imshowWait('ORB matches', orbMatchesImg);
Unterschied finden