Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Added filter to points in Lines, adapted algorithms according to changes, standardized outputs to return frame and angle #6

Closed
wants to merge 12 commits into from

Conversation

abhigyandabla
Copy link
Contributor

No description provided.

@abhigyandabla abhigyandabla requested a review from L0Lmaker October 8, 2022 03:25
Comment on lines 56 to 57
# xPoints = []
# yPoints = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete?

Comment on lines 101 to 102
# xPoints.append(intersect[0])
# yPoints.append(intersect[1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment on lines 191 to 200
def filterPoints(numArray):
low = np.percentile(numArray, 20)
high = np.percentile(numArray, 80)
filtered = []

for num in numArray:
if num >= low and num <= high:
filtered.append(num)

return filtered
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation

Comment on lines 210 to 224

filteredX = filterPoints(xPoints)
filteredY = filterPoints(yPoints)

if len(filteredX) != 0:
if use_median:
IntersectingX = np.median(points)
IntersectingX = np.median(filteredX)
IntersectingY = np.median(filteredY)
else:
IntersectingX = np.mean(points)
IntersectingX = np.mean(filteredX)
IntersectingY = np.mean(filteredY)

cv2.circle(frame, (int(IntersectingX), int(frame.shape[1] / 2)), 8, (255, 0, 0), -1)
cv2.circle(frame, (int(IntersectingX), int(IntersectingY)), 8, (255, 0, 0), -1)

return (int(IntersectingX), int(frame.shape[1] / 2))
return (int(IntersectingX), int(IntersectingY))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update documentation for this change and any other methods that are changed

Comment on lines 69 to 73

intersections = Lines.getIntersections(lines)
xPoints = [point[0] for point in intersections]
yPoints = [point[1] for point in intersections]
vanishing_point = Lines.drawVanishingPoint(ellipse_frame, xPoints, yPoints)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python variable conventions, here and everywhere else.

Comment on lines +193 to +198
if show:
cv2.imshow('frame', frame)
cv2.imshow('mask', mask)
cv2.imshow('c_mask', c_mask)
cv2.imshow('points', points)
cv2.waitKey(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if we can remove unnecassary frame processes for algorithms

@L0Lmaker L0Lmaker linked an issue Oct 8, 2022 that may be closed by this pull request
@AnimeAllstar
Copy link
Member

AnimeAllstar commented Oct 11, 2022

When will this be merged by? If this successfully standardizes the outputs, can we merge and move the other changes requested by @L0Lmaker to another PR?

@L0Lmaker
Copy link
Contributor

L0Lmaker commented Oct 11, 2022

Yeah that should be doable @AnimeAllstar

I'll merge it in and ping you.

@L0Lmaker
Copy link
Contributor

When will this be merged by? If this successfully standardizes the outputs, can we merge and move the other changes requested by @L0Lmaker to another PR?

So it looks like we can't merge this in yet. There are runtime errors when the code is run on videos.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize outputs for Scanning Algorithm
3 participants