I have the completed code for everything except Gx dEdx Gy d

I have the completed code for everything except Gx (dE/dx), Gy (dE/dy), SGM, and normalization. How do I compute these for gray-level images that span 640 x 480?

1) Display the gray level image 2) Run your program to compute an image that is proportional to the absolute value of or using the Sobel operator on the input image. Multiply every pixel in this computed image by the same constant so that the maximum value is 255. Output and display this image. 3) Run your program to compute an image that is proportional to the absolute value of using the Sobel operator on the input image. Multiply every pixel in this computed image by the same constant so that the maximum value is 255. Output and display this image. 4) Run your program to compute an image that is proportional to the squared gradient magni- tude of the input image using the Sobel operator. Multiply every pixel in this computed image by the same constant so that the maximum value is 255. Output and display this image. 5) Apply a suitable threshold to the squared gradient magnitude image to generate a binary image that isolates the edges. Output and display this image.

Solution

As previously mentioned above, in order to improving image matching accuracy and giving the image-pair with a same gray dynamic range, it is necessary to uniform the brightness difference of stereo image-pair to be the same. When using HE, H which is selected to uniform the brightness is a specific cumulative histogram for all the image. The cumulative histogram is a straight line with a angle of 45 . Histogram equalization is the approach that nonlinearly stretching the original grayscale of the image according to the mapping rule. Therefore, the result is to make the number of pixels of each grayscale roughly the same and the distribution of the image histogram changing into a \"uniform\" distribution. But, this approach has many drawbacks, such as reducing of image grayscale, disappearance of image detail, through enhancement, artifact etc. [2]. See Figure 1, details after histogram equalization is almost not distinguishable from the vegetation, especially in the right part of the image (see in particular the part in the rectangular zone). 0 200 400 600 800 1000 1200 1400 0 50 100 150 200 250 (a) Image and its histogram 0 200 400 600 800 1000 1200 1400 0 50 100 150 200 250 (b) Image after HE and its histogram Figure 1. Effect of histogram equalization International Journal of Signal Processing, Image Processing and Pattern Recognition Vol. 6, No. 2, April, 2013 57 In this paper, a new image equalization method based on cumulative histogram is proposed. The purpose of our approach is to select an appropriate mapping rule based on cumulative histogram to adjust H1 and H2 with the same form. We consider image-pair as 1 I and 2 I , whose cumulative histogram are taken as H1 and H2 . A prefect mapping rule H is the key part of the problem. Before we give the algorithm of how to find mapping rule in our methods, there are two propositions are given below. If H is the identity function on [0,1], each image i I becomes ( ) i i H I , i.e. the two histograms are equalized. Proposition 1: if : [0,1] ( , 1,2) 1 2 Ii i is the image-pair, i h is the image histogram of i I , the cumulative histogram :[0,1][0,1] Hi of i I is x Hi x hi t dt 0 ( ) ( ) (2.1) Proposition 2: if :[0,1][0,1] Fi is a continuous monotonically increasing function, then Fi H Hi 1 , and ( ) i i F I is a new image, the cumulative histogram of the new image is 1 Hi H Fi (2.2) To illustrate the theory of our method based on cumulative histogram, two artificial gray images with distinct gray dynamic range are shown in Figure 2. One image has higher gray value, while the other has lower gray value, See Figure 2(a). The cumulative histogram of the two original artificial gray images is H1 and H2 shown in Figure 2(c). There is another two cumulative histograms which are also placed in this unified coordinate. One is the straight line and the other is the fold line. The straight line is labeled as H , which is the average position of H1 and H2 . The fold line is labeled as H3 which is the numerical average of H1 and H2 . From Figure 2(b), we can see the obviously deferent between the two images transformed by the cumulative histogram H or H3 . After transformed by H3 , new structure in transformed image is appeared. While transformed by H , the image is smooth. This result was already pointed out by Julie Delon [5], that the new structure will affect further image matching. So H3 is not the best average result of H1 and H2 , while H may be the better average which can be calculated from the formula (2.3), and we call H as the middle axis cumulative histogram. 1 1 2 1 1 2 H H H (2.3) (a) 1 I and 2 I (b) after H and after H3 (c) Cumulative histogram 1 2 3 H,H ,H ,H Figure 2. Original images and transformed images after the corresponding cumulative histograms 0 50 100 150 200 250 0 0.2 0.4 0.6 0.8 1 H1 H2 H H3 International Journal of Signal Processing, Image Processing and Pattern Recognition Vol. 6, No. 2, April, 2013 58 Image transformed by middle axis cumulative histogram may appear a global result, it is not considering pixel space or neighbor details which is very important for image matching. In this paper, we introduce a local method based on middle axis cumulative histogram which is considering the brightness based on the neighborhood information of each pixel to maintain more image details during the brightness difference transform. The global middle axis cumulative histogram is note as MACH. The new approach combining the advantage of local adapt and MACH is named as block adaptive middle axis cumulative histogram (BAMACH). The BAMACH based approach can make every pixel adapt to its surroundings, better result can be obtained during brightness difference correction and more details can be maintained. Generally, the size of 1 I and 2 I is set to M N , real-time window size is W and step length is W / 2 , two zero matrix 1 I and 2 I with the same size as 1 I and 2 I . The BAMACH can be expressed as in Algorithm 1. Algorithm 1: input : A couple of images 1 I and 2 I ; two zero matrix 1 I and 2 I with the same size as 1 I and 2 I ; partition of each image W I1 and W I2 ; step length is W / 2 output: A new image-pair 1 I and 2 I foreach block with size of W . do Compute the cumulative histogram of W I1 and W I 2 , marked as H1W and H2W ; Compute the middle axis as formula (1); Compute the nonlinear mapping F H H1W 1 1 , F H H2W 1 2 ; Compute the image gray value of the block ( ) W W I F I 1 1 1 , ( ) W W I F I 2 1 2 ; Put W I1 and W I2 into 1 I and 2 I in the corresponding position; end 3. Experiments and Discussions In this paper, test on three real remote sensing image-pairs was carried out and all methods were implemented in MATLAB. In order to illustrate our algorithm BAMACH effectiveness, we show all the result of the three experiments, and contrast the results with HE and MACH. 3.1 Effect on gray dynamic range Figure 3~Figure 5 shows the first experiment of applying the proposed algorithm BAMACH and also the results of applying HE and MACH. See Figure 3, the first column is the original image-pair, although the angle variation between both original views is small, the light difference is exist. The second to the fourth column is the images transformed by HE, MACH and BAMACH. In Figure 4, after transformed by HE, MACH and BAMACH, we can see clearly that the number of pixels of each gray roughly the same. But after HE, the dynamic range of histogram is broad, which will bring the unnecessary gray value to image-pair; after MACH, the histogram has almost the same gray dynamic range but not smooth which means some gray value are dramatically deferent; after BAMACH, the distribution of the image cumulative histogram is nearly \"uniform\" and the histogram has the same smooth appearance especially. In short, histogram after BAMACH became more identical and satisfied with International Journal of Signal Processing, Image Processing and Pattern Recognition Vol. 6, No. 2, April, 2013 59 the assumption of stereo matching and gray dynamic range changes the same. If we scan some image details, we can see that the details in image after BAMACH are rich and visible. Figure 3. Column 1: Original image-pair, Column 2-4: the transformed view by HE, MACH and BAMACH 0 200 400 600 800 1000 1200 0 50 100 150 200 250 0 200 400 600 800 1000 1200 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 1600 1800 2000 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 1600 1800 2000 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 1600 1800 2000 0 50 100 150 200 250 0 200 400 600 800 1000 1200 1400 0 50 100 150 200 250 Figure 4. Column 1: The histogram of original image-pair, Column 2-4: The histogram of the processed view after HE, MACH and BAMACH 0 50 100 150 200 250 300 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 50 100 150 200 250 300 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 50 100 150 200 250 300 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 50 100 150 200 250 300 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 5. The cumulative histogram of original image-pair and after HE, MACH, BAMACH International Journal of Signal Processing, Image Processing and Pattern Recognition Vol. 6, No. 2, April, 2013 60 3.2 Effect on image spectrum and details Generally, image acquisition process doesn’t satisfy with the property “to be well sampled according to Shannon-Whittaker sampling theorem”. If we want a good matching precision, the image must be well sampled. In order to check the effects of the different transformations on the spectrum experimentally, we made the following example: we compute the modification of 1 I via HE, MACH and BAMACH. From Figure 6 and Table 1, we can see that the spectrums of 1 I via BAMACH remain more in the central square than that of others and the spectrums energy become balance between the image-pair. Most natural images have a spectrum really concentrated in the center of its support. It follows that after a transform like a histogram modification, the spectrum sprawls but doesn’t go much out of its support. The ratios of energy presented illustrate that our algorithm is really useful in well sampled. If we scan some image details in Figure 6, we can see that the details in BAMACH are rich and visible. This algorithm is also an effective way in enhancing image detail. Figure6.The spectrums of the right view and after HE, MACH, BAMACH Table 1. Spectrums Energy Remained in Central Square original HE MACH BAMACH Experiment 1 I1 0.2725 0.2804 0.2708 0.2944 Experiment 1 I2 0.2615 0.2496 0.2621 0.2945 3.3 Effect on image matching Image transformed by BAMACH has the same gray dynamic range and maintain more image detail than HE and MACH without increasing or decreasing obviously. So image-pairs transformed by BAMACH may get a higher matching precision. SSD [6] is a commonly used similarity measure method, named the sum of squared disparity. See Figure 3, the right image of remote sensing is the real-time image with the size of 256×256. Take a reference window from the left image at the random point 80,140with the size of 41×21. The experimental results show that, the matching point from the image transformed by HE, MACH and BAMACH is (86,141),(110,139),(86,141). All the matching points is correct and same, while the matching accuracy is different, see Table 2, line one. And all the results show that image-pair transformed with the proposed approach can reach the higher matching accuracy. Figure 7~Figure 8 show the matching results of the second and the third experiment. The effectiveness are the same with the first one

I have the completed code for everything except Gx (dE/dx), Gy (dE/dy), SGM, and normalization. How do I compute these for gray-level images that span 640 x 480
I have the completed code for everything except Gx (dE/dx), Gy (dE/dy), SGM, and normalization. How do I compute these for gray-level images that span 640 x 480

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site