9月10日课上题
This commit is contained in:
Generated
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="OpenCV_Study" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="OpenCV_Study" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/2024,9,10.iml" filepath="$PROJECT_DIR$/.idea/2024,9,10.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import cv2 as cv
|
||||||
|
|
||||||
|
# read image
|
||||||
|
img = cv.imread("opencv_logo.png",cv.IMREAD_UNCHANGED)
|
||||||
|
|
||||||
|
# get height and width, channel of img
|
||||||
|
height,width,channel=img.shape
|
||||||
|
|
||||||
|
# show infos
|
||||||
|
print("height=\t",height)
|
||||||
|
print("width=\t",width)
|
||||||
|
print("channel=\t",height)
|
||||||
|
|
||||||
|
# split channels
|
||||||
|
blue,green,red=cv.split(img)
|
||||||
|
|
||||||
|
# show channels
|
||||||
|
## red channel
|
||||||
|
#cv.imshow("channel", red)
|
||||||
|
## green channel
|
||||||
|
cv.imshow("channel", green)
|
||||||
|
## blue channel
|
||||||
|
#cv.imshow("channel", blue)
|
||||||
|
cv.waitKey(0)
|
||||||
|
cv.destroyWindow("channel")
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
Reference in New Issue
Block a user