Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates README to describe what happens during the first run #19

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def Dehaze(img_path, Params = None, model_path = 'lib/Algorithms/pretrained_aod_
x = np.expand_dims(img, axis=0).transpose(0,3,1,2)

# Loading model weights
np_weights = np.load(model_path).item()
np_weights = np.load(model_path, allow_pickle=True).item()

output = aod_net(x, np_weights)
output = np.squeeze(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def DebrisDetect(img_path, Params):
avg_dim = (((width+height)//2)//3)*2

# Gaussian Blur
proc_img = cv2.GaussianBlur(img, (5,5), Params["LineGaussianIter"])
proc_img = cv2.GaussianBlur(cv2.UMat(img), (5,5), Params["LineGaussianIter"])

# Kernel Dilation
proc_img = cv2.dilate(proc_img, (5,5), iterations=Params["LineDilationIter"])
Expand All @@ -97,7 +97,7 @@ def DebrisDetect(img_path, Params):
dst = cv2.Canny(proc_img, Params["LineCannyEdgeLowerBound"], Params["LineCannyEdgeThreshold"])
cdst = cv2.cvtColor(dst, cv2.COLOR_GRAY2BGR)

lines = cv2.HoughLines(dst, 0.7, float(np.pi / 180.0), int(avg_dim/2))
lines = cv2.HoughLines(dst, 0.7, float(np.pi / 180.0), int(avg_dim/2)).get()

# If lines are found
if lines is not None:
Expand All @@ -124,13 +124,13 @@ def DebrisDetect(img_path, Params):
else:

# Gaussian Blur
proc2_img = cv2.GaussianBlur(img, (5,5), Params["CornerGaussianIter"])
proc2_img = cv2.GaussianBlur(cv2.UMat(img), (5,5), Params["CornerGaussianIter"])

# Erosion
proc2_img = cv2.erode(proc2_img, (5,5), iterations=Params["CornerErosionIter"])

# Stronger Bilateral Blur
proc2_img = cv2.bilateralFilter(proc2_img, 16, Params["CornerBilateralColor"], Params["CornerBilateralSpace"])
proc2_img = cv2.bilateralFilter(proc2_img, 16, Params["CornerBilateralColor"], Params["CornerBilateralSpace"]).get()

# Shi-Tomasi
gray = cv2.cvtColor(proc2_img, cv2.COLOR_BGR2GRAY)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
Release version can be found at: http://cver.hrail.crasar.org

## Visual Studio
* Microsoft .NET Framework 4.6.1
* Microsoft .NET Framework 4.6.1.
* Visual Studio will ask whether you want to download it when you open the project and will point you to the download page at https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral
* Microsoft Visual Studio 2017 Installer Projects Extension
* This can be installed by clicking ```Tools -> Extensions and Updates... -> Online``` then entering the name of the extension in the search box


## Python Setup
The first time the project is run inside Visual Studio, it will download and install the required Python packages.

* Python 3.6.4
* https://www.python.org
* OpenCV
Expand Down