A combination of Azure Cosmos DB, Azure Logic Apps, and AI can store and analyze images effectively. Here is an overview of how these services can work together:
- Azure Cosmos DB: Azure Cosmos DB is a globally distributed, multi-model database service provided by Microsoft Azure. It offers low-latency, scalable storage for structured and unstructured data, including images. You can use Azure Cosmos DB to store and manage your image data efficiently, with features such as automatic indexing and global replication for high availability.
- Azure Logic Apps: Azure Logic Apps is a cloud-based service that allows you to create custom workflows and automate business processes. You can use Logic Apps to build an end-to-end image processing pipeline. For example, you can create a Logic App that monitors a specific storage location for new image uploads, triggers automated image analysis, and performs subsequent actions based on the results.
- AI Services: Azure provides various AI services that can integrated into your image processing pipeline. You can leverage Azure Cognitive Services, specifically the Computer Vision API, for image analysis. Computer Vision API offers pre-trained models to analyze images for features like object recognition, image classification, face detection, and more. You can use this API within your Logic App workflows to extract valuable insights from your images.
Cognitive Service and Image Quality
Go to the Azure portal, and there is Cognitive service, a prebuilt model that reads a JPEG image and gives you a Json of the actual document that comes out. Store this in the Cosmos DB. We have a Logic app connecting to a Storage account to get there. The Storage account is where you put the images. Next, there is an API connection to go to the Storage account. It connects to Outlook and Cognitive services computer vision. We will dive into this with Mail as an example.
Step 1. Go to the Azure portal.
Step 2. In the dashboard, go to ReadMail.
Step 3. Click on the Logic app designer under Development Tools.
In the Cognitive service, every time there is a new piece of mail that arrives in a specific folder. It grabs all of the attachments in that folder. For each attachment, it creates a blob entry. The Cognitive service can find and read an image stored in a physical or virtual location. So, the trigger here is number one it goes into a folder in your mail, and that folder then triggers another task which grabs all attachments and puts them into storage. Each time a new attachment goes into blob storage, that triggers a Cognitive Service Task and gets the blob content. It processes each image if it is a JPEG image. Some of the attachments in the mail are not JPEG images, and Cognitive Services doesn’t know what to do with them, and the Logic app component will break. So, make sure there is a JPEG image and use the pre-build model OCR to convert to a JSON file for each JPEG image.
For some images, it will not get converted to a JSON file. Then, you have to create or update documents for the Cosmos DB task. The Cosmos DB task puts the image values that could be pulled out from the JSON into a Cosmos DB item.
In Cosmos DB, we use a partition value of JPEG so it just uses the media type and is always the same. When you use Cosmos DB, you need an ID and a partition key value. If we look at the Cosmos DB, we can see the image programmatically displayed. Then, connect to Outlook as a source for reading the Cognitive Services and for security. To work this setup with Azure you have to connect between Azure services. Outlook is not considered part of those services, so authenticate with Outlook and give more access to Outlook. The easiest way to do it was to reach out to Outlook, get the attachments, put them in storage, and then everything is inside Azure. And you can manipulate without worrying about any extra authentication.
Conclusion
You can create a robust and automated system to store and analyze images by incorporating Azure Cosmos DB, Azure Logic Apps, and AI services like Computer Vision API. This combination of services empowers you to extract valuable insights and automate actions based on the content of the images.
Metclouds Technologies help you to create a robust and automated system to store and analyze images.