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

Announcements

News and Announcements icon
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 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard