Ich habe ein Projekt, das sich mit Krankheitserkennung beschäftigt. Wir müssen C# verwenden. Wie soll ich feststellen, ob der Baum infiziert ist oder nicht? Ich benutze Accord. Abbildung meines Korrelationswertes sind zu hoch. Hier ist ein Beispielbild rechte Seite: infiziert; linke Seite: gesund/nicht infiziertImage Texture Recognition C#
Antwort
Da Sie erwähnt haben, dass Sie Accord.NET verwenden, glaube ich, dass Sie vielleicht einen Blick auf the examples for Bag-of-Visual-Words werfen möchten. Da Sie die Texturerkennung erwähnt haben, sollten Sie vielleicht das BoVW-Beispiel in Betracht ziehen, das den Haralick-Funktionsdeskriptor zum Extrahieren von Strukturmerkmalen aus Bildern verwendet. Dieses Beispiel wird im Folgenden wiedergegeben:
// Ensure results are reproducible
Accord.Math.Random.Generator.Seed = 0;
// The Bag-of-Visual-Words model converts images of arbitrary
// size into fixed-length feature vectors. In this example, we
// will be setting the codebook size to 3. This means all feature
// vectors that will be generated will have the same length of 3.
// By default, the BoW object will use the sparse SURF as the
// feature extractor and K-means as the clustering algorithm.
// In this example, we will use the Haralick feature extractor.
// Create a new Bag-of-Visual-Words (BoW) model using Haralick features
var bow = BagOfVisualWords.Create(new Haralick()
{
CellSize = 256, // divide images in cells of 256x256 pixels
Mode = HaralickMode.AverageWithRange,
}, new KMeans(3));
// Generate some training images. Haralick is best for classifying
// textures, so we will be generating examples of wood and clouds:
var woodenGenerator = new WoodTexture();
var cloudsGenerator = new CloudsTexture();
Bitmap[] images = new[]
{
woodenGenerator.Generate(512, 512).ToBitmap(),
woodenGenerator.Generate(512, 512).ToBitmap(),
woodenGenerator.Generate(512, 512).ToBitmap(),
cloudsGenerator.Generate(512, 512).ToBitmap(),
cloudsGenerator.Generate(512, 512).ToBitmap(),
cloudsGenerator.Generate(512, 512).ToBitmap()
};
// Compute the model
bow.Learn(images);
bow.ParallelOptions.MaxDegreeOfParallelism = 1;
// After this point, we will be able to translate
// images into double[] feature vectors using
double[][] features = bow.Transform(images);
Um dieses Beispiel, um Ihr Problem zu bewerben, anstatt die images
Variable Schaffung der wood
und cloud
Textur Generatoren verwenden, können Sie sie von Ihrer eigenen Datenbank von Bildern abrufen. Später, nachdem Sie eine Feature-Darstellung für jedes der Bilder in ihrem Datensatz extrahiert haben, können Sie diese Darstellungen verwenden jedes maschinelles Lernen Klassifikator zu lernen, wie eine Support Vector Machine, Code wie:
// Now, the features can be used to train any classification
// algorithm as if they were the images themselves. For example,
// let's assume the first three images belong to a class and
// the second three to another class. We can train an SVM using
int[] labels = { -1, -1, -1, +1, +1, +1 };
// Create the SMO algorithm to learn a Linear kernel SVM
var teacher = new SequentialMinimalOptimization<Linear>()
{
Complexity = 100 // make a hard margin SVM
};
// Obtain a learned machine
var svm = teacher.Learn(features, labels);
// Use the machine to classify the features
bool[] output = svm.Decide(features);
// Compute the error between the expected and predicted labels
double error = new ZeroOneLoss(labels).Loss(output); // should be 0
PS : Es ist möglicherweise möglich, eine bessere Leistung in Ihrem Klassifikationsproblem zu erzielen, wenn Sie die Erstellung von SVMs mit ChiSquare kernel anstelle von Linear in Erwägung ziehen.
- 1. OpenCV - Best Image Recognition Algorithmus
- 2. Vize.ai Image Recognition in iOS-App
- 3. Three.js Texture/Image-Aktualisierung zur Laufzeit
- 4. Simple Image Recognition Aufgabe in Android: Dominoe Lesen
- 5. PyAutoGUI Image Recognition - Geringes Problem mit Pixel-Farbanpassung
- 6. Tensorflow des Image Recognition Tutorial gleiche Antwort gibt
- 7. C++/OpenGL: Texture Beispiel pixmap - Konvertierungsfehler verengenden
- 8. Threejs Texture
- 9. Texture Memory-tex2D Grundlagen
- 10. Java Cross Hatching Texture
- 11. SFML Texture Speicherverwaltung
- 12. PointCloud Classification and Recognition
- 13. Vertex Texture Fetch (Texture lesen im Vertex Shader)
- 14. Forge Texture nicht rendern
- 15. Texture Aframe Objekt
- 16. OpenGL Texture Loading
- 17. POVRay „Konturlinie“ Texture
- 18. Libgdx Animieren Texture Regionen
- 19. Texture Mapping in GLSL
- 20. Shadowmap texture alpha
- 21. Watson Visual Recognition in Android
- 22. Audio Processing - Tone Recognition
- 23. Speech Recognition API
- 24. ibm visual recognition limits
- 25. Google Speech Recognition API
- 26. Watson Visual Recognition Fehlercode 400
- 27. Recognition Gesichter auf einem Video mit Python
- 28. Vulkan Texture Mapping Ungenauigkeiten in GPU-Treiber?
- 29. C# image whitespace
- 30. C# image resizing