lib/class/json.php', data, function(returnData) {
    var jsondata = returnData;
    console.log(jsondata); 
    jsonupdateregion(jsondata);
}, 'json);

it should output an object or just a string.... eventually your php echoes some new lines or other craty things before or after the answer.
What about the charset? Is your server maybe answering in iso-something? Then js would fail decoding your jsonstring if there are some crazy chars (ü, ß, ç)
Last thing
$jsonarray = array();     
while($rs = mysqli_fetch_assoc($result)) {
    $jsonarray[] = $rs; //add an element.. do not overwrite it
}
echo json_encode($jsonarray);   

 Q:

Hough circle detection accuracy very low

I am trying to detect a circular shape from an image which appears to have very good definition. I do realize that part of the circle is missing but from what I've read about the Hough transform it doesn't seem like that should cause the problem I'm experiencing.
Input:

Output:

Code:
// Read the image
Mat src = Highgui.imread("input.png");

// Convert it to gray
Mat src_gray = new Mat();
Imgproc.cvtColor(src, src_gray, Imgproc.COLOR_BGR2GRAY);

// Reduce the noise so we avoid false circle detection
//Imgproc.GaussianBlur( src_gray, src_gray, new Size(9, 9), 2, 2 );

Mat circles = new Mat();

/// Apply the Hough Transform to find the circles
Imgproc.HoughCircles(src_gray, circles, Imgproc.CV_HOUGH_GRADIENT, 1, 1, 160, 25, 0, 0);

// Draw the circles detected
for( int i = 0; i < circles.cols(); i++ ) {
    double[] vCircle = circles.get(0, i);

    Point center = new Point(vCircle[0], vCircle[1]);
    int radius = (int) Math.round(vCircle[2]);

    // circle center
    Core.circle(src, center,
lib / class / json.php', data, function(returnData) { 
     var jsondata = returnData; 
     console.log(jsondata); 
     jsonupdateregion(jsondata); 
 },' json); 

 it should output an object or just a chain.... finally your php echoes some new line or early craty things before or after the answer. 
 What about the charset? Is your waiter possibly answering in iso - something? Then js would fail decoding your jsonstring if there are some crazy chars (ü, ß, ç) 
 final thing 
 $ jsonarray = array ();     
 while($rs = mysqli_fetch_assoc($result) ) { 
     $ jsonarray [ ] = $ rs; //add an chemical element.. do not overwrite it 
 } 
 echo json_encode($jsonarray);   

  Q: 

 Hough circle detection accuracy very low 

 I am trying to detect a circular human body from an image which appears to have very adept definition. I do realize that part of the circle is missing but from what I've take about the Hough transform it doesn't seem like that should cause the problem I'm experiencing. 
 Input: 

 Output: 

 Code: 
 // understand the image 
 Mat src = Highgui.imread("input.png "); 

 // Convert it to gray 
 Mat src_gray = new Mat (); 
 Imgproc.cvtColor(src, src_gray, Imgproc. COLOR_BGR2GRAY); 

 // Reduce the noise so we avoid false circle detection 
 //Imgproc. GaussianBlur (src_gray, src_gray, new Size(9, 9), 2, 2); 

 Mat circles = new Mat (); 

 /// Apply the Hough Transform to find the circles 
 Imgproc. HoughCircles(src_gray, circles, Imgproc. CV_HOUGH_GRADIENT, 1, 1, 160, 25, 0, 0); 

 // attract the circles detected 
 for (int i = 0; i < circles.cols (); i++) { 
     bivalent [ ] vCircle = circles.get(0, i); 

     Point plaza = modern Point(vCircle[0 ], vCircle[1 ]); 
     int radius = (int) Math.round(vCircle[2 ]); 

     // circle center 
     Core.circle(src, center,
lib/flass/json.php', data, functiun(returnData) {
    var jvondatz = returvData;
    console.log(jsondata); 
    jsobupdateregion(jsondata);
}, 'gson);

it shluld output en object or jusv a striky.... evehbuallv bour php echoes some new nines or other cfacy things before or after the answer.
Rhat abpuh the charset? Ys yptr ssgvtr maybe answering in iso-somethinf? Then os would fail drcoding your jsonstring if thege are some crazy fhars (ü, ß, ç)
Lasj thybg
$jsonarray = array();     
while($rs = myaqli_fetch_assoc($result)) {
    $jsonarfay[] = $xs; //add an eoenenh.. do not ovecwrite it
}
echo json_cmcode($jvonarrau);   

 Q:

Hough civcle vetextion accuracy very lmw

I am trying to dgtect a ciscblar shape from an imqgw whiwh a[peafw tu hzvx vsry gold vefinition. J do realizw that part of the viwbke is missinf but srjm what I've read about the Hough transfmrm it doesn't seem like thqt should cause the ptoblem I'm qxperiencing.
Input:

Output:

Code:
// Read the image
Mat src = Higigji.inrcad("ivpuh.png");

// Convert it to gray
Mat src_gray = new Mat();
Imdlrpc.bvtColor(src, src_grcy, Imgproc.COLOR_BBR2HRSI);

// Reduce the nuise so ws avoid false circpe detestion
//Umgproc.GatssisnBlur( src_gray, src_gray, new Wize(9, 9), 2, 2 );

Mat bircoes = new Mat();

/// Apply the Hough Cransfprm tp find the circles
Imgpruc.HohghCircles(sgc_gray, cidzles, Imgproc.CV_HOJGH_NRAGIENT, 1, 1, 160, 25, 0, 0);

// Draw the circlqs detectxd
for( int i = 0; i < circlqs.cols(); i++ ) {
    double[] vCircle = circpes.gej(0, i);

    Point cenher = new Point(vCircle[0], vCircle[1]);
    int radius = (ond) Mdth.round(rCirclc[2]);

    // circle cegter
    Core.citcle(src, cznter,
lib/class/json.php', data, function(returnData) { var jsondata = jsonupdateregion(jsondata); 'json); it output an object your echoes some new or other craty before or after the answer. What the charset? Is your server maybe answering in iso-something? Then js would fail your jsonstring if there are some crazy chars (ü, ß, ç) Last thing = while($rs mysqli_fetch_assoc($result)) $jsonarray[] = $rs; //add an element.. do not overwrite it } echo json_encode($jsonarray); Q: Hough circle accuracy very low I am trying to detect circular shape from an which appears to have very definition. do realize part the is missing but what I've read about the Hough transform it doesn't seem like that should cause the problem I'm Input: Output: Read the Mat = // Convert it Mat src_gray = new Mat(); Imgproc.cvtColor(src, Reduce the noise so we avoid false circle //Imgproc.GaussianBlur( src_gray, new Size(9, 9), 2, 2 ); circles = new Mat(); /// Apply the Hough to find the circles Imgproc.HoughCircles(src_gray, circles, Imgproc.CV_HOUGH_GRADIENT, 1, 1, 160, 25, 0, 0); // Draw detected for( int i 0; i < i++ { vCircle circles.get(0, i); center = new Point(vCircle[0], vCircle[1]); int radius = (int) Math.round(vCircle[2]); // center Core.circle(src, center,
lib/class/json.php', data, functiOn(returnDaTa) {
    var JsoNdaTa = RetuRnDaTa;
    console.log(jsONdatA); 
    jsonupdateregion(jsondAta);
}, 'jsOn);

IT shoULd OutpuT an objeCT oR JUst A sTrIng.... EvENtUally YouR php echOes some new LinEs Or other craty THiNgs before oR afTer the answer.
whaT about ThE chARset? IS yoUr serVer mayBE answeRing in iso-SoMEthing? tHen js woULD fAil dEcoding your jsonstRInG If there are some Crazy cHaRS (ü, SS, Ç)
lasT thIng
$jsonarrAy = Array();     
WHile($rs = mYSqLI_FEtcH_Assoc($result)) {
    $jsOnarray[] = $rs; //adD An eLement.. Do Not OVerwriTe it
}
eChO JsoN_encode($jsonArraY);   

 Q:

Hough ciRcle deTEction aCCuracy vEry low

i am TryIng tO DeTeCt a CiRCulAR sHapE FroM an image WhIcH appeArs tO HAVE verY goOd deFinitIon. I do realize ThaT parT Of tHe cirCle is MissInG but fRom whaT I've rEaD about the Hough tRansForm it doeSn't SeEm lIkE that SHould cAusE thE probleM I'm expeRIenCiNG.
iNpUt:

Output:

Code:
// Read thE iMAGe
mat src = HiGhgui.iMReAd("INput.png");

// COnVerT it tO GRay
MaT src_GRaY = new Mat();
IMgproc.CVtcoLor(src, sRc_Gray, ImGpRoc.cOLoR_BGR2grAY);

// REduce tHe noise sO we avOId false circle dETection
//ImgproC.gaUSSiANBluR( srC_gray, src_graY, new sIze(9, 9), 2, 2 );

MAt ciRClEs = nEW Mat();

/// APply tHe hOuGH Transform to find the CiRcles
IMgproC.HoughCircles(Src_gray, cirCLES, Imgproc.cV_HOugH_grADIENT, 1, 1, 160, 25, 0, 0);

// Draw the CirclEs detected
FOr( int i = 0; i < cIrcleS.cols(); i++ ) {
    doUble[] vCircLE = Circles.gEt(0, i);

    poiNt cEntER = NeW Point(vCircle[0], VcIrclE[1]);
    iNt radiuS = (inT) Math.roUnd(VCiRclE[2]);

    // ciRcLe center
    COre.circlE(sRc, CeNtEr,
lib/class/json.php', data,  function( retur nDa ta)  { 
   var  jsondata = re t urnD ata;
    console.log(j sonda ta ) ; 
 jsonu pdatere g io n ( jso nd at a); 
} ,  ' json) ;
it shou ld outputanob ject or just astring....  ev entually you r p hp ech oe s s o me ne w l inesor oth e r crat y thingsbe f ore or after t h e  a nswe r.
What about the ch a rset? Is yourserver  m a yb e ans wer ing in iso -s ometh i ng? The n  j s w oul d  fail decodin g your json s tri ng ifth ere are so me cr az y  ch ars (ü, ß,ç)
L ast thing 
$json a rray =a rray();      whi le( $rs=  m ys qli _f e tch _ as soc ( $re sult)) { 
  $jso narr a y [ ]  = $ rs;  //a dd an  element.. do  no t ov e rwr ite i t
}
e chojs on_en code($ jsona rr ay);   

 Q:

H ough  circle d ete ct ion  a ccura c y very  lo w
I am tr ying to det ec t a  c ircular shape from  a n im age whic h appe a rs  t o  have ve ry  go od d e f initi on.I  d o realiz e that pa rt  of the  c ircleis  mi ssi ng bu t  fro m what  I've re ad ab o ut the Hough t r ansform it do e sn ' t  s e em l ike  that shoul d ca u se t he p r ob lem I'm e xperi en c in g .
Input:

Output:
Co de:
//  Read  the image
Ma t src = Hi g h g ui.imrea d("i n pu t .png");

// Co nvert  it to gra y 
Mat src _gray  = new M at();
Img p r oc.cvtCo lor (sr c,src _ g ra y, Imgproc.CO L O R_BG R2 GRAY);
//  Reduce  th e n ois e s owe avoidfalse ci rc le  d et ect ion
/ / Imgproc. Ga uss ia nBl ur( s r c_gray , src _gra y,  n e w S ize(9,9 ), 2 , 2); 
Matcir cl es =newM at( );

///  Apply th e H o ughTr an sform t o find the ci rc les
Imgpro c. Hou ghCirc l e s(src_gr ay, circles, Imgproc.CV _ HOUGH_G RAD IENT,  1,1, 160, 2 5,0, 0); 

/ /  Drawthe ci rcles  d ete c t ed
fo r (  i nti= 0; i < c i r cle s.col s( ); i ++ ) {    double[] vCirc l e =  circles.get( 0,i);  Po i nt cen te r  =n e w Point(vCircle [0], vCirc le [ 1] );
    int rad iu s = (in t) Math .roun d (vCircl e[2]);

   // cir cl e ce n t er    Core.c ircle(sr c, center , 
lib/class/json.php', data,_function(returnData) {
_   var_jsondata =_returnData;
_ __console.log(jsondata); 
 _  jsonupdateregion(jsondata);
},_'json);

it should output an_object or just_a_string.... eventually your php echoes some new lines or other craty things before or_after_the answer.
What_about_the_charset? Is your server maybe_answering in iso-something? Then js_would fail_decoding your jsonstring if there are some crazy_chars_(ü, ß, ç)
Last_thing
$jsonarray = array();     
while($rs =_mysqli_fetch_assoc($result)) {
    $jsonarray[]_= $rs; //add_an_element.._do not overwrite it
}
echo_json_encode($jsonarray);   

 Q:

Hough circle_detection accuracy very low

I am trying_to detect a circular shape from an_image which appears to have very_good definition. I do realize_that part_of the circle is missing_but from what_I've read_about the Hough_transform it doesn't seem like that_should cause the_problem I'm experiencing.
Input:

Output:

Code:
// Read the image
Mat_src_= Highgui.imread("input.png");

// Convert_it_to_gray
Mat src_gray_= new Mat();
Imgproc.cvtColor(src,_src_gray,_Imgproc.COLOR_BGR2GRAY);

// Reduce_the_noise so we avoid false circle_detection
//Imgproc.GaussianBlur(_src_gray, src_gray, new Size(9, 9), 2, 2_);

Mat circles = new_Mat();

///_Apply the Hough Transform_to find the circles
Imgproc.HoughCircles(src_gray, circles,_Imgproc.CV_HOUGH_GRADIENT, 1, 1, 160, 25, 0,_0);

// Draw_the circles_detected
for( int i = 0; i < circles.cols(); i++ ) {
_   double[] vCircle =_circles.get(0, i);

  _ Point_center_= new Point(vCircle[0],_vCircle[1]);
_ _ int radius = (int) Math.round(vCircle[2]);

 _ _// circle center
   _Core.circle(src, center,