Thank you for this. You just made batch trading card photo editing and analysis 100x faster for me.
@murtazasworkshop
3 жыл бұрын
Glad it helped!
@MarkusBurrer
2 жыл бұрын
To find the biggest contour you can simply use sort. You don't need to loop over the array yourself.
@khalidben9940
3 жыл бұрын
you are doing a big favor to all of us new learners.Thank you so much for such great efforts
@scripachd3488
3 жыл бұрын
How to fix errors in the code from the site: lables[d] -> lables[d][c]
@rulaneshedo2775
4 жыл бұрын
very good Tutorial. thanks for sharing your knowledge with us
@murtazasworkshop
4 жыл бұрын
My pleasure
@nandandubey3636
4 жыл бұрын
The video helped a lot!!! However when tried with different orientation of the document , it fails to warp the document.
@komiagotsi5343
4 жыл бұрын
Great tutorials, very clear, thanks! How can I detect automatically the best threshold1 and threashold2 ?
@sangaweavers
4 жыл бұрын
Grt vdo thanks for time saving but unable to get code as you refer description for code
@mohitangrish4741
4 жыл бұрын
Can you please explain the working of reorder function
@MsFearco
3 жыл бұрын
This looks super useful. Thanks!
@mertcapkin7263
3 жыл бұрын
For me it does not work. I get an error: can't convert object of type list to str for text. I did not change your code.
@user-eh9gb5wn1r
3 жыл бұрын
I have such error. Please if you correct this. Can you share answer later
@bigounce1292
3 жыл бұрын
Change the second argument to lables[d][c] (utils.py:38) The column index is missing
@ateechakma568
3 жыл бұрын
@@bigounce1292 in line number 38 in utils.py it is written "cv2.rectangle(ver, (c * eachImgWidth, eachImgHeight * d) " canyou tell what to do exactly like change what line to what?
@conexcol
3 жыл бұрын
I have the same error too. I think is the openCV version. I think this is for openCV2. python3 main.py 480 Traceback (most recent call last): File "main.py", line 72, in stackedImage = utils.stackImages(imageArray,0.75,lables) File "./utils.py", line 38, in stackImages cv2.putText(ver,lables[d],(eachImgWidth*c+10,eachImgHeight*d+20),cv2.FONT_HERSHEY_COMPLEX,0.7,(255,0,255),2) cv2.error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'putText' > Overload resolution failed: > - Can't convert object of type 'list' to 'str' for 'text' > - Can't convert object of type 'list' to 'str' for 'text'
@nguyenkhoa851
3 жыл бұрын
@@bigounce1292 Big thumbs up
@JoseHernandez-qk5by
2 жыл бұрын
Hi Murtaza just to mention in minute 17:30 your code shows in line 81: if cv2.waitKey(1) & 0xFF == ord('s'): But downloadable file has: if cv2.waitKey(1) & 0xFF == ord('s'):
@subhrabanerjee380
3 жыл бұрын
sir it shows this error -215:Assertion failed) !ssize.empty() in function 'cv::resize'
@1nd0Aryan
Жыл бұрын
Doing god's work my friend.
@rodrigobucrin7912
4 жыл бұрын
Very clear, thanks!
@xerogaming2127
Жыл бұрын
results are different for different cameras , code seems to work only for images with specific resolution , with any high resoltion like 4k , it cannot scan the image maybe due to extra noise
@jackofalltrades1202
Жыл бұрын
That's sure
@Moprationsz
2 жыл бұрын
Hey, amazing video! Please notice that the files in your course have some characters on their unicode form, crashing all the code.
@brownmax4120
3 жыл бұрын
Hey... Can i apply it on handwritten images?
@anilrustaq738
3 жыл бұрын
I want a software like this for pc which can detect edges and crop photos. Allowing batch cropping
@HosseinOjvar
2 жыл бұрын
Very useful tutorial, thank you
@techiebuzz1515
4 жыл бұрын
The transformations went OK, but then I got such error: SystemError: returned NULL without setting an error kindly respond
@varunjohnson9570
3 жыл бұрын
I too got the same error
@tapog3134
3 жыл бұрын
Great tutorials . can you make for android to ? thanks
@bvc_
4 жыл бұрын
Danke!!!!
@alirezap3201
3 жыл бұрын
perfect . thank you
@VLovac
Жыл бұрын
its not working
@nikhitawatpal3636
Жыл бұрын
I DONT HAVE HEIGHT AND WIDTH BUT PIXEL DIMENSIONS AFTER ADDING THOSE DIMENSIONS AND RUNNING MY PYCHARM DOES NOT RESPOND IT SAYS RESULT NOT RESPONDING.. BUT FOR ALL OTHER CODES IT WORKS FINE
@Hanstein.
2 жыл бұрын
source code doesn't exist, as in the link you provided in the description
@user-yb2xt7gf6w
11 ай бұрын
Hi, can you provide the picture used in this example. Thanks!
@ateechakma568
3 жыл бұрын
if i am using an image instead of a web cam and adjusting the code than changing trackbar values of threshold 1 and 2 does not effect my image threshold but if i remove the trackbar than the contour automatically capture the whole image. pls help
@sagarhm2237
3 жыл бұрын
how to control pointer to crop the images using touch on pointer
@hansbleijs6918
3 жыл бұрын
Great videos, but where do i find the utlis.py file?
@@maximomateo2538 Then copy this code import cv2 import numpy as np ## TO STACK ALL THE IMAGES IN ONE WINDOW def stackImages(imgArray,scale,lables=[]): rows = len(imgArray) cols = len(imgArray[0]) rowsAvailable = isinstance(imgArray[0], list) width = imgArray[0][0].shape[1] height = imgArray[0][0].shape[0] if rowsAvailable: for x in range ( 0, rows): for y in range(0, cols): imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale) if len(imgArray[x][y].shape) == 2: imgArray[x][y]= cv2.cvtColor( imgArray[x][y], cv2.COLOR_GRAY2BGR) imageBlank = np.zeros((height, width, 3), np.uint8) hor = [imageBlank]*rows hor_con = [imageBlank]*rows for x in range(0, rows): hor[x] = np.hstack(imgArray[x]) hor_con[x] = np.concatenate(imgArray[x]) ver = np.vstack(hor) ver_con = np.concatenate(hor) else: for x in range(0, rows): imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale) if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR) hor= np.hstack(imgArray) hor_con= np.concatenate(imgArray) ver = hor if len(lables) != 0: eachImgWidth= int(ver.shape[1] / cols) eachImgHeight = int(ver.shape[0] / rows) print(eachImgHeight) for d in range(0, rows): for c in range (0,cols): cv2.rectangle(ver,(c*eachImgWidth,eachImgHeight*d),(c*eachImgWidth+len(lables[d])*13+27,30+eachImgHeight*d),(255,255,255),cv2.FILLED) cv2.putText(ver,lables[d],(eachImgWidth*c+10,eachImgHeight*d+20),cv2.FONT_HERSHEY_COMPLEX,0.7,(255,0,255),2) return ver def reorder(myPoints): myPoints = myPoints.reshape((4, 2)) myPointsNew = np.zeros((4, 1, 2), dtype=np.int32) add = myPoints.sum(1) myPointsNew[0] = myPoints[np.argmin(add)] myPointsNew[3] =myPoints[np.argmax(add)] diff = np.diff(myPoints, axis=1) myPointsNew[1] =myPoints[np.argmin(diff)] myPointsNew[2] = myPoints[np.argmax(diff)] return myPointsNew def biggestContour(contours): biggest = np.array([]) max_area = 0 for i in contours: area = cv2.contourArea(i) if area > 5000: peri = cv2.arcLength(i, True) approx = cv2.approxPolyDP(i, 0.02 * peri, True) if area > max_area and len(approx) == 4: biggest = approx max_area = area return biggest,max_area def drawRectangle(img,biggest,thickness): cv2.line(img, (biggest[0][0][0], biggest[0][0][1]), (biggest[1][0][0], biggest[1][0][1]), (0, 255, 0), thickness) cv2.line(img, (biggest[0][0][0], biggest[0][0][1]), (biggest[2][0][0], biggest[2][0][1]), (0, 255, 0), thickness) cv2.line(img, (biggest[3][0][0], biggest[3][0][1]), (biggest[2][0][0], biggest[2][0][1]), (0, 255, 0), thickness) cv2.line(img, (biggest[3][0][0], biggest[3][0][1]), (biggest[1][0][0], biggest[1][0][1]), (0, 255, 0), thickness) return img def nothing(x): pass def initializeTrackbars(intialTracbarVals=0): cv2.namedWindow("Trackbars") cv2.resizeWindow("Trackbars", 360, 240) cv2.createTrackbar("Threshold1", "Trackbars", 200,255, nothing) cv2.createTrackbar("Threshold2", "Trackbars", 200, 255, nothing) def valTrackbars(): Threshold1 = cv2.getTrackbarPos("Threshold1", "Trackbars") Threshold2 = cv2.getTrackbarPos("Threshold2", "Trackbars") src = Threshold1,Threshold2 return src
@weltsiebenhundert
3 жыл бұрын
@@CodingCircle hero you are
@CodingCircle
3 жыл бұрын
@@weltsiebenhundert Thanks Glad that Helped
@primarodrigues3560
3 жыл бұрын
@@CodingCircle Thanks...Worked it
@myprojects-df6ol
3 ай бұрын
Is the camera module or webcam you used for the video
@hillcheung5713
2 жыл бұрын
How can I solve this? Thank you cv2.error: OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1257: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'
@yacinerouizi844
3 жыл бұрын
thank you
@rahullambe2858
4 жыл бұрын
Thank you Sir 👍
@dhruvgandhi8790
4 жыл бұрын
HI Sir but code is not available on website
@JoseHernandez-qk5by
2 жыл бұрын
Hi Murtaza I want to develope an cam scann to web application... for such target how the client's cam scamm connects to the web???
@rahisarm
3 жыл бұрын
Please do a tutorial for extract data from identity cards in key value pairs
@prabcsh
3 жыл бұрын
You can try pytesseract for that. Use image_to_data() of pytesseract library to get a dictionary of detected texts.
@samimferdoush8141
2 жыл бұрын
When I save image from webcam feed it says NameError: name 'imgWarpColored' is not defined Please help me to fix it
@mksnkv
4 жыл бұрын
thanks a lot for the video. I am trying to apply the program to a static image. I removed the infinite loop and just want a static plot of 6 images. The transformations went OK, but then I got such error: SystemError: returned NULL without setting an error while putting text on the plot of 6 images. Even if I comment the line, I got corrupted small black screen instead of image of 6 parts. Hope for response P.S. I use OpenCV 4.2.0, Python 3.7 on Ubuntu OS
@GOD9494
4 жыл бұрын
cv2.putText(ver,lables[d][c],(eachImgWidth*c+10,eachImgHeight*d+20),cv2.FONT_HERSHEY_COMPLEX,0.7,(255,0,255),2) change it to this line.
@landrynoulawe1565
3 жыл бұрын
I have the same problem, when i comment the line. I'm also using Linux : linux Mint 19.1 and OpenCV 4.2.0 + python 3.6
@rajushingadiya2860
3 жыл бұрын
your result image is black and white instead of colour example your input image have color droid logo at top but in output it's converted into lines logo
@B__PutriAuliaSN_DMekatronika
9 ай бұрын
can it be used to detect container images??
@vinhtruongngoc902
Жыл бұрын
Mr. Murtaza , can i see the Utils src code
@sivanaga6669
3 жыл бұрын
Can you do some videos on reading text from 3D images. I tried to follow the same you did in previous videos but no luck. The text is not detected.
@rezazaimzadeh4276
2 жыл бұрын
hi.how to autorun python code at startup moment windows?
@1phong.djk.392
4 жыл бұрын
Love it
@nan0mchgaming937
3 жыл бұрын
How to use draw rectangle utils function???
@user-cb7yl4nr6h
10 ай бұрын
How do I convert an image to a Word file?
@sibghatullah2736
4 жыл бұрын
Very nice work Mr. Murtaza, can you make a video on document layout analysis? To extract all tables in an image, i already wrote a code but due to inline space difference i can not use it for multiple layouts,
@murtazasworkshop
4 жыл бұрын
Thanx . I will look into it
@sibghatullah2736
4 жыл бұрын
@@murtazasworkshop i can Share you the code to speed up this process,
@copaceanubobi6101
3 жыл бұрын
you find solution for this project ?
@BieAnimation
3 жыл бұрын
Thanks for share the project, but i got an erro. Help 480 Traceback (most recent call last): File "C:\Users\..\Scanner Python\PythonDocumentScanner.py", line 73, in stackedImage = utlis.stackImages(imageArray, 0.75, lables) File "C:\Users\..\Scanner Python\utlis.py", line 41, in stackImages cv2.putText(ver, lables[d], (eachImgWidth * c + 10, eachImgHeight * d + 20), cv2.FONT_HERSHEY_COMPLEX, cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'putText' > Overload resolution failed: > - Can't convert object of type 'list' to 'str' for 'text' > - Can't convert object of type 'list' to 'str' for 'text'
@nguyentranquoc3143
2 жыл бұрын
Sir, What is the image processing algorithm used in this project?
@AlotaibiAbdulAziz
4 жыл бұрын
thanks .. good video, .. can get an image from scannr device ? how?
@rons96
3 жыл бұрын
On first step you show all the code, and when you start at begin you say: lets copy and paste a super complicated function here or download this file and put it on program's folder, then run. How can I learn when you do these things? Impossible.
@sankasuvarna1764
4 жыл бұрын
Hi sir ur videos are really nice.can u make a video on motion recognition and face recognition in live video using opencv and python
@murtazasworkshop
4 жыл бұрын
yes will be sharing face recognition soon .
@hrithiklanghi6418
3 жыл бұрын
Is there even a lib named like that... I tgink it should be utils isn't it.... Please clarify ...confused
@sanjaykariyanna6367
4 жыл бұрын
Sir, plz tell how to save the code and process with one click , like CamScanner, and also tell us how to convert the our own written code to a application or web application and use in the mobile just like Doc scanner . Plz plz do tell, it's my humble request, I'm waiting to know about it since from few months. 🙏🙏
@adiwharwher8613
3 жыл бұрын
How to compile for android?
@kunaljain7103
4 жыл бұрын
Hey please tell me how can i use this in my app
@yodiaryavi741
4 жыл бұрын
how work with webcam
@arianneyoon7374
2 жыл бұрын
where can we find the utlis.py file?
@cumulus1311
4 жыл бұрын
can I export/save it to Microsoft Word documents or text file, thanks
@murtazasworkshop
4 жыл бұрын
i am not sure about word file but you can do pdf
@caer7947
Жыл бұрын
what application is this? is this android studio?
@esooghazy
3 жыл бұрын
Hey Murtaza, Thanks for your amazing videos! I just wanted to ask how can I download the code because it's grayed and can't be downloaded through your website. I tried to write it while watching the video, but some parts aren't shown in the video.
@murtazasworkshop
3 жыл бұрын
You can enroll at the top of the page to get access.
@rulaneshedo2775
4 жыл бұрын
Dear Mr.Murtaza i am having trouble saving the image, i would like to know if there some advice to this situation. below is the error: Traceback (most recent call last): File "C:\Users\Dell\Desktop\scanner\scanner.py", line 79, in cv2.imwrite("Scanned/myImage"+str(count)+".jpg",imgWarpColored)#imgWarpColored NameError: name 'imgWarpColored' is not defined
@murtazasworkshop
4 жыл бұрын
it says that you have not defined variable before using. try to match it with the code on the website if you dont seem to locate the error.
@rulaneshedo2775
4 жыл бұрын
@@murtazasworkshop got it solved, Thanks!
@ameng9176
4 жыл бұрын
@@rulaneshedo2775 hi Runlane Shedp. i run the code and it doesn't show the image, No error code, can you teamview for me, this is my email : tienmanhssbg@gmail.com. please, thank you very much
@rulaneshedo2775
4 жыл бұрын
@@ameng9176 yeah sure, i will do my best to help you
@shantanumali3098
4 жыл бұрын
@@rulaneshedo2775 What was the solution ?
@adityamahimkar6138
3 жыл бұрын
Hii sir, loved your video can you provide me the trackbar explanation video of yours Thanks 😊
@murtazasworkshop
3 жыл бұрын
you can check the "learn opencv 3 hours " video in the 7th chapter i have explained trackbars
@adityamahimkar6138
3 жыл бұрын
@@murtazasworkshop okie thanks
@ccn4709
3 жыл бұрын
Sorry to say I never trusted on Indian youtuber. But u changed my mind
@hrithiklanghi6418
3 жыл бұрын
What is utlis i am not able to install it nor import it
@murtazasworkshop
3 жыл бұрын
Its a file that needs to be in the same folder
@praneethcj6544
4 жыл бұрын
Hey buddy ... CAN YOU MAKE A VIDEO ON INVOICE IMAGE Classification??
@murtazasworkshop
4 жыл бұрын
if you just want to differentiate between paper and invoice have a look at this . kzitem.info/news/bejne/2meQ2IOpcqVjhHY
@sibghatullah2736
4 жыл бұрын
i am working on same project and stuck, we can collaborate ping me at sybghatallah@gmail.com
@pankajpomal
4 жыл бұрын
Gr8...can I make apk with python and setup admob??
@murtazasworkshop
4 жыл бұрын
i havent tried it but you can look into "pyhton for andorid" .
@amanjha8303
4 жыл бұрын
Can you please tell me how to convert this into an app?
@murtazasworkshop
4 жыл бұрын
for apps its best to use native platforms
@smrjt9102
4 жыл бұрын
ModuleNotFoundError: No module named 'utlis' the above ERROR is showing even after installing the module utlis. #help
@komiagotsi5343
4 жыл бұрын
I have the same error, but I resolved it. You have this error because There is no python file named utlis. So change utlis to right name who is utils. Hope that is would help you.
@nizarhaidar5225
3 жыл бұрын
Utlis or intended spelling "Utils" is can be downloaded here www.computervision.zone/courses/document-scanner/lesson/utlis-py-2/
@khainguyen5663
4 жыл бұрын
cv2.putText(ver,lables[d],((eachImgWidth*c)+10,(eachImgHeight*d)+20),cv2.FONT_HERSHEY_SIMPLEX, 0.75, (0, 0, 0), 1,cv2.LINE_AA) TypeError: bad argument type for built-in operation Can guys help me resolve this error
@patterndbrand
2 жыл бұрын
cv2.putText(ver,labels[d][c],((eachImgWidth*c)+10
@anaghanil9603
4 жыл бұрын
Which software is using to type code
@murtazasworkshop
4 жыл бұрын
pycharm community version
@hafizmuhammadabdullahbhatt9047
3 жыл бұрын
Is it 'utlis' or 'utils', because, there's no file name 'utlis', there's only 'utils'....Plzzzzzzzzzzzzzz
@kaitoukid9427
3 жыл бұрын
save the second file name to utlis.py
@kid3082
4 жыл бұрын
Hi, thanks for the video. I have a problem by running the code. I have this error. Traceback (most recent call last): File "C:\Users\Kid\PycharmProjects\Scanner\DocumentScannerMain.py", line 73, in stackedImage = utlis.stackImages(imageArray, 0.75, lables) File "C:\Users\Kid\PycharmProjects\Scanner\utlis.py", line 42, in stackImages 0.7, (255, 0, 255), 2) SystemError: returned NULL without setting an error [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback Can you help me please. Great thanks
@komiagotsi5343
4 жыл бұрын
I have the same error, This line of the code is used to display label on the top of each screen. It's not necessary . So I commented this line. And It worked.
@kid3082
4 жыл бұрын
@@komiagotsi5343 Thank you :)
@ameng9176
4 жыл бұрын
@@komiagotsi5343 dear Komi AGOTSI ! I fixed the error like you, but it didn't work, can you teamview me? please !
@numu4913
3 жыл бұрын
Who needs the solution, you just need to convert labels to string with method str() or ' '.join() like: stackedImage = utilities.stackImages(imageArray, 0.75, str(labels)) stackedImage = utilities.stackImages(imageArray, 0.75, ' '.join(labels))
@dreamlit8500
3 жыл бұрын
@@numu4913 thank you it worked
@gigachad6844
3 жыл бұрын
returned NULL without setting an error
@anchovygoblin
3 жыл бұрын
It's so fantastic lecture for me!! Thank you for your great teaching :) I'm an openCV beginner sir. But... I don't understand that final if loop >>> if cv2.waitKey(1) & amp; 0xFF == ord('s') I know this line is used to quit the video like this. >>> if cv2.waitKey(1) & 0xFF == ord('q') But now, i have a red problem text in Pycharm... So... what does "amp; (semicolon)" mean?? Is there any alternative word that i can save scanned image?
@kisamesafe
3 жыл бұрын
cv2.VideoCapture(0) if u can use first one you should write 0
@BieAnimation
3 жыл бұрын
thanks
@RajeshRoy402
3 жыл бұрын
Hi, where can I find the code for this?
@RajeshRoy402
3 жыл бұрын
I got it.
@sunuilham1644
3 жыл бұрын
@@RajeshRoy402 can you please give me the link to the code?
@sunuilham1644
3 жыл бұрын
you can find the code at his website
@zamaralishah2113
4 жыл бұрын
Dear sir, Thanks. But one question is that how to import utlis from main library.
@murtazasworkshop
4 жыл бұрын
just write from utlis import* this will import every thing. Make sure utlis.py is in the same folder as your main py file.
@zamaralishah2113
4 жыл бұрын
Dear sir, Thanks
@shrikantsawant538
4 жыл бұрын
Are bhai I want code where is the code
@murtazasworkshop
4 жыл бұрын
follow the link in the description and enroll to get access to the code
Пікірлер: 164