टास्क सर्कल का पता लगाने और तुलना करने के लिए इमेज प्रोसेसिंग या मशीन लर्निंग क्या करें


मैं एक सॉफ्टवेयर पर काम कर रहा हूं जहां मैं कुछ इमेज प्रोसेसिंग करना चाहता हूं और छवि से सर्कल का पता लगाना चाहता हूं और वहां दो सर्कल हैं जिन्हें मैं पहचानना चाहता हूं पहला ऑब्जेक्ट में है (कच्चा हीरा) और दूसरा वह है जिस पर मैं चित्र बना रहा हूं छवि या वीडियो बॉक्स.
यह किस प्रकार की छवि होगी, इसकी कुछ छवियां यहां दी गई हैं छवि 1
छवि2
छवि 3
छवि4

यहां उपरोक्त छवियों में एक लाल वृत्त है जिसे मैं कुछ मापदंडों का उपयोग करके चित्रित कर रहा हूं और ऑब्जेक्ट पर जो काला वृत्त है वह वह वृत्त है जिसे मैं तुलना के लिए पहचानना चाहता हूं या उस वृत्त के साथ मिलान करना चाहता हूं जो मैंने वीडियो बॉक्स पर बनाया है।

अब पहचान पूरी होने के बाद मैं उन वृत्तों की तुलना या मिलान करना चाहता हूं जो मैं बना रहा हूं और वह वृत्त जो मुझे छवि प्रसंस्करण से प्राप्त होता है।

इसलिए मैं दो दिनों से इमेज प्रोसेसिंग का प्रयास कर रहा हूं, फिर भी मुझे वह परिणाम नहीं मिला जो मैं चाहता था।
इसलिए मुझे मशीन लर्निंग या एआई के बारे में सोचना होगा
यदि मैं मेल खाने वाले या न मेल खाने वाले सर्किलों का डेटा सेट प्रदान कर सकता हूं तो क्या मैं अपने प्रोजेक्ट के लिए एआई या मशीन लर्निंग का उपयोग कर सकता हूं?
यदि हां तो मैं इसका उपयोग कैसे कर सकता हूं और इसके लिए कितना समय चाहिए?

मैंने क्या प्रयास किया है:

मैंने EmguCV लाइब्रेरी की कोशिश की है और कुछ इमेज प्रोसेसिंग की है लेकिन यह सटीक नहीं है फिर भी मैं ऑब्जेक्ट (कच्चा हीरा) पर केवल काले घेरे का पता लगाने पर अटका हुआ हूं।

यहां मैंने emgucv का उपयोग करके कुछ छवि प्रसंस्करण किया है लेकिन मुझे वह परिणाम नहीं मिला जो मैं चाहता था
इस कोड का उपयोग करके मुझे जो परिणाम मिले वे हैं:
छवि 1
छवि2

ध्यान दें: यह कुछ छवियों के लिए भी काम करता है, सभी के लिए नहीं।

सी#
// Convert the image to grayscale
            Image<Gray, byte> grayImage = originalImage.Convert<Gray, byte>();
            pictureBox1.Image = grayImage.ToBitmap();


            // Apply Gaussian blur
            CvInvoke.GaussianBlur(grayImage, grayImage, new Size(5, 5), 0);
            pictureBox2.Image = grayImage.ToBitmap();

            // Threshold the grayscale image to isolate black circles
            double thresholdValue = 70; // Adjust this value based on the intensity of your black circles
            Image<Gray, byte> binaryImage = grayImage.ThresholdBinary(new Gray(thresholdValue), new Gray(255));
            pictureBox3.Image = binaryImage.ToBitmap();

            VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();
            Mat hierarchy = new Mat();

            CvInvoke.FindContours(binaryImage, contours, hierarchy, RetrType.List, ChainApproxMethod.ChainApproxSimple);

            // Loop through all detected contours
            for (int i = 0; i < contours.Size; i++)
            {
                using (VectorOfPoint contour = contours[i])
                {
                    double area = CvInvoke.ContourArea(contour);
                    double perimeter = CvInvoke.ArcLength(contour, true);

                    // Calculate circularity (4 * π * area / perimeter^2)
                    double circularity = (4 * Math.PI * area) / (perimeter * perimeter);

                    // Check if the contour is a perfect circle based on circularity
                    if (circularity > 0.8 && contour.Size > 150) // Adjust the circularity threshold and minimum number of vertices as needed
                    {
                        CircleF circle = CvInvoke.MinEnclosingCircle(contour);
                        originalImage.Draw(circle, new Bgr(Color.Red), 2); // You can change the color and thickness of the circle here
                    }
                }
            }

            pictureBox.Image = originalImage.ToBitmap();

समाधान 1

नमस्ते,
सर्कल का पता लगाने के लिए हफ़ सर्कल ट्रांसफ़ॉर्म पर एक नज़र डालें।

コメント

タイトルとURLをコピーしました