Learning OpenCV – Scaling work project make money

OpenCV – Scaling You can perform scaling on an image using the resize() method of the imgproc class. Following is the syntax of this method. resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interpolation) This method accepts the following parameters − src − A Mat object representing the source (input image) for this operation. dst − A Mat object representing the destination (output image) for this operation. dsize − A Size object representing the size of the output image. fx − A variable of the type double representing the scale factor along the horizontal axis. fy − A variable of the type double representing the scale factor along the vertical axis. Interpolation − An integer variable representing interpolation method. Example The following program demonstrates how to apply scale transformation to an image. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Size; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class Scaling { public static void main(String args[]) { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file =”E:/OpenCV/chap24/transform_input.jpg”; Mat src = Imgcodecs.imread(file); // Creating an empty matrix to store the result Mat dst = new Mat(); // Creating the Size object Size size = new Size(src.rows()*2, src.rows()*2); // Scaling the Image Imgproc.resize(src, dst, size, 0, 0, Imgproc.INTER_AREA); // Writing the image Imgcodecs.imwrite(“E:/OpenCV/chap24/scale_output.jpg”, dst); System.out.println(“Image Processed”); } } Assume that following is the input image transform_input.jpg specified in the above program (size − Width:300px and height:300px). Output On executing the program, you will get the following output − Image Processed If you open the specified path, you can observe the output image as follows (size − Width:600px and height:600px) − Learning working make money

Learning OpenCV – Adaptive Threshold work project make money

OpenCV – Adaptive Threshold In simple thresholding, the threshold value is global, i.e., it is same for all the pixels in the image. Adaptive thresholding is the method where the threshold value is calculated for smaller regions and therefore, there will be different threshold values for different regions. In OpenCV, you can perform Adaptive threshold operation on an image using the method adaptiveThreshold() of the Imgproc class. Following is the syntax of this method. adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, C) This method accepts the following parameters − src − An object of the class Mat representing the source (input) image. dst − An object of the class Mat representing the destination (output) image. maxValue − A variable of double type representing the value that is to be given if pixel value is more than the threshold value. adaptiveMethod − A variable of integer the type representing the adaptive method to be used. This will be either of the following two values ADAPTIVE_THRESH_MEAN_C − threshold value is the mean of neighborhood area. ADAPTIVE_THRESH_GAUSSIAN_C − threshold value is the weighted sum of neighborhood values where weights are a Gaussian window. thresholdType − A variable of integer type representing the type of threshold to be used. blockSize − A variable of the integer type representing size of the pixelneighborhood used to calculate the threshold value. C − A variable of double type representing the constant used in the both methods (subtracted from the mean or weighted mean). Example The following program demonstrates how to perform Adaptive threshold operation on an image in OpenCV. Here we are choosing adaptive threshold of type binary and ADAPTIVE_THRESH_MEAN_C for threshold method. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class AdaptiveThresh { public static void main(String args[]) throws Exception { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file =”E:/OpenCV/chap14/thresh_input.jpg”; // Reading the image Mat src = Imgcodecs.imread(file,0); // Creating an empty matrix to store the result Mat dst = new Mat(); Imgproc.adaptiveThreshold(src, dst, 125, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 11, 12); // Writing the image Imgcodecs.imwrite(“E:/OpenCV/chap14/Adaptivemean_thresh_binary.jpg”, dst); System.out.println(“Image Processed”); } } Assume that following is the input image thresh_input.jpg specified in the above program. Output On executing the program, you will get the following output − Image Processed If you open the specified path, you can observe the output image as follows − Other Types of Adaptive Thresholding In addition to the ADAPTIVE_THRESH_MEAN_C as the adaptive method and THRESH_BINARY as the threshold type as demonstrated in the previous example, we can choose more combinations of these two values. Imgproc.adaptiveThreshold(src, dst, 125, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 11, 12); Following are the values representing various combinations of values for the parameters adaptiveMethod and thresholdType and their respective outputs. adaptiveMethod / thresholdType ADAPTIVE_THRESH_MEAN_C ADAPTIVE_THRESH_GAUSSIAN_C: THRESH_BINARY THRESH_BINARY_INV Learning working make money

Learning OpenCV – Writing an Image work project make money

OpenCV – Writing an Image The write() method of the Imgcodecs class is used to write an image using OpenCV. To write an image, repeat the first three steps from the previous example. To write an image, you need to invoke the imwrite() method of the Imgcodecs class. Following is the syntax of this method. imwrite(filename, mat) This method accepts the following parameters − filename − A String variable representing the path where to save the file. mat − A Mat object representing the image to be written. Example Following program is an example to write an image using Java program using OpenCV library. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; public class WritingImages { public static void main(String args[]) { //Loading the OpenCV core library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); //Instantiating the imagecodecs class Imgcodecs imageCodecs = new Imgcodecs(); //Reading the Image from the file and storing it in to a Matrix object String file =”C:/EXAMPLES/OpenCV/sample.jpg”; Mat matrix = imageCodecs.imread(file); System.out.println(“Image Loaded ……….”); String file2 = “C:/EXAMPLES/OpenCV/sample_resaved.jpg”; //Writing the image imageCodecs.imwrite(file2, matrix); System.out.println(“Image Saved …………”); } } On executing the above program, you will get the following output − Image Loaded ………. Image Saved ……….. If you open the specified path, you can observe the saved image as shown below − Learning working make money

Learning OpenCV – Dilation work project make money

OpenCV – Dilation Erosion and dilation are the two types of morphological operations. As the name implies, morphological operations are the set of operations that process images according to their shapes. Based on the given input image a “structural element” is developed. This might be done in any of the two procedures. These are aimed at removing noise and settling down the imperfections, to make the image clear. Dilation This procedure follows convolution with some kernel of a specific shape such as a square or a circle. This kernel has an anchor point, which denotes its center. This kernel is overlapped over the picture to compute maximum pixel value. After calculating, the picture is replaced with anchor at the center. With this procedure, the areas of bright regions grow in size and hence the image size increases. For example, the size of an object in white shade or bright shade increases, while the size of an object in black shade or dark shade decreases. You can perform the dilation operation on an image using the dilate() method of the imgproc class. Following is the syntax of this method. dilate(src, dst, kernel) This method accepts the following parameters − src − A Mat object representing the source (input image) for this operation. dst − A Mat object representing the destination (output image) for this operation. kernel − A Mat object representing the kernel. Example You can prepare the kernel matrix using the getStructuringElement() method. This method accepts an integer representing the morph_rect type and an object of the type Size. Imgproc.getStructuringElement(int shape, Size ksize); The following program demonstrates how to perform the dilation operation on a given image. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Size; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class DilateTest { public static void main( String[] args ) { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file =”C:/EXAMPLES/OpenCV/sample.jpg”; Mat src = Imgcodecs.imread(file); // Creating an empty matrix to store the result Mat dst = new Mat(); // Preparing the kernel matrix object Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size((2*2) + 1, (2*2)+1)); // Applying dilate on the Image Imgproc.dilate(src, dst, kernel); // Writing the image Imgcodecs.imwrite(“E:/OpenCV/chap10/Dilation.jpg”, dst); System.out.println(“Image Processed”); } } Input Assume that following is the input image sample.jpg specified in the above program. Output On executing the program, you will get the following output − Image Processed If you open the specified path, you can observe the output image as follows − Learning working make money

Learning OpenCV – Storing Images work project make money

OpenCV – Storing Images To capture an image, we use devices like cameras and scanners. These devices record numerical values of the image (Ex: pixel values). OpenCV is a library which processes the digital images, therefore we need to store these images for processing. The Mat class of OpenCV library is used to store the values of an image. It represents an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc. This class comprises of two data parts: the header and a pointer Header − Contains information like size, method used for storing, and the address of the matrix (constant in size). Pointer − Stores the pixel values of the image (Keeps on varying). The Mat Class The OpenCV Java library provides this class with the same name (Mat) within the package org.opencv.core. Constructors The Mat class of OpenCV Java library has various constructors, using which you can construct the Mat object. S.No Constructors and Description 1 Mat() This is the default constructor with no parameters in most cases. We use this to constructor to create an empty matrix and pass this to other OpenCV methods. 2 Mat(int rows, int cols, int type) This constructor accepts three parameters of integer type representing the number of rows and columns in a 2D array and the type of the array (that is to be used to store data). 3 Mat(int rows, int cols, int type, Scalar s) Including the parameters of the previous one, this constructor additionally accepts an object of the class Scalar as parameter. 4 Mat(Size size, int type) This constructor accepts two parameters, an object representing the size of the matrix and an integer representing the type of the array used to store the data. 5 Mat(Size size, int type, Scalar s) Including the parameters of the previous one, this constructor additionally accepts an object of the class Scalar as parameter. 6 Mat(long addr) 7 Mat(Mat m, Range rowRange) This constructor accepts an object of another matrix and an object of the class Range representing the range of the rows to be taken to create a new matrix. 8 Mat(Mat m, Range rowRange, Range colRange) Including the parameters of the previous one, this constructor additionally accepts an object of the class. Range representing the column range. 9 Mat(Mat m, Rect roi) This constructor accepts two objects, one representing another matrix and the other representing the Region Of Interest. Note − Array type. Use CV_8UC1, …, CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. The type of the matrices were represented by various fields of the class CvType which belongs to the package org.opencv.core. Methods and Description Following are some of the methods provided by the Mat class. S.No Methods and Description 1 Mat col(int x) This method accepts an integer parameter representing the index of a column and retrieves and returns that column. 2 Mat row(int y) This method accepts an integer parameter representing the index of a row and retrieves and returns that row. 3 int cols() This method returns the number of columns in the matrix. 4 int rows() This method returns the number of rows in the matrix. 5 Mat setTo(Mat value) This method accepts an object of the Mat type and sets the array elements to the specified value. 6 Mat setTo(Scalar s) This method accepts an object of the Scalar type and sets the array elements to the specified value. Creating and Displaying the Matrix In this section, we are going to discuss our first OpenCV example. We will see how to create and display a simple OpenCV matrix. Given below are the steps to be followed to create and display a matrix in OpenCV. Step 1: Load the OpenCV native library While writing Java code using OpenCV library, the first step you need to do is to load the native library of OpenCV using the loadLibrary(). Load the OpenCV native library as shown below. //Loading the core library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Step 2: Instantiate the Mat class Instantiate the Mat class using any of the functions mentioned in this chapter earlier. //Creating a matrix Mat matrix = new Mat(5, 5, CvType.CV_8UC1, new Scalar(0)); Step 3: Fill the matrix using the methods You can retrieve particular rows/columns of a matrix by passing index values to the methods row()/col(). And, you can set values to these using any of the variants of the setTo() methods. //Retrieving the row with index 0 Mat row0 = matrix.row(0); //setting values of all elements in the row with index 0 row0.setTo(new Scalar(1)); //Retrieving the row with index 3 Mat col3 = matrix.col(3); //setting values of all elements in the row with index 3 col3.setTo(new Scalar(3)); Example You can use the following program code to create and display a simple matrix in Java using OpenCV library. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.CvType; import org.opencv.core.Scalar; class DisplayingMatrix { public static void main(String[] args) { //Loading the core library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); //Creating a matrix Mat matrix = new Mat(5, 5, CvType.CV_8UC1, new Scalar(0)); //Retrieving the row with index 0 Mat row0 = matrix.row(0); //setting values of all elements in the row with index 0 row0.setTo(new Scalar(1)); //Retrieving the row with index 3 Mat col3 = matrix.col(3); //setting values of all elements in the row with index 3 col3.setTo(new Scalar(3)); //Printing the matrix System.out.println(“OpenCV Mat data:n” + matrix.dump()); } } On executing the above program, you will get the following output − OpenCV Mat data: [ 1, 1, 1, 3, 1; 0, 0, 0, 3, 0; 0, 0, 0, 3, 0; 0, 0, 0, 3, 0; 0, 0, 0, 3, 0] Loading Image using JavaSE API The BufferedImage class of the java.awt.image.BufferedImage package is used to store an image and the ImageIO class of the package import javax.imageio provides methods to read and write Images. Example You can use the following program code to load and save images using JavaSE library.

Learning OpenCV – Rotation work project make money

OpenCV – Rotation You can perform rotation operation on an image using the warpAffine() method of the imgproc class. Following is the syntax of this method − Imgproc.warpAffine(src, dst, rotationMatrix, size); This method accepts the following parameters − src − A Mat object representing the source (input image) for this operation. dst − A Mat object representing the destination (output image) for this operation. rotationMatrix − A Mat object representing the rotation matrix. size − A variable of the type integer representing the size of the output image. Example The following program demonstrates how to rotate an image. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; import org.opencv.core.Size; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class Rotation { public static void main(String args[]) { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file =”E:/OpenCV/chap24/transform_input.jpg”; Mat src = Imgcodecs.imread(file); // Creating an empty matrix to store the result Mat dst = new Mat(); // Creating a Point object Point point = new Point(300, 200) // Creating the transformation matrix M Mat rotationMatrix = Imgproc.getRotationMatrix2D(point, 30, 1); // Creating the object of the class Size Size size = new Size(src.cols(), src.cols()); // Rotating the given image Imgproc.warpAffine(src, dst, rotationMatrix, size); // Writing the image Imgcodecs.imwrite(“E:/OpenCV/chap24/rotate_output.jpg”, dst); System.out.println(“Image Processed”); } } Assume that following is the input image transform_input.jpg specified in the above program. Output On executing the program, you will get the following output − Image Processed If you open the specified path, you can observe the output image as follows − Learning working make money

Learning OpenCV – Adding Borders work project make money

OpenCV – Adding Borders This chapter teaches you how toad borders to an image. The copyMakeBorder() Method You can add various borders to an image in using the method copyMakeBorder() of the class named Core, which belongs to the package org.opencv.core. following is the syntax of this method. copyMakeBorder(src, dst, top, bottom, left, right, borderType) This method accepts the following parameters − src − An object of the class Mat representing the source (input) image. dst − An object of the class Mat representing the destination (output) image. top − A variable of integer the type integer representing the length of the border at the top of the image. bottom − A variable of integer the type integer representing the length of the border at the bottom of the image. left − A variable of integer the type integer representing the length of the border at the left of the image. right − A variable of integer the type integer representing the length of the border at the right of the image. borderType − A variable of the type integer representing the type of the border that is to be used. Example Following program is an example demonstrating, how to add border to a given image. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; public class AddingBorder { public static void main( String[] args ) { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file =”E:/OpenCV/chap15/input.jpg”; Mat src = Imgcodecs.imread(file); // Creating an empty matrix to store the result Mat dst = new Mat(); Core.copyMakeBorder(src, dst, 20, 20, 20, 20, Core.BORDER_CONSTANT); Imgcodecs.imwrite(“E:/OpenCV/chap15/border_constant.jpg”, dst); System.out.println(“Image Processed”); } } Assume that following is the input image thresh_input.jpg specified in the above program. Output On executing the program, you will get the following output − Image Processed If you open the specified path, you can observe the output image as follows − Other Types of Borders In addition to the border type, BORDER_CONSTANT demonstrated in the previous example, OpenCV caters various other types of borders. All these types are represented by predefined static fields (fixed values) of Core class. You can choose the type of the threshold operation you need, by passing its respective predefined value to the parameter named borderType of the copyMakeBorder() method. Core.copyMakeBorder(src, dst, 20, 20, 20, 20, Core.BORDER_CONSTANT); Following are the values representing various types of borders operations and their respective outputs. Operation and Description Output BORDER_CONSTANT BORDER_ISOLATED BORDER_DEFAULT BORDER_REFLECT BORDER_REFLECT_101 BORDER_REFLECT101 BORDER_REPLICATE BORDER_WRAP Learning working make money

Learning OpenCV – Discussion work project make money

Discuss OpenCV OpenCV is a cross-platform library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection. In this tutorial, we explain how you can use OpenCV in your applications. Learning working make money

Learning OpenCV – Using Camera work project make money

OpenCV – Using Camera In this chapter, we will learn how to use OpenCV to capture frames using the system camera. The VideoCapture class of the org.opencv.videoio package contains classes and methods to capture video using the camera. Let’s go step by step and learn how to capture frames − Step 1: Load the OpenCV native library While writing Java code using OpenCV library, the first step you need to do is to load the native library of OpenCV using the loadLibrary(). Load the OpenCV native library as shown below. // Loading the core library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Step 2: Instantiate the video capture class Instantiate the Mat class using any of the functions mentioned in this tutorial earlier. // Instantiating the VideoCapture class (camera:: 0) VideoCapture capture = new VideoCapture(0); Step 3: Read the frames You can read the frames from the camera using the read() method of the VideoCapture class. This method accepts an object of the class Mat to store the frame read. // Reading the next video frame from the camera Mat matrix = new Mat(); capture.read(matrix); Example The following program demonstrates how to capture a frame using camera and display it using JavaFX window. It also saves the captured frame. import java.awt.image.BufferedImage; import java.awt.image.DataBufferByte; import java.awt.image.WritableRaster; import java.io.FileNotFoundException; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; import javafx.stage.Stage; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.videoio.VideoCapture; public class CameraSnapshotJavaFX extends Application { Mat matrix = null; @Override public void start(Stage stage) throws FileNotFoundException, IOException { // Capturing the snapshot from the camera CameraSnapshotJavaFX obj = new CameraSnapshotJavaFX(); WritableImage writableImage = obj.capureSnapShot(); // Saving the image obj.saveImage(); // Setting the image view ImageView imageView = new ImageView(writableImage); // setting the fit height and width of the image view imageView.setFitHeight(400); imageView.setFitWidth(600); // Setting the preserve ratio of the image view imageView.setPreserveRatio(true); // Creating a Group object Group root = new Group(imageView); // Creating a scene object Scene scene = new Scene(root, 600, 400); // Setting title to the Stage stage.setTitle(“Capturing an image”); // Adding scene to the stage stage.setScene(scene); // Displaying the contents of the stage stage.show(); } public WritableImage capureSnapShot() { WritableImage WritableImage = null; // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Instantiating the VideoCapture class (camera:: 0) VideoCapture capture = new VideoCapture(0); // Reading the next video frame from the camera Mat matrix = new Mat(); capture.read(matrix); // If camera is opened if( capture.isOpened()) { // If there is next video frame if (capture.read(matrix)) { // Creating BuffredImage from the matrix BufferedImage image = new BufferedImage(matrix.width(), matrix.height(), BufferedImage.TYPE_3BYTE_BGR); WritableRaster raster = image.getRaster(); DataBufferByte dataBuffer = (DataBufferByte) raster.getDataBuffer(); byte[] data = dataBuffer.getData(); matrix.get(0, 0, data); this.matrix = matrix; // Creating the Writable Image WritableImage = SwingFXUtils.toFXImage(image, null); } } return WritableImage; } public void saveImage() { // Saving the Image String file = “E:/OpenCV/chap22/sanpshot.jpg”; // Instantiating the imgcodecs class Imgcodecs imageCodecs = new Imgcodecs(); // Saving it again imageCodecs.imwrite(file, matrix); } public static void main(String args[]) { launch(args); } } Output On executing the program, you will get the following output. If you open the specified path, you can observe the same frame which is saved as a jpg file. Learning working make money

Learning OpenCV – Hough Line Transform work project make money

OpenCV – Hough Line Transform You can detect the shape of a given image by applying the Hough Transform technique using the method HoughLines() of the Imgproc class. Following is the syntax of this method. HoughLines(image, lines, rho, theta, threshold) This method accepts the following parameters − image − An object of the class Mat representing the source (input) image. lines − An object of the class Mat that stores the vector that stores the parameters (r, Φ) of the lines. rho − A variable of the type double representing the resolution of the parameter r in pixels. theta − A variable of the type double representing the resolution of the parameter Φ in radians. threshold − A variable of the type integer representing the minimum number of intersections to “detect” a line. Example The following program demonstrates how to detect Hough lines in a given image. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class HoughlinesTest { public static void main(String args[]) throws Exception { // Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); // Reading the Image from the file and storing it in to a Matrix object String file = “E:/OpenCV/chap21/hough_input.jpg”; // Reading the image Mat src = Imgcodecs.imread(file,0); // Detecting edges of it Mat canny = new Mat(); Imgproc.Canny(src, canny, 50, 200, 3, false); // Changing the color of the canny Mat cannyColor = new Mat(); Imgproc.cvtColor(canny, cannyColor, Imgproc.COLOR_GRAY2BGR); // Detecting the hough lines from (canny) Mat lines = new Mat(); Imgproc.HoughLines(canny, lines, 1, Math.PI/180, 100); System.out.println(lines.rows()); System.out.println(lines.cols()); // Drawing lines on the image double[] data; double rho, theta; Point pt1 = new Point(); Point pt2 = new Point(); double a, b; double x0, y0; for (int i = 0; i < lines.cols(); i++) { data = lines.get(0, i); rho = data[0]; theta = data[1]; a = Math.cos(theta); b = Math.sin(theta); x0 = a*rho; y0 = b*rho; pt1.x = Math.round(x0 + 1000*(-b)); pt1.y = Math.round(y0 + 1000*(a)); pt2.x = Math.round(x0 – 1000*(-b)); pt2.y = Math.round(y0 – 1000 *(a)); Imgproc.line(cannyColor, pt1, pt2, new Scalar(0, 0, 255), 6); } // Writing the image Imgcodecs.imwrite(“E:/OpenCV/chap21/hough_output.jpg”, cannyColor); System.out.println(“Image Processed”); } } Assume that following is the input image hough_input.jpg specified in the above program. Output On executing the program, you will get the following output − 143 1 Image Processed If you open the specified path, you can observe the output image as follows − Learning working make money