<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div>Here is the code block which runs perfect in c<br></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;">    CvHistogram* hist;<br>    {<br>        int hist_size[] = { h_bins, s_bins };<br>        float h_ranges[] = { 0, 180 };<br>        float s_ranges[] = { 0, 255 };<br>        float*
 ranges[] = { h_ranges, s_ranges };<br>        hist = cvCreateHist( 2, hist_size, CV_HIST_ARRAY, ranges, 1 );<br>    }</div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;">and here is my attempt </div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent;
 font-style: normal;"> (setf hist (let* ((hist-size (cffi:foreign-alloc :int :initial-contents <br>                              (list h-bins s-bins)))<br>               (h-ranges (cffi:foreign-alloc :float :initial-contents '(0.0 180.0)))<br>               (s-ranges (cffi:foreign-alloc :float :initial-contents '(0.0 255.0)))<br>               (ranges (cffi:foreign-alloc :initial-contents <br>                           (list h-ranges s-ranges))))<br>           (create-hist 2 hist-size +hist-array+ ranges 1)))</div><div
 style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;">cvCreateHist info is <a href="https://us-mg5.mail.yahoo.com/neo/here"> here</a> <br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family:
 HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;">Im getting this error in inferior lisp....i got it to move out of lisp but it gets stuck in c.  The rest of the program seems negligible so didnt post....this block i attempted to convert gets error...I tried only a few ways to write these array declarations because this is ALWAYS how i successfully do array declarations...I would be grateful for guidance and any extra info i can provide i will<br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0,
 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;">OpenCV Error: Unknown error code -19 (Number of dimensions is out of range) in cvCreateHist,</div></div></body></html>