FAQ Database Discussion Community


Bandpass Filter in Python for Image Processing

python,image,opencv,image-processing,filtering
I have a noisy dataset (a stack of images) which films dim particles moving about some really bright artefacts (which are immobilized). I would like to somehow remove the immobilized artefacts from the images by applying some sort of bandpass filter wherein only pixels within a specific range are converted...

Saving images with more than 8 bits per pixel in matlab

image,matlab,image-processing,computer-vision
I need to save a set of pre-processing images in matlab, resulting in grayscale images. The problem is the fact that these pre-processed images have pixel values higher than 255. If I save them with imwrite() as, for instance, .PNG files, does matlab normalize the values to be in [0,255]...

Segmentation image processing using MATLAB

matlab,image-processing
I am trying to segment my image using the following code. image=imread('mob.jpg'); image = im2bw(image); L = bwlabel(image,8);% Calculating connected components mx=max(max(L)) [r,c] = find(L==1); rc = [r c]; [sx sy]=size(rc); n1=zeros(imx,imy); for i=1:sx x1=rc(i,1); y1=rc(i,2); n1(x1,y1)=255; end imshow(image); figure, imshow(n1); This was my input image- I wanted to separate...

Error in writing a grayscale image

java,image-processing
In the following code am trying to read a grayscale image, store the pixel values in a 2D array and rewrite the image with a different name. The code is package dct; import java.awt.image.BufferedImage; import java.awt.image.DataBufferByte; import java.awt.image.Raster; import java.io.File; import javax.imageio.ImageIO; public class writeGrayScale { public static void main(String[]...

How to detect objects in an image based on colour?

image,matlab,image-processing,image-segmentation,text-segmentation
I am using a handwriting database for writer recognition. I'm using the QUWI database, it has a sample of an original image and a sample of the image segmented into lines by giving each line a different colour. For example here is the original image: (stackovrflow was not uploading this...

How to convert byte array to image in php?

php,image,image-processing,bytearray
I want to convert the byte array from a webservice to image. The webservice response array looks like the following but I could not figure out how to render this array back to an image. Please help me 'MemberImage' => array (size=151745) 0 => int 255 1 => int 216...

complicated matlab image processing

matlab,image-processing,signals
I have a really weird question. Let's assume i have an oscillogram like the one shown below. I need to -somehow- capture the points that compose the signal and afterwards try to make a Fourier analysis and plot the harmonics of the signal. Do you think such an operation could...

Lowpass filter non working

matlab,image-processing,filter
I have a noisy image that I am trying to clean using a lowpass filter (code below, modified from here). The image I get as a result is essentially identical to the one I gave as an input. I'm not an expert, but my conclusion would be that the input...

Captcha with merging a number with real image

image,image-processing,merge,captcha
I have searched for captcha generation tools, but I could not find any tool which can generate the below captcha pictures. You can seen these when you want to register on google. It uses a number merged on a real picture and produce a new real image picture. Do you...

Capturing macro and micro geometry using image features

image-processing,textures,sift,pattern-recognition,lbph-algorithm
I am extracting image features for texture identification. I want to extract image features from a 2D image. These features should capture the micro as well as macro geometry of the image. I have tried to find out some algorithm which can give me the above result. I tried SIFT...

OpenCV convert color per pixel

android,opencv,image-processing,colors,pixel
Hello i want to convert the color in image, i'm using per-pixel methods but it seems very slow src.getPixels(pixels, 0, width, 0, 0, width, height); // RGB values int R; for (int i = 0; i < pixels.length; i++) { // Get RGB values as ints // Set pixel color...

adaptive thresholding ---ValueError: too many values to unpack

python,opencv,image-processing,adaptive-threshold
I'm pretty amateur at image processing. I could successfully do normal thresholding but however I'm facing an error in Adaptive Thresholding. Here is my code: import cv2 import numpy as np img = cv2.imread("vehicle004.jpg") img = cv2.medianBlur(img,5) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) _,th2=cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY,11,2) cv2.imshow("window2",th2) cv2.waitKey(0) cv2.destroyAllWindows() Error Message: line 7, in <module>...

Image processing approach

python,image-processing,image-segmentation,imagej
In the following greyscale image,I am trying to identify the objects that I have manually labelled in red. Does anyone have suggestions of how to do this? I have attempted to use a gaussian blur and thresholding but cannot exclusively identify these particles. Would edge detection be a good approach?...

How to convert a RGB image to a two dimensional image in Matlab

image,matlab,image-processing,computer-vision,vision
I have a RGB image called imrgb, the size of which is 320*512*3. I want to know how to convert it to a two dimensional image? I saw some colorful images, but they are still two dimensional instead of three dimensional. Can anyone tell me how to convert it to...

Is it possible to add a watermark on to a JPG without re-compression?

php,image-processing,jpeg,watermark,lossless-compression
It seems to be logical that it should be impossible to add a watermark to an JPG image without re-compressing the image when saving it as an JPG. Can someone confirm this? The question is generally related to PHP, but I don't think the server language makes a difference to...

Rotate image without cropping OpenCV

python,opencv,image-processing
The question is how to rotate image using OpenCV and keep original dimensions. Currently using this function: def rotateImage(image, angle): (h, w) = image.shape[:2] center = (w / 2, h / 2) M = cv2.getRotationMatrix2D(center,angle,1.0) rotated_image = cv2.warpAffine(image, M, (w,h)) return rotated_image Additionally what kind of algorithm utilised in warpAffine...

De-blur an image in matlab - Error in image dimensions

image,matlab,image-processing,computer-vision
I am trying to do deblurr an image in matlab. this is my code im = im2double(imread('C:\Users\adhil\Desktop\matlab pics\test.JPG')); figure, imshow (G1); % FFT for B1 G_1 = fftshift(G1); G_1 = fft2(G_1); G_1 = ifftshift(G_1); h_1 = fspecial( 'gaussian', [130 221] , 1.0 ); % Fourier Transform of 2D Gaussian H_1...

Finding 3D coordinate of object

opencv,image-processing,3d,camera-calibration
I try to find 3D coordinate (in world )of abject that I know his coordinate in image .so after some research in internet I succed to find X and Y cordinate. but I can't find Z that is my program in openCV void drawAndCalcul3D(int x,int y,Mat& frame) { cv::Mat uvPoint...

OpenCV get coordinates of red-only rectangle area

c++,opencv,image-processing
I have the following output from red-only filtration done by the following algorithm: cv::Mat findColor(const cv::Mat & inputBGRimage, int rng=20) { // Make sure that your input image uses the channel order B, G, R (check not implemented). cv::Mat mt1, mt2; cv::Mat input = inputBGRimage.clone(); cv::Mat imageHSV; //(input.rows, input.cols, CV_8UC3);...

Python - creating a delay that takes in account the execution time

python,image-processing,time,delay
i am writing a function that reads N (800*600) frames from a bin file in one sec. the FPS is user controllable import time def getFrame(file,N): #read N frames per second, 800X600 pixels each from file start = time.time() delay = (1/float(N)) while N: frame = file.read(480000) time.sleep(delay) N -=...

imshow is not working

c++,opencv,image-processing
I used a for loop for reading 300 frames and for accumulating them.I gave an imshow command inside to print the frames continuously but they are not printed during the for loop is processing but it comes as a single image Here's my code: enter code here #include<iostream> #include "opencv2/highgui/highgui.hpp"...

how to translate and scale the image?

image,matlab,image-processing,computer-vision,vision
My image looks like this: The given imrgb = 320*512*3 double; color_map = 64*3 double; after using [X, map] = rgb2ind(imrgb, color_map); I get X = 320*512 uint8. The image is too big for the further processing. My question is how to translate and scale the image to a standard...

imread function doesn't work in matlab

matlab,image-processing,matlab-figure
I am new to Image processing and learning matlab. Actually till now I have used matlab cloud version where uploading an image was directly possible and didn't face any issue. But now I am facing an extreme problem of uploading an image in matlab offline version software. I imported an...

Opencv unable to get ROI of highest intensity part

python,opencv,image-processing,roi
I have tried this code. import sys import numpy as np sys.path.append('/usr/local/lib/python2.7/site-packages') import cv2 from cv2.cv import * img=cv2.imread("test2.jpg",cv2.IMREAD_COLOR) gimg = cv2.imread("test2.jpg",cv2.IMREAD_GRAYSCALE) b,g,r = cv2.split(img) ret,thresh1 = cv2.threshold(gimg,127,255,cv2.THRESH_BINARY); numrows = len(thresh1) numcols = len(thresh1[0]) thresh = 170 im_bw = cv2.threshold(gimg, thresh, 255, cv2.THRESH_BINARY)[1] trig=0 trigmax=0; xmax=0 ymax=0 for x in...

How to improve performance method GetThumbnailAsync in window phone 8.1

c#,image-processing,optimization,winrt-xaml
I write a function to show images on a folder (assume i have about 60 images in this folder) in window phone 8.1. And the problem is function GetThumbnailAsync() take so long time when i create stream to get bitmapImage. Here's my code //getFileInPicture is function get all file in...

How to convert a point in image imrotated with loose option to a point in image imrotated with crop option in Matlab?

image,matlab,image-processing,matlab-figure,coordinate-systems
How to find the relation between image imrotated with loose option Image 1 and image imrotated with crop option Image 2 ? the angle of rotation is not necessary -45° ... I = imread('cameraman.tif'); Im1 = imrotate(I,-45); % bbox option sets to 'loose' by default Im2 = imrotate(I,-45,'nearest','crop'); % bbox...

How to obtain infra red / heat vision using opencv

c++,opencv,image-processing
I want to achieve infra red vision effect (the vision usually used for aliens in movies), just like the one used in Predator 2 - using OpenCV. I have searched, but I have been pointed out that IR filter is made using webcam hardware that supports it. Is there any...

Performing a phase correlation with fft in R

r,image-processing,fft,cross-correlation
I am trying to implement a 2d phase correlation algorithm in R using a recipe from Wikipedia (http://en.wikipedia.org/wiki/Phase_correlation) in order to track the movement between 2 images. These images (frames) were captured with a camera shaking in the wind and the ultimate goal is to remove the shake in these...

How do I find and remove white specks from an image using SciPy/NumPy?

python,image-processing,numpy,scipy
I have a series of images which serve as my raw data which I am trying to prepare for publication. These images have a series of white specks randomly throughout which I would like to replace with the average of some surrounding pixels. I cannot post images, but the following...

MATLAB ConnectedComponentLabeler does not work in for loop

image,matlab,image-processing,computer-vision,matlab-cvst
I am trying to get a set of binary images' eccentricity and solidity values using the regionprops function. I obtain the label matrix using the vision.ConnectedComponentLabeler function. This is the code I have so far: files = getFiles('images'); ecc = zeros(length(files)); %eccentricity values sol = zeros(length(files)); %solidity values ccl =...

Detecting white image background with PHP?

javascript,php,css,image,image-processing
Is it possible with PHP (alternatively JS or something similiar) to detect if an image has a mostly white background? It is because where I display my images there's a white background. And some images have a dark or colorful background, but some are white or mostly white. And I...

How to swap pixels of an image randomly?

java,arrays,image-processing,bufferedimage
I've been working on a Java program that reads an image, subdivides it into a definable number of rectangular tiles, then swaps the pixels of each tile with those of another tile, and then puts them back together and renders the image. An explanation of the idea: http://i.imgur.com/OPefpjf.png I've been...

How to segment out the region of interest in this mask

matlab,image-processing
Hi I got this mask as following, and I try to segment out the left panel. I used the watershed method, so hope that it will return one single value for the left panel. D = bwdist(~mask); imshow(D,[],'InitialMagnification','fit'); Di = -D; Di(~mask) = -Inf; L = watershed(Di); Lrgb = label2rgb(L,'jet');...

“Can't open file ”C:“ for reading; you may not have read permission.” error in MATLAB

image,matlab,image-processing,svm,imread
I have such a code; for x = 1:100 path = sprintf('C:\Users\hasan_000\Documents\MATLAB\Project\Images\%d.jpg', x); imgarray = imread(sprintf(path)); end I have a folder involves 100 pictures. I want to convert them to matrix by uploading automatically in a loop. But I get this error: Can't open file "C:" for reading; you may...

Image Preprocessing for cave painting extraction

opencv,image-processing,opencv3.0
Please consider a sample image shown below The cave paintings are vaguely seen here. Can you please suggest a probable image processing technique I can use here to extractthe regions of the painting? I tried OTSU threshold, as it is a type of adaptive threshold, but it did not work....

Pass Buffer to ChildProcess Node.js

javascript,node.js,image-processing,subprocess
Here I have on Node.Js where I want to do Image Processing in a Sub Process. As you will see I take the file image.jpg and want to write it back to hello.jpg in a subprocess: var node = require('child_process').spawn('node',['-i']); var fs = require('fs'); node.stdout.on('data',function(data) { var fs = require('fs');...

How to match the resulting “map” with the given “color_map”?

image,matlab,image-processing,computer-vision,vision
I have a RGB image called imrgb, the size of which is 320*512*3 double.And I also have the color_map = 64*3 double. I use the following code: [X, map] = rgb2ind(imrgb, 256) the resulting X= 320*512 uint8, and the resulting map = 65*3 double. The resulting "map" is totally different...

Zero out portion of multidim numpy array

python-2.7,image-processing,numpy
I have an numpy array with dimensions (200, 200, 3). It is an RGB image. I also have the (xmin,ymin,xmax,ymax) coordinates of a region of this image that I would like to set to zero. This region should be zero in all three channels. I can of course solve this...

How to read the data of a raw image in python - approach

python,opencv,image-processing,numpy
I am interested in reading the rgb data of a raw image using python. I would like to analyze the rgb of the RAW image with NO filtering and processing done by the DSLR. How would you recommend proceeding? What library etc.? Storing as a numpy array, if possible would...

Extracting polygon given coordinates from an image using OpenCV

python,opencv,image-processing
I've a set of points like the following: <data:polygon> <data:point x="542" y="107"/> <data:point x="562" y="102"/> <data:point x="582" y="110"/> <data:point x="598" y="142"/> <data:point x="600" y="192"/> <data:point x="601" y="225"/> <data:point x="592" y="261"/> <data:point x="572" y="263"/> <data:point x="551" y="245"/> <data:point x="526" y="220"/> <data:point x="520" y="188"/> <data:point x="518" y="152"/> <data:point x="525" y="127"/> <data:point...

Extract a page from a uniform background in an image

image,matlab,image-processing,computer-vision
If I have an image, in which there is a page of text shot on a uniform background, how can I auto detect the boundaries between the paper and the background? An example of the image I want to detect is shown below. The images that I will be dealing...

thicken an object of image to a curve in matlab

matlab,image-processing
I have a labeled matrix containing two objects. How can I thicken an object to a curve? Actually I have the following image: and I want this: Each pixel of the resulting curve is the median of each column. But if you have another idea, it is acceptable, because I...

how to detect partial corrupted images in Jpg/Jpeg format

matlab,image-processing
In a very big image dataset, we have some corrupted images as following images. These images can be viewed without any problem, but human eyes can see some corrupted areas in gray color. How can I detect these corrupted images? Actually I have written a script in Matlab for detecting....

Warning: IMSHOW(I,N) is an obsolete syntax. Your grayscale image will be displayed using 256 shades of gray

matlab,image-processing,dct
I get this warning:Warning: IMSHOW(I,N) is an obsolete syntax. Your grayscale image will be displayed using 256 shades of gray..please help me. Ihave implemented 2d dct.why its not working for m=64; m=input('enter the basis matrix dimension:'); n=m; alpha2=ones(1,n)*sqrt(2/n); alpha2(1)=sqrt(1/n); alpha1=ones(1,m)*sqrt(2/m); alpha1(1)=sqrt(1/m); for u=0:m-1 for v=0:n-1 for x=0:m-1 for y=0:n-1 a(u+1,v+1,x+1,y+1)=alpha1(u+1)*alpha2(v+1)*cos((2*x+1)*u*pi/(2*n))*cos((2*y+1)*v*pi/(2*n));...

Obj-C Method calls super slow, lots more CPU usage?

objective-c,performance,image-processing
I'm doing pixel processing and when I call an empty Objective-C method, it uses 25% more CPU. Furthermore another strange occurrence is if I have another Obj-C function call in that method that never gets called, it increases the CPU usage by an extra 10%. Here's the code I'm calling:...

What does the index refer to when selecting a pixel on an image in Matlab?

matlab,image-processing,matlab-figure,dicom,figure
When looking at a single pixel of an image in Matlab, what does this index refer to? X/Y refer to the coordinates of the pixel, and RGB refers to the color, but any ideas on what the index is? To clarify, when I am viewing a figure in Matlab and...

How to scale a pattern before fill in fabricjs

html5,image,image-processing,html5-canvas,fabricjs
I'm trying to fill a polygon with a pattern that is larger than the polygon itself. I want to scale down the pattern before filling the polygon with it but I can't figure out how. I can certainly resize the file pattern file before it's loaded but I was wondering...

Detecting individual images in an array of images

algorithm,image-processing
I'm building a photographic film scanner. The electronic hardware is done now I have to finish the mechanical advance mechanism then I'm almost done. I'm using a line scan sensor so it's one pixel width by 2000 height. The data stream I will be sending to the PC over USB...

How to rearrange each image patch into number of column vector [duplicate]

matlab,image-processing
This question already has an answer here: Efficient Implementation of `im2col` and `col2im` 2 answers I am working on a project where i have used a image whose size is (512x512)then i have divided the whole image by 8 so that there will be 64x64 block then i have...

Getting an image to render with php

php,image,laravel,image-processing
To keep it simple, I'm trying to display an image using php to help try and prevent any kind of a security loophole. I have the image being read through a php script and I am wanting to render it, so instead of going to http://example.com/path/to/uploads/dir/image.jpg I want to have...

computing Histogram of oriented gradients on log polar bins [closed]

matlab,opencv,image-processing,computer-vision,emgucv
I want to compute histogram of oriented gradient on my image. But I don't want to divide the image to regular square blocks. I'm going to divide the image to uniform log polar bins(like bins in shape context or bins like here ) and then on each bin(block) the histogram...

Imageresizer.net not resizing image coming from the database

asp.net-mvc,image-processing,image-resizing,imageresizer
I'm using the imageresizer plugin from http://imageresizing.net/. The website i'm working on (an asp.net mvc5 application) contains some static images located in the /content/images folder in the root of the website. The second part of the images is coming from the database through an MVC-controller. The static images are being...

C# native Image template match (FIXED)

c#,performance,image-processing,native,template-matching
UPDATED - SOLVED LOCKING BIT HERE IS THE NEW CODE public Task<Point[]> MatchImage(Bitmap orig, Bitmap template, int limit = 30) { Task<Point[]> tsk = new Task<Point[]>(() => { BitmapData lockedOrig = orig.LockBits( new Rectangle(0, 0, orig.Width, orig.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); //bloqueando a leitura da memoria em que a imagem nova sera...

How to compute the distance of a set points

matlab,image-processing
I have a problem about computing the distance of points. Let see my definition. I have a finite set points: S={a_i=(a_i1,a_i2) ∈ Ω, 1<=i<=k } where Ω is image domain, i is index of pixel. The distance function d is tuned by parameter sigma that allows adjustment according to the...

Displaying a 32-bit image with NaN values (ImageJ)

python,image-processing,imagej
I wrote a multilanguage 3-D image denoising ImageJ plugin that does some operations on an image and returns the denoised image as a 1-D array. The 1-D array contains NaN values (around the edges). The 1-D array is converted back into an image stack and displayed. It is simply black....

OpenGL GLSL: How to implement the concept of gradient map in photoshop using fragment shader?

image-processing,glsl,photoshop
This may be not the perfect question for stackoverflow but I have asked this in graphicdesign network of stackexchange but did not get any answer so posting it here. I am trying to implement gradient map of Photoshop programmatically using glsl fragment shader. Consider below shown gradient map where all...

How to concatenate 3 histograms on the same graph in Matlab

matlab,image-processing,plot,histogram
I have calculated 3 histograms for an rgb image using imhist function in Matlab, one for each channel. I want to plot these histograms on the same graph, where for instance, the histogram for the first (red) channel stretches on the x axis from 0 to 255, the histogram for...

How to identify Bimodal Histograms automatically?

image-processing,histogram
I have a problem where i receive a lot of histograms from some database images. Those histograms are represented as vectors(0...256), and i have to identify and work with the bimodal histograms. Well, is there a formula to automatically identify wich histograms are bimodal and wich arent? Since they are...

conversion between Mat and Mat1b/Mat3b

c++,opencv,image-processing,mat
I want to match my code into a given interface. Inside my class OperateImage in all methods I use cv::Mat format. When putting it in SubMain function which uses cv::Mat3b and returns cv::Mat1b it does not work. How can I change it so that I can use my written class?...

How to get pixel coordinates from Feature Matching

python,opencv,image-processing,matching,feature-detection
I need to get the list of the x and y coordinates of the pixels that feature matcher selects in the code provided. I'm using Python and OpenCV. Can anyone help me? img1=cv2.imread('DSC_0216.jpg',0) img2=cv2.imread('DSC_0217.jpg',0) orb=cv2.ORB(nfeatures=100000) kp1,des1=orb.detectAndCompute(img1,None) kp2,des2=orb.detectAndCompute(img2,None) img1kp=cv2.drawKeypoints(img1,kp1,color=(0,255,0),flags=0) img2kp=cv2.drawKeypoints(img2,kp2,color=(0,255,0),flags=0) cv2.imwrite('m_img1.jpg',img1kp) cv2.imwrite('m_img2.jpg',img2kp)...

Reading all the files in sequence in MATLAB

matlab,image-processing
I am trying to read all the images in the folder in MATLAB using this code flst=dir(str_Expfold); But it shows me output like this. which is not the sequence as i want. Can anyone please tell me how can i read all of them in sequence? for giving downmark, please...

java image processing sobel edge detection

java,image-processing,edge-detection,sobel
I have a problem with java program, in which i'm using sobel operator for edge detection, but when I'm trying to use that funcion, console says: Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 262144 at sun.awt.image.ByteInterleavedRaster.getPixels(ByteInterleavedRaster.java:1015) at Obrazek.jButtonSobelActionPerformed(Obrazek.java:566) And the code for that is: FileInputStream inFile = null; try { long beginTime...

Manually Sharpen Image in Java without ConvolveOp

java,image-processing
I am trying to understand how to process images manually. This is a school project, so I won't be able to use ConvolveOp. I am trying to manually do what it does. From what I have read, the sharpen kernel is this: -1 -1 -1 -1 9 -1 -1 -1...

How to prevent exceeding matrix dimensions while dividing an image into blocks?

image,matlab,image-processing,image-segmentation
I have an image which I want to divide into overlapping blocks. I have set the box to be of size 8 rows and 8 columns, and the overlapping factor to be 4 rows/columns. This is what I have written to solve this: img = imread('a03-017-05.png'); overlap = 4 count...

Back ground Subtraction class pros please answer

image,opencv,image-processing,background-subtraction,pixel-manipulation
Can someone define the class BackgroundSubtractorMOG2.What does history(argument for the BackgroundSubtractor class mean).Is some technique like code books available using BackgroundSubtractorMOG2 class?? Thanks in advance...

How can I determine the length of a multi-page TIFF using Python Image Library (PIL)?

python,image-processing,python-imaging-library,tiff
I know that the Image.seek() and Image.tell() methods of PIL allow me to go to a particular frame, and list the current frame, respectively. I would like to know how many frames there are total. Is there a function for getting this info? Alternatively, is there a way in python...

Apply multiple effect on bitmap without saving it

android,image-processing,bitmap,textures,effect
My requirement is to load multiple Effect on bitmap. I am following apply-effects-on-image-using-effects for it. I got success for applying the effect but My requirements is to give brightness effect separately. That means user can able to give Brightness effect after applying any other effect without saving the file. I...

Python opencv filtering everything outside region of interest

python,opencv,image-processing
Given an image and a set of points (number of points >= 3), where the set of points would form a polygon which is my region of interest, my aim is to filter everything in this image that is outside this region of interest, while the area inside it is...

How to rearrange matrix column into block using for loop?

matlab,image-processing
I am working on a project where i have used a image whose size is (512x512)then i have divided the whole image by 8 so that there will be 64x64 block then i have rearranged each 8x8 image patch into a single column and my new size is 64x4069. Now...

How can I replace the white rectangle within an image using ImageMagick?

php,image-processing,imagemagick
Overview: The first picture is my original image. Here I want to replace the white rectangle shown with another image. My approach: I have created a mask image using floodfill and it looks as: Problem: Now I would like to get the distance or co-ordinates of the rectangle in the...

Lab-image values on both of a and b axises exceeds the range

java,opencv,image-processing,colors,javacv
i converted a color image to Lab-color space, and when i displayed the values of the Lab-image, i found that the values of the pixels on the a-axis and b-axis are greater than 128!! while the values on the a-axis and b-axis should range from -128 to +128 please let...

Send portion of an image to client in PHP

php,image-processing
Hi I have a huge image on my PHP server, which represents a map in a web game. I need the client request only to get a small portion of that image. the client request cant load the whole image because: 1) it will suffocate the server 2) I dont...

MATLAB: changing montage orientation of 2 images

image,matlab,image-processing,orientation,montage
I'm trying to use MATLAB to open a montage of just two images placed top and bottom. MATLAB defaults to a left/right orientation. I've tried montage(images, 'Size', [2 1]) but this still gives me the left/right orientation but just adds a blank row underneath.

How to reduce processing time for imread and imwrite

matlab,image-processing,parallel-processing,imread
I am working on a 3d reconstruction using parallel computing in Matlab. I profiled my code and found that imread and imwrite took most of the processing time. My goal is to significantly reduce the processing time as my simulations involve large data sets and iterations. My code: projection_length =...

OpenCV Java RGB BGR

java,opencv,image-processing,video
I tried several times to obtain a normal video in Java with OpenCV but all the time I have the colours switched: I mean when I run the program blue is orange in the video. Here is my code: public class Mat2Image { BufferedImage img; Mat mat = new Mat();...

How do I correct this LockBits math error?

c#,image-processing,rgb,getpixel,lockbits
Using GetPixel/SetPixel, I was using the following to power an image filter that emphasizes reds and purples: for (int y = 0; y < bmpMain.Height; y++) for (int x = 0; x < bmpMain.Width; x++) { bmpMain.GetPixel(x, y); Color c = bmpMain.GetPixel(x, y); int myRed = c.R, myGreen = c.G,...

Selecting Overlapping / Touching regions (Binary Images, Matlab)

matlab,image-processing
I'm trying to select overlapping/ touching images from 2 binary images. The first image (blue circles) has the main body and I want to find any green triangles attached to it. 1st Binary Image here (colored for identification) 2nd Binary Image here FinalImage = BinaryImage1 | BinaryImage2; **Apply Filter** Expected...

Create mask from bwtraceboundary in Matlab

image,matlab,image-processing,mask,boundary
I'm trying to create a mask (or similar result) in order to erase pieces of a binary image that are not attached to the object surrounded by the boundary. I saw this thread (http://www.mathworks.com/matlabcentral/answers/120579-converting-boundary-to-mask) to do this from bwboundaries, but I'm having trouble making suitable changes to it. My goal...

I don't get the use of axis(1:2) in Matlab?

matlab,image-processing,matlab-figure
I am in front of the following (modified) matlab code : figure(3); subplot(2,3,2); axises=axis; center = [mean(axises(1:2)),mean(axises(3:4))]' my problem is : Why did he use axises and not keep using axis ? What does axises(1:2) do ? I have checked the axis documentation, but there is no mention to something...

Connecting two binary objects in matlab

matlab,image-processing
I have a binary matrix containing several binary objects and I want to bridge between them. Actually I have the following picture: And the result has to be like this: Is there any function or a shortcut way, other than loops, for this problem?...

Increase Size of Black Bullets in Image in C#

c#,image-processing,aforge
Given the following image: I need to output this image: I want to increase the size of Black Pixels in the image using C# or AForge.Net...

OpenCV / Image Processing techniques to find the centers of bright spots in an image

python,opencv,image-processing,feature-detection
I'm currently doing a project based on the methodology described in this paper: Camera calibration from a single night sky image As a beginner in computer vision, I do not quite understand how I can implement the method used in the paper to find the centre of all the bright...

Display .bin depth image in Matlab

image,matlab,image-processing,bin
Here is the .bin image which I saved in c#. Please anyone help to view this in MATLAB. the dimension of image 424 x 512. I have tried this code, but its not working correctly file = fopen('test0.bin', 'r'); A = fread(file, 424*512, 'uint16=>uint16'); A1 = reshape(A, 424, 512); imagesc(A1)...

Convert Android image into a file that MATLAB can read

android,image,matlab,image-processing,bitmap
I´m working on a project related with image recognition using MATLAB and I'm currently using an Android app to help with some pre-processing steps. I thought it was going to be easy to work with matrices instead of bitmaps. I finally managed to finish my algorithm and to import it...

How to separate the patches in the image?

image,matlab,image-processing,computer-vision,vision
I want to initialize the dictionary of this image. The image is the same as this one: image source The size of the grey image is 320*512 double. I want to separate the 40 brain image patches in this grey image. I have two questions 1) how to get the...

Make strip of nan in a matrice matlab

matlab,image-processing,matlab-figure
I have an image size (m x n x 4) I want to make strip of 0 or NaNon it. I want the strips to be 4 pixels wide and having a space of about 30 pixels between them. That is when I display the image in RGB I have...

How to call OpenCV's MatchTemplate method from C#

c#,opencv,image-processing,emgucv,opencvsharp
I'm trying to get the template's position on the image using OpenCVSharp library from NuGet. Here is the code I've wrote: var image = Cv.LoadImage("Image.png"); var template = Cv.LoadImage("Template.png"); var w = (image.Width - template.Width) + 1; var h = (image.Height - template.Height) + 1; IplImage result = new IplImage(w,...

HOG Feature Extraction of Arabic Line Images

image-processing,machine-learning,computer-vision
I am doing a project on Writer Identification. I want to extract HOG features from Line Images of Arabic Handwriting. And than use Gaussian Mixture Model for Classification. The link to the database containing the line Images is : http://khatt.ideas2serve.net/ So my questions are as follows; There are three folders...

How to create thumbnails using opencv-python?

python,opencv,image-processing,python-imaging-library
I'm trying to downsample my image(using anti-aliasing) using Python-Pillow's im.thumbnail() method. My code looks like: MAXSIZE = 1024 im.thumbnail(MAXSIZE, Image.ANTIALIAS) Can you tell me some alternative in opencv-python to perform this re-sizing operation ?...

Using key positions in steganography using DCT

image,image-processing,dct
I have a question about steganography. Once the DCT matrix's are computed and the LSB's are replaced can we assume that the location at which the data is entered in the DCT of the cover image is know at the receiver? If not then how is the image reconstructed?

Java encode raw bytes into image simple image fomat/ file

java,image,scala,image-processing
I am very new to image encoding and would rather not learn a whole lot about it. Basically I'm taking greyscale byte array where each byte equals one pixel. I'm getting this data from mnist where I get 28x28 byte images. Anyway, bellow is my code, so you understand what...

Draw line to connect centroids

matlab,image-processing,line,centroid
I have an image . After I process to find centroid, it has four centroids. My goal is I want to connect them using line and measure the angle between this area. To be clear about the centroid and my goal, you can open . Here it is my code...

How to convert image from double to uint8 in matlab?

image,matlab,image-processing
I have an image I which is of type double. I want to convert the image from double to uint8. I have tried using both: I=uint8(I) I=im2uint8(I). When I use the imshow(I) command, I get only a black image and nothing else. What am I doing wrong?...

How to combine images in Ruby

ruby-on-rails,ruby,linux,shell,image-processing
I have 4 square images, 1,2,3 and 4 each with 2048x2048px. I need to combine those into a 4096x4096px image, like this: 1 2 3 4 Right now I am doing this manually with Gimp, but the amount processing is growing and I would like to implement an automated solution....

effect of ligting on image segmentation in matllab

matlab,image-processing,image-segmentation,fuzzy-c-means
I'm trying to do a segmentation task on the below picture. I'm using fuzzy c-means with some minimal pre-processing. The segmentation will have 3 classes: background(the blue region), meat(the red region) and fat(the white region). The background segmentation works perfectly. However meat-and-fat segmentation on the left side of the photo...

What is the need of normalisation in image?

matlab,image-processing
I saw this code in the internet imgN = double(img-min(img(:)))/(max(img(:)-min(img(:)))); to normalize the image in 0..1 . What's the meaning of it? Also its shows this error Error using / Integers can only be combined with integers of the same class, or scalar doubles. ...

Displaying surface with non-rectangular boundary

matlab,image-processing,plot,3d,surface
Refer to the attached image. I want to display the image in Matlab using the function surf(). However, I only want to display the region of the actual object without the background (the pale-green region surrounding the actual object which has 0 value). How to do that? I tried replacing...

Simple way to resize large number of image files

shell,image-processing,python-imaging-library
I have a folder which contains about 45000 jpeg images. Most of them are from 10KB - 20Kb. Now I want to write a script to resize all of them to fixed size 256x256. I wonder if there is any simple way to do that like: for a in *.jpg...

Using OpenCV in Swift iOS

ios,swift,opencv,image-processing
After adding the OpenCV 2 framework in my xcode project, I tried searching for samlpes or tutorials for integration with swift. Are there any good tutorials for the same?...

how can i know if the image is in RGB or BGR format?

java,opencv,image-processing,rgb,bgr
is there any way to know in advance if an image used as an input to a system is in RGB or BGR format? I am using opencv with java API and i would like to convert an input image into grayscale or Lab* color space, and in opencv you...