Ask Your Question

akash29's profile - activity

2020-09-28 23:59:18 -0500 received badge  Student (source)
2020-01-07 03:24:33 -0500 received badge  Notable Question (source)
2019-04-01 09:08:36 -0500 received badge  Popular Question (source)
2017-07-07 01:12:11 -0500 commented question How to smooth the edges of a low quality image?

Watershed is not helping in this matter. I have tried that. Maps of India are too bad that they can't even detect a contour in this low-quality image. I am going with the active contours on the Edge Detector Output but active contours are taking a lot of computation time. Any better approach would be really appreciated.

2017-07-06 05:49:04 -0500 asked a question How to smooth the edges of a low quality image?

I am working on this picture.

Google Map Satellite Image

Due to its bad quality, firstly I use histogram equalization after that bilateral blur to preserve the edges, adaptive Canny and edge sharpening kernel and the output is this:-

Edge detection

I need the edges to be closed and gone through morphological operations but the results were not satisfactory and the operation can't be generalized on all the images. How to solve this? Here's the code:- Edge Sharp

2017-07-01 05:28:32 -0500 asked a question Is there any problem in convolution of binary image and kernel?

I need to sharpen the edge of the following imageBinary image.

I am doing a 2D convolution with the image for edge sharpening. The kernels are [[1,1,1],[1,-7,1],[1,1,1]] and [[-1,-1,-1],[-1,9,-1],[-1,-1,-1]] Then there's this error:- error: (-213) Unsupported combination of source format (=4), and destination format (=4) in function cv::getLinearFilter

On the other hand, I am using it on the gray image and it's working fine. Thanks for the help.

2017-07-01 00:11:57 -0500 asked a question I am working on building extraction using maps. I need to remove roads from the political maps?

I am taking this image as my input and applying thresholding, median Blur and Watershed algorithm to extract buildings.Source Image

After applying Median blur and thresholding I am getting this result Thresh

Median blur helps to remove the text but how to segment out the roads?

2017-06-28 02:37:10 -0500 received badge  Enthusiast
2017-06-26 15:09:12 -0500 asked a question How does Pyramid Mean Shift Filtering helps in finding better threshold?

shifted = cv2.pyrMeanShiftFiltering(image, 21, 51) gray = cv2.cvtColor(shifted, cv2.COLOR_BGR2GRAY) thresh = cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU)

2017-06-26 06:15:19 -0500 received badge  Supporter (source)
2017-06-26 06:00:52 -0500 commented answer cv2 threshold flags

Thanks a lot.

2017-06-26 05:53:37 -0500 commented answer cv2 threshold flags

I was going through some tutorial on watershed segmentation process and finding contours.

2017-06-26 05:35:23 -0500 asked a question cv2 finding contours

I am working on satellite images to mask out the rooftop area from houses and buildings.

Applying histogram equalization on the image and then applying the watershed algorithm to mask out the buildings, I am getting too many responses and without applying that some rooftops are missing. Is there any way to optimize the number of counts? Here are some sample images that I have to work on.Rooftop example 1 Rooftop Example 2

I am applying Mean Shift Filtering and after that thresholding and then watershed algorithm.

2017-06-26 05:28:34 -0500 commented answer cv2 threshold flags

In case of finding contours, cnts = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)[-2] what does -2 implies? Thanks for help.

2017-06-26 05:22:25 -0500 received badge  Scholar (source)
2017-06-26 04:48:44 -0500 asked a question cv2 threshold flags

What is the difference between cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU) and cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY + cv2.THRESH_OTSU) ?

# Otsu's thresholding
gray = cv2.cvtColor(shifted, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU)**[1]**

In the end, there's [1] written what does it mean? I am trying to use automatic threshold.

2017-06-24 14:08:41 -0500 answered a question How can I modify the edge detection method for the HoughCircles function?

Rather playing with the parameters of Canny Edge Detection use adaptive Canny Edge Detector. It will give a far better result. Adaptive Canny works on finding median over the image and uses that value for upper and lower threshold. You can go through this documentation:- Zero Parameter Auto Canny Detection:// I think this will help you find better edges.

2017-06-22 01:25:20 -0500 commented question Unable to open video file in opencv3.2.0?

Yeah, I have copied the file from C:\opencv\build\x64\vc14\bin to the root directory of Python27 and added the path to the environment variable too. Please, anything you can point it out more that would be lot helpful.Thanks in advance.

2017-06-21 02:59:15 -0500 commented question Unable to open video file in opencv3.2.0?

opencv_ffmpeg.dll file is added to the PATH and to the root directory of Python27 too.

2017-06-20 14:10:13 -0500 received badge  Editor (source)
2017-06-19 17:54:22 -0500 asked a question What happens in case of images with shadow in 3d reconstruction using shape from stereo?

Shape from Stereo is fine like using right and left image of picture and then using depth map to plot them all in a single image to recover 3d model. Like during day time if we take a photo from left and right then there are shadows of obstacles on the terrace. When applying shape from stereo does that will create a problem?

Harris and SIFT will not work without shadow removal from the image.I have tried this.

2017-06-19 17:48:49 -0500 asked a question How to remove shadow from a single image?

I have been through the different documentation but in all of those shadows are removed from video files. I want to remove the shadow from a single image. cv2.BackgroudSubtractorMOG/GGM is not working but MOG2 is working but on video files only. I want to reconstruct 3d model using 2d points in the image but the shadow points are working like outliers.

2017-06-19 17:44:03 -0500 commented question Unable to open video file in opencv3.2.0?

I have tried .avi and .mp4 format. No extract error messages are getting. The shell restarts after few seconds. No, the video has no jitter when playing through VLC

2017-06-19 07:16:31 -0500 asked a question Unable to open video file in opencv3.2.0?

Video files can't read although camera is working using VideoCapture. I have added the correct ffmpeg file from opencv directory to C:/Python27 environment variable. What to do now, still the video is not working? Here's my simple code to open video file import numpy as np import cv2

Capture video from file

cap = cv2.VideoCapture('vtest.avi')

while True:

ret, frame =

if ret == True:

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)


    if cv2.waitKey(30) & 0xFF == ord('q'):
        print True

    print False

cap.release() cv2.destroyAllWindows()