angular过滤字符

介绍 (Introduction)

In this article, we will create an optical character recognition (OCR) application using Angular and the Azure Computer Vision Cognitive Service.

在本文中,我们将使用Angular和Azure计算机视觉认知服务创建一个光学字符识别(OCR)应用程序。

Computer Vision is an AI service that analyzes content in images. We will use the OCR feature of Computer Vision to detect the printed text in an image. The application will extract the text from the image and detects the language of the text.

Computer Vision是一项AI服务,可以分析图像中的内容。 我们将使用Computer Vision的OCR功能来检测图像中的打印文本。 该应用程序将从图像中提取文本并检测文本的语言。

Currently, the OCR API supports 25 languages.

当前,OCR API支持25种语言。

先决条件 (Prerequisites)

  • Install the latest LTS version of Node.JS from https://nodejs.org/en/download/

    从https://nodejs.org/en/download/安装最新的LTS版本的Node.JS

  • Install the Angular CLI from https://cli.angular.io/

    从https://cli.angular.io/安装Angular CLI

  • Install the .NET Core 3.1 SDK from https://dotnet.microsoft.com/download/dotnet-core/3.1

    从https://dotnet.microsoft.com/download/dotnet-core/3.1安装.NET Core 3.1 SDK

  • Install the latest version of Visual Studio 2019 from https://visualstudio.microsoft.com/downloads/

    从https://visualstudio.microsoft.com/downloads/安装最新版本的Visual Studio 2019

  • An Azure subscription account. You can create a free Azure account at https://azure.microsoft.com/en-in/free/

    Azure订阅帐户。 您可以在https://azure.microsoft.com/en-in/free/创建一个免费的Azure帐户

源代码 (Source Code)

You can get the source code from GitHub.

您可以从GitHub获取源代码。

We will use an ASP.NET Core backend for this application. The ASP.NET Core backend provides a straight forward authentication process to access Azure cognitive services. This will also ensure that the end-user won’t have direct access to cognitive services.
我们将为此应用程序使用ASP.NET Core后端。 ASP.NET Core后端提供了直接的身份验证过程,以访问Azure认知服务。 这还将确保最终用户不会直接访问认知服务。

创建Azure计算机视觉认知服务资源 (Create the Azure Computer Vision Cognitive Service resource)

Log in to the Azure portal and search for the cognitive services in the search bar and click on the result. Refer to the image shown below.

登录到Azure门户,然后在搜索栏中搜索认知服务,然后单击结果。 请参考下图。

On the next screen, click on the Add button. It will open the cognitive services marketplace page. Search for the Computer Vision in the search bar and click on the search result. It will open the Computer Vision API page. Click on the Create button to create a new Computer Vision resource. Refer to the image shown below.

在下一个屏幕上,单击添加按钮。 它将打开认知服务市场页面。 在搜索栏中搜索“计算机视觉”,然后单击搜索结果。 它将打开“计算机视觉API”页面。 单击创建按钮以创建新的计算机视觉资源。 请参考下图。

On the Create page, fill in the details as indicated below.

在“创建”页面上,如下所示填写详细信息。

  • Name: Give a unique name for your resource.

    名称 :为资源指定一个唯一的名称。

  • Subscription: Select the subscription type from the dropdown.

    订阅 :从下拉列表中选择订阅类型。

  • Pricing tier: Select the pricing tier as per your choice.

    定价层 :根据您的选择选择定价层。

  • Resource group: Select an existing resource group or create a new one.

    资源组 :选择一个现有资源组或创建一个新的资源组。

Click on the Create button. Refer to the image shown below.

单击创建按钮。 请参考下图。

After your resource is successfully deployed, click on the “Go to resource” button. You can see the Key and the endpoint for the newly created Computer Vision resource. Refer to the image shown below.

成功部署资源后,单击“转到资源”按钮。 您可以看到新创建的计算机视觉资源的密钥和端点。 请参考下图。

Make a note of the key and the endpoint. We will be using these in the latter part of this article to invoke the Computer Vision OCR API from the .NET Code. The values are masked here for privacy.

记下密钥和端点。 在本文的后半部分,我们将使用它们来从.NET代码中调用Computer Vision OCR API。 为了保护隐私,此处将这些值屏蔽。

创建ASP.NET Core应用程序 (Creating the ASP.NET Core application)

Open Visual Studio 2019 and click on “Create a new Project”. A “Create a new Project” dialog will open. Select “ASP.NET Core Web Application” and click on Next. Now you will be at “Configure your new project” screen, provide the name for your application as ngComputerVision and click on create. Refer to the image shown below.

打开Visual Studio 2019,然后单击``创建新项目''。 将打开一个“创建新项目”对话框。 选择“ ASP.NET Core Web应用程序”,然后单击“下一步”。 现在,您将在“配置新项目”屏幕上,将应用程序的名称提供为ngComputerVision ,然后单击“创建”。 请参考下图。

You will be navigated to “Create a new ASP.NET Core web application” screen. Select “.NET Core” and “ASP.NET Core 3.1” from the dropdowns on the top. Then, select the “Angular” project template and click on Create. Refer to the image shown below.

您将被导航到“创建新的ASP.NET Core Web应用程序”屏幕。 从顶部的下拉菜单中选择“ .NET Core”和“ ASP.NET Core 3.1”。 然后,选择“ Angular”项目模板,然后单击Create 。 请参考下图。

This will create our project. The folder structure of the application is shown below.

这将创建我们的项目。 该应用程序的文件夹结构如下所示。

The ClientApp folder contains the Angular code for our application. The Controllers folders will contain our API controllers. The angular components are present inside the ClientApp\src\app folder.

ClientApp文件夹包含我们应用程序的Angular代码。 Controllers文件夹将包含我们的API控制器。 角度分量位于ClientApp\src\app文件夹内。

The default template contains a few Angular components. These components won’t affect our application, but for the sake of simplicity, we will delete fetchdata and counter folders from ClientApp/app/components folder. Also, remove the reference for these two components from the app.module.ts file.

默认模板包含一些Angular组件。 这些组件不会影响我们的应用程序,但是为了简单起见,我们将从ClientApp/app/components文件夹中删除fetchdata和counter文件夹。 另外,从app.module.ts文件中删除对这两个组件的app.module.ts

安装计算机视觉API库 (Installing Computer Vision API library)

We will install the Azure Computer Vision API library which will provide us with the models out of the box to handle the Computer Vision REST API response. To install the package, navigate to Tools >> NuGet Package Manager >> Package Manager Console. It will open the Package Manager Console. Run the command as shown below.

我们将安装Azure Computer Vision API库,该库将为我们提供现成的模型来处理Computer Vision REST API响应。 要安装软件包,请导航至工具>> NuGet软件包管理器>>软件包管理器控制台。 它将打开软件包管理器控制台。 运行如下所示的命令。

Install-Package Microsoft.Azure.CognitiveServices.Vision.ComputerVision -Version 5.0.0

You can learn more about this package at the NuGet gallery.

您可以在NuGet画廊中了解有关此软件包的更多信息。

创建模型 (Create the Models)

Right-click on the ngComputerVision project and select Add >> New Folder. Name the folder as Models. Again, right-click on the Models folder and select Add >> Class to add a new class file. Put the name of your class as LanguageDetails.cs and click Add.

右键单击ngComputerVision项目,然后选择添加>>新建文件夹。 将该文件夹命名为Models。 再次右键单击Models文件夹,然后选择Add >> Class添加新的类文件。 将类的名称输入LanguageDetails.cs ,然后单击“添加”。

Open LanguageDetails.cs and put the following code inside it.

打开LanguageDetails.cs并将以下代码放入其中。

namespace ngComputerVision.Models
{public class LanguageDetails{public string Name { get; set; }public string NativeName { get; set; }public string Dir { get; set; }}
}

Similarly, add a new class file AvailableLanguage.cs and put the following code inside it.

同样,添加一个新的类文件AvailableLanguage.cs并将以下代码放入其中。

using System.Collections.Generic;namespace ngComputerVision.Models
{public class AvailableLanguage{public Dictionary<string, LanguageDetails> Translation { get; set; }}
}

We will also add two classes as DTO (Data Transfer Object) for sending data back to the client.

我们还将添加两个类作为DTO(数据传输对象),用于将数据发送回客户端。

Create a new folder and name it DTOModels. Add the new class file AvailableLanguageDTO.cs in the DTOModels folder and put the following code inside it.

创建一个新文件夹并将其命名为DTOModels。 在DTOModels文件夹中添加新的类文件AvailableLanguageDTO.cs ,并将以下代码放入其中。

namespace ngComputerVision.DTOModels
{public class AvailableLanguageDTO{public string LanguageID { get; set; }public string LanguageName { get; set; }}
}

Add the OcrResultDTO.cs file and put the following code inside it.

添加OcrResultDTO.cs文件,并将以下代码放入其中。

namespace ngComputerVision.DTOModels
{public class OcrResultDTO{public string Language { get; set; }public string DetectedText { get; set; }}
}

添加OCR控制器 (Adding the OCR Controller)

We will add a new controller to our application. Right-click on the Controllers folder and select Add >> New Item. An “Add New Item” dialog box will open. Select “Visual C#” from the left panel, then select “API Controller Class” from templates panel and put the name as OCRController.cs. Click on Add.

我们将向我们的应用程序添加一个新的控制器。 右键单击Controllers文件夹,然后选择Add >> New Item。 “添加新项”对话框将打开。 从左侧面板中选择“ Visual C#”,然后从模板面板中选择“ API Controller Class”,并将名称命名为OCRController.cs 。 点击添加。

Refer to the image below.

请参考下图。

The OCRController will handle the image recognition requests from the client app. This controller will also return the list of all the languages supported by OCR API.

OCRController将处理来自客户端应用程序的图像识别请求。 该控制器还将返回OCR API支持的所有语言的列表。

Open the OCRController.cs file and put the following code inside it.

打开OCRController.cs文件,并将以下代码放入其中。

using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Net.Http;
using System.Net.Http.Headers;
using Newtonsoft.Json.Linq;
using System.IO;
using Newtonsoft.Json;
using System.Text;
using ngComputerVision.Models;
using System.Collections.Generic;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models;
using ngComputerVision.DTOModels;namespace ngComputerVision.Controllers
{[Produces("application/json")][Route("api/[controller]")]public class OCRController : Controller{static string subscriptionKey;static string endpoint;static string uriBase;public OCRController(){subscriptionKey = "b993f3afb4e04119bd8ed37171d4ec71";endpoint = "https://ankitocrdemo.cognitiveservices.azure.com/";uriBase = endpoint + "vision/v2.1/ocr";}[HttpPost, DisableRequestSizeLimit]public async Task<OcrResultDTO> Post(){StringBuilder sb = new StringBuilder();OcrResultDTO ocrResultDTO = new OcrResultDTO();try{if (Request.Form.Files.Count > 0){var file = Request.Form.Files[Request.Form.Files.Count - 1];if (file.Length > 0){var memoryStream = new MemoryStream();file.CopyTo(memoryStream);byte[] imageFileBytes = memoryStream.ToArray();memoryStream.Flush();string JSONResult = await ReadTextFromStream(imageFileBytes);OcrResult ocrResult = JsonConvert.DeserializeObject<OcrResult>(JSONResult);if (!ocrResult.Language.Equals("unk")){foreach (OcrLine ocrLine in ocrResult.Regions[0].Lines){foreach (OcrWord ocrWord in ocrLine.Words){sb.Append(ocrWord.Text);sb.Append(' ');}sb.AppendLine();}}else{sb.Append("This language is not supported.");}ocrResultDTO.DetectedText = sb.ToString();ocrResultDTO.Language = ocrResult.Language;}}return ocrResultDTO;}catch{ocrResultDTO.DetectedText = "Error occurred. Try again";ocrResultDTO.Language = "unk";return ocrResultDTO;}}static async Task<string> ReadTextFromStream(byte[] byteData){try{HttpClient client = new HttpClient();client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", subscriptionKey);string requestParameters = "language=unk&detectOrientation=true";string uri = uriBase + "?" + requestParameters;HttpResponseMessage response;using (ByteArrayContent content = new ByteArrayContent(byteData)){content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");response = await client.PostAsync(uri, content);}string contentString = await response.Content.ReadAsStringAsync();string result = JToken.Parse(contentString).ToString();return result;}catch (Exception e){return e.Message;}}[HttpGet]public async Task<List<AvailableLanguageDTO>> GetAvailableLanguages(){string endpoint = "https://api.cognitive.microsofttranslator.com/languages?api-version=3.0&scope=translation";var client = new HttpClient();using (var request = new HttpRequestMessage()){request.Method = HttpMethod.Get;request.RequestUri = new Uri(endpoint);var response = await client.SendAsync(request).ConfigureAwait(false);string result = await response.Content.ReadAsStringAsync();AvailableLanguage deserializedOutput = JsonConvert.DeserializeObject<AvailableLanguage>(result);List<AvailableLanguageDTO> availableLanguage = new List<AvailableLanguageDTO>();foreach (KeyValuePair<string, LanguageDetails> translation in deserializedOutput.Translation){AvailableLanguageDTO language = new AvailableLanguageDTO();language.LanguageID = translation.Key;language.LanguageName = translation.Value.Name;availableLanguage.Add(language);}return availableLanguage;}}}
}

In the constructor of the class, we have initialized the key and the endpoint URL for the OCR API.

在该类的构造函数中,我们已经初始化了OCR API的键和端点URL。

The Post method will receive the image data as a file collection in the request body and return an object of type OcrResultDTO. We will convert the image data to a byte array and invoke the ReadTextFromStream method. We will deserialize the response into an object of type OcrResult. We will then form the sentence by iterating over the OcrWord object.

Post方法将在请求正文中将图像数据作为文件集合接收,并返回OcrResultDTO类型的对象。 我们将图像数据转换为字节数组,然后调用ReadTextFromStream方法。 我们将反序列化为OcrResult类型的对象。 然后,我们将通过遍历OcrWord对象形成句子。

Inside the ReadTextFromStream method, we will create a new HttpRequestMessage. This HTTP request is a Post request. We will pass the subscription key in the header of the request. The OCR API will return a JSON object having each word from the image as well as the detected language of the text.

ReadTextFromStream方法内部,我们将创建一个新的HttpRequestMessage 。 这个HTTP请求是一个Post请求。 我们将在请求的标头中传递订阅密钥。 OCR API将返回一个JSON对象,其中包含图像中的每个单词以及检测到的文本语言。

The GetAvailableLanguages method will return the list of all the language supported by the Translate Text API. We will set the request URI and create a HttpRequestMessage which will be a Get request. This request URI will return a JSON object which will be deserialized to an object of type AvailableLanguage.

GetAvailableLanguages方法将返回翻译文本API支持的所有语言的列表。 我们将设置请求URI并创建一个HttpRequestMessage ,它将是一个Get请求。 该请求URI将返回一个JSON对象,该对象将反序列化为AvailableLanguage类型的对象。

为什么我们需要获取支持的语言列表? (Why do we need to fetch the list of supported languages?)

The OCR API returns the language code (e.g. en for English, de for German, etc.) of the detected language. But we cannot display the language code on the UI as it is not user-friendly. Therefore, we need a dictionary to look up the language name corresponding to the language code.

OCR API返回检测到的语言的语言代码(例如,en表示英语,de表示德语等)。 但是我们不能在用户界面上显示语言代码,因为它不友好。 因此,我们需要一个字典来查找与语言代码相对应的语言名称。

The Azure Computer Vision OCR API supports 25 languages. To know all the languages supported by OCR API see the list of supported languages. These languages are a subset of the languages supported by the Azure Translate Text API.

Azure计算机视觉OCR API支持25种语言。 要了解OCR API支持的所有语言,请参阅支持的语言列表。 这些语言是Azure Translate Text API支持的语言的子集。

Since there is no dedicated API endpoint to fetch the list of languages supported by OCR API, we are using the Translate Text API endpoint to fetch the list of languages. We will create the language lookup dictionary using the JSON response from this API call and filter the result based on the language code returned by the OCR API.

由于没有专用的API端点来获取OCR API支持的语言列表,因此我们使用翻译文本API端点来获取语言列表。 我们将使用来自此API调用的JSON响应来创建语言查找字典,并根据OCR API返回的语言代码过滤结果。

在应用程序的客户端上工作 (Working on the Client side of the application)

The code for the client-side is available in the ClientApp folder. We will use Angular CLI to work with the client code.

客户端的代码可在ClientApp文件夹中找到。 我们将使用Angular CLI来处理客户端代码。

Using Angular CLI is not mandatory. I am using Angular CLI here as it is user-friendly and easy to use. If you don’t want to use CLI then you can create the files for components and services manually.
使用Angular CLI不是强制性的。 我在这里使用Angular CLI,因为它易于使用且易于使用。 如果您不想使用CLI,则可以手动创建组件和服务的文件。

Navigate to the ngComputerVision\ClientApp folder in your machine and open a command window. We will execute all our Angular CLI commands in this window.

导航到计算机中的ngComputerVision \ ClientApp文件夹,然后打开一个命令窗口。 我们将在此窗口中执行所有Angular CLI命令。

创建客户端模型 (Create the client-side models)

Create a folder called models inside the ClientApp\src\app folder. Now we will create a file availablelanguage.ts in the models folder. Put the following code in it.

ClientApp\src\app文件夹内创建一个名为models的文件夹。 现在,我们将在models文件夹中创建一个文件availablelanguage.ts 。 将以下代码放入其中。

export class AvailableLanguage {languageID: string;languageName: string;
}

Similarly, create another file inside the models folder called ocrresult.ts. Put the following code in it.

同样,在models文件夹内创建另一个文件ocrresult.ts 。 将以下代码放入其中。

export class OcrResult {language: string;detectedText: string
}

You can observe that both these classes have the same definition as the DTO classes we created on the server-side. This will allow us to bind the data returned from the server directly to our models.

您可以观察到这两个类与我们在服务器端创建的DTO类具有相同的定义。 这将使我们能够将从服务器返回的数据直接绑定到我们的模型。

创建计算机视觉服务 (Create the Computervision Service)

We will create an Angular service which will invoke the Web API endpoints, convert the Web API response to JSON and pass it to our component. Run the following command.

我们将创建一个Angular服务,该服务将调用Web API端点,将Web API响应转换为JSON并将其传递给我们的组件。 运行以下命令。

ng g s services\Computervision

This command will create a folder name as services and then create the following two files inside it.

此命令将创建一个文件夹名称作为服务,然后在其中创建以下两个文件。

  • computervision.service.ts — the service class file.

    computervision.service.ts —服务类文件。
  • computervision.service.spec.ts — the unit test file for service.

    computervision.service.spec.ts-服务的单元测试文件。

Open computervision.service.ts file and put the following code inside it.

打开computervision.service.ts文件,并将以下代码放入其中。

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';@Injectable({providedIn: 'root'
})
export class ComputervisionService {baseURL: string;constructor(private http: HttpClient) {this.baseURL = '/api/OCR';}getAvailableLanguage() {return this.http.get(this.baseURL).pipe(response => {return response;});}getTextFromImage(image: FormData) {return this.http.post(this.baseURL, image).pipe(response => {return response;});}
}

We have defined a variable baseURL which will hold the endpoint URL of our API. We will initialize the baseURL in the constructor and set it to the endpoint of the OCRController.

我们定义了一个变量baseURL,它将保存我们API的端点URL。 我们将在构造函数中初始化baseURL并将其设置为OCRController的端点。

The getAvailableLanguage method will send a Get request to the GetAvailableLanguages method of the OCRController to fetch the list of supported languages for OCR.

getAvailableLanguage方法会发送一个GET请求到GetAvailableLanguages的方法OCRController获取用于OCR支持的语言列表。

The getTextFromImage method will send a Post request to the OCRController and supply the parameter of type FormData. It will fetch the detected text from the image and language code of the text.

getTextFromImage方法将向OCRController发送一个Post请求,并提供FormData类型的参数。 它将从图像和文本的语言代码中获取检测到的文本。

创建Ocr组件 (Create the Ocr component)

Run the following command in the command prompt to create the OcrComponent.

在命令提示符下运行以下命令以创建OcrComponent

ng g c ocr --module app

The --module flag will ensure that this component will get registered at app.module.ts.

--module标志将确保此组件将在app.module.ts注册。

Open ocr.component.html and put the following code in it.

打开ocr.component.html并将以下代码放入其中。

<h2>Optical Character Recognition (OCR) using Angular and Azure Computer Vision Cognitive Services</h2><div class="row"><div class="col-md-5"><textarea disabled class="form-control" rows="10" cols="15">{{ocrResult?.detectedText}}</textarea><hr /><div class="row"><div class="col-sm-5"><label><strong> Detected Language :</strong></label></div><div class="col-sm-6"><input disabled type="text" class="form-control" value={{DetectedTextLanguage}} /></div></div></div><div class="col-md-5"><div class="image-container"><img class="preview-image" src={{imagePreview}}></div><input type="file" (change)="uploadImage($event)" /><p>{{status}}</p><hr /><button [disabled]="loading" class="btn btn-primary btn-lg" (click)="GetText()"><span *ngIf="loading" class="spinner-border spinner-border-sm mr-1"></span>Extract Text</button></div>
</div>

We have defined a text area to display the detected text and a text box for displaying the detected language. We have defined a file upload control which will allow us to upload an image. After uploading the image, the preview of the image will be displayed using an <img> element.

我们定义了一个文本区域来显示检测到的文本,并定义一个文本框来显示检测到的语言。 我们定义了一个文件上传控件,它将允许我们上传图像。 上载图像后,将使用<img>元素显示图像的预览。

Open ocr.component.ts and put the following code in it.

打开ocr.component.ts并将以下代码放入其中。

import { Component, OnInit } from '@angular/core';
import { ComputervisionService } from '../services/computervision.service';
import { AvailableLanguage } from '../models/availablelanguage';
import { OcrResult } from '../models/ocrresult';@Component({selector: 'app-ocr',templateUrl: './ocr.component.html',styleUrls: ['./ocr.component.css']
})
export class OcrComponent implements OnInit {loading = false;imageFile;imagePreview;imageData = new FormData();availableLanguage: AvailableLanguage[];DetectedTextLanguage: string;ocrResult: OcrResult;DefaultStatus: string;status: string;maxFileSize: number;isValidFile = true;constructor(private computervisionService: ComputervisionService) {this.DefaultStatus = "Maximum size allowed for the image is 4 MB";this.status = this.DefaultStatus;this.maxFileSize = 4 * 1024 * 1024; // 4MB}ngOnInit() {this.computervisionService.getAvailableLanguage().subscribe((result: AvailableLanguage[]) => this.availableLanguage = result);}uploadImage(event) {this.imageFile = event.target.files[0];if (this.imageFile.size > this.maxFileSize) {this.status = `The file size is ${this.imageFile.size} bytes, this is more than the allowed limit of ${this.maxFileSize} bytes.`;this.isValidFile = false;} else if (this.imageFile.type.indexOf('image') == -1) {this.status = "Please upload a valid image file";this.isValidFile = false;} else {const reader = new FileReader();reader.readAsDataURL(event.target.files[0]);reader.onload = () => {this.imagePreview = reader.result;};this.status = this.DefaultStatus;this.isValidFile = true;}}GetText() {if (this.isValidFile) {this.loading = true;this.imageData.append('imageFile', this.imageFile);this.computervisionService.getTextFromImage(this.imageData).subscribe((result: OcrResult) => {this.ocrResult = result;if (this.availableLanguage.find(x => x.languageID === this.ocrResult.language)) {this.DetectedTextLanguage = this.availableLanguage.find(x => x.languageID === this.ocrResult.language).languageName;} else {this.DetectedTextLanguage = "unknown";}this.loading = false;});}}
}

We will inject the ComputervisionService in the constructor of the OcrComponent and set a message and the value for the max image size allowed inside the constructor.

我们将把ComputervisionService注入OcrComponent的构造函数中,并设置一条消息和该构造函数中允许的最大图像大小的值。

We will invoke the getAvailableLanguage method of our service in the ngOnInit and store the result in an array of type AvailableLanguage.

我们将在ngOnInit调用服务的getAvailableLanguage方法,并将结果存储在AvailableLanguage类型的数组中。

The uploadImage method will be invoked upon uploading an image. We will check if the uploaded file is a valid image and within the allowed size limit. We will process the image data using a FileReader object. The readAsDataURL method will read the contents of the uploaded file.

上传图像后将调用uploadImage方法。 我们将检查上传的文件是否为有效图像,并且是否在允许的大小限制内。 我们将使用FileReader对象处理图像数据。 readAsDataURL方法将读取上载文件的内容。

Upon successful completion of the read operation, the reader.onload event will be triggered. The value of imagePreview will be set to the result returned by the fileReader object, which is of type ArrayBuffer.

成功完成读取操作后,将触发reader.onload事件。 imagePreview的值将设置为imagePreview对象返回的结果,该对象的类型为ArrayBuffer

Inside the GetText method, we will append the image file to a variable for type FormData. We will invoke the getTextFromImage of the service and bind the result to an object of type OcrResult. We will search for the language name from the array availableLanguage, based on the language code returned from the service. If the language code is not found, we will set the language as unknown.

GetText方法内部,我们将图像文件追加到FormData类型的变量中。 我们将调用服务的getTextFromImage并将结果绑定到OcrResult类型的对象。 我们将根据服务返回的语言代码从availableLanguage数组中搜索语言名称。 如果找不到语言代码,我们会将语言设置为未知。

We will add the styling for the text area in ocr.component.css as shown below.

我们将在ocr.component.css中为文本区域添加样式,如下所示。

.preview-image {max-height: 300px;max-width: 300px;
}.image-container{display: flex;padding: 15px;align-content: center;align-items: center;justify-content: center;border: 2px dashed skyblue;
}

We will add the navigation links for our components in the nav menu. Open nav-menu.component.html and remove the links for Counter and Fetch data components. Add the following lines in the list of navigation links.

我们将在导航菜单中添加组件的导航链接。 打开nav-menu.component.html并删除“计数器”和“获取”数据组件的链接。 在导航链接列表中添加以下行。

<li class="nav-item" [routerLinkActive]="['link-active']"><a class="nav-link text-dark" routerLink='/computer-vision-ocr'>Computer Vision</a>
</li>

执行演示 (Execution Demo)

Press F5 to launch the application. Click on the Computer Vision button on the nav menu at the top. You can upload an image and extract the text from the image as shown in the image below.

按F5启动应用程序。 单击顶部导航菜单上的“计算机视觉”按钮。 您可以上传图像并从图像中提取文本,如下图所示。

摘要 (Summary)

We have created an optical character recognition (OCR) application using Angular and the Computer Vision Azure Cognitive Service. The application is able to extract the printed text from the uploaded image and recognizes the language of the text. The OCR API of the Computer Vision is used which can recognize text in 25 languages.

我们已经使用Angular和Computer Vision Azure认知服务创建了光学字符识别(OCR)应用程序。 该应用程序能够从上载的图像中提取打印的文本,并识别文本的语言。 使用了Computer Vision的OCR API,它可以识别25种语言的文本。

I just released a free eBook on Angular and Firebase. You can download the free book from Build a Full-Stack Web Application Using Angular & Firebase

我刚刚发布了有关Angular和Firebase的免费电子书。 您可以从使用Angular和Firebase构建全栈Web应用程序中下载免费书籍

也可以看看 (See Also)

  • Template-Driven Form Validation In Angular

    Angular中模板驱动的表单验证

  • Reactive Form Validation In Angular

    Angular的React形式验证

  • Continuous Deployment For Angular App Using Heroku And GitHub

    使用Heroku和GitHub持续部署Angular App

  • Policy-Based Authorization In Angular Using JWT

    使用JWT在Angular中基于策略的授权

  • Optical Character Reader Using Blazor And Computer Vision

    使用Blazor和计算机视觉的光学字符读取器

If you like the article, share with you friends. You can also connect with me on Twitter and LinkedIn.

如果您喜欢这篇文章,请与您的朋友分享。 您也可以在Twitter和LinkedIn上与我联系。

翻译自: https://www.freecodecamp.org/news/how-to-create-an-optical-character-reader-using-angular-and-azure-computer-vision/

angular过滤字符

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Protractor(angular定制的e2e)的简易入门

    这周项目终于上了e2e的测试&#xff0c;之前一直都没有测试的概念。 感谢我的领导和同志引入这样的理念和思想。 多的不说。 具体的环境搭建可以参考 http://jackhu.top/article/5607fa9d10f611091d0933c3 我就具体说说用的一些方法和经验吧 browser.getTitle() //获取文件标题…...

    2024/5/9 15:02:02
  2. 在NativeScript-angular应用中使用本地设备剪切板

    当我刚开始学习nativescript我建立了一个以本地设备剪贴板复制和粘贴&#xff0c;虽然没有什么真正改变剪贴板功能。 我们将看到如何直接复制粘贴在angular&#xff0c;TypeScript建立了一个NativeScript应用程序&#xff0c; 这将是一个非常简单的应用程序&#xff0c;但为了让…...

    2024/4/20 1:33:32
  3. 欧式双眼皮可以改吗

    ...

    2024/5/9 15:13:59
  4. angular js 使用pdf.js_胶水(框架) Stencil.js

    去年的同一时间&#xff0c;我写了那篇《前端下半场&#xff1a;构建跨框架的 UI 库》推荐了 Stencil.js&#xff0c;当时是在项目的试验期。而 Stencil.js 已经在今年&#xff08;2019 &#xff09;的 6 月份&#xff0c;推出了 1.0 正式版&#xff0c;这意味着你已经可以开始…...

    2024/4/20 19:36:25
  5. angular单元测试与自动化UI测试实践

    关于本文&#xff1a;介绍通过karma与jsmine框架对angular开发的应用程序进行单元与E2E测试。 angular单元测试与集成测试实践 先决条件创建项目 webstorm中创建空白web项目创建html、js文件夹安装框架 安装前端框架 1) 安装bower包管理器2) 初始化bower.json文件3) 安装angula…...

    2024/4/30 21:34:34
  6. webpack+angular的项目SEED(下)

    webpackangular的项目SEED(上)介绍了项目的构建生产和热编译显示。 介绍 这里就主要来讲测试&#xff0c;敏捷开发好多公司都在做&#xff0c;敏捷开发有许多种方法&#xff0c;但不管采用那一种方法&#xff0c;测试都是必须的&#xff0c;验证代码&#xff0c;验证功能&#…...

    2024/5/6 23:18:39
  7. 几年前做过埋线双眼皮现在想做韩式3点

    ...

    2024/4/20 19:36:20
  8. ArcFace Additive Angular Margin Loss for Deep Face Recognition 阅读笔记

    这篇论文的成果在 MegaFace 百万人脸识别挑战中&#xff0c;获得了state-of-art的效果&#xff0c;可以说是CNN在人脸领域的又一进步。它的优势主要有3点&#xff1a; 使用了Additive Angular Margin,在对feature 和 weights进行了L2 normalization的基础上&#xff0c;再计算…...

    2024/5/8 5:15:43
  9. angular自动化测试--protractor

    前戏 面向模型编程&#xff1b; 测试驱动开发&#xff1b; 先保障交互逻辑&#xff0c;再调整细节。---by 雪狼。 为什么要自动化测试&#xff1f; 1&#xff0c;提高产出质量。 2&#xff0c;减少重构时的痛。反正我最近重构多了&#xff0c;痛苦经历多了。 3&#xff0c;便于…...

    2024/4/20 19:36:18
  10. AngularJS浏览缩放图片

    近期开发APP采用AngularJSionic,要使用到浏览图片&#xff0c;在网上查阅文档比较推荐的一种方式是ng-flow-master&#xff0c;github地址为&#xff1a;https://github.com/jsypsy/ng-flow-master 有些不足之处是图片大小无法进行缩放&#xff0c;是原图大小进行显示&#xf…...

    2024/4/20 19:36:17
  11. 给 Web 开发者的 25 款最有用的 AngularJS 工具

    转自&#xff1a;http://www.oschina.net/news/60200/bestl-angularjs-tools AngularJS 是一种新 JavaScript 框架&#xff0c;目的是降低要求&#xff0c;加快开发速度。AngularJS 是让 HTML 标记动态&#xff0c;使其对 web 开发者更有帮助&#xff0c;同时从大量的分段中给…...

    2024/4/20 19:35:58
  12. angular4总结项目中的知识点-leaflet相关调用,组件传值看下一章

    1. ng-template 是angular4中的用于获取#id的值&#xff0c;例子如下&#xff1a; <ng-template let-col let-monitor"rowData" pTemplate"body"><input #chk type"checkbox" (change)"regularChecked(monitor,chk)" />&…...

    2024/4/20 19:35:56
  13. Angular12 学习angular2前的热身准备

    1 ECMA European Computer Manufactures Association 这个组织的目标是评估&#xff0c;开发和认可电信和计算机标准。 百度百科&#xff1a;点击前往 ECMA65&#xff1a;满足ECMA标准的第五代JavaScript&#xff0c;所有浏览器都支持 ECMAS6&#xff1a;满足ECMA标准的第六代…...

    2024/4/20 19:35:54
  14. 四点定位双眼皮原理

    ...

    2024/4/20 19:35:53
  15. Ionic Gallery 图片预览简单教程

    Ionic Gallery 主要应用在ionic angularJs中&#xff0c;理论上支持热门的框架。话不多说&#xff0c;直接开始吧&#xff1a; 引入文件 <link href"lib/ion-gallery/dist/ion-gallery.css" rel"stylesheet"> <script src"lib/ion-galle…...

    2024/4/20 19:31:12
  16. 基于ngx-echarts和angular-gridster2 做的基于dashboard例子

    ###配置相关看下面的链接 https://xieziyu.github.io/ngx-echarts/api-doc/index.html api关于ngx-echarts https://xieziyu.github.io/ngx-echarts/#/demo/map/hongkong-pd demo关于ngx-echarts https://github.com/tiberiuzuld/angular-gridster2 api关于angular-gridster2 h…...

    2024/4/20 19:31:11
  17. 保存指定DOM为图片

    1.引入一个js html2canvas.js&#xff0c;已上传我的资源 https://download.csdn.net/download/qq_21987433/12153897 2.html DOM提供 <div id"Authbook" style"background-color: #fff;width: 100%"><div id"inBox" ><p>&l…...

    2024/5/1 4:14:28
  18. angular2中使用html2canvas将数据导出为图片,并下载本地

    1、安装html2canvas npm install --save html2canvas 官方网站https://html2canvas.hertzen.com/ 2、在需要的组件中引入html2canvas // 导入整个模块的内容 import * as html2canvas from html2canvas; 3、定义方法&#xff0c;将数据转换为canvas // #mainTable是数据表格的i…...

    2024/4/20 19:31:09
  19. 孝感沈阳双眼皮哪好

    ...

    2024/5/9 6:42:00
  20. ionic实现长图显示与双指缩放

    html代码 <ion-content class"has-header"><ion-scroll direction"xy" class"msg-file" style"height:100%" zooming"true" min-zoom"1" max-zoom"2" overflow-scroll"false">…...

    2024/4/20 19:35:51

最新文章

  1. C/C++ 初级球球大作战练手

    效果演示&#xff1a; https://live.csdn.net/v/385490 游戏初始化 #include <stdbool.h> #include<stdio.h> #include<stdlib.h> #include<time.h> #include<graphics.h> #include <algorithm> #include<math.h> #include<mmsy…...

    2024/5/9 16:05:53
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/7 10:36:02
  3. 阿里云8核32G云服务器租用优惠价格表,包括腾讯云和京东云

    8核32G云服务器租用优惠价格表&#xff0c;云服务器吧yunfuwuqiba.com整理阿里云8核32G服务器、腾讯云8核32G和京东云8C32G云主机配置报价&#xff0c;腾讯云和京东云是轻量应用服务器&#xff0c;阿里云是云服务器ECS&#xff1a; 阿里云8核32G服务器 阿里云8核32G服务器价格…...

    2024/5/9 5:08:35
  4. 自定义OPPO-r9s的kernel内核,并开启安卓支持docker

    0. 版本说明 本文提供了OPPO手机r9s的内核编译方法&#xff0c;并开机支持docker。用的是开源lineage14.1的rom。 我这边基于开源lineage14.1&#xff0c;打了一个docker内核编译镜像(17380582683/r9s)&#xff0c;大家可以在容器里&#xff0c;手动打出完整的rom包zip文件。…...

    2024/5/2 2:39:28
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/8 6:01:22
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/9 15:10:32
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/9 4:20:59
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/7 11:36:39
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/8 20:48:49
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/7 9:26:26
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/8 19:33:07
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/8 20:38:49
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/9 7:32:17
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57