国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做COMP27112、代寫(xiě)C/C++程序語(yǔ)言

時(shí)間:2024-04-24  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



COMP27112: Visual Computing Lab 4
COMP27112: Visual Computing
Lab 4
1 Introduction
For this practical assignment you should use C/C++ and OpenCV to develop the code. Your code, results and
comments MUST be submitted in a single PDF file. Only submit the PDF file.
You should use the supplied images for your processing and include them in your report.
For ease of marking, please lay out your report in sections using the titles given in this document.
You will probably need to refer to the OpenCV documentation website: https://docs.opencv.org/4.8.0/.
2 Intended Learning Outcomes
By the end of this assignment, you should be able to:
• Implement image processing code using C/C++ and OpenCV
• Create an image processing function that you can add to your own library
• Choose combinations of techniques in order to solve an image processing problem (that is, a image processing pipeline, or workflow)
3 Image Histogram and Segmentation [10 Marks]
3.1 Histogram
Image segmentation is the process of partitioning an image into distinct parts (regions or objects). Thresholding
is a simple way to do this, and the result is a binary image (that is, one that consists of two levels: black and
white for example).
Imagine that you want to write software to help a drone navigate in a desert by following roads. You might
want to segment the drone camera image into sand and road. This is shown in the following image where sand
is labelled white and the road is labelled black.
The grey-level threshold that was used in the above thresholding problem was 110. But how do you decide
which threshold value to use? It is often done by examining a histogram of the image, as shown below.
Department of Computer Science, The University of Manchester (Jan 2024) Page 1 of 7
COMP27112: Visual Computing Lab 4
In this histogram image, a vertical bar is drawn in black to represent the number of pixels in the image with
a particular grey level (0–255). The grey vertical gridlines mark 0, 64, 128, 192, and 255. Two peaks can be
seen in this image: a large one at the lighter end (the sand), and a small one at the darker end (the road). A
suitable threshold value, between the two peaks, can be estimated at around 110.
**2; TASK
Write a function that creates a histogram image like the one shown above. The image must be 400 pixels high
and 512 pixels wide. Because it is 512 pixels wide and the horizontal axis should represent 256 grey levels
(0–255), each bar should be two pixels wide. You can use the supplied histogram.cpp as a starting point.
The highest count in the histogram should be drawn to the full height of the image. If the count for a grey-level
is zero, no bar should be drawn.
You must write your own code to count the number of occurrences of each grey level, and to scale the counts to
fit the image. You must not use the OpenCV calcHist() function nor something similar from other libraries.
You can draw the bars by setting pixels in the image or by drawing lines or rectangles with OpenCV functions.
Drawing the gridlines is optional, but if you do add them, it will make your function more helpful. The gridlines
in the above image were drawn in light grey to avoid them being mistaken for bars, and the bars were drawn
over the top of the gridlines (that is, the gridlines were drawn first).
Your REPORT should contain the source code for your histogram function and the histogram image for these
two supplied images:
circuit board.jpg science person.jpg
NOTE If you use LATEX to write your report, you might include your code using the listings package:
\usepackage{listings}
...
\begin{lstlisting}[language=C++]
int x = 123;
\end{lstlisting}
3.2 Thresholding
For this part, you should use your histogram function to help you choose suitable threshold values. If you failed
to do that part of the assignment, you can use an image manipulation program such as gimp that provides a
Department of Computer Science, The University of Manchester (Jan 2024) Page 2 of 7
COMP27112: Visual Computing Lab 4
histogram display. The gimp program is available for Linux, Windows and macOS.
You may also use the programs that you created in the previous lab for doing OTSU thresholding and interactive
thresholding.
**2; TASK
Choose an appropriate threshold value for each of the following problems, and give a brief description of any
problems encountered or any observations.
Filename Problem
fundus.tif This is taken from a set of images used to train and test algorithms
for recognising the effects of diabetes on the retina. The aim of the
processing is to identify the blood vessels
glaucoma.jpg This is an image taken from a set used to train ophthalmologists to
recognise glaucoma. The aim of processing is to find the diffuse bright
region towards the middle and the brighter area inside it.
optic nerve head.jpg This was an image captured by a bespoke device that gives a tightly
framed image of the optic nerve head. The aim of processing is to find
the outlines of the large, slightly bright area and the smaller brighter
area inside it.
motorway.png This is an image from the internet of a motorway destination sign. Car
manufacturers have deployed systems that read speed limit signs. A next
step would be to read these signs. So the aim would be to find the white
text.
In your REPORT, include the following for each problem:
• the original image
• the image histogram
• thresholded image
• threshold value that was chosen
• a brief description of any observations you made
4 Horizon Detection [10 Marks]
This section asks you to find, and plot, a polynomial that represents the horizon in the following images:
horizon1.jpg horizon2.png horizon3.jpg
4.1 Processing Pipeline
You will need to do some form of edge detection that finds the edge between the Earth and space in two of the
images, and sea and sky in the final one. You might think that you could do binary thresholding first and then
Department of Computer Science, The University of Manchester (Jan 2024) Page 3 of 7
COMP27112: Visual Computing Lab 4
do edge detection, but you will find that there are lots of areas of misclassification that you will need to deal
with.
This lab asks you to use the Canny edge detector and the Hough line transform in your processing pipeline.
You should attempt to process the images in the following way:
• Convert the image into greyscale (if necessary)
• Apply a Canny filter on the image, leaving us with an image of the edges
• Apply a probabilistic Hough transformation that will return a list of pairs of Points defining the start and
end coordinates for line segments.
• Filter out the short lines, use Pythagoras to compute the lines’ lengths.
• Filter out the vertical lines. You could do that by either calculating the inverse tangent of each line
(use atan2), finding its angle from the horizontal, or check whether the x co-ordinates of the segment’s
endpoints are similar.
• Now that you are left with all the (nearly) horizontal lines’ points, find a curve that best fits all those
points. This is called polynomial regression. It takes some points and calculates the best polynomial of
any order that you choose that fits all the points. Be careful not to overfit the points though; since the
horizon curve best matches a quadratic function choosing a higher order polynomial can give you unstable
results, i.e. a very wavy line.
Your program will need to use a number of parameters. It would be ideal if a single set of parameters
could be used to process all images of this type, but that often isn’t possible.
You should allow for your program to use different parameter values. This might be achieved by passing
them in as command-line parameters, using a switch-statement, or just by using three set of constants,
two of which being commented out for each image.
NOTE You are supplied with some code to help you with this lab, see horizon.cpp. The contents of this file
are shown below.
The fitPoly function, shown below, accepts a list of points. It calculates a line (curve) of best fit through
those points. You also specify an order for the poylonimial, n (if you are expecting a straight line, you would
set n to 1, for example). The function returns the polymomial as a vector of doubles, the order of which is the
order of coefficients: a + bx + cx2 + . . .. You might want to set up a vector with a few points and try out this
function so that you are clear on its operation.
1 //Polynomial regression function
2 std::vector<double> fitPoly(std::vector<cv::Point> points, int n)
3 {
4 //Number of points
5 int nPoints = points.size();
6
7 //Vectors for all the points’ xs and ys
8 std::vector<float> xValues = std::vector<float>();
9 std::vector<float> yValues = std::vector<float>();
10
11 //Split the points into two vectors for x and y values
12 for(int i = 0; i < nPoints; i++)
13 {
14 xValues.push_back(points[i].x);
15 yValues.push_back(points[i].y);
16 }
17
18 //Augmented matrix
19 double matrixSystem[n+1][n+2];
20 for(int row = 0; row < n+1; row++)
Department of Computer Science, The University of Manchester (Jan 2024) Page 4 of 7
COMP27112: Visual Computing Lab 4
21 {
22 for(int col = 0; col < n+1; col++)
23 {
24 matrixSystem[row][col] = 0;
25 for(int i = 0; i < nPoints; i++)
26 matrixSystem[row][col] += pow(xValues[i], row + col);
27 }
28
29 matrixSystem[row][n+1] = 0;
30 for(int i = 0; i < nPoints; i++)
31 matrixSystem[row][n+1] += pow(xValues[i], row) * yValues[i];
**
33 }
34
35 //Array that holds all the coefficients
36 double coeffVec[n+2] = {}; // the "= {}" is needed in visual studio, but not in Linux
37
38 //Gauss reduction
39 for(int i = 0; i <= n-1; i++)
40 for (int k=i+1; k <= n; k++)
41 {
42 double t=matrixSystem[k][i]/matrixSystem[i][i];
43
44 for (int j=0;j<=n+1;j++)
45 matrixSystem[k][j]=matrixSystem[k][j]-t*matrixSystem[i][j];
46
** }
48
49 //Back-substitution
50 for (int i=n;i>=0;i--)
51 {
52 coeffVec[i]=matrixSystem[i][n+1];
53 for (int j=0;j<=n+1;j++)
54 if (j!=i)
55 coeffVec[i]=coeffVec[i]-matrixSystem[i][j]*coeffVec[j];
56
57 coeffVec[i]=coeffVec[i]/matrixSystem[i][i];
58 }
59
60 //Construct the vector and return it
61 std::vector<double> result = std::vector<double>();
62 for(int i = 0; i < n+1; i++)
63 result.push_back(coeffVec[i]);
64 return result;
65 }
As part of this lab, you will be asked to draw the detected horizon from the polynomial onto the image. The
function pointAtX(), shown below, will help you with that. If you provide it with an x-coordinate and the
polynomial coefficients, it will return a point (x, y) (that is, it will calculate the y-coordinate for you and return
it as a point that you might use in an OpenCV function).
1 //Returns the point for the equation determined
2 //by a vector of coefficents, at a certain x location
3 cv::Point pointAtX(std::vector<double> coeff, double x)
4 {
5 double y = 0;
6 for(int i = 0; i < coeff.size(); i++)
7 y += pow(x, i) * coeff[i];
8 return cv::Point(x, y);
9 }
**2; TASK
Write a program to perform the processing pipeline described above. Use the supplied fitPoly() and pointAtX()
as well as the OpenCV functions Canny() and HoughLinesP().
Department of Computer Science, The University of Manchester (Jan 2024) Page 5 of 7
COMP27112: Visual Computing Lab 4
You will need to experiment with the parameters for the Canny and Hough functions and other processing that
you do. You will probably need different values for each image that you process, so make them easier to work
with in your program. That is, don’t just hard-code values into your function calls.
Make sure that you understand the purpose of the Canny parameters lowerThreshold and upperThreshold;
and the Hough parameters rho, theta, threshold, minLen, maxGap.
Once you have obtained a polynomial that follows the line of the horizon, draw the line/curve on the original
colour image. Make it stand out by drawing it in a bright colour and don’t draw the line too narrow (nor so
thick that it disguises an inaccurate detection). You might draw this line by setting pixels in the image, or by
using the OpenCV functions circle() or line().
Your REPORT should include your code.
4.2 Processing
Now that you have written your program to detect the horizon in an image, use it on the provided horizon
images.
**2; TASK
Run your program on each of the three supplied horizon images. You may need to choose different parameter
values to get a good result in each image.
You might have trouble with noise in a couple of the images. If that is the case (and you can’t select parameter
values to achieve the aim), try adding some extra processing to your pipeline, but make sure that the horizon
is detected accurately.
In your REPORT, include the following for each horizon image:
• The original image
• The Canny edge image
• The image with all of the probabilistic Hough lies drawn
• The image with the short lines removed
• The image with only the (approximately) horizontal lines
• The image with the horizon drawn
• The set of parameter values with an obvious name for the parameter
• If you needed to add extra processing, give a brief description
NOTE Draw your Hough lines and the final horizon in colour onto the original colour image.
Optional: The horizon in the oil-rig image needs rotating clockwise to make it horizontal. Calculate the angle
that it needs to be rotated by (in degrees). Hint: use your calculated polynomial. Show your working and state
an OpenCV function that can rotate the image. Rotate the image to make the horizon horizontal. Do you have
any observations on your result?
Department of Computer Science, The University of Manchester (Jan 2024) Page 6 of 7
COMP27112: Visual Computing Lab 4
5 Marking Scheme
3.1 Write a function to create a histogram image. 5 marks
3.1 Show histogram for the images circuit board.jpg and science person.jpg. 1 marks
3.2 Threshold the images fundus.tif, glaucoma.jpg, optic nerve head.jpg,
and motorway.png. One mark for each image for supplying the output image,
threshold value, and observations.
4 marks
4.1 Write code that performs the stated horizon-detection processing pipeline. 4 marks
4.2 Process the three images (horizon1, horizon2, horizon3) and draw the detected
horizon from the polynomial on the original colour image. Include the requested
images at the intermediate stages as well as the parameter values used. Two
marks for each horizon image.
6 marks
Total 20 marks
Check-list
Have you:
• Created a well-formatted report?
• Included input, intermediate, and output images with useful labels?
• Chosen a size for your images so that the details can be seen, but not so big that the document covers
too many pages? (See the images in this document.)
• Included the code?
Submit your report as a single pdf document on Blackboard.
Do not include any other files or zip it – just submit a pdf.
Department of Computer Science, The University of Manchester (Jan 2024) Page 7 of 7

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


















 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:在菲律賓出生的小孩怎么出境 注意事項(xiàng)有哪些
  • 下一篇:COMP30023代寫(xiě)、代做C/C++語(yǔ)言程序
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁(yè)版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产成人黄色av| 91久久久久久久一区二区| 国产精品一区二区三区久久久| 精品国产依人香蕉在线精品| 亚洲精品成人a8198a| 国产女同一区二区| 国产精品久久久久久av福利软件 | 欧美亚洲日本黄色| 久99久在线| 日本亚洲导航| 久久精品日韩| 日韩av电影在线网| 久久免费精品视频| 午夜精品久久久久久久99热| 99九九视频| 亚洲精品影院| 久久久在线视频| 欧美一级片一区| 久久99精品久久久久久青青日本 | aaa免费在线观看| 亚洲自拍小视频| 91麻豆国产语对白在线观看| 亚洲综合视频1区| av片在线免费| 一级日韩一区在线观看| 成人h在线播放| 午夜精品一区二区三区在线观看 | 九九视频直播综合网| 不卡一卡2卡3卡4卡精品在| 中文精品无码中文字幕无码专区| 国产精品一区二| 亚洲自拍小视频| 久久琪琪电影院| 奇米精品一区二区三区| 久久天堂av综合合色| 国产综合色一区二区三区| 国产精品福利久久久| 国产美女视频免费| 一级特黄录像免费播放全99| 国产精品av免费| 欧美专区中文字幕| 欧美xxxx18性欧美| 97国产一区二区精品久久呦| 日韩av三级在线| 国产精品久久中文| 不卡影院一区二区| 青青在线视频一区二区三区| 国产精品精品视频一区二区三区 | 114国产精品久久免费观看| 午夜精品美女久久久久av福利| 久久久久久久91| 免费亚洲一区二区| 伊人久久大香线蕉成人综合网| 久久久欧美精品| 欧美国产亚洲一区| 一区二区精品在线观看| 久久国产精品一区二区三区| 毛葺葺老太做受视频| 亚洲a在线观看| 国产精品日韩一区二区三区| www国产免费| 欧美精品无码一区二区三区| 欧美激情综合色| 久久国产手机看片| 国产一区二区三区黄| 少妇一晚三次一区二区三区| 国产精品青草久久久久福利99| www黄色日本| 精品欧美一区二区三区久久久 | 国产精品区免费视频| 99精品一区二区三区的区别| 欧美精品123| 无码人妻h动漫| 国产精品久久久久久av下载红粉| 91免费在线视频| 欧美这里只有精品| 亚洲精品免费在线视频| 国产精品高潮粉嫩av| 久久国产色av免费观看| 成人www视频在线观看| 黄色免费观看视频网站| 欧美一级免费视频| 中文字幕日本最新乱码视频| 国产精品嫩草在线观看| 久久精彩视频| 91精品国产成人| 国产日韩欧美在线观看| 欧美一级电影久久| 日本精品一区二区| 亚洲欧美一区二区原创| 国产精品久久久久高潮| 久99久视频| 91国产在线免费观看| 国产乱人伦真实精品视频| 国内精品视频在线| 欧美午夜精品久久久久久蜜| 日本一区二区三区精品视频| 亚洲淫片在线视频| 欧美激情伊人电影| 久久艳片www.17c.com| 国产精品无码一区二区在线| 久久久久免费视频| 国产成人一区二区三区电影| 草莓视频一区| 国产精品一区二区电影| 国产自产女人91一区在线观看| 欧美日韩无遮挡| 青青成人在线| 欧洲精品国产| 欧美一区二区影视| 欧美中文在线视频| 欧美一级成年大片在线观看| 日韩免费精品视频| 日本wwwcom| 日本一区二区黄色| 天天人人精品| 亚洲高清乱码| 性欧美精品一区二区三区在线播放 | 国产一区在线免费观看| 男人天堂新网址| 欧美 日韩 国产 激情| 欧美久久久久久久久久久久久久| 日韩久久久久久久久久久久久| 日本一道本久久| 日本精品久久中文字幕佐佐木| 日本一区二区三区视频在线观看| 日本丰满少妇黄大片在线观看| 日韩欧美在线播放视频| 日韩欧美精品一区二区 | 操人视频欧美| 91精品国自产在线观看| 久久久在线观看| 久久久久久久久网| 久久天天躁狠狠躁老女人| 国产精品久久久久91| 久久亚洲综合国产精品99麻豆精品福利 | 国产精品大全| 少妇久久久久久| 国产精品视频一区国模私拍| 国产精品青草久久久久福利99| 国产精品久久久久久搜索| 久久777国产线看观看精品| 中文字幕99| 亚洲啊啊啊啊啊| 日本a在线免费观看| 男女超爽视频免费播放| 国产女人精品视频| 久久久亚洲天堂| 久久精品一偷一偷国产| 国产精品高潮呻吟视频| 伊人婷婷久久| 日韩亚洲欧美精品| 欧美亚洲成人免费| 国产拍精品一二三| 97碰在线观看| 日韩在线视频免费观看高清中文 | 中文字幕日韩一区二区三区 | 精品久久久久亚洲| 亚洲欧美国产一区二区| 日本一区二区三区在线视频| 激情五月宗合网| 97久久国产亚洲精品超碰热| 91av免费看| 国产精品久久久久久久久免费| 一区二区三区四区视频在线观看| 日本一区视频在线播放| 韩国一区二区av| 91免费精品视频| 国产精品视频资源| 亚洲视频在线二区| 欧美精品亚洲| 91成人免费观看| 国产精品久久久av久久久| 午夜精品久久久久久99热| 黄色小网站91| 久久免费视频网| 久久91精品国产91久久跳| 亚洲国产日韩美| 麻豆亚洲一区| 国产成人精品日本亚洲11| 欧美精品在线看| 日韩免费av一区二区三区| 国产免费亚洲高清| www高清在线视频日韩欧美| 中国丰满熟妇xxxx性| 欧美精品久久久| 久久免费国产视频| 中文字幕黄色大片| 女女同性女同一区二区三区91 | 国产在线精品自拍| 久久综合精品一区| 欧美精品福利在线| 僵尸世界大战2 在线播放| 国产大片精品免费永久看nba| 国产99久久久欧美黑人| 欧美日韩在线成人| 久久精品女人的天堂av| 亚洲尤物视频网| 国产欧美综合一区| 国产成人免费高清视频|