2016-11-09 13:18:44 -0600 | received badge | ● Taxonomist |
2013-10-24 03:18:49 -0600 | received badge | ● Student (source) |
2013-08-03 22:59:29 -0600 | commented answer | Block Overlapped Histogram Equalization However the code i wrote has some errors, the Output Image only compute local histogram equalization at the second column (pixels below 1). The border pixels has white intensity and the other pixels are all black as shown above in Output Image. Why my code cannot run "histogram[image.at<uchar>(y+k,x-r-1)]--;" and "histogram[image.at<uchar>(y+k,x+r)]++;"? Please advise. Thank you. |
2013-08-03 22:13:37 -0600 | commented answer | Block Overlapped Histogram Equalization I had just insert a picture above for reference. Initially I will compute the local histogram equalization of the first 3 x 3 kernel (center and indicated by 1 in the picture). Then I will move from left to right to the second pixel and compute the second local histogram equalization (center and indicated by 2 in the picture). To do a fast algorithm, I just want to delete the first column and add the fourth column to the previous histogram as indicated by ( - ) and ( + ) in the above picture. At the 8 th column, after finish computing local histogram equalization on the first row, I want to move to the second row and 8th column, then sliding from right to left. |
2013-08-03 11:52:56 -0600 | asked a question | Block Overlapped Histogram Equalization I want to do a block overlapped histogram equalization with a 3x3 kernel with fast algorithm. For example, given a 9x9 image (with rows from 0 to 8 ; and columns from 0 to 8). The location for each pixel will be given as: (rows, columns) i.e (height, width). First the pixel at location (1,1) will be computed using a 3x3 kernel to obtain the first kernel histogram. Then move to the second pixel at location (1,2), here I would like to delete pixel at location (0,0), (1,0), (2,0) and add pixel at location (0,3), (1,3), (2,3) to the previous kernel histogram while maintaining pixels at locations (0,1), (1,1) (2,1) and (0,2) (1,2) (2,2). The window will slides from left to right until the second last column at (1,7). In the OutputImage, I can only compute the kernel histogram with column=1 (i.e x==cr_w/2) while other kernel histograms cannot be computed. Is there something wrong at “histogram[image.at<uchar>(y+k,x-r-1)]--;” and “histogram[image.at<uchar>(y+k,x+r)]++;” in the code I wrote below? Please advise. After finish sliding the first row at (1,7), I wand to continue with the second row at location (2,7) by deleting pixels at first row and adding pixels at fourth row. Then I would like to slide from right to left. How do I need to modify my code so that it can run till the last pixel at (7,7)? Code: |
2013-06-01 11:10:48 -0600 | asked a question | Error left operand must be l-value Hi, please help. I got an error while building my program: "error C2106: '=' : left operand must be l-value". Actually i want to assign first pixel of Output_image with first pixel of 3x3 Gaussian mask, then second pixel of Output_image with second pixel of 5x5 Gausssian mask and so on. I figure that the problem come from the line [int(outputimage.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))] for the program shown below: Is it correct for me to assign [int(Output_image.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))]? Please advise me on how to solve the above error. Thamk you very much. |
2013-05-30 10:18:18 -0600 | received badge | ● Editor (source) |
2013-05-26 09:47:19 -0600 | asked a question | Output image which combine pixels from different smoothing filter mask Hi, please help. How do I write code using OpenCV for the problem below: Given an input image f(x), I want to produce an output image g(x) with: 1) first pixel using the original pixel value 2) second pixel with 3x3 smoothing filter mask value and 3) third pixel with 5x5 smoothing filter mask value The remaining pixels will repeat the above 3 steps until the last pixels. Currently I am able to produce the smooth image of 3x3 and 5x5 mask filter. However i cant figure out how to combine this smooth pixels into one output image g(x) like the condition given above. Please help and advise. Thank you very much. Below is my code for the above question. The compilation error is: (error C2106: '=' : left operand must be l-value). This error flag when assigning pixel for the output image with first pixel using original image pixel, second pixel using 3x3 filter mask pixel value, third pixel using 5x5 filter mask pixel value. include <iostream>include <fstream>include <math.h>include "cv.h"include "highgui.h"include <create _own="" histogram.h="">int image_height; int image_width; cv::Mat image; Histogram1D h; using namespace std; int main() { cv::Mat image3, image5; cv::GaussianBlur(imageClone3,result_3,cv::Size(3,3),0,0); //3x3 filter mask cv::GaussianBlur(imageClone5,result_5,cv::Size(5,5),0,0); //5x5 filter mask cv::namedWindow("Image Result_3"); cv::imshow("Image Result_3",result_3); cv::imwrite("3x3.bmp",result_3); cv::namedWindow("Image Result_5"); cv::imshow("Image Result_5",result_5); cv::imwrite("5x5.bmp",result_5); for (int i=0; i<image_height; i++)="" for="" (int="" j="0;" j<image_width;="" j++)="" {="" if(j%3="=0)" int(outputimage.at<uchar="">(i,j)) = int(image.at<uchar>(i,j)); //first pixel of output image using the original input pixel value } Please help me to solve the above problem. Thank you. |