1. A camera module installed on an electronic device, the camera module comprising: a housing, having two hollow cylinder-shaped shafts at two opposite ends, the two hollow cylinder-shaped shafts being pivotally connected with the electronic device; a camera, disposed in the housing; and a hinge portion, configured inside at least one of the two hollow cylinder-shaped shafts, the hinge portion comprising: a first bracket, connected with the housing at one end; a first cam, fixed on the first bracket, wherein a first through hole goes through the first cam and the first bracket, and the housing, the first bracket and the first cam can rotate simultaneously; a second cam, having a second through hole; a spring; a second bracket, connected with the electronic device at one end; and a connection shaft, secured to the second bracket, wherein the connection shaft goes through the spring, the second cam via the second through hole, the first cam and the first bracket via the first through hole successively so as to restrict all thereof within a predetermined distance, when the housing rotates in relation to the electronic device, interactions among the spring, the first cam and the second cam equip the housing with regional positioning and regional automatic rotation functionalities.