Anyone wanna help make a complete version of CL-OPENCV

Discussion of Common Lisp

Anyone wanna help make a complete version of CL-OPENCV

Postby joeish80829 » Thu Sep 05, 2013 12:48 am

I already added 96 new funtions to CL-OPENCV and plan to make it complete....so any help you give me will aid in a badass lisp cv library being available soon....I will check this post daily for replies

Here is list of the new package.lisp file from cl-opencv....detailing all my new additions....to entice any takers:



(defpackage :cl-opencv
(:use #:cl)
(:export
;; C Constants

;; C Integer Limits
#:+char-bit+
#:+schar-min+
#:+schar-max+
#:+uchar-max+
#:+char-min+
#:+char-min-j+
#:+char-max+
#:+char-max-j+
#:+mb-len-max+
#:+shrt-min+
#:+shrt-max+
#:+ushrt-max+
#:+int-max+
#:+uint-max+
#:+long-max+
#:+ulong-max+

;; Extra OpenCV constants

#:+max-dim+

;; core - Basic C Structures and Operations
#:cv-point
#:make-cv-point
#:cv-point-p
#:copy-cv-point
#:cv-point-x
#:cv-point-y

#:size
#:make-size
#:size-p
#:copy-size
#:size-width
#:size-height

#:cv-rect
#:make-cv-rect
#:cv-rect-p
#:copy-cv-rect
#:cv-rect-x
#:cv-rect-y
#:cv-rect-width
#:cv-rect-height

#:make-cv-scalar

#:cv-matrix
#:+8uc1+
#:+8uc2+
#:+8uc3+
#:+8uc4+
#:+8sc1+
#:+8sc2+
#:+8sc3+
#:+8sc4+
#:+16uc1+
#:+16uc2+
#:+16uc3+
#:+16uc4+
#:+16sc1+
#:+16sc2+
#:+16sc3+
#:+16sc4+
#:+32sc1+
#:+32sc2+
#:+32sc3+
#:+32sc4+
#:+32f+
#:+32fc1+
#:+32fc2+
#:+32fc3+
#:+32fc4+
#:+64fc1+
#:+64fc2+
#:+64fc3+
#:+64fc4+

#:ipl-image
#:+ipl-depth-1u+
#:+ipl-depth-8u+
#:+ipl-depth-16u+
#:+ipl-depth-32f+
#:+ipl-depth-64f+
#:+ipl-depth-8s+
#:+ipl-depth-16s+
#:+ipl-depth-32s+

#:cv-array
#:image-ptr

#:clone-image
#:clone-mat
#:clone-mat-nd
#:convert-scale
#:convert-scale-abs
#:copy
#:create-data
#:create-image-header
#:create-mat
#:create-mat-header
#:create-mat-nd
#:create-mat-nd-header
#:create-image
#:create-trackbar
#:dot-product
#:get-diag
#:get-dim-size
#:get-elem-type
#:get-image
#:get-image-coi
#:get-mat
#:get-real-1d
#:get-real-2d
#:get-real-3d
#:get-real-nd
#:get-size
#:get-sub-rect
#:+ipl-origin-tl+
#:+ipl-origin-bl+
#:init-image-header
#:init-mat-nd-header
#:release-data
#:release-image
#:release-image-header
#:release-mat
#:release-mat-nd
#:reset-image-roi
#:reshape
#:cv-set
#:set-1d
#:set-2d
#:set-3d
#:set-nd
#:set-data
#:set-image-coi
#:set-image-roi
#:set-real-1d
#:set-real-2d
#:set-real-3d
#:set-real-nd
#:set-zero



;; Dynamic Structures
#:clear-mem-storage
#:create-child-mem-storage
#:create-mem-storage
;; Sequence types constants for cvSeq

#:+seq-magic-val+
#:+set-magic-val+
#:+seq-eltype-bits+
#:+seq-eltype-mask+
#:+seq-eltype-point+
#:+seq-eltype-code+
#:+seq-eltype-generic+
#:+seq-eltype-ptr+
#:+seq-eltype-ppoint+
#:+seq-eltype-index+
#:+seq-eltype-graph-edge+
#:+seq-eltype-graph-vertex+
#:+seq-eltype-trian-atr+
#:+seq-eltype-connected-comp
#:+seq-eltype-point3d+
#:+seq-kind-bits+
#:+seq-kind-mask+

;; types of sequences
#:+seq-kind-generic+
#:+seq-kind-curve+
#:+seq-kind-bin-tree+

;; types of sparse sequences (sets)
#:+seq-kind-graph+
#:+seq-kind-subdiv2d+
#:+seq-flag-shift+

;; flags for curves
#:+seq-flag-closed+
#:+seq-flag-simple+
#:+seq-flag-convex+
#:+seq-flag-hole+
#:create-seq
#:get-seq-elem
#:mem-storage-alloc
#:release-mem-storage
#:seq-elem-idx
#:seq-insert
#:seq-push
#:seq-push-front
#:seq-push-multi
#:seq-remove

;; core - Operations on Arrays
#:abs-diff
#:abs-diff-scalar
#:add
#:add-scalar
#:and-scalar
#:+cmp-eq+
#:+cmp-gt+
#:+cmp-ge+
#:+cmp-lt+
#:+cmp-le+
#:+cmp-ne+
#:cmp
#:cv-and
#:add-weighted
#:det
#:+dft-inverse+
#:+dft-scale+
#:+dft-rows+
#:+dft-complex-output+
#:+dft-real-output+
#:+dxt-forward+
#:+dxt-inverse+
#:+dxt-inv-scale+
#:+dxt-inverse-scale+
#:+dxt-rows+
#:+dxt-mul-conj+
#:dft
#:div
#:cv-exp
#:flip
#:get-optimal-dft-size
#:invert
#:in-range-scalar
#:cv-log
#:lut
#:cv-max
#:cv-maxs
#:mul
#:cv-not
#:cv-or
#:pow
#:or-scalar
#:scale-add
#:split
#:subtract
#:subtract-scalar
#:sub-r-scalar
#:x-or
#:x-or-scalar

;; core - Drawing Functions
#:+aa+
#:circle
#:ellipse
#:line
#:rectangle

;; imgproc - Image Processing - Image Filtering

#:ipl-conv-kernel
#:+ipl-border-constant+
#:+ipl-border-replicate+
#:+border-constant+
#:+border-replicate+
#:+border-reflect+
#:+border-wrap+
#:+border-reflect-101+
#:+border-reflect101+
#:+border-default+
#:copy-make-border
#:+cv-shape-rect+
#:+cv-shape-cross+
#:+cv-shape-ellipse+
#:+morph-rect+
#:+morph-cross+
#:+morph-ellipse+
#:+cv-shape-custom+
#:create-structuring-element-ex
#:dilate
#:erode
; #:filter-2d
#:laplace
#:+gaussian-5x5+
#:pyr-down
#:release-structuring-element
#:+blur-no-scale+
#:+blur+
#:+gaussian+
#:+median+
#:+bilateral+
#:smooth

;; imgproc - Image Processing - Miscellaneous Image Transformations

;;Constants for color conversion
#:+bgr2bgra+
#:+rgb2rgba+

#:+bgra2bgr+
#:+rgba2rgb+

#:+bgr2rgba+
#:+rgb2bgra+

#:+rgba2bgr+
#:+bgra2rgb+

#:+bgr2rgb+
#:+rgb2bgr+

#:+bgra2rgba+
#:+rgba2bgra+

#:+bgr2gray+
#:+rgb2gray+
#:+gray2bgr+
#:+gray2rgb+
#:+gray2bgra+
#:+gray2rgba+
#:+bgra2gray+
#:+rgba2gray+

#:+bgr2bgr565+
#:+rgb2bgr565+
#:+bgr5652bgr+
#:+bgr5652rgb+
#:+bgra2bgr565+
#:+rgba2bgr565+
#:+bgr5652bgra+
#:+bgr5652rgba+

#:+gray2bgr565+
#:+bgr5652gray+

#:+bgr2bgr555+
#:+rgb2bgr555+
#:+bgr5552bgr+
#:+bgr5552rgb+
#:+bgra2bgr555+
#:+rgba2bgr555+
#:+bgr5552bgra+
#:+bgr5552rgba+

#:+gray2bgr555+
#:+bgr5552gray+

#:+bgr2xyz+
#:+rgb2xyz+
#:+xyz2bgr+
#:+xyz2rgb+

#:+bgr2ycrcb+
#:+rgb2ycrcb+
#:+ycrcb2bgr+
#:+ycrcb2rgb+

#:+bgr2hsv+
#:+rgb2hsv+

#:+bgr2lab+
#:+rgb2lab+

#:+bayerbg2bgr+
#:+bayergb2bgr+
#:+bayerrg2bgr+
#:+bayergr2bgr+
#:+bayerbg2rgb+
#:+bayergb2rgb+
#:+bayerrg2rgb+
#:+bayergr2rgb+

#:+bgr2luv+
#:+rgb2luv+
#:+bgr2hls+
#:+rgb2hls+

#:+hsv2bgr+
#:+hsv2rgb+

#:+lab2bgr+
#:+lab2rgb+
#:+luv2bgr+
#:+luv2rgb+
#:+hls2bgr+
#:+hls2rgb+

#:+bayerbg2bgr-vng+
#:+bayergb2bgr-vng+
#:+bayerrg2bgr-vng+
#:+bayergr2bgr-vng+

#:+bayerbg2rgb-vng+
#:+bayergb2rgb-vng+
#:+bayerrg2rgb-vng+
#:+bayergr2rgb-vng+
#:+bgr2hsv-full+
#:+rgb2hsv-full+
#:+bgr2hls-full+
#:+rgb2hls-full+
#:+hsv2bgr-full+
#:+hsv2rgb-full+
#:+hls2bgr-full+
#:+hls2rgb-full+

#:+lbgr2lab+
#:+lrgb2lab+
#:+lbgr2luv+
#:+lrgb2luv+

#:+lab2lbgr+
#:+lab2lrgb+
#:+luv2lbgr+
#:+luv2lrgb+

#:+bgr2yuv+
#:+rgb2yuv+
#:+yuv2bgr+
#:+yuv2rgb+

#:+bayerbg2gray+
#:+bayergb2gray+
#:+bayerrg2gray+
#:+bayergr2gray+

;;yuv 4:2:0 formats family

#:+yuv2rgb-nv12+
#:+yuv2bgr-nv12+
#:+yuv2rgb-nv21+
#:+yuv2bgr-nv21+
#:+yuv420sp2rgb+
#:+yuv420sp2bgr+

#:+yuv2rgba-nv12+
#:+yuv2bgra-nv12+
#:+yuv2rgba-nv21+
#:+yuv2bgra-nv21+
#:+yuv420sp2rgba+
#:+yuv420sp2bgra+

#:+yuv2rgb-yv12+
#:+yuv2bgr-yv12+
#:+yuv2rgb-iyuv+
#:+yuv2bgr-iyuv+
#:+yuv2rgb-i420+
#:+yuv2bgr-i420+
#:+yuv420p2rgb+
#:+yuv420p2bgr+

#:+yuv2rgba-yv12+
#:+yuv2bgra-yv12+
#:+yuv2rgba-iyuv+
#:+yuv2bgra-iyuv+
#:+yuv2rgba-i420+
#:+yuv2bgra-i420+
#:+yuv420p2rgba+
#:+yuv420p2bgra+

#:+yuv2gray-420+
#:+yuv2gray-nv21+
#:+yuv2gray-nv12+
#:+yuv2gray-yv12+
#:+yuv2gray-iyuv+
#:+yuv2gray-i420+
#:+yuv420sp2gray+
#:+yuv420p2gray+

;;yuv 4:2:2 formats family

#:+yuv2rgb-uyvy+
#:+yuv2bgr-uyvy+
;;+yuv2rgb-vyuy+
;;+yuv2bgr-vyuy+
#:+yuv2rgb-y422+
#:+yuv2bgr-y422+
#:+yuv2rgb-uynv+
#:+yuv2bgr-uynv+

#:+yuv2rgba-uyvy+
#:+yuv2bgra-uyvy+
;;+yuv2rgba-vyuy+
;;+yuv2bgra-vyuy+
#:+yuv2rgba-y422+
#:+yuv2bgra-y422+
#:+yuv2rgba-uynv+
#:+yuv2bgra-uynv+

#:+yuv2rgb-yuy2+
#:+yuv2bgr-yuy2+
#:+yuv2rgb-yvyu+
#:+yuv2bgr-yvyu+
#:+yuv2rgb-yuyv+
#:+yuv2bgr-yuyv+
#:+yuv2rgb-yunv+
#:+yuv2bgr-yunv+

#:+yuv2rgba-yuy2+
#:+yuv2bgra-yuy2+
#:+yuv2rgba-yvyu+
#:+yuv2bgra-yvyu+
#:+yuv2rgba-yuyv+
#:+yuv2bgra-yuyv+
#:+yuv2rgba-yunv+
#:+yuv2bgra-yunv+

#:+yuv2gray-uyvy+
#:+yuv2gray-yuy2+
;;+yuv2gray-vyuy+
#:+yuv2gray-y422+
#:+yuv2gray-uynv+
#:+yuv2gray-yvyu+
#:+yuv2gray-yuyv+
#:+yuv2gray-yunv+

;; alpha premultiplication

#:+rgba2mrgba+
#:+mrgba2rgba+

#:+rgb2yuv-i420+
#:+bgr2yuv-i420+
#:+rgb2yuv-iyuv+
#:+bgr2yuv-iyuv+

#:+rgba2yuv-i420+
#:+bgra2yuv-i420+
#:+rgba2yuv-iyuv+
#:+bgra2yuv-iyuv+
#:+rgb2yuv-yv12+
#:+bgr2yuv-yv12+
#:+rgba2yuv-yv12+
#:+bgra2yuv-yv12+

#:+colorcvt-max+

#:+adaptive-thresh-mean-c+
#:+adaptive-thresh-gaussian-c+
#:adaptive-threshold
#:cvt-color
#:+dist-l1+
#:+dist-l2+
#:+dist-c+
#:+dist-label-ccomp+
#:+dist-label-pixel+
#:+dist-mask-3+
#:+dist-mask-5+
#:+dist-mask-precise+
#:dist-transform
#:+thresh-binary+
#:+thresh-binary-inv+
#:+thresh-trunc+
#:+thresh-tozero+
#:+thresh-tozero-inv+
#:threshold

;; imgproc - Image Processing - Feature Detection

#:canny

;; highgui - User Interface

#:cv-capture
#:cv-video-writer

#:+cvtimg-flip+
#:+cvtimage-swap-rb+
#:convert-image
; #:create-trackbar
#:destroy-all-windows
#:destroy-window
; #:get-trackbar-pos
; #:init-system
#:move-window
#:+window-normal+
#:+window-autosize+
#:named-window
#:resize-window
; #:set-mouse-callback
; #:set-trackbar-pos
#:show-image
#:wait-key

;; highgui - Reading and Writing Images and Video
#:create-camera-capture
#:create-file-capture
#:capture-from-cam
#:capture-from-file
#:decode-image
#:decode-image-m
#:encode-image
#:+load-image-unchanged+
#:+load-image-grayscale+
#:+load-image-color+
#:+load-image-anydepth+
#:+load-image-anycolor+
#:load-image
#:load-image-m
#:save-image
#:with-capture
#:+cap-prop-pos-msec+
#:+cap-prop-pos-frames+
#:+cap-prop-pos-avi-ratio+
#:+cap-prop-frame-width+
#:+cap-prop-frame-height+
#:+cap-prop-fps+
#:+cap-prop-fourcc+
#:+cap-prop-frame-count+
#:+cap-prop-format+
#:+cap-prop-mode+
#:+cap-prop-brightness+
#:+cap-prop-contrast+
#:+cap-prop-saturation+
#:+cap-prop-hue+
#:+cap-prop-gain+
#:+cap-prop-exposure+
#:+cap-prop-convert-rgb+
#:+cap-prop-white-balance+
#:+cap-prop-rectification+
#:get-capture-property
#:grab-frame
#:query-frame
#:release-capture
#:retrieve-frame
#:set-capture-property
; #:fourcc
; #:create-video-writer
; #:release-video-writer
; #:write-frame

))
Last edited by joeish80829 on Wed Sep 25, 2013 2:30 am, edited 2 times in total.
joeish80829
 
Posts: 96
Joined: Tue Sep 03, 2013 5:32 am

Re: Anyone wanna help make a complete version of CL-OPENCV

Postby joeish80829 » Thu Sep 05, 2013 12:58 am

To entice you more I already added a new funtion to the CL-OPENCV test.lisp that detects colored objects

Here is a peek:

Code: Select all
(defun detect-red-objects (&optional (camera-index 0) (width *default-width*)
          (height *default-height*))
  "Show the output from the camera CAMERA-INDEX."
  (with-capture (capture (create-camera-capture camera-index))
    (let ((window-name-1 "Video")
          (window-name-2 "Ball"))
           (named-window window-name-1)
            (named-window window-name-2)
      (do* ((frame (query-frame capture) (query-frame capture))
             (img (clone-image frame))
              (frame (clone-image img))
              (img-size (get-size frame))             
              (img-hsv (create-image img-size +ipl-depth-8u+ 3))
              (img-hsv-size (get-size img-hsv))
            (img-thresh (create-image img-hsv-size +ipl-depth-8u+ 1))
             (scalar-1 (make-cv-scalar 170.0 160.0 60.0))
          (scalar-2 (make-cv-scalar 180.0 256.0 256.0)))
         ((plusp (wait-key *millis-per-frame*)) nil)
         (smooth frame frame +gaussian+ 3 3)
       (cvt-color frame img-hsv +bgr2hsv+)
        (in-range-scalar img-hsv scalar-1 scalar-2 img-thresh)
         (smooth img-thresh img-thresh +gaussian+ 3 3)
         (show-image window-name-1 frame)
        (show-image window-name-2 img-thresh))
      (destroy-all-windows))))
Last edited by nuntius on Thu Sep 05, 2013 10:28 am, edited 1 time in total.
Reason: added [code] block
joeish80829
 
Posts: 96
Joined: Tue Sep 03, 2013 5:32 am


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 5 guests

cron