{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-12T11:19:24-04:00", "answer_date": "2024-09-12 11:19:24", "is_docs_available": "", "is_excel_available": "", "is_pdf_available": "", "count_file_available": 0, "main_page": "student_question_view", "question_id": "10479799", "url": "\/study-help\/questions\/write-a-c-windows-form-app-to-locate-a-red-10479799", "question_creation_date_js": "2024-09-12T11:19:24-04:00", "question_creation_date": "Sep 12, 2024 11:19 AM", "meta_title": "[Solved] Write a C# Windows Form App to locate a r | SolutionInn", "meta_description": "Answer of - Write a C# Windows Form App to locate a red object through a camera mounted on the mobile robot using AForge Library u | SolutionInn", "meta_keywords": "write,c,windows,form,app,locate,red,object,camera,mounted,mobile,robot", "question_title_h1": "Write a C# Windows Form App to locate a red object through a camera mounted on the mobile robot using AForge Library using the resolution", "question_title": "Write a C# Windows Form App to locate a red object through", "question_title_for_js_snippet": "Write a C Windows Form App to locate a red object through a camera mounted on the mobile robot using AForge Library using the resolution of the camera and pixel location of the red object in the video So that when the robot moves around, the video from the camera can used to used to tell if the red object is in the middle of the video, have rectangle around it and if it is in central position show a message box displaying that the red object is recognised So, if the pixel location of the red object is 200 then it is located to the left, if the pixel location is 400 then it is located in the middle, if it is 600 then it means the red object is in the right from the middle part of the video Display a co ordinate label in the form based on pixel location Note that the camera only moves along x axis I have used EuclideanColorFiltering filter from AForge Imaging Filters Library to extract the red object from the image but the red object placed anywhere cannot be located yet for robot to move towards it if(radiobtnRed Checked) create filter EuclideanColorFiltering filter new EuclideanColorFiltering() set center colol and radius filter CenterColor new RGB (Color FromArgb(215, 0, 0)) filter Radius 100 apply the filter filter ApplyInPlace(image1) ProcessImg(image1) define Process Image function public void ProcessImg(Bitmap image) BlobCounter blobCounter new BlobCounter() blobCounter MinWidth 5 blobCounter MinHeight 5 blobCounter FilterBlobs true blobCounter ObjectsOrder ObjectsOrder Size BitmapData objectsData image LockBits(new Rectangle(0, 0, image Width, image Height), ImageLockMode ReadOnly, image PixelFormat) grayscaling Grayscale grayscaleFilter new Grayscale(0 2125, 0 7154, 0 0721) UnmanagedImage grayImage grayscaleFilter Apply(new UnmanagedImage(objectsData)) unlock image image UnlockBits(objectsData) blobCounter ProcessImage(image) Rectangle rects blobCounter GetObjectsRectangles() Blob blobs blobCounter GetObjectsInformation() pictureBox3 Image image ", "question_description": "

Write a \"C# Windows Form App\" to \"locate a red object through a camera\" mounted on the mobile robot using AForge Library using the \"resolution of the camera\" and \"pixel location of the red object\" in the video.<\/p>

So that when the robot moves around, the video from the camera can used to used to tell if the red object is in the middle of the video, have rectangle around it and if it is in central position show a message box displaying that the red object is recognised. So, if the pixel location of the red object is 200 then it is located to the left, if the pixel location is 400 then it is located in the middle, if it is 600 then it means the red object is in the right from the middle part of the video. Display a co-ordinate label in the form based on pixel location.<\/p>

Note that the camera \"only moves along x axis\".<\/p>

<\/p>

I have used EuclideanColorFiltering filter from AForge.Imaging.Filters Library to extract the red object from the image but the red object placed anywhere cannot be located yet for robot to move towards it. <\/p>

<\/p>

if(radiobtnRed.Checked) { \/\/ create filter EuclideanColorFiltering filter = new EuclideanColorFiltering(); \/\/ set center colol and radius filter.CenterColor = new RGB (Color.FromArgb(215, 0, 0)); filter.Radius = 100; \/\/ apply the filter filter.ApplyInPlace(image1);<\/p>

ProcessImg(image1); }<\/p>

<\/p>

\/\/ define Process Image function public void ProcessImg(Bitmap image) { BlobCounter blobCounter = new BlobCounter(); blobCounter.MinWidth = 5; blobCounter.MinHeight = 5; blobCounter.FilterBlobs = true; blobCounter.ObjectsOrder = ObjectsOrder.Size; <\/p>

BitmapData objectsData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, image.PixelFormat); \/\/grayscaling Grayscale grayscaleFilter = new Grayscale(0.2125, 0.7154, 0.0721); UnmanagedImage grayImage = grayscaleFilter.Apply(new UnmanagedImage(objectsData));<\/p>

\/\/ unlock image image.UnlockBits(objectsData);<\/p>

blobCounter.ProcessImage(image); Rectangle[ ] rects = blobCounter.GetObjectsRectangles(); Blob[ ] blobs = blobCounter.GetObjectsInformation(); pictureBox3.Image = image;<\/p>

}<\/p>

<\/p>

<\/p>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-09-12 11:19:24", "see_more_questions_link": "\/study-help\/questions\/computer-science-programming-2022-November-11", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/business-communication\/7-selfanalysis-do-i-feel-comfortable-with-the-purpose-and-1998298", "description": "7. Self-analysis. Do I feel comfortable with the purpose and development of my presentation? Do I sincerely believe that what I have to communicate is important and true? Have I done everything...", "stars": 0 }, { "url": "\/develop-a-chart-similar-to-figure-for-the-following-assignment", "description": "Develop a chart similar to Figure for the following assignment: Your client, Baxter Controls, has requested your advice as to when a contingent liability should be booked (recorded) as a liability....", "stars": 3 }, { "url": "\/study-help\/questions\/write-a-c-windows-form-app-to-locate-a-red-10479799", "description": "Write a \"C# Windows Form App\" to \"locate a red object through a camera\" mounted on the mobile robot using AForge Library using the \"resolution of the camera\" and \"pixel location of the red object\" in...", "stars": 3 }, { "url": "\/study-help\/questions\/how-has-spanish-companies-profitability-evolved-since-the-beginning-of-6522249", "description": "How has Spanish companies profitability evolved since the beginning of the financial crisis?", "stars": 3 }, { "url": "\/study-help\/questions\/creggs-fine-furnishings-manufactures-upscale-custom-furniture-creggs-currently-uses-4349507", "description": "Cregg's Fine Furnishings manufactures upscale custom furniture. Cregg's currently uses a plantwide overhead rate based on direct labor hours to allocate its $1,300,000 of manufacturing overhead to...", "stars": 3 }, { "url": "\/study-help\/questions\/please-please-upload-the-answer-in-excel-using-solver-2636461", "description": "[ PLEASE PLEASE UPLOAD THE ANSWER IN EXCEL USING SOLVER BY NON-LINEAR OPTIMIZATION METHOD. I REQUEST YOU TO GIVE THE ANSWER TO THESE QUESTIONS BY SOLVING ON EXCEL AND ATTACHING THE EXCEL HERE OR AT...", "stars": 3 }, { "url": "\/study-help\/questions\/2-1-point-given-aabc-tan-a-b-b-2061264", "description": "2. (1 point) Given AABC, tan A b b", "stars": 3 }, { "url": "\/study-help\/questions\/geolander-tire-manufactures-tires-for-allterrain-vehicles-geolander-uses-joh-7437720", "description": "Geolander Tire manufactures tires for all-terrain vehicles Geolander uses job costing and has a perpetual inventory system. On November 22, Geolander received an order for 100 TX tires from ATV...", "stars": 3 }, { "url": "\/study-help\/questions\/ac114-unit-2-lab-assignment-question-6-of-6-current-1760451", "description": "AC114 Unit 2 Lab Assignment Question 6 of 6 Current Ampt in Prog Os Are 1. Helen Martated on Deviare Co. a company that rondes craft theth of Ane Cash $11.000 Service Revenue 36.400 Account 1200...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/yiok-gmbh-had-only-one-job-in-process-on-april-10479798", "next": "\/study-help\/questions\/case-study-1-kindly-read-the-case-below-and-10479800" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "Write a C# Windows Form App to locate a red object through", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/write-a-c-windows-form-app-to-locate-a-red-10479799" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } } } }