Ask Your Question

shobhitpuri's profile - activity

2018-10-05 21:30:06 -0600 received badge  Notable Question (source)
2018-10-05 21:30:06 -0600 received badge  Popular Question (source)
2017-08-04 20:06:37 -0600 received badge  Famous Question (source)
2016-08-03 09:45:10 -0600 received badge  Notable Question (source)
2015-12-03 09:01:37 -0600 received badge  Popular Question (source)
2013-03-27 14:51:53 -0600 commented answer How to get dct of an image in python using opencv

okay. I get it. Thanks. Also I'm curious to know that even if I am not converting 'img' in the range of [0..1], it seems to work fine. How is that? imf = np.float32(img) # float conversion dst = cv2.dct(imf) # the dct img = np.uint8(dst) # convert back

2013-03-24 03:17:56 -0600 commented answer How to get dct of an image in python using opencv

Thanks for the answer. When I am checking the values of the 'dst' variable, they are coming out to be more than 1. As a result the 'img' has values > 255? Can you please explain this? It would be really helpful.

2013-03-22 11:17:39 -0600 commented answer How to use cv.boxFilter() in python

When I used 'False' in Normalized, I was receiving and empty white image. Then I used 'True' after reading the wiki article here: http://en.wikipedia.org/wiki/Kernel_%28image_processing%29 It says: For Blur, you need to Normalize the image. Normalization ensures that the pixel values in the output image are of the same relative magnitude as those in the input image.

I was able to see the image saved after the boxFilter.

2013-03-21 08:35:56 -0600 answered a question How to use cv.boxFilter() in python

@Guanta is extremely right. I got that working as follows:

cv2.boxFilter(imgcv1, 0, (7,7), imgcv1, (-1,-1), False, cv2.BORDER_DEFAULT)
2013-03-21 08:33:09 -0600 commented answer How to use cv.boxFilter() in python

Thanks for the reply @Guanta. You are extremely right. Finally, I did the same and got that working.

2013-03-21 08:32:10 -0600 received badge  Scholar (source)
2013-03-18 19:14:03 -0600 commented question How to get dct of an image in python using opencv

Thanks for your comment. You're right. Actually I've been trying to look around for the same thing. Have a look at this post: http://stackoverflow.com/questions/7931382/calculate-discrete-cosine-transformation-of-image-with-opencv . Please let me know if you get this working. I'll post the solution if I am able to get it running .

2013-03-18 18:08:20 -0600 asked a question How to get dct of an image in python using opencv

I've been trying to figure out a way of getting a DCT of image. After getting the image and doing a bunch of filtering, I want to calculate DCT. Following is the code sniplet:

imgcv1 = cv2.split(imgcv)[0] 
cv2.boxFilter(imgcv1, 0, (7,7), imgcv1, (-1,-1), False, cv2.BORDER_DEFAULT)
#resize image to 32x32
cv2.resize( imgcv1, (32, 32 ) ,imgcv1)

I've been trying to play around with the description given here but no success. When I tried something like:

dst = cv2.dct(imgcv1)

I get an error like:

cv2.error: /build/buildd/opencv-2.3.1/modules/core/src/dxt.cpp:2247: error: (-215) type == CV_32FC1 || type == CV_64FC1 in function dct

How can I get the dct? I would be grateful for your help.

2013-03-18 14:18:30 -0600 asked a question How to use cv.boxFilter() in python

I am having following error when I use the boxFilter function:

SystemError: new style getargs format but argument is not a tuple

Here is the code sniplet:

//After downloading image from url, I process it as follows
imgcv = cv2.cvtColor(np.asarray(im), cv.CV_RGB2YCrCb)
#Get the channel 0 
imgcv1 = cv2.split(imgcv)[0] 
cv2.boxFilter(imgcv1, 1, 7, data, (1,1), 0, cv2.BORDER_DEFAULT)

It says the argument is not a tuple. How to make it into tuples? I tried to search a lot but no helpful results. I am a beginner in openCV and in python. Here is the definition of the filter:

cv2.boxFilter(src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]) → dst
Parameters: 
    src – Source image.
    dst – Destination image of the same size and type as src .
    ksize – Smoothing kernel size.
    anchor – Anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center.
    normalize – Flag specifying whether the kernel is normalized by its area or not.
    borderType – Border mode used to extrapolate pixels outside of the image.
2013-03-07 09:45:29 -0600 received badge  Autobiographer
2013-03-07 09:38:46 -0600 received badge  Supporter (source)