Skip to content

Suggest#1

Open
88IO wants to merge 1 commit intomasterfrom
develop
Open

Suggest#1
88IO wants to merge 1 commit intomasterfrom
develop

Conversation

@88IO
Copy link

@88IO 88IO commented Jun 13, 2019

I read python scripts you written. I'm glad that more members use python language.

I will suggest four points.

1. if you could do, you should hide user name

from

cv2.imread("C:/Users/<USERNAME>/<FILENAME>") 

to

import os
home = os.path.expanduser("~")
cv2.imread(os.path.join(home, "<FILENAME>"))

2. Write in all lowercase English. When you run scripts, it's hard to type file name written in Japanese.

Canny.py -> canny.py
輪郭抽出1.py -> extract_contour1.py

3. Use "/" instead of "\". Only Windows OS use backquotes. if you want to type file path, you could choose several ways

fpath = "<DIRNAME>\\<FILENAME>"
fpath = r"<DIRNAME>\<FILENAME>"
fpath = "<DIRNAME>/<FILENAME>"
fpath = os.path.join("<DIRNAME>", <FILENAME>")

The third one is the simplest.

4. Include image files in your project

In addition, you should use relative paths instead of absolute ones.
if you do, every member could run these scripts. (only if they have installed the opencv library)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant