使用cv2.HoughLines之后我无法获得输出图像?

问题描述

我想在某些卫星图像上使用OpenCV的Hough变换来检测线,我使用带有标志2020-10-25 10:47:24.604330-0400 test2[2991:35955] Connection 1: received failure notification 2020-10-25 10:47:24.604477-0400 test2[2991:35955] Connection 1: Failed to connect 1:61,reason -1 2020-10-25 10:47:24.604584-0400 test2[2991:35955] Connection 1: encountered error(1:61) 2020-10-25 10:47:24.609628-0400 test2[2991:35955] Task <EF95DB6A-2445-4E58-9B2F-AFA35EE0A68E>.<1> HTTP load Failed,0/0 bytes (error code: -1004 [1:61]) 2020-10-25 10:47:24.616313-0400 test2[2991:35955] Task <EF95DB6A-2445-4E58-9B2F-AFA35EE0A68E>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x600001748c90 {Error Domain=kcfErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kcfStreamErrorCodeKey=61,_kcfStreamErrorDomainKey=1}},NSErrorFailingURLStringKey=https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog,NSErrorFailingURLKey=https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog,_kcfStreamErrorDomainKey=1,_kcfStreamErrorCodeKey=61,NSLocalizedDescription=Could not connect to the server.} 2020-10-25 10:47:24.645716-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started 2020-10-25 10:47:24.649697-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/) 2020-10-25 10:47:24.651125-0400 test2[2991:35955] 6.34.0 - [Firebase/Analytics][I-ACS023171] Resetting App Measurement data 2020-10-25 10:47:24.752809-0400 test2[2991:35975] 6.34.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement 2020-10-25 10:47:24.788481-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled 2020-10-25 10:47:24.789629-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting,set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist 2020-10-25 10:47:39.183384-0400 test2[2991:36053] [] nw_socket_handle_socket_event [C3.1:3] Socket SO_ERROR [61: Connection refused] 2020-10-25 10:47:39.183765-0400 test2[2991:36053] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(726) [0x7fd4bee004a0] handshake Failed at state 0 2020-10-25 10:47:39.185931-0400 test2[2991:36053] Connection 3: received failure notification 2020-10-25 10:47:39.186090-0400 test2[2991:36053] Connection 3: Failed to connect 1:61,reason -1 2020-10-25 10:47:39.186224-0400 test2[2991:36053] Connection 3: encountered error(1:61) 2020-10-25 10:47:39.190919-0400 test2[2991:36053] Task <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1> HTTP load Failed,0/0 bytes (error code: -1004 [1:61]) 2020-10-25 10:47:39.192171-0400 test2[2991:35790] Task <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kcfStreamErrorCodeKey=61,NSUnderlyingError=0x600001732970 {Error Domain=kcfErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kcfStreamErrorCodeKey=61,_NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>,_NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>"),NSLocalizedDescription=Could not connect to the server.,NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900,NSErrorFailingURLKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900,_kcfStreamErrorDomainKey=1} 2020-10-25 10:47:39.194966-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code,error: -1004,Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kcfStreamErrorCodeKey=61,_kcfStreamErrorDomainKey=1} 2020-10-25 10:47:39.197349-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS023128] Network request Failed to fetch remote config. Code,Error: 0,_kcfStreamErrorDomainKey=1} 2020-10-25 10:47:39.198538-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS023129] Network fetch Failed. Will retry later. Code,error: 0,_kcfStreamErrorDomainKey=1} 的{​​{1}}进行读取,然后将图像从float32转换为uint8以接受然后,theCanny检测器cv2.imshow()使用了cv.IMREAD_LOAD_GDAL,此后我想显示/绘制图像,但是它显示了有关尺寸的错误,它显示图片数据的形状无效(4975、1、2)

cv2.Canny()

显示错误是: cv2.houghlines()

问题是使用image = cv.imread(path,cv.IMREAD_LOAD_GDAL) convert = np.uint8(image) ed = cv.Canny(arr,50,200) line = cv.houghlines(ed,1,np.pi / 180,240) plt.imshow(line) 后,它将图像从2D更改为3D:(736,1109)'uint8'变为(4975,1,2)'float32'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)