I have finally began using a jupyter notebook in addition to pycharm. However, I am finding it much more of a hassle to paste code onto stackoverflow from jupyter.
I have the following error
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-78-9346139ce50d> in <module>
1 blurred = cv2.medianBlur(img, 5)
----> 2 grey_blur = cv2.cvtColor(blurred, cv2.cv2.COLOR_BGR2GRAY)
3 thresh = cv2.adaptiveThreshold(grey_blur, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 15, 5)
4 combined = cv2.bitwise_and(new_image, new_image, mask=thresh)
5 cv2.imshow("cartoon Lau blk shrt", combined)
error: OpenCV(4.5.3) c:\users\runneradmin\appdata\local\temp\pip-req-build-c2l3r8zm\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::`anonymous-namespace'::CvtHelper<struct cv::impl::`anonymous namespace'::Set<3,4,-1>,struct cv::impl::A0xb6623f80::Set<1,-1,-1>,struct cv::impl::A0xb6623f80::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
> Invalid number of channels in input image:
> 'VScn::contains(scn)'
> where
> 'scn' is 1
I want to post the entire code in addition to the error message, but I don't want to go through and crtl+c, crtl+v for each cell, it seems excessive
I want to respect everyone's time here on stackoverflow and am asking for help with understanding best practices.
1-I have heard that running jupyter from VS Code is an option but have not attempted it yet.
2-Is there a way to share directly from jupyter itself or should I look into VS code?
3- maybe there is another option to share a link to the whole project
I have attempted downloading a .py file. I was able to drag it into PyCharm but the format was still off
# In[ ]:
image = cv2.imread('C:\\Users\\holli\\OneDrive\\Pictures\\python photos\\lau black short changing room, haair.jpg')
image.shape
# In[ ]:
x,y,z= image.shape
# In[ ]:
plt.imshow(image)
So, at this point I am going to just stick with PyCharm for now.
Click on a cell to select it.
Shift+Click on another cell to select that cell and all cells in-between.
Press just C
to copy the cell inputs (it's a jupyter shortcut). This should work for copying into other notebooks, but you can also paste that into any other editor, or a Stack Overflow post.
I don't know of a particular way to copy cell output. It's all text in a web browser so the regular methods for that will work though.