Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

car_detection in image OpenCV #110

Closed

Conversation

ryuk156
Copy link
Contributor

@ryuk156 ryuk156 commented Aug 16, 2020

issue : #93

About Pull request :
This pr consist of car detection in an image if a car is detected in an image the green rectangle will be drawn , it uses pre trained car classifer

Demo :
image

@ryuk156 ryuk156 changed the title Create car_detection_image.py car_detection in image OpenCV Aug 16, 2020
@ryuk156
Copy link
Contributor Author

ryuk156 commented Aug 16, 2020

@ankitdobhal review and merge

Copy link

@disha2sinha disha2sinha left a comment

Choose a reason for hiding this comment

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

Don't put so many new lines between codes

Image-Processing/car_detection_image.py Outdated Show resolved Hide resolved

## the above variable will return 4 cordinates i.e height,width,postionx,positiony


Choose a reason for hiding this comment

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

remove excess new line

Image-Processing/car_detection_image.py Outdated Show resolved Hide resolved
Image-Processing/car_detection_image.py Show resolved Hide resolved
@ryuk156
Copy link
Contributor Author

ryuk156 commented Aug 16, 2020

@disha2sinha done review please

Copy link

@disha2sinha disha2sinha left a comment

Choose a reason for hiding this comment

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

Put space around operators and after comma

img=cv2.imread(img_file) #create image reader
black_and_white=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #convert image black and white i.e. grayscale
car_tracker=cv2.CascadeClassifier(classifier_car) #create classifier
cars=car_tracker.detectMultiScale(black_and_white) #detect cars

Choose a reason for hiding this comment

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

Put a new line before starting for loop

car_tracker=cv2.CascadeClassifier(classifier_car) #create classifier
cars=car_tracker.detectMultiScale(black_and_white) #detect cars
for (x,y,w,h) in cars: ## the above variable will return 4 cordinates i.e height,width,postionx,positiony
cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),3) ##this loop will create grren rectangle when car is detected
Copy link

@disha2sinha disha2sinha Aug 17, 2020

Choose a reason for hiding this comment

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

put new line after ending for loop

@ryuk156
Copy link
Contributor Author

ryuk156 commented Aug 17, 2020

@disha2sinha done

@disha2sinha
Copy link

Add README (guide) along with this inside the folder same as your
Update the README with appropriate installation methods and description guidelines.
Maintain proper Contribution protocols protocols (ignore if you're already following it!) & good practices!

@ryuk156 ryuk156 closed this Aug 19, 2020
@ryuk156 ryuk156 deleted the car_detection_image_opencv branch August 19, 2020 16:52
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.

2 participants