Posts

Extract string from image using pytesseract

Image
I am a newbie on OCR manipulation and extraction data from images. After searching for solution I did find some code but it didn't work for my use case, it didn't extract correctly all characters, at most 2 of them. I want to get the characters on this image: I tried this solution: image = cv2.imread('./images/screenshot_2023_11_16_15_41_24.png') # Assuming 4 characters in a 36x9 image char_width = image.shape[1] // 4 char_height = image.shape[0] characters = [] characters_slices = [(0, 9), (9, 18), (18, 27), (27, 36)] # Adjust based on your image for start, end in characters_slices: char = image[0:char_height, start:end] characters.append(char) # Perform OCR on each character extracted_text = "" for char in characters: char_text = pytesseract.image_to_string(char, config='--psm 10 --oem 3 -c char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') extracted_text += char_text.strip() + " " print("Extracted Text:...

Makefile won't find *.lib but path is declared

I am trying to compile a plugin example for a software from autodesk. here is the Makefile ############################################################################## # Makefile for use by API developers # # # # NOTE: "vcvarsall amd64" must be run before attempting to compile the API # # examples. Please see the API documentation for information. # # # ############################################################################## # # If the location of the Alias libraries and header files are # different from $ALIAS_LOCATION, set it here. # ALIAS_LOCATION=C:\Program Files\Autodesk\AliasSurface2023.0 CPPEXAMPLES = cppCube.exe EXAMPLES = $(CPPEXAMPLES) CC = cl.exe CPLUSPLUS = cl.exe LINK = link.exe INCLUDES = /I. /I"$(ALIAS_LOCATION)\ODS\Common\include" ...

Building correct API query URL to filter data from clinicaltrials.gov by multiple keywords

Image
I am trying to get some data from a public API and need some help figuring out the correct query syntax for the request URL. Below is my script. (Never mind fixing or improving the function, it is working well enough so far.) What I need is the correct query URL. I would like to get a list of clinical studies from clinicaltrials.gov for search term "EGFR", but narrow the search down so that only results are returned that have "Recruiting" OR "Active, not recruiting" in the "OverallStatus" field. Here are the possible values for the "OverallStatus" field. I am having a hard time figuring out the API docs. There is a page with Search Expressions and Syntax , but they don't explain how to search for multiple values. How do I build the query string to search for multiple possible values in a field? I appreciate any insights! library(tidyverse) library(httr) library(jsonlite) library(glue) get_studies_df <- function(query_url...

NextJS 13 in Azure: process.env.{SETTING_NAME} in server components is undefined

I upgraded to NextJS v13 from v12. I thought components inside the src/app folder are server components by default but when I try to use the values from process.env after deploying with Azure, its returning undefined for those configuration settings. It works when I run it locally maybe because those settings are in a .env file but after deployment it should get it from the Azure configuration settings. Here is the sample page: src/app/page.tsx import SampleClientView from '@components/components/client/SampleClientView'; // This has 'use client'; const SamplePage = () => { const configOne = process.env.CONFIG_ONE; const configTwo = process.env.CONFIG_TWO; return ( <SampleClientView configOne={configOne} configTwo={configTwo} /> ); }; export default SamplePage;

LINQ Exception when Lists of Documents containing Lists - Querying MongoDB Entity Framework Core

We are doing some development on the EF Core Library for MongoDB. It's in preview, so I'm trying to work out if this is a bug or a feature (or lack of a feature). We are not doing any queries on these elements yet, but when the problematic collection is queried, if the problematic element is defined, we're running into problems. public class Template { public ObjectId _id { get; set; } public string name { get; set; } public bool inheritFrom { get; set; } public List<CallRound> callRounds { get; set; } //this is a list of sub documents with a list, it complains public Qualifier qualifiers { get; set; } // this is a sub document with a list, it doesn't complain } public class CallRound { public List<CollectionReference>? jobQualifiers { get; set; } //this is the offender, if we comment out this code, the query functions public bool isOvertime { get; set; } public bool offerOrientedOnly { get; set; } public string gend...

Deploy Container App from Bitbucket to Azure

Image
I have a Bitbucket repository which builds my code with a pipeline and pushes a docker image to Docker Hub . So far, so good. Now I want to continues deploy the latest image to my Container App on Azure. My options seems to be: Setup Continuous Deployment in Azure Create a pipeline step in bitbucket to push the new image created to Azure with Azure CLI My problem with 1. is that it seems to be only support for GitHub with it required. And my problem with 2. is that it doesnt look like Atlassian has this supported Which leaves me with some costum created pipeline where Im suppose to do this with Azure CLI where Im way out of my depth. Does anyone have a suggestion to how I can automaticly update my Container App?

Error saying "git is not installed" but it actually is [closed]

This error appears in the cmd window Image of error when I try to run "gradlew.bat" from the baritone repository "https://ift.tt/Qq6blna". Also it is definitely not the file's fault because other people don't have this issue. I tried running the gradlew.bat file and expected it to create/build a "dist" folder which is supposed to contain artifacts aka .jar files of the MC mod baritone, result is it didn't get created. File of gradlew.bat https://pastebin.com/FEzqR9FR code ` @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, ...