讲解:ENGG1003、MATLAB、MATLAB、softwareDatabase|C/C++

ENGG1003 Project DescriptionMay 17, 20191 IntroductionDigital images are finding increasing application to engineering problems thanks to the increased availabilityof low cost digital cameras. Similarly, thermal imaging cameras are also becoming cheaper and therefore arefinding an increased usage in engineering applications.However, digital images have limited value without further processing hence the need to use computersto extract relevant features. This processing is achieved through software.You will be required to develop suitable image processing algorithms and implement them in a MATLABprogram that will be able to extract information from images that will help to solve a specific engineeringproblem.2 Project Description2.1 Medical EngineeringResearch into the application of local hyperthermia directed to kill cancerous tumors is being conducted.Delivery of sufficient thermal energy to kill tumors but leave other tissue unaffected means that feedbackof the thermal profile of a target area needs to be analysed. You are given images from a thermal camerawhich captures the thermal distribution of a patient’s treatment area. Your task is to write a program inMATLAB designed to process the images and extract features which indicate that the thermal treatment isonly affecting the tumor.2.2 Chemical EngineeringYou are assigned to a team which is developing a new process incorporating an experimental tank reactor.The tank aims to generate homogeneous reaction rates throughout the tank in order to maximise its yield. Tothis end thermal images are captured of the side of the tank. Your task is to write a program in MATLABdesigned to process the images and extract features which will identify area of accelerated reaction ratesor non-homogeneous reaction rates (as the reaction are exothermic) so that the design of the tank can bechanged to correct these problems.2.3 Mechanical EngineeringYou are given the thermal images of the backup roll on a four high rolling mill designed to produce sheetsteel for cars. Temperature gradients across the roll cause imperfections in resulting steel sheet. Your taskis to write a program in MATLAB designed to process the images and extract features which will identifywhere these temperature gradients are and therefore allow the use of sprays to equalise the temperatureacross the rolls thereby improving the quality of the resulting sheet steel.2.4 Electrical EngineeringA study into transformer performance shows that a failing power transformer produces an increasing numberof hot spots. You are tasked to a team that is developing a field device which can quickly determine if a1transformer is likely to fail. Your task is to write a program in MATLAB designed to process the imagesand extract features which will identify whether the transformer is failing and therefore should be replaced.2.5 Mechatronics EngineeringThermal imaging is used in search and rescue robots throughout the world. A new project aims to combine aquadcopter with a thermal imaging camera to detect possible survivors amongst rubble. Your task is to writea program in MATLAB designed to process the images and extract features which will identify potentialsurvivors so that rescuers can focus their efforts to the most promising locations.2.6 Aerospace EngineeringThermal imaging is used to identify the quality of a thermal panel for a launch vehicle’s heat protection.Your task is to write a program in MATLAB designed to process the thermal images and extract featureswhich will identify faulty panels.2.7 Environmental EngineeringSatellite thermal images of clouds are used to identify locations of potentially building storm activities. Yourtask is to write a program in MATLAB designed to process the infrared images and extract features whichwill help in identifying potentially destructive storms.2.8 Information TechnologyMany international airports employ thermal imaging cameras to detect passengers with fevers in an effortto reduce the spread of disease. Since major disease outbreaks are rare, the airport you work for has moveda thermal imaging camera to monitor passenger queues at a known bottleneck in the customs process. Youhave been been assigned the task of analysing the images to estimate the number of passengers queued in agiven image.23 Thermal Imagining DevicesThere are two devices that capture the thermal images. A low resolution and high resolution camera. Thespecifications of each device is as follows:1. Low resolution sensorSensor has a width of 80 pixels (4.6 mm) x height of 60 pixels (3.7 mm). Diagonal Field of view63.5o. Detectable temperature range ?40oC to 382oC with a resolution of approximately 0.026oC.The sensor returns an array of thermal intensities as an integer level represented by 14 bits.Image data format is an array 80 by 60 which has each element containing integer numbers representingthe relative temperature level for each sensor pixel.2. High resolution sensorSensor has a width of 640 pixels (4.6 mm) x height of 480 pixels (3.7 mm). Diagonal Field of view63.5o. Detectable temperature range ?40oC to 382oC with a resolution of approximately 0.026oC.The sensor returns an array of thermal intensities as an integer level represented by 14 bits.Image data format is a run-length encoded (RLE) array containing encoded integer numbers representingthe relative temperature level for each sensor pixel.34 Requirements Specification4.1 Task 1 (9 Marks): Process a low resolution sensor image with an idealisedfeatureYou are given an idealised test image with a single circular feature. You are to develop an algorithm andimplement that algorithm in the form of a MATLAB program that is capable of performing the followingtasks.1. Find the centre of the circular feature in pixels.2. Calculate the radius of the feature in pixels.3. Calculate the area of the feature in pixels.4. Given the distance from the camera to the surface and sensor information, calculate the actual locationof the centre relative to the edge of the image, the radius of the feature and the area of the feature.Task 1: Low Resolution Sensor Image10 20 30 40 50 60 70 80Figure 1: Task 1: Example ImageHint: A simplistic approach to achieve the above goals is to take advantage of the fact that the test imageonly contains one single circular feature with a clearly defined edge. Hence, you could scan each line of theimage in a vertical direction until you find the first edge of the circle and then find the last vertical edge.Combining this with a scan of the horizontal lines in the image would result in finding the extreme pointsof the circular feature from which you can answer the questions that have been asked.44.2 Task 2 (3.5 Marks): Process a low resolution sensor image with realisticfeaturesThe first image was idealised for simplicity. The next image is more realistic and as such lens effects and otherambient disturbances including thermal gradient are present in the image. As such a more sophisticatedalgorithm of edge detection will be required. You are to develop an algorithm that uses Sobel edge detection(see Appendix C) and implement it in the form of a MATLAB program that is capable of performing thefollowing tasks:1. Find the centre of the circular feature in pixels.2. Calculate the radius of the feature in pixels.3. Calculate the area of the feature in pixels.4. Given the distance from the camera to the surface and sensor information, calculate the actual locationof the centre relative to the edge of the image, the radius of the feature and the area of the feature.You may use MATLAB’s built-in implementation of the Sobel algorithm (documentation: here) or implementit yourself. Manual implementation will be worth more marks. Final marking guide TBA.Task 2: Low Resolution Sensor Image10 20 30 40 50 60 70 80Figure 2: Task 2: Example Image54.3 Task 3: Process high resolution sensor image with multiple features(2019) This task was removed to reduce student load in weeks 12 and 13.65 AppendicesA Approximation of Image SizeIt is important to determine the real size of objects in an image. A simple approximation for achieving thisis to use the information provided by the camera’s manufacturer.A.1 Field of ViewA cameras field of view is nothing more than the visible cone that a camera is capable of seeing. This isusually described as an angle in degrees.Diagonal FOVSensor Viewable AreaTotal Viewable AreaDistance to ObjectCameraFigure 3: Camera field of view schematic.A.2 Object Size EstimationWith a small amount of trigonometry we see that the diagonal field of view can be combined with thedistance from the object to get the relationship between a pixel and the real object size that it represents.dtva = 2do tan �(1)where dtva is the diameter of the total viewable area, do is the distance from the focal point to the objectand F OV is the field of view angle in radians. Using dtva which is equivalent to the diagonal distance thatthe sensor can see we can calculate the pixel to object size as follows.�(3)where ws is the width of the sensor in mm, hs is the heighENGG1003作业代做、MATLAB编程语言作业调试、MATLAB课程作业代做、代写software留学生作业 代做Dt of the sensor in mm, hsva is the height of thesensor viewable area in mm and wsva is the width of the sensor viewable area in mm.Then height of the object ho in mm and the width of the object wo are given by�where hsp is the height of the sensor in pixels, hop is the height of the object in pixels, wsp is the width ofthe sensor in pixels and wop is the width of the object in pixels.7B Kernel ConvolutionNB: This section describes a process which is almost identical to Question 4 from the Week 10 Lab.Most image processing consists of some form of filtering. Filtering is performed via the convolution of amatrix called a kernel with an image and producing a new image with the result of the convolution. Thekernel describes how each pixel in an image should be modified based on a set of weighted values applied tothe surrounding pixels in an image.B.1 Illustrative ExampleTo illustrate the kernel convolution procedure we will select the following kernel k.�Secondly we will use the following image for our example.1 2 3 4 5 61 10 10 200 200 10 102 10 10 200 200 10 103 10 10 200 200 10 104 10 10 200 200 10 105 10 10 200 200 10 106 10 10 200 200 10 10We note that the numbers represent values of luminosity in the range 0 to 255 where 0 corresponds to blackand 255 white. So essentially our image appears to contain a vertical ridge.Now in order to apply the convolution or filter we take the kernel k and flip it both horizontally andvertically kc.�Then we place the central element of kc over each pixel in the image. For example, placing kc’s central valueover the first pixel in the image we see that top and left elements are outside the bounds of the image andtherefore these kernel values will not be used in the next part of the calculation.1 2 3 4 5 61 10 10 200 200 10 102 10 10 200 200 10 103 10 10 200 200 10 104 10 10 200 200 10 105 10 10 200 200 10 106 10 10 200 200 10 10Once we have overlaid the kernel on the image we calculate the filtered version of the pixel by summing theproduct of each image pixel value with its flipped kernel value and dividing by the sum of kc’s elements thathave overlaid image pixels. For this example we haver(1, 1) = 5 × 10 + 4 × 10 +2 × 10 + 1 × 10 (8)= 120/(5 + 4 + 2 + 1) (9)= 10 (10)Similarly if we are calculating the filtered value for pixel (3, 3) we have81 2 3 4 5 61 10 10 200 200 10 102 10 10 200 200 10 103 10 10 200 200 10 104 10 10 200 200 10 105 10 10 200 200 10 106 10 10 200 200 10 10r(3, 3) =9 × 10 + 8 × 200 + 7 × 200 +6 × 10 + 5 × 200 + 4 × 200 +3 × 10 + 2 × 200 + 1 × 200(11)= 5580/(9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) (12)= 124 (13)Hence the entire filtered matrix for this example would be1 2 3 4 5 61 10 55 119 155 91 102 10 61 124 149 86 103 10 61 124 149 86 104 10 61 124 149 86 105 10 61 124 149 86 106 10 64 127 146 83 10C Sobel Edge DetectorAn edge is described as a line at which there is a “sharp” change in pixel intensity. The definition of sharpis user defined and very much dependent on what features and hence edge you are trying to extract from animage. The detection of the edges therefore comes down to trying to identify a significant change in gradientintensity throughout an image.One of the most basic approximations to finding these gradients is to use a technique called Sobel edgedetection. The implementation of the Sobel edge detector simply performs two kernel convolutions wherethe kernels applied are given as follows.�Once the two new images (Ix and Iy) resulting from the convolutions are obtained, they are combined togive the resulting image which represents the magnitude of the gradient at each pixel.�where Ix is the image resulting from the convolution of kx and the image to be processed and Iy is the imageresulting from the convolution of ky and the image to be processed.Another bit of resulting information which the Sobel edge detection produces is the direction of the edgegradient. This can be of use for including or excluding edge elements and is described by the followingequation.�N.B. Remember to flip these kernels before applying them to your image.9D Gaussian FilteringA Gaussian filter is a good way to remove noise and thereby avoiding potentially false edge detection. Forthis application we will arbitrarily choose the following to be the kernel for the Gaussian filtering.1 4 7 4 14 16 26 16 47 26 41 26 74 16 26 16 41 4 7 4 1�(17)E Non-maximum SuppressionThis is one technique used to thin edges. Once edge detection has been performed we can apply nonmaximumsuppression which thins the edges and thereby only the thicker more distinct edges remain whilethe thin non-important ones disappear.To implement this we use the results from an edge detection algorithm in our case Sobel edge detection(c.f., Appendix C) and using them in the following procedure.1. Create a new image Itf which is constructed by applying a threshold to each pixel in If. That is, for thetemperature value of each pixel uniquely identified by a row r and a column c, and denoted as If(r, c)if the value of this pixel is greater than or equal to our selected threshold value t then we keep its valueby storing it in our new image at location I�otherwise we set the element to zero. For example, if ourstarting image denoted by Ifis as shown below1 2 3 4 5 61 10 55 119 155 91 102 10 61 124 149 86 103 10 61 124 149 86 104 10 61 124 149 86 105 10 61 124 149 86 106 10 64 127 146 83 10and the threshold t = 124 then our new threshold image, denoted by I�, would result as follows.1 2 3 4 5 61 0 0 0 155 0 02 0 0 124 149 0 03 0 0 124 149 0 04 0 0 124 149 0 05 0 0 124 149 0 06 0 0 127 146 0 02. Take the image (array) of gradient directions Θ as determined by applying, for example, Sobel edgedetection and round each element to the nearest value from the set (0o, 45o, 90o and 135o) to create anew gradient direction image Θ. ˉ3. Process each non-zero pixel of ItF by looking at its gradient direction i.e., the value of Θ and checking ˉthe two adjacent pixels along the direction of the gradient. If either of those two pixels have a gradientmagnitude greater than the current test pixel then set the test pixel to 0 otherwise leave it alone.Repeat for all remaining pixels. (N.B. If one of the pixels adjacent to the test pixel is outside theimage we assume it magnitude is 0).The entire process results in a new image containing only the strongest magnitude pixels.10F Double-Thresholding and Edge TrackingThis step aims to strengthen the remaining edges after a considerable amount of processing. This techniquecan be summarised as follows.1. Select a low magnitude threshold tl and a high magnitude threshold th such that tl 2. Create a new image T which results from taking an image and applying the thresholds such that if theimage pixel magnitude is less than tlit is set to zero. If the magnitude is greater than th it is set tomaximum. And if the magnitude is between tl and th then we set its magnitude to half maximum.3. Take T and compare each of the eight magnitude pixels. If a strong pixel is present in the set of 8 thenmake this pixel strong otherwise set it to zero.G Canny Edge DetectorThis edge detector gives good detection for real images. The steps required to implement this detector areas follows:1. Remove noise by applying a Gaussian filter (see D).2. Determine the intensity gradients for the image by applying Sobel edge detection (see C).3. Remove spurious edge detection by applying non-maximum suppression (see E).4. Detect potential edges by applying double-threshold (see F).5. Apply hysteresis to track edges (see F).H Run Length EncodingRun length encoding (RLE) is a technique for compressing data. It is a simple approach which works verywell when the data contains many similar values. Conversely if each value in a data set is different then nocompression will result. The format of the compressed data is as follows. There is a header where the first4 bytes represent the width (2 bytes) and height (2 bytes) of the array, e.g., 80 60.After the header, each element of the compressed array is represented by two sequential 2 byte entries(16 bits each). The first entry is the number of repetitions and the second is the actual value that is repeated(in this specific case it is a 14 bit integer representing the thermal intensity).For example, a compressed file that has the following values1 2 3 4 5 61 10 10 200 200 10 102 10 10 200 200 10 103 10 10 200 200 10 104 10 10 200 200 10 105 10 10 200 200 10 106 10 10 200 200 10 10would be compressed to the RLE file6 6 2 10 2 200 410 2 200 4 10 2 2004 10 2 200 4 10 2200 4 10 2 200 2 10.Note that the above RLE encoded file would not appear as a table. It would appear as one long line. Thisis only done for visual clarity. Similarly the RLE input would be converted into a single line of values forthe encoding process hence the need to specify a header to describe the width and height of the compresseddata.11转自:http://www.7daixie.com/2019052248576096.html

你可能感兴趣的:(讲解:ENGG1003、MATLAB、MATLAB、softwareDatabase|C/C++)