Issue I’m implementing color quantization based on k-means clustering method on some RGB images. Then, I will determine the performance the algorithm. I found some information about training and testing. As I understand, I should divide the samples of images
Continue readingTag: image-processing
Save normalized tensor to png in a loop using pytorch
Issue I am working on a GAN and cannot make it work to save images that I transformed into tensors back to “normal” pngs within a loop. The same goes for the tensors that are generated by the Generator. I
Continue readingHow To Compress the Images In Python without Resize or image cropping
Issue I have an image processing problem and 100 image dataset. now im trying to reduce the image pixel size , that means converting the larger images to smaller image pixel size(not cropping). Im already trying some python code ,
Continue readingHow to scan a DPM datamatrix from a mobile app
Issue I’m trying to leverage ZXing in an Android app to scan data matrixes. So far I’m successful with printed data matrixes such as this: But other data matrixes printed by laser or punched have circle-looking marks instead of square-looking
Continue readingHow to merge two image in Xamarin Forms?
Issue I’m developing a Xamarin Forms iOS app. In the xaml file, there is a grid. <Grid x:Name=”QrCodeSite” HeightRequest=”300″ Margin=”37, 37, 37, 0″> <Grid.RowDefinitions> <RowDefinition Height=”*” /> </Grid.RowDefinitions> </Grid> In the related .cs file, I use ZXing.Net.Mobile.Forms to generate a
Continue readingZxing not scanning certain Data Matrix codes
Issue Hi I am able to read some 2d datamatrix barcode images downloaded from internet using Zxing library but not able to read images taken from my high resolution colored camera images. Now I am converting them into black and
Continue readingHow to adjust parameter of SVM for better training
Issue I am working on a Linear SVM and I am using Opencv with Python, I am trying to adjust the parameters for better training but still not getting the good results, I am feeling that I am going through
Continue readingPytorch – Should 'CenterCrop' be used to test set? Does this count as cheating?
Issue I’m learning image classification with Pytorch. I found some papers code use ‘CenterCrop’ to both train set and test set,e.g. Resize to larger size,then apply CenterCrop to obtain a smaller size. The smaller size is a general size in
Continue readingwhat does class_mode parameter in Keras image_gen.flow_from_directory() signify?
Issue train_image_gen = image_gen.flow_from_directory(‘/Users/harshpanwar/Desktop/Folder/train’, target_size=image_shape[:2], batch_size=batch_size, class_mode=’binary’) In the above code snippet what does class_mode=’binary’ signify. I think it is for the number of categories of images. I am using this code for training a image recognition classifier in Keras
Continue readingopencv createsamples has no error, but no samples found
Issue I’m using this tutorial, and I’m on the stage of creating lots of samples from my positive images. I’m using Windows. This is the command: perl bin/createsamples.pl positives.txt negatives.txt samples 1500\ “C:\opencv_built\bin\Release\opencv_createsamples.exe -bgcolor 0 -bgthresh 0 -maxxangle 1.1\ -maxyangle
Continue readingHow to read/import training and testing images for multiclassification from a zipped folder in google colab? gdrive already mounted to gcolab
Issue I am fairly new to machine learning and deep learning. I am doing a student project wherein I am doing multiclassification image processing. Since, I do not have the recommended nVIDIA gpu for tensorflow (cannot buy it atm either),
Continue readingWhy do my train_generator and val_generator produce the same picture?
Issue I set aside a validation split like below: val_samples = 60 train_imgs = coco_imgs[:-val_samples] train_masks = coco_masks[:-val_samples] val_imgs = coco_imgs[-val_samples:] val_masks = coco_masks[-val_samples:] My train_imgs and val_imgs show different pictures: fig, ax = plt.subplots(ncols =2, figsize = (10,3), sharex
Continue readingUsing Local Binary Patterns with a Circular Mask
Issue In order to extract texture-based features; LBPs (Local Binary Patterns) are used in many background-foreground detection algorithms. It is easy to understand why those features are tolerant against the illumination. However; there is one of their structural properties that
Continue readingdivide image into two equal parts python opencv
Issue can someone tell me how to implement a bisection of the image into upper and lower part? so that I could overlap them. for example, I have an image and I should divide it to calculate a number of
Continue readingBox function with 11 elements
Issue There is an image and it is blurred horizontally with an 11 element box filter. My question is: how can the box filter be 11 elements? And since it says horizontal direction here, could it be a kernel 11
Continue readingEstimating distance from camera to ground plane point
Issue How can I calculate distance from camera to a point on a ground plane from an image? I have the intrinsic parameters of the camera and the position (height, pitch). Is there any OpenCV function that can estimate that
Continue readingDetermine if a point is inside or outside of a shape with opencv
Issue I have images with white background and simple shapes in them (each image has one shape). I want to determine if a certain point (x,y) is inside the shape or not. How can I do that with opencv? Solution
Continue readingIs there any Difference of Gaussians function in Matlab?
Issue I am new to Image Processing, and in my experiment I am having difficulty with Difference of Gaussians. Various implementation were given to me but I don’t understand them and their parameters. Here are my formulas Should I implement
Continue readingAutomatically cropping an image with python/PIL
Issue Can anyone help me figure out what’s happening in my image auto-cropping script? I have a png image with a large transparent area/space. I would like to be able to automatically crop that space out and leave the essentials.
Continue readingHow to properly use pre-trained CNN for image prediction on a folder of images
Issue I am trying to build a CNN model and use it on 2833 images to see if it can predict a selection (of my own choice) of three features and the popularity score from a tabular dataset. So far
Continue readingArmadillo porting imagesc to save image bitmap from matrix
Issue I have this matlab code to display image object after do super spectrogram (stft, couple plca…) t = z2 *stft_options.hop/stft_options.sr; f = stft_options.sr*[0:size(spec_t,1)-1]/stft_options.N/1000; max_val = max(max(db(abs(spec_t)))); imagesc(t, f, db(abs(spec_t)),[max_val-60 max_val]); And get this result: I was porting to C++
Continue readingShow the center coordinate of the object tracking bounding box
Issue I would like to know how I can print the tracking coordinate rectangle onto the video. I want the coordinate of the center point of the rectangle and, of course, I want: if the tracker is moving, the coordinate
Continue readingHow do I crop an image using C#?
Issue How do I crop an image using C#? Solution You can use Graphics.DrawImage to draw a cropped image onto the graphics object from a bitmap. Rectangle cropRect = new Rectangle(…); Bitmap src = Image.FromFile(fileName) as Bitmap; Bitmap target =
Continue readingHow to connect disjointed lines or edges in images?
Issue I am currently working on lines extraction from a binary image. I initially performed a few image processing steps including threshold segmentation and obtained the following binary image. As can be seen in the binary image the lines are
Continue readingHow to connect broken lines that cannot be connected by erosion and dilation?
Issue I have an image like this that has multiple stoppers and some of the lines are broken. To connect this broken line, I used a morphological operation like this: import cv2 import numpy as np img = cv2.imread(‘sample.png’, cv2.IMREAD_GRAYSCALE)
Continue readingHow to add a row of pixels at the bottom and to the right of an image?
Issue So Im experiencing an issue with a framework that Im working with, where the images sort of get translated by 1 pixel downwards and one pixel to the left (making the pixel data wrong). To counteract this I would
Continue readingReading .PNGs, how do you identify clusters of color and rewrite the image file so that every cluster has a unique RGB code?
Issue Continued from this question: How could you rewrite a list of lists so that "islands" of values are unique from one another? Brief: How would you parse an image, for example: in such a way that you identify the
Continue readingHow to ignore external list in case of lists in list(without using Numpy)
Issue I writing a function that its input is- image_one, image_two, mask). This function outputs a new image by calculating every new pixel according to the formula- new_image[i][j] = round(image_one[i][j] x mask[i][j] + image_two[i][j] x (1 – mask[i][j])) I wrote
Continue readingnormalize image with opencv in c++?
Issue I have a TfLite model that takes a standardized float32 image as an input, the pixel range should convert from the [0~255] to [-1~1] I wrote a demo function but it didn’t work. I couldn’t set the color value
Continue readingOpenCV output monochrome TIFF group 4 compression
Issue Is there a way to output monochrome TIFF files in OpenCV with group 4 compression? This is the command to do it with imagemagick/graphicsmagick ‘gm convert ‘.$file.’ -type bilevel -monochrome -compress group4 ‘.$output OpenCV version 4.5.1 update # g++
Continue readingHow to average every 50 values inside a larger matrix in Python
Issue I have an array of 7000 images and those images are of size 224x224x3. Therefore the entire matrix shape is (7000, 224, 224, 3). What I want to do is select every 50 images and calculate their mean obtaining
Continue readingAlternatives for Error level Analysis (ELA)
Issue I am working on Image processing with deep learning and I came on to the topic Error level Analysis which gives/shows the difference in compression level(I’m trying to show if the image as gone under multiple compressions or not)
Continue readingApplying a gradient map from image to another image with transparency in Python (PIL, numpy, etc)
Issue I’ve been struggling with trying to apply a gradient map which is sourced from an image file to a grayscale image which includes alpha/transparency. The following includes the source image and the gradient map image. I first attempted this
Continue readingProgrammatically generate image layout
Issue I’d like to create a python script that would receive some text and photos, arrange and compose them following some rules, and output a final image. To do so, I would need a python library that could: Read, scale
Continue readingIssues in encrypting a string in binary form and embed in image matlab
Issue I was working on a project that encrypts a string and embeds it in the image, how I do is by making it binary. My program fully worked when I generated random data using the rand() function, but when
Continue readinggenerate thumbnail for every image in folder
Issue I am trying to write a bash script that generates small thumbnail versions for every image in a folder, so I can use it for more efficient image loading in react. The selected answer from this question I have
Continue readingHow is the smooth dice loss differentiable?
Issue I am training a U-Net in keras by minimizing the dice_loss function that is popularly used for this problem: adapted from here and here def dsc(y_true, y_pred): smooth = 1. y_true_f = K.flatten(y_true) y_pred_f = K.flatten(y_pred) intersection = K.sum(y_true_f
Continue readingImage Comparison not working with Camera captured images
Issue [![enter image description here][1]][1][![enter image description here][2]][2]I am working on comparing two images for differences. Problem is that it works fine when I download some image from web, but not work when I tried to compare images which are
Continue readingFinding corners of box and crop Image
Issue Hey Guys I am working with numpy and opencv and want to get a image cropped by the contours of it. Here is one example what picture i want to crop by the edges, And i want that the
Continue readingValueError: too many values to unpack (expected 4) during ORB detection
Issue I’m detecting Unicode words on a starscape background. They all look a little like the example images below. I have a folder with 183 images, if any of those images are detected I want to click a button on
Continue readingDirect access to a single pixel using Python
Issue Is there any way with Python to directly get (only get, no modify) a single pixel (to get its RGB color) from an image (compressed format if possible) without having to load it in RAM nor processing it (to
Continue readingPixel manipulation in Numpy
Issue I want to convert all pixel values 0 instead of the value of 255. Pixel values are kept in Numpy array, namely x and: x.shape = (100, 1, 256, 256) How to manipulate arrays with the condition? I tried
Continue readingconvert RGB to black and white
Issue The code snippet in Python should convert the rgb image to black and white, but only a black image output. I do not know where the problem is (input and output image should be bmp) from PIL import Image
Continue readingPython making Hologram pyramid
Issue I am studying on hologram vision. I want to placed 4 images onto black screen. I wrote this code: import numpy as np import cv2 from screeninfo import get_monitors if __name__ == ‘__main__’: screen = get_monitors()[0] print(screen) width, height
Continue readingUse OpenCV to identiy hollow and filled circles
Issue I’m using OpenCV houghcircles to identify all the circles (both hollow and filled). Follow is my code: import numpy as np import cv2 img = cv2.imread(‘images/32×32.png’) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) bilateral = cv2.bilateralFilter(gray,10,50,50) minDist = 30 param1 = 30
Continue readingHow to fill a polygon in OpenCV?
Issue The Python code given below draws a triangle, how can I fill it with a color inside? Or another easier way to draw a triangle in OpenCV? pts = np.array([[100,350],[165,350],[165,240]], np.int32) cv2.polylines(img,[pts],True,(0,255,255),2) Solution You have to use cv2.fillPoly(). Illustration
Continue readingChanging the output of a convolutional layer to a tuple of tensors
Issue For processing video frames, I use the squeeze and excitation block for weighting the channels of a convolutional layer. I want to combine (using torch.stack) the channels(feature maps) of a convolutional layer with the weighted channels (by using the
Continue readingDifference between contrast stretching and histogram equalization
Issue I would like to know the difference between contrast stretching and histogram equalization. I have tried both using OpenCV and observed the results, but I still have not understood the main differences between the two techniques. Insights would be
Continue readingHow to remove background and video from facial landmarks
Issue Im using this code to detect teh 468 facial landmarks from a face: import cv2 import mediapipe as mp import time cap = cv2.VideoCapture(0) pTime = 0 mpDraw = mp.solutions.drawing_utils mpFaceMesh = mp.solutions.face_mesh faceMesh = mpFaceMesh.FaceMesh(max_num_faces=2) drawSpec = mpDraw.DrawingSpec(thickness=1,
Continue readingCombining various image channels after gaussian filtering produces white image
Issue I am trying to implement a gaussian filter for an image with dimensions (256, 320, 4). I first generated a gaussian Kernel for the same and then individually perform the convolution on each of the 4 channel, i.e on
Continue readingWhy cv2.write saves black images?
Issue hi folks, greetings am using this code that I found on the web, to apply a wiener filter on an image, the code : from scipy.signal.signaltools import deconvolve from skimage import color, data, restoration img = color.rgb2gray(img) from scipy.signal
Continue readingRotating QR code to the correct position using Python OpenCV
Issue I’m a beginner in python and currently studying QR code detection and decoding. I’m having a hard time rotating the detected QR code to the right position. I already used minAreaRect() to rotate my QR code but it doesn’t
Continue readingBitmap image to base64 conversion
Issue I am trying to convert a bitcode image to base64 format. I tried to code like public static String encodeToBase64(Bitmap image, Bitmap.CompressFormat compressFormat, int quality) { ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream(); image.compress(compressFormat, quality, byteArrayOS); return Base64.encodeToString(byteArrayOS.toByteArray(), Base64.URL_SAFE); } generated
Continue readingHow to recognise adult content programmatically?
Issue I am currently developing a website for a client. It consists of users being able to upload pictures to be shown in a gallery on the site. The problem we have is that when a user uploads an image
Continue readingPython3 'cv2.resizeWindow('img', 500,500)' error
Issue I am trying to run this face tracking program provided here, but running the python program returns; Traceback (most recent call last): File "C:\Users\User\Desktop\Projects\Face Tracking\servo\face.py", line 27, in <module> cv2.resizeWindow(‘img’, 500,500) cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window_w32.cpp:1473: error: (-27:Null pointer) NULL window:
Continue readingPython3 'cv2.resizeWindow('img', 500,500)' error
Issue I am trying to run this face tracking program provided here, but running the python program returns; Traceback (most recent call last): File "C:\Users\User\Desktop\Projects\Face Tracking\servo\face.py", line 27, in <module> cv2.resizeWindow(‘img’, 500,500) cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window_w32.cpp:1473: error: (-27:Null pointer) NULL window:
Continue readingPython3 'cv2.resizeWindow('img', 500,500)' error
Issue I am trying to run this face tracking program provided here, but running the python program returns; Traceback (most recent call last): File "C:\Users\User\Desktop\Projects\Face Tracking\servo\face.py", line 27, in <module> cv2.resizeWindow(‘img’, 500,500) cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window_w32.cpp:1473: error: (-27:Null pointer) NULL window:
Continue readingimage regions corrupt after applying squared filter
Issue I have this image: I am applying a low-pass square filter to that: def SquareFilter(imgShape,size): filterSquare = np.zeros(imgShape) filterSquare[ imgShape[0]//2-size//2 : imgShape[0]//2+size//2, imgShape[1]//2-size//2 : imgShape[1]//2+size//2 ] = 1 return filterSquare im = cv2.imread("Images/wall.jpg",0) freq = np.fft.fft2(im) freq2 = np.fft.fftshift(freq)
Continue readingPython/Opencv save multiple images to folder with different names
Issue I am working on image processing, I have a folder with all of the images that needs to be processed, and I want to save all the processed images to another folder. How do I do that? for img
Continue readingResize image to maintain aspect ratio in Python, OpenCv
Issue I’d like to get a 1000 x 1000 picture in Python from any input picture so that the input doesn’t lose it’s aspect ratio. In other words, I want to resize the input so that its longer dimension is
Continue readingIs there any computational benefit to using Canny edge detection before circle Hough Transform?
Issue I was looking at how to detect billiard balls on a pool table, when I stumbled upon this post. The OP states that he employs the Canny edge detection algorithm on the hue channel of his video feed before
Continue readingPython: Image resizing: keep proportion – add white background
Issue I would like to create a Python script to resize images, but not changing its proportions, just by adding a white background (So, a : 500*700 px image would transform to a 700*700 px image by adding 100 px
Continue readingHow to detect an object that blends with the background?
Issue I am a beginner and I am trying to apply an outline to the white remote control on the left that shares the same color with the background. a = cv2.imread(file_name) imgGray = cv2.cvtColor(a,cv2.COLOR_BGR2GRAY) imgGray = cv2.GaussianBlur(imgGray,(11,11),20) k5 =
Continue readingRemove everything of a specific color (with a color variation tolerance) from an image with Python
Issue I have some text in blue #00a2e8, and some text in black on a PNG image (white background). How to remove everything in blue (including text in blue) on an image with Python PIL or OpenCV, with a certain
Continue readingDetect white blobs using opencv python
Issue I am trying to simply find white circular blobs in an image. When i tried going with houghcircles, I keep getting letters and digits mistaken for circles, whereas I only need complete circles, i.e. blobs. So I ran this
Continue readingWhen applying Gaussian filter the image becomes dark
Issue When I run the following code the output result is blurred but the image gets darker as I increase the value of sigma. Imports import numpy as np import cv2 import matplotlib.pyplot as plt %matplotlib inline import math import
Continue readingcv2.VideoCapture inconsistent behavior between cap.set and loop read
Issue I was trying to read the 600th frame of a video using cv2.VideoCapture. However, I found that the following two methods both successfully read an image but the images are different. I was wondering which is the correct way
Continue readingPython OpenCV Color Tracking
Issue Below is my python code for tracking white color objects. It works – but only for a few seconds and then the whole screen turns black and in some times it not work. I experimented with blue color and
Continue readingQuantify longest axis and width of irregular shapes within a single image
Issue Original question I have about 80-100 images such as (A). Each image is composed of shapes that were filled with black color after marking the outline in ImageJ. I need to extract each individual shape as in (B). I
Continue readingHow to estimate standard deviation in images with speckle noise?
Issue I am using this function that I found on the web, to add speckle noise to images for research purposes: def add_speckle(k,theta,img): gauss = np.random.gamma(k, theta, img.size) gauss = gauss.reshape(img.shape[0], img.shape[1], img.shape[2]).astype(‘uint8’) noise = img + img * gauss
Continue readingHow to convert bounding box (x1, y1, x2, y2) to YOLO Style (X, Y, W, H)
Issue I’m training a YOLO model, I have the bounding boxes in this format:- x1, y1, x2, y2 => ex (100, 100, 200, 200) I need to convert it to YOLO format to be something like:- X, Y, W, H
Continue readingHow can I retain background after dilating text in image
Issue import cv2 import numpy as np # Load image, grayscale, Gaussian blur, Otsu’s threshold image = cv2.imread(‘1.png’) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) blur = cv2.GaussianBlur(gray, (7,7), 0) thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1] # Create rectangular structuring element
Continue readingUnderstanding BufferedImage.getRGB output values
Issue I’m getting an integer value for the pixel in an image using this method: int colour = img.getRGB(x, y); Then I’m printing out the values and I see that black pixels correspond to a value like “-16777216”, a kind
Continue readingCheck if an image contains blue pixels
Issue I have this image: And I’m trying to write a function in Python that will return True if the image contains blue pixels, or False otherwise. That image is just an example. I will have others were the blue
Continue readingHow to find extreme outer points in an image with Python OpenCV
Issue I have this image of a statue. I’m trying to find the top, bottom, left, and right most points on the statue. Is there a way to measure the edge of each side to determine the outer most point
Continue readingHow to create a Python convolution kernel?
Issue I’m trying to create a convolution kernel, and the middle is going to be 1.5. Unfortunately I keep running in to ideas on how to do that. I’m trying to create something similar to this Array = [ [0
Continue readingHow to get the location of all text present in an image using OpenCV?
Issue I have this image that contains text (numbers and alphabets) in it. I want to get the location of all the text and numbers present in this image. Also I want to extract all the text as well. How
Continue readingHow to convert PNG to JPG in Python?
Issue I’m trying to compare two images, one a .png and the other a .jpg. So I need to convert the .png file to a .jpg to get closer values for SSIM. Below is the code that I’ve tried, but
Continue readingHow to determine between inner and outer contour with Python OpenCV?
Issue I want to have a polygon region of interest and would like to perform an object detection algorithm within this area. For example, the user gives some points and I want to create a polygon with them in my
Continue readingHow to crop and extract stamp from an image with OpenCV?
Issue I am new to OpenCV. I have a "simple" image of a stamp that I have already processed a bit, as you can see in the code below. Now I have the problem of cropping the image to get
Continue readingOpenCV version 4.1.0 drawContours error: (-215:Assertion failed) npoints > 0 in function 'drawContours'
Issue I have the following code that worked well with OpenCV 3.4.1 and now is not working with OpenCV 4.1.0 and gives an error. I do not know how to adapt the code with the newer version, can you help
Continue readingUse cv2.findContours output as plt.contour input
Issue I have the following image I find the contour using contours, hierarchy = cv2.findContours(thresh, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE) contour = contours[0] Next, I determine the center of the contour def find_center(contour: np.ndarray) -> tuple: M = cv2.moments(contour) x = int(M["m10"] /
Continue readingImage masking by coordinate or changing binary image pixel to black based on the the coordinate
Issue I have this binary image and i want to remove the objects (convert all the white pixel to black ) that are above the (x, y) coordinate. This is the inital binary image image This is is the binary
Continue readingError: (-215:Assertion failed) npoints > 0 while working with contours using OpenCV
Issue When I run this code: import cv2 image = cv2.imread(‘screenshoot10.jpg’) cv2.imshow(‘input image’, image) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) edged = cv2.Canny(gray, 30, 200) cv2.imshow(‘canny edges’, edged) _, contours = cv2.findContours(edged, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) cv2.imshow(‘canny edges after contouring’, edged) print(contours) print(‘Numbers of
Continue readingDoes cv2.HoughCircles() perform a Gaussian blur?
Issue This is an extension to another user’s question asking whether it is necessary to perform a Gaussian blur before using cv2.Canny(). I know from the documentation that cv2.HoughCircles() calls a Canny edge detector (presumably cv2.Canny()). Based on the user’s
Continue readingHow to sort contours of a grid using OpenCV python?
Issue I’m trying to sort the following squares inside the checkers board grid. I have the valid contours, inside a NumPy array. Here’s a snippet of the code, on how I get the valid squares contours. # Find contours and
Continue readingHow to stretch a line to fit image with Python OpenCV?
Issue I have an image with the size of W * H, I want to draw a line on this and the line should be automatically fit to the image, for example if I draw it: I want this: How
Continue readingImage noise removal is part of image enhancement or image restoration?
Issue I am working in digital image processing field, recently I am studying about Image Noise, I just want to know that whether this noise removal is part of image enhancement or image restoration. I have read some papers on
Continue readingHow to scan two images for differences?
Issue I’m trying to scan 2 images (32bppArgb format), identify when there is a difference and store the difference block’s bounds in a list of rectangles. Suppose these are the images: second: I want to get the different rectangle bounds
Continue readingjoining dotted line by interpolation in an image
Issue I have this image as shown below. It is a binary mask I created this image using the below code. Basically I got the x_idx, y_idx for just those white pixels, and I know the actual image size, so
Continue readingPython OpenCV skew correction for OCR
Issue Currently, I am working on an OCR project where I need to read the text off of a label (see example images below). I am running into issues with the image skew and I need help fixing the image
Continue readinginput_image_meta shape error while using pixellib custom trainig on images
Issue I am using pixellib fot training custom image instance segmentation. I have created a dataset whiche can be seen below in link. Dataset:https://drive.google.com/drive/folders/1MjpDNZtzGRNxEtCDcTmrjUuB1ics_3Jk?usp=sharing the code which I used to make a custom model is import pixellib from pixellib.custom_train import
Continue readingCounting curves, angles and straights in a binary image in openCV and python
Issue I want to write a tool for finding the number of angles, curves and straight lines within each bounded object in an image. All input images will be black on white background and all will represent characters. As illustrated
Continue readingWhat purpose does .astype("uint8") have here?
Issue (score,diff)= structural_similarity(original_gray,tempered_gray,full=True) diff = (diff*255).astype("uint8") print("SSIM:{}".format(score)) The above mentioned code is a snippet from a program that matches two images using their SSIM score. What I don’t understand here is the function of .astype("uint8"), and why are we multiplying
Continue readingHow to detect a hollowed shape as one object instead of two?
Issue A shape that is hollow, take the below situation as example, is detected as 2 objects, the outer triangle(can be seen as just an outline) is somehow detected as 2 objects as shown in the second image (2 green
Continue readingHow can I draw a circle next to each other with a text in center uisng opencv in python?
Issue I’m trying to draw a concurrent circles of equal radius on top row of image with a text on center of circle. I’m able to draw a single circle on center of image as shown below I used below
Continue readingStoring RTSP stream as video file with OpenCV VideoWriter
Issue I’m developing a Python module, with OpenCV, that connects to an RTSP stream to perform some preprocessing on the video (mostly, reducing fps and resolution), and then store it in the file system. But, even after trying several codecs,
Continue readingApply color filter to a bitmap
Issue I would need to color an image as in the example below. I would need to apply this transformation in memory, after loading the image from a file. An example of what I would like to achieve can be
Continue readingOpenCV using k-means to posterize an image
Issue I want to posterize an image with k-means and OpenCV in C++ interface (cv namespace) and I get weird results. I need it for reduce some noise. This is my code: #include "cv.h" #include "highgui.h" using namespace cv; int
Continue readingCT projection (distance-driven) operator implementation?
Issue I am trying to use MATLAB to implement a CT (computed tomography) projection operator, A, which I think is also referred as “system matrix” often times. Basically, for a N x N image M, the projection data, P, can
Continue reading