代写lab作业代码编程计算机类：Lab 8 – Blueberry Sorting
Lab 8 – Blueberry Sorting
On completion of this lab you will have:
• Developed a stand-alone (Pi) image acquisition software system and an image processing algorithm for sorting based on color.
• Interfaced with electro-mechanical components to sort coloured objects.
You are developing an automated blueberry sorting system as a stand-alone device. The system will run on the Raspberry Pi, however it may be easier to do the initial design and debugging on a windows PC.
The system must gate (control the flow) of blueberries down an intake (paper towel tube, plastic bottle, etc). The system must analyze each blueberry (ping-pong ball) for proper color and pass the good berries into one basket and reject all the rest of the objects into a reject bin.
• One potential solution is to use the 1st servo to block the flow of balls down the intake so it can be imaged by the webcam. The 2nd servo can be used to reject or pass the ball.
• Use the OpenCV webcam object to load and process images in the update method and display the results in the draw method. As with the previous labs, you should inherit from CBase4618 and your blueberry sorting specific code should be in a new class called CBlueberrySort.
• Process the image to segment the colour blue (use the HSV color space and the inRange function)
• Identify the largest object of the target colour in the image (use findContours function and sort for largest area), you may want to experiment with erode and dilate functions to remove noise.
• If an object size is within a blueberry threshold, sort to the good bin, otherwise reject.
• Show on the display image the sorting logic (outline shape, color mask, etc) and system status, ON/OFF, pass / reject, count of the number of berries accepted / rejected.
2.0 Extra functionality (requires 3 LED’s and 3 pushbuttons).
• Add the ability to turn ON and OFF (start/stop) the sorting system with a PUSHBUTTON. The keyboard ‘S’ key can also turn on and off the system. Show the system state on the display image.
• If the system is OFF, add the ability to manually PASS (with a button) or REJECT (with another button) the current blueberry in the sorting queue. You can also pass ‘P’ or fail ‘R’ the berry with the keyboard. The ‘C’ clear key is used to reset the berry counter. Show all actions (Pass/Reject/etc) on the display.
• 1 LED should indicate if the system is ON or OFF
• 2 LED’s should indicate if the blueberry was accepted or rejected (Green for pass, Red for reject).
3 Lab Completion Demo Week 1 (8)
Complete the image analysis portion of the project in which it is determined whether to PASS or REJECT an object. You will need to implement the chute for feeding the berries to the imaging system, but the rest of the system need not yet be implemented. This portion of the lab may be implemented either Windows or the Pi.
A) Create a physical structure that will hold the feed for the berries, the chute which passes the berries to the camera imaging location and the holder for the camera.
B) Show an image of the object to be processed in real-time.
C 5x) Process the image to correctly identify if the object should be PASSED or REJECTED. Display the status on the image.
D) Remove the object by hand and let the next fall into place, the identification of the next object should occur.
4 Lab Completion Demo Week 2 (8)
Port the image analysis system to the Raspberry Pi if not already done. Implement the remainder of the system.
A) Implement the ability to manually PASS and REJECT a berry using pushbuttons.
B) Implement the ability to manually PASS and REJECT a berry using the keyboard.
C) Implement the ability to START and STOP the system using the pushbuttons.
D) Implement the ability to START and STOP the system using the keyboard.
E) Implement the LED’s to show the ON/OFF state and the PASS/REJECT events. F 3x) Correctly sort berries.
Copy your source code (CPP and H files only) to the share-in folder with your student number.
本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝或者Upwork交易！
E-mail:firstname.lastname@example.org 微信：BadGeniuscs 工作时间：无休息工作日-早上8点到凌晨3点