简体   繁体   中英

Can't understand OpenCV Python functions arguments

I'm learning OpenCV and also Python. But I can't understand these funcions parameters:

cv2.Canny(image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]])

After ther argument "threshold2" I can't understand anymore, what does these [] means? It's a List? It's a silly question, but I really want to understand.

I assume you're familiar with C/C++, I found I could understand them better when I looked at them from point of view a language I already knew. They are parameters with default values. It means that if you do not supply any values for those parameters, they will use the default ones.

In C/C++ terms:

void point(int x = 3, int y = 4); // 3 , 4 are default values

point(1,2); // calls point(1,2)
point(1);   // calls point(1,4)
point();    // calls point(3,4)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM