SimpleCV ile Görüntü İşlemeye Giriş

Herkese Merhabalar,
Görüntü işleme hızla popülerleşen ve gittikçe daha fazla üzerine projeler geliştirilen ve hatta hayatımızda kullandığımız araç gereçlerde kullanılan bir alan olmaya başladı. Bu durumda bir sürü insan bu konu üzerine bir şeyler yapmak istiyor fakat daha kurulum aşamasında veya kaynak yetersizliğinden dolayı bu ilgilerinden vazgeçiyorlar. Bu sorun için önerebileceğim bir çözüm var. SimpleCV!

SimpleCV’nin opencv ve matlab ile karşılaştırıldığı makaleye buradan ulaşabilirsiniz.

http://simplecv.org/download/

SimpleCV görüntü işlemeyle alakalı paketlerin bir arada toplandığı bir python paketler bütünüdür. yukarıdaki linkten kurulum dosyasını indirip sadece bir kaç tık ile kurabilirsiniz.
SimpleCV ile yüklediğimiz paketler ise şöyle:

Görüldüğü gibi Python’un bile yüklü olmasına gerek yok ihtiyacımız olan tüm paketler bir kaç tık ile yükleniyor. Aşağıda basit bir SimpleCV kodu bulunmakta aynı zamanda aşağıdaki linklerden dökümantasyona ve örneklere bakabilirsiniz.
http://simplecv.readthedocs.io/en/latest/
http://examples.simplecv.org/en/latest/

SimpleCV fonksiyonları ve kullanımları:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
#Reading an image
Image(’lenna.png’)
#Converting the image to RGB colorspace
img.toRGB()
#Converting the image to BGR colorspace
img.toBGR()
#Converting the image to HLS colorspace
img.toHLS()
#Converting the image to HSV colorspace
img.toHSV()
#Converting the image to XYZ colorspace
img.toXYZ()
#Converting the image to GRAY colorspace
img.toGray()
#Create a new, empty OpenCV bitmap
img.getEmpty(channels)
#Full copy of the image
img.copy()
#Resize the image
img.resize(x,y)
#Invert image
img.invert()
#Horizontally mirror an image
img.flipHorizontal()
#Vertically mirror an image
img.flipVertical()
#Stretch filter on a greyscale image
img.stretch(thresh low, thresh high)
#Binary threshold
img.binarize(thresh, maxv, blocksize, p)
#Mean color of the image
img.meanColor()
#Finds the FeatureSet strongest corners first
img.findCorners(maxnum, minquality, mindistance)
#Blobs are continuous light regions
img.findBlobs(threshval, minsize, maxsize, threshblocksize, threshconstant)
#Finding the location of a known object
findHaarFeatures(self, cascade, scale factor, min neighbors, use canny)
#Uploading the Image to Imgur or Flickr
img.upload(dest,api key, api secret,verbose)
#Smooth the image
img.smooth(algorithm name, aperature, sigma, spatial sigma, grayscale)
#Draw a circle on the Image
img.drawCircle(ctr, rad, color, thickness)
#Draw a line
img.drawLine(pt1, pt2, color, thickness)
#Size of image
img.size()
#Split the image into a series of image chunks
img.split(cols, rows)
#Images of R,G,B channels are recombined into a single image
img.mergeChannels(r,b,g)
#Apply a color correction curve in HSL space
img.applyHLSCurve(hCurve, lCurve, sCurve)
#Apply a color correction curve in RGB space
img.applyRGBCurve(rCurve, gCurve, bCurve)
#Applies Intensity to all three color channels
img.applyIntensityCurve(curve)
#Returns Image of the string
img.toString()
#Split the channels of an image into RGB
img.splitChannels(grayscale)
#Returns image representing the distance of each pixel from a given color tuple
img.colorDistance(color)
#Apply morphological erosion to a image
img.erode(iterations)
#Apply morphological dilation to a image
img.dilate(iterations)
#Histogram equalization on the image
img.equalize()
#Applies erosion operation followed by a morphological dilation
img.morphOpen()
#The difference between the morphological dilation and
img.morphGradient()
#the morphological gradient 1D
#histogram(numpy array) of intensity for pixels in the image
img.histogram(numbins)
#The histogram of the hue channel for the image
img.hueHistogram(bins)
#Returns the peak hue values histogram of hues
img.huePeaks(bins)
#Add two images
img.add(other)
#Subtract two images Or two images
img.sub(other) img. or (other)
#Image division operation taking two images as input
img.div(other)
#Raises every array element in image array to a power
img.pow(other)
#Finds 2d and 1d barcodes in the image
img.findBarcode(zxing path)
#Finds line segments in the image
img.findLines(threshold, minlinelength,maxlinegap, cannyth1, cannyth2)
#Finds a chessboard within that image
img.findChessboard(dimensions, subpixel)
#Canny edge detection method
img.edges(t1, t2)
#function rotates an image around a specific point
img.rotate(angle, fixed, point, scale)
#return a shear-ed image from the cornerpoints
img.shear(cornerpoints)
#Function for warp performs an affine rotation
img.transformPerspective(rotMatrix)
#Returns the RGB value for a particular image pixel
img.getPixel(x, y)
#Returns a single row of RGB values from the image
img.getHorzScanline(row)
#Returns a single column of gray values from the image
getVertScanlineGray(column)
#Returns a single row of gray values from the image
getHorzScanlineGray(row)
#Crops the image based on parameters
img.crop(x , y, w, h, centered)
#Returns the selected region.
img.regionSelect(x1, y1, x2, y2 )
#Clears out the entire image
img.clear()
#Draws the string on the image at the specified coordinates.
img.drawText(text , x , y , color, fontsize)
#Draw a rectangle on the image
img.drawRectangle(x,y,w,h,color,width,alpha)
#Shows the current image
img.show(type)
#Push a new drawing layer onto the back of the layer stack
img.addDrawingLayer(layer)
#Insert a new layer into the layer stack at the specified index
img.insertDrawingLayer(layer, index)
Remove a layer from the layer stack based on the layer’s index
img.removeDrawingLayer(index)
#Return a drawing layer based on the index
img.getDrawingLayer(index)
#Returns the gray value for a particular image pixel
img.getGrayPixel( x, y)
#Returns a single column of RGB values from the image
img.getVertScanline(column)
#Remove all of the drawing layers
img.clearLayers()
#Return the array of DrawingLayer objects
img.layers()
#Return all DrawingLayer objects as a single DrawingLayer.
img.mergedLayers()
#Render all of the layers onto the current image
img.applyLayers(indicies)
#automatically adjust image size to match the display size
img.adaptiveScale(resolution,fit=True)
#Combine two images as a side by side images
img1.sideBySide(img2, side, scale)
#Generate a binary mask of the image based on a range of rgb values
createBinaryMask(self,color1,color2)
#Make the canvas larger but keep the image the same size
img.embiggen(size, color, pos)
#The white areas of the mask will be kept and the black areas removed
img.applyBinaryMask(mask,bg color)
#Generate a grayscale or binary mask image based either on a hue or an RGB triplet
img.createAlphaMask(hue, hue lb,hue ub)
#Apply a function to every pixel and return the result
img.applyPixelFunction(theFunc)
#Calculate the integral image and return it as a numpy array
img.integralImage(tilted)
#Convolution performs a shape change on an image.
img.convolve(,kernel,center)
#Function searches an image for a template image
img.findTemplate(template image, threshold, method)
#Return any text it can find using OCR on the image
img.readText()
#extract perfect circles from the image
img.findCircle(canny,thresh,distance)
#Attempts to perform automatic white balancing
img.whiteBalance(method)
#Apply a LUT (look up table) to the pixels in a image
img.applyLUT(rLUT,bLUT,gLUT)
#Finds keypoints in an image and returns them as the raw keypoints
img. getRawKeypoints(thresh,flavor, highQuality, forceReset)
#Method does a fast local approximate nearest neighbors (FLANN) calculation between two sets of feature vectors
img. getFLANNMatches(sd,td
#Calculates keypoints for both images, determines the keypoint correspondences
img.drawKeypointMatches(template, thresh, minDist,width)
#Match a template image with another image using SURF keypoints.
img.findKeypointMatch(template, quality,minDist,minMatch)
#This method finds keypoints in an image and returns them as a feature set
img.findKeypoints(min quality, flavor,highQuality)
#Returns the colors in the palette of the image
img.getPalette(bins,hue)
#Takes in the palette from another image and attempts to apply it to this image
img.rePalette(palette,hue)
#returns the visual representation (swatches) of the palette in an image
img.drawPaletteColors(size,horizontal,bins,hue)
#The method then goes through and replaces each pixel with the centroid of the clutsters found by k-means
img.palettize(bins,hue)
#Palettization and behaves similar to the fndBlobs
img.findBlobsFromPalette(palette selection, minsize, maxsize)
#Method uses the color palette to generate a binary image
img.binarizeFromPalette(palette selection)
#Returns the RAW DFT transform of an image
img.rawDFTImage(grayscale)
#Method applies a simple band pass DFT filter
img.bandPassFilter(xCutoffLow, xCutoffHigh, yCutoffLow, yCutoffHigh,grayscale)
#Skeletonization of the image smartThreshold uses a method
img.skeletonize(radius)
#graph cut, to automagically generate a grayscale mask image
img.smartThreshold(mask, rect)
#It takes a image converts it to grayscale, and applies a threshold
img.smartFindBlobs(mask,rect,thresh level)
#This method is same as Paint bucket tool in image manipulation program
img.floodFill(points,tolerance,color,lower,upper,fixed range)
#Returns Image where the values similar to the seed pixel have been replaced by the input color
img.floodFillToMask(points,tolerance,color,lower,upper,fixed range,mask)
#A featureset of blobs form the Mask Image
img.findBlobsFromMask(mask,threshold, minsize, maxsize )
#Returns the log value of the magnitude image of the DFT transform
img.getDFTLogMagnitude(grayscale)
#Apply an arbitrary filter to the DFT of an image
img.applyDFTFilter(flt,grayscale)
#Applies a high pass DFT filter
img.highPassFilter(xCutoff,yCutoff,grayscale)
#Applies a low pass DFT filter
img.lowPassFilter(xCutoff,yCutoff,grayscale)
#InverseDFT(raw dft image) DFT is applied on image using gaussian lowpass filter
img.applyUnsharpMask(boost,dia,grayscale)
#Performs an optical flow calculation and attempts to find motion between two subsequent frames
img.findMotion(previous frame, window, method, aggregate)
#Creates a butterworth filter of 64x64 pixels, resizes it to fit the image
img.applyButterworthFilter(dia, order,highpass,grayscale)
#Creates a gaussian filter of 64x64 pixels, resizes it to fit image
img.applyGaussianFilter(dia, highpass, grayscale)
Paylaş