代做CS373 Assignment - Sign Detection 2025调试Python程序

CS373 Assignment - Sign Detection

2025 version 5

Introduction

• In this assignment, the main component is to write a Python code pipeline to automatically detect all the road signs in the given images. We have provided a Python skeleton code package for you, so you just need to implement the necessary functions to make the pipeline working.

• It is a great way to enhance your understanding of the image processing.

• Through out the course, you will develop the following skills (your tools) to complete the pipeline for road sign detection.

• RGB color image to greyscale conversion

• Image contrast stretching

• Edge detection

• Image blurring

• Image thresholding

• Erosion and dilation operation

• Connected Component Analysis

• More…

Step 1: Convert to Greyscale and Normalize

1. Implement “computeRGBToGreyscale()” to convert a grey scale image: read input image using the ‘readRGBImageToSeparatePixelArrays()’ helper function. Convert the RGB image to greyscale (use RGB channel ratio 0.3 x red, 0.6 x green, 0.1 x blue), and round the pixel values to the nearest integer value.

2. Implement “scaleTo0And255And5_95Percentile()” to stretch the image contrast: stretch the values between 0 to 255 (using the 5-95 percentile strategy) as described on lecture slides ImagesAndHistograms, p20-68). Do not round your 5% and 95% cumulative histogram values. Your output for this step should be the same as the image shown on Fig. 2.

Hint 1: see lecture slides ImagesAndHistograms and Coderunner Programming quiz in Week 10.

Hint 2: for our example image (Fig. 1), the 5_percentile (f_min) = 202 and the 95_percentile (f_max) = 217.

Step 2: Edge Detection

1. Implement “computeVerticalEdgesSobelAbsolute(), computeHorizontalEdgesSobelAbsolute()” to apply a 3x3 Sober filter in horizontal (x) and vertical (y) directions independently to get the edge maps, you should store the computed value for each individual pixel as Python float.

Hint 1: see lecture slides on edge detection and Coderunner Programming quiz in Week 11.

Hint 2: please use the 3x3 Sober filter shown below for this assignment:

2. Implement “computeEdgesSobelAbsolute()” to take the absolute value of the sum between horizontal (x) and vertical (y) direction edge maps. Do not round the numbers in the intermediate step. The output for this step should be similar to the image shown on Fig. 5.

Hint 3: you should use the BorderIgnore option and set border pixels to zero in output, as stated on the slide Filtering, p13.

Hint 4: for computing the edge strength in both x and y direction, you may use the following equation:

Step 3: Image Blurring

Implement “computeStandardDeviationImage7x7()” to apply a 7x7 standard deviation filter to the image obtained from Step 2. Your output for this step should be similar to the image shown on Fig. 7.

Hint 1: do not round your output values.

Hint 2: after computing the standard deviation filter for one 7x7 window, you should take the absolute value of your result before moving to the next window.

Hint 3: you should use the BorderIgnore option and set border pixels to zero in output, as stated on the slide Filtering, p13.

Hint 4: see lecture slides on image filtering and Coderunner Programming quiz in Week 11.

Step 4: Threshold the Image

Implement “computeThresholdGE()” to perform. a simple thresholding operation to segment the sign(s) from the black background. After performing this step, you should have a binary image (see Fig. 10).

Hint 1: set the threshold value to 31 would give the best result for all the easy images we provided to you. Please set the threshold value to 31 to satisfy out auto-marking system.

Hint 2: set any pixel value smaller than 31 to 0, this represents your background (region 1) in the image, and set any pixel value bigger or equal to 31 to 255, which represents your foreground (region 2) – the sign.

Hint 3: see lecture slides on image segmentation (p7) and see Programming quiz on Coderunner on Week 10.

Step 5: Erosion and Dilation

Implement “dilation() and erosion()” to perform. dilation and erosion. Your implemented function should be able to run dilation/erosion multiple times based on the function argument (num_of_iterations). Your output for this step should be similar to the image shown on Fig. 11.

Hint 1: use a 9x9 kernel (all elements equal to 1), see Fig. 12 for the kernel details.

Hint 2: the filtering process has to access pixels that are outside the input image. So, please use the BoundaryZeroPadding option, see lecture slides Filtering, p13.

Hint 3: see lecture slides on image morphology and Coderunner Programming quiz in Week 12.

Step 6: Connected Component Analysis

Implement “computeConnectedComponentLabeling()” to perform. a connected component analysis to find all connected components. Your output for this step should be similar to the image shown on Fig. 13.

After erosion and dilation, you may find there are still some holes in the binary image. That is fine, as long as it is one connected component.

Hint 1: see lecture slides on Segmentation_II, p4-6, and Coderunner Programming quiz in Week 12.

Hint 2: please use 4-neighbourhood grassfire method.

Step 7: Draw Bounding Box

Implement “returnBBoxCoords()” to extract the bounding box(es) around all regions that your pipeline has found by looping over the image and looking for the minimum and maximum x and y coordinates of the pixels in the previously determined connected components. Your output for this step should be the same as the image shown on Fig. 14.

Make sure you record the bounding box locations for each of the connected components your pipeline has found.

We will provide code for drawing the bounding box(es) in the image (see next slides), so please store all the bounding box locations in a Python list called ‘bounding_box_list’, so our program can loop through all the bounding boxes and draw them on the output image.

Below is an example of the ‘bounding_box_list’ for our example image on the right.




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图