web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Python脚本

(1) ShareShare
ReportReport
Posted on by
import cv2 as cv
import pytesseract
from PIL import Image
import sys
 
pytesseract.pytesseract.tesseract_cmd = r'C:\Tesseract\tesseract.exe'
 
def recognize_text(image):
    blur = cv.pyrMeanShiftFiltering(image, sp=8, sr=60)
    gray = cv.cvtColor(blur, cv.COLOR_BGR2GRAY)
    binary = cv.adaptiveThreshold(gray, 255, cv.ADAPTIVE_THRESH_GAUSSIAN_C, cv.THRESH_BINARY_INV, 11, 2)
    test_message = Image.fromarray(binary)
    text = pytesseract.image_to_string(test_message, config='--psm 7 -c tessedit_char_whitelist=0123456789')
    return text
  
src = cv.imread(r'C:\yanzhengma\tupian\7364.jpg')
if src is None:
    print("无法读取图像文件,请检查文件路径")
    sys.exit(1)
else:
    result = recognize_text(src)
    print(result)
Why can I run this code in VsCode and get the output.But there is no output in Power Automate?
I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at
    Hey there,
     
    Could you please explain what is your issue?
     
    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard